diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-03-31 04:37:05 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-03-31 04:37:05 +0000 |
commit | f74d9f1f9f88617a2d822980aca2cdb14a424607 (patch) | |
tree | c20c9c597296a4eab2a54fecd880673fdb454898 /c/src/lib/libbsp/m68k/mrm332 | |
parent | 2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org> (diff) | |
download | rtems-f74d9f1f9f88617a2d822980aca2cdb14a424607.tar.bz2 |
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
* clock/ckinit.c, console/sci.c, console/sci.h, include/bsp.h,
misc/interr.c, startup/bspstart.c, timer/timer.c: Convert to using
c99 fixed size types.
Diffstat (limited to 'c/src/lib/libbsp/m68k/mrm332')
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/clock/ckinit.c | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/console/sci.c | 188 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/console/sci.h | 16 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/include/bsp.h | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/misc/interr.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/startup/bspstart.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/timer/timer.c | 2 |
8 files changed, 119 insertions, 107 deletions
diff --git a/c/src/lib/libbsp/m68k/mrm332/ChangeLog b/c/src/lib/libbsp/m68k/mrm332/ChangeLog index 591cb5a89b..9f1c9da384 100644 --- a/c/src/lib/libbsp/m68k/mrm332/ChangeLog +++ b/c/src/lib/libbsp/m68k/mrm332/ChangeLog @@ -1,3 +1,9 @@ +2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org> + + * clock/ckinit.c, console/sci.c, console/sci.h, include/bsp.h, + misc/interr.c, startup/bspstart.c, timer/timer.c: Convert to using + c99 fixed size types. + 2004-02-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Reflect changes to bsp.am. diff --git a/c/src/lib/libbsp/m68k/mrm332/clock/ckinit.c b/c/src/lib/libbsp/m68k/mrm332/clock/ckinit.c index fd0589c933..037dae7b05 100644 --- a/c/src/lib/libbsp/m68k/mrm332/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/mrm332/clock/ckinit.c @@ -24,8 +24,8 @@ #define CLOCK_VECTOR MRM_PIV -rtems_unsigned32 Clock_isrs; /* ISRs until next tick */ -volatile rtems_unsigned32 Clock_driver_ticks; +uint32_t Clock_isrs; /* ISRs until next tick */ +volatile uint32_t Clock_driver_ticks; /* ticks since initialization */ rtems_isr_entry Old_ticker; @@ -101,7 +101,7 @@ rtems_device_driver Clock_control( void *pargp ) { - rtems_unsigned32 isrlevel; + uint32_t isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.c b/c/src/lib/libbsp/m68k/mrm332/console/sci.c index 7aa1f286da..4a50af70ad 100644 --- a/c/src/lib/libbsp/m68k/mrm332/console/sci.c +++ b/c/src/lib/libbsp/m68k/mrm332/console/sci.c @@ -36,6 +36,12 @@ * $Id$ * * $Log$ +* Revision 1.4 2004/01/07 21:13:50 joel +* 2004-01-07 Joel Sherrill <joel@OARcorp.com> +* +* * times, console/sci.c: Remove efi68k and efi332 references as they are +* no longer in the tree. +* * Revision 1.3 2003/01/20 20:33:17 joel * 2003-01-20 Duane Gustavus <duane@unt.edu> * @@ -189,7 +195,7 @@ void SCI_output_char(char c); rtems_isr SciIsr( rtems_vector_number vector ); // interrupt handler -const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled ); +const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled ); rtems_device_driver SciInitialize (); // device driver api rtems_device_driver SciOpen (); // device driver api @@ -198,20 +204,20 @@ rtems_device_driver SciRead (); // device driver api rtems_device_driver SciWrite (); // device driver api rtems_device_driver SciControl (); // device driver api -signed32 SciInterruptOpen(); // termios api -signed32 SciInterruptClose(); // termios api -signed32 SciInterruptWrite(); // termios api +int32_t SciInterruptOpen(); // termios api +int32_t SciInterruptClose(); // termios api +int32_t SciInterruptWrite(); // termios api -signed32 SciSetAttributes(); // termios api +int32_t SciSetAttributes(); // termios api -signed32 SciPolledOpen(); // termios api -signed32 SciPolledClose(); // termios api -signed32 SciPolledRead(); // termios api -signed32 SciPolledWrite(); // termios api +int32_t SciPolledOpen(); // termios api +int32_t SciPolledClose(); // termios api +int32_t SciPolledRead(); // termios api +int32_t SciPolledWrite(); // termios api -static void SciSetBaud(unsigned32 rate); // hardware routine -static void SciSetDataBits(unsigned16 bits); // hardware routine -static void SciSetParity(unsigned16 parity); // hardware routine +static void SciSetBaud(uint32_t rate); // hardware routine +static void SciSetDataBits(uint16_t bits); // hardware routine +static void SciSetParity(uint16_t parity); // hardware routine static void inline SciDisableAllInterrupts( void ); // hardware routine static void inline SciDisableTransmitInterrupts( void );// hardware routine @@ -226,18 +232,18 @@ static void inline SciDisableTransmitter( void ); // hardware routine static void inline SciEnableReceiver( void ); // hardware routine static void inline SciEnableTransmitter( void ); // hardware routine -void SciWriteCharWait ( unsigned8 ); // hardware routine -void SciWriteCharNoWait( unsigned8 ); // hardware routine +void SciWriteCharWait ( uint8_t); // hardware routine +void SciWriteCharNoWait( uint8_t); // hardware routine -unsigned8 inline SciCharAvailable( void ); // hardware routine +uint8_t inline SciCharAvailable( void ); // hardware routine -unsigned8 inline SciReadCharWait( void ); // hardware routine -unsigned8 inline SciReadCharNoWait( void ); // hardware routine +uint8_t inline SciReadCharWait( void ); // hardware routine +uint8_t inline SciReadCharNoWait( void ); // hardware routine void SciSendBreak( void ); // test routine -static signed8 SciRcvBufGetChar(); // circular rcv buf -static void SciRcvBufPutChar( unsigned8 ); // circular rcv buf +static int8_t SciRcvBufGetChar(); // circular rcv buf +static void SciRcvBufPutChar( uint8_t); // circular rcv buf //atic void SciRcvBufFlush( void ); // circular rcv buf void SciUnitTest(); // test routine @@ -251,21 +257,21 @@ void SciPrintStats(); // test routine static struct rtems_termios_tty *SciTermioTty; -static unsigned8 SciInited = 0; // has the driver been inited +static uint8_t SciInited = 0; // has the driver been inited -static unsigned8 SciOpened; // has the driver been opened +static uint8_t SciOpened; // has the driver been opened -static unsigned8 SciMajor; // major device number +static uint8_t SciMajor; // major device number -static unsigned16 SciBaud; // current value in baud register +static uint16_t SciBaud; // current value in baud register -static unsigned32 SciBytesIn = 0; // bytes received -static unsigned32 SciBytesOut = 0; // bytes transmitted +static uint32_t SciBytesIn = 0; // bytes received +static uint32_t SciBytesOut = 0; // bytes transmitted -static unsigned32 SciErrorsParity = 0; // error counter -static unsigned32 SciErrorsNoise = 0; // error counter -static unsigned32 SciErrorsFraming = 0; // error counter -static unsigned32 SciErrorsOverrun = 0; // error counter +static uint32_t SciErrorsParity = 0; // error counter +static uint32_t SciErrorsNoise = 0; // error counter +static uint32_t SciErrorsFraming = 0; // error counter +static uint32_t SciErrorsOverrun = 0; // error counter #if defined(CONSOLE_SCI) @@ -296,13 +302,13 @@ static const char SciIdent[]="$Id$"; // then the receive data interrupt handler will put characters in this buffer // instead of sending them up to the termios module for the console -static unsigned8 SciRcvBuffer[SCI_RCV_BUF_SIZE]; +static uint8_t SciRcvBuffer[SCI_RCV_BUF_SIZE]; -static unsigned8 SciRcvBufPutIndex = 0; // array index to put in next char +static uint8_t SciRcvBufPutIndex = 0; // array index to put in next char -static unsigned8 SciRcvBufGetIndex = 0; // array index to take out next char +static uint8_t SciRcvBufGetIndex = 0; // array index to take out next char -static unsigned8 SciRcvBufCount = 0; // how many bytes are in the buffer +static uint8_t SciRcvBufCount = 0; // how many bytes are in the buffer @@ -377,7 +383,7 @@ void SCI_output_char(char c) * Scope: public ****************************************************************************/ -const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled ) +const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled ) { if ( polled ) { @@ -401,7 +407,7 @@ const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled ) rtems_isr SciIsr( rtems_vector_number vector ) { - unsigned8 ch; + uint8_t ch; if ( (*SCSR) & SCI_ERROR_PARITY ) SciErrorsParity ++; @@ -469,10 +475,10 @@ rtems_isr SciIsr( rtems_vector_number vector ) * Scope: private ****************************************************************************/ -static signed8 SciRcvBufGetChar() +static int8_t SciRcvBufGetChar() { rtems_interrupt_level level; - unsigned8 ch; + uint8_t ch; if ( SciRcvBufCount == 0 ) { @@ -505,7 +511,7 @@ static signed8 SciRcvBufGetChar() * Scope: private ****************************************************************************/ -static void SciRcvBufPutChar( unsigned8 ch ) +static void SciRcvBufPutChar( uint8_t ch ) { rtems_interrupt_level level; @@ -583,9 +589,9 @@ static void SciRcvBufFlush( void ) * Scope: public API ****************************************************************************/ -signed32 SciInterruptOpen( - signed32 major, - signed32 minor, +int32_t SciInterruptOpen( + int32_t major, + int32_t minor, void *arg ) { @@ -649,9 +655,9 @@ SciSetBaud( 19200); // set the baud rate * Scope: public - termio entry point ****************************************************************************/ -signed32 SciInterruptClose( - signed32 major, - signed32 minor, +int32_t SciInterruptClose( + int32_t major, + int32_t minor, void *arg ) { @@ -672,10 +678,10 @@ signed32 SciInterruptClose( * Scope: public API ****************************************************************************/ -signed32 SciInterruptWrite( - signed32 minor, +int32_t SciInterruptWrite( + int32_t minor, const char *buf, - signed32 len + int32_t len ) { // We are using interrupt driven output so termios only sends us @@ -716,15 +722,15 @@ signed32 SciInterruptWrite( * Scope: public API ****************************************************************************/ -signed32 SciSetAttributes( - signed32 minor, +int32_t SciSetAttributes( + int32_t minor, const struct termios *t ) { - unsigned32 baud_requested; - unsigned32 sci_rate = 0; - unsigned16 sci_parity = 0; - unsigned16 sci_databits = 0; + uint32_t baud_requested; + uint32_t sci_rate = 0; + uint16_t sci_parity = 0; + uint16_t sci_databits = 0; if ( minor != SCI_MINOR ) // check the minor dev num { @@ -819,9 +825,9 @@ signed32 SciSetAttributes( * Scope: public - termios entry point ****************************************************************************/ -signed32 SciPolledOpen( - signed32 major, - signed32 minor, +int32_t SciPolledOpen( + int32_t major, + int32_t minor, void *arg ) { @@ -873,9 +879,9 @@ signed32 SciPolledOpen( * Scope: public termios API ****************************************************************************/ -signed32 SciPolledClose( - signed32 major, - signed32 minor, +int32_t SciPolledClose( + int32_t major, + int32_t minor, void *arg ) { @@ -894,8 +900,8 @@ signed32 SciPolledClose( * Scope: public API ****************************************************************************/ -signed32 SciPolledRead( - signed32 minor +int32_t SciPolledRead( + int32_t minor ) { if ( minor != SCI_MINOR ) // check the minor dev num @@ -924,13 +930,13 @@ signed32 SciPolledRead( * Scope: public termios API ****************************************************************************/ -signed32 SciPolledWrite( - signed32 minor, +int32_t SciPolledWrite( + int32_t minor, const char *buf, - signed32 len + int32_t len ) { - signed32 written = 0; + int32_t written = 0; if ( minor != SCI_MINOR ) // check minor device num { @@ -1108,8 +1114,8 @@ rtems_device_driver SciRead ( ) { rtems_libio_rw_args_t *rw_args; // ptr to argument struct - unsigned8 *buffer; - unsigned16 length; + uint8_t *buffer; + uint16_t length; rw_args = (rtems_libio_rw_args_t *) arg; // arguments to read() @@ -1169,8 +1175,8 @@ rtems_device_driver SciWrite ( ) { rtems_libio_rw_args_t *rw_args; // ptr to argument struct - unsigned8 *buffer; - unsigned16 length; + uint8_t *buffer; + uint16_t length; rw_args = (rtems_libio_rw_args_t *) arg; @@ -1184,7 +1190,7 @@ rtems_device_driver SciWrite ( return RTEMS_INCORRECT_STATE; // must be opened first } - buffer = (unsigned8*)rw_args->buffer; // points to data + buffer = (uint8_t*)rw_args->buffer; // points to data length = rw_args->count; // how many bytes @@ -1218,9 +1224,9 @@ rtems_device_driver SciControl ( ) { rtems_libio_ioctl_args_t *args = arg; // rtems arg struct - unsigned16 command; // the cmd to execute - unsigned16 unused; // maybe later - unsigned16 *ptr; // ptr to user data + uint16_t command; // the cmd to execute + uint16_t unused; // maybe later + uint16_t *ptr; // ptr to user data //printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); @@ -1275,10 +1281,10 @@ rtems_device_driver SciControl ( * Scope: private ****************************************************************************/ -static void SciSetBaud(unsigned32 rate) +static void SciSetBaud(uint32_t rate) { - unsigned16 value; - unsigned16 save_sccr1; + uint16_t value; + uint16_t save_sccr1; // when you open the console you need to set the termio struct baud rate // it has a default value of 9600, when someone calls tcsetattr it reverts! @@ -1290,7 +1296,7 @@ static void SciSetBaud(unsigned32 rate) // set baud rate - you must define the system clock constant // see mrm332.h for an example - value = ( (unsigned16) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff ); + value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff ); save_sccr1 = *SCCR1; // save register @@ -1315,9 +1321,9 @@ static void SciSetBaud(unsigned32 rate) * Scope: private ****************************************************************************/ -static void SciSetParity(unsigned16 parity) +static void SciSetParity(uint16_t parity) { - unsigned16 value; + uint16_t value; value = *SCCR1; // get the register @@ -1355,9 +1361,9 @@ static void SciSetParity(unsigned16 parity) * Scope: private ****************************************************************************/ -static void SciSetDataBits(unsigned16 bits) +static void SciSetDataBits(uint16_t bits) { - unsigned16 value; + uint16_t value; value = *SCCR1; // get the register @@ -1460,7 +1466,7 @@ static void inline SciDisableReceiver( void ) * Scope: public ****************************************************************************/ -void SciWriteCharWait(unsigned8 c) +void SciWriteCharWait(uint8_t c) { // poll the fifo, waiting for room for another character @@ -1493,7 +1499,7 @@ void SciWriteCharWait(unsigned8 c) * Scope: public ****************************************************************************/ -void SciWriteCharNoWait(unsigned8 c) +void SciWriteCharNoWait(uint8_t c) { if ( ( *SCSR & SCI_XMTR_AVAILABLE ) == 0 ) { @@ -1517,9 +1523,9 @@ void SciWriteCharNoWait(unsigned8 c) * Scope: public ****************************************************************************/ -unsigned8 inline SciReadCharWait( void ) +uint8_t inline SciReadCharWait( void ) { - unsigned8 ch; + uint8_t ch; while ( SciCharAvailable() == 0 ) // anything there? { @@ -1548,9 +1554,9 @@ unsigned8 inline SciReadCharWait( void ) * Scope: public ****************************************************************************/ -unsigned8 inline SciReadCharNoWait( void ) +uint8_t inline SciReadCharNoWait( void ) { - unsigned8 ch; + uint8_t ch; if ( SciCharAvailable() == 0 ) // anything there? return -1; @@ -1573,7 +1579,7 @@ unsigned8 inline SciReadCharNoWait( void ) * Scope: public ****************************************************************************/ -unsigned8 inline SciCharAvailable( void ) +uint8_t inline SciCharAvailable( void ) { return ( *SCSR & SCI_RCVR_READY ); // char in data register? } @@ -1626,9 +1632,9 @@ void SciSendBreak( void ) void SciUnitTest() { - unsigned8 byte; // a character - unsigned16 fd; // file descriptor for device - unsigned16 result; // result of ioctl + uint8_t byte; // a character + uint16_t fd; // file descriptor for device + uint16_t result; // result of ioctl fd = open("/dev/sci",O_RDWR); // open the device diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.h b/c/src/lib/libbsp/m68k/mrm332/console/sci.h index 7f4ddfaf18..7d6676e75d 100644 --- a/c/src/lib/libbsp/m68k/mrm332/console/sci.h +++ b/c/src/lib/libbsp/m68k/mrm332/console/sci.h @@ -214,7 +214,7 @@ extern "C" { // look at console_open to see how this is called -const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled ); +const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled ); /* SCI interrupt */ @@ -222,17 +222,17 @@ const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled ); //rtems_isr SciIsr( rtems_vector_number vector ); -//signed32 SciOpenPolled ( signed32 major, signed32 minor, void *arg ); -//signed32 SciOpenInterrupt ( signed32 major, signed32 minor, void *arg ); +//int32_t SciOpenPolled ( int32_t major, int32_t minor, void *arg ); +//int32_t SciOpenInterrupt ( int32_t major, int32_t minor, void *arg ); -//signed32 SciClose ( signed32 major, signed32 minor, void *arg ); +//int32_t SciClose ( int32_t major, int32_t minor, void *arg ); -//signed32 SciWritePolled ( signed32 minor, const char *buf, signed32 len ); -//signed32 SciWriteInterrupt( signed32 minor, const char *buf, signed32 len ); +//int32_t SciWritePolled ( int32_t minor, const char *buf, int32_t len ); +//int32_t SciWriteInterrupt( int32_t minor, const char *buf, int32_t len ); -//signed32 SciReadPolled ( signed32 minor ); +//int32_t SciReadPolled ( int32_t minor ); -//signed32 SciSetAttributes ( signed32 minor, const struct termios *t ); +//int32_t SciSetAttributes ( int32_t minor, const struct termios *t ); #ifdef __cplusplus diff --git a/c/src/lib/libbsp/m68k/mrm332/include/bsp.h b/c/src/lib/libbsp/m68k/mrm332/include/bsp.h index be9c4815f0..ffa7c81bea 100644 --- a/c/src/lib/libbsp/m68k/mrm332/include/bsp.h +++ b/c/src/lib/libbsp/m68k/mrm332/include/bsp.h @@ -73,8 +73,8 @@ extern "C" { */ #define rtems_bsp_delay( microseconds ) \ - { register rtems_unsigned32 _delay=(microseconds); \ - register rtems_unsigned32 _tmp=123; \ + { register uint32_t _delay=(microseconds); \ + register uint32_t _tmp=123; \ asm volatile( "0: \ nbcd %0 ; \ nbcd %0 ; \ diff --git a/c/src/lib/libbsp/m68k/mrm332/misc/interr.c b/c/src/lib/libbsp/m68k/mrm332/misc/interr.c index 268a79023d..036e247083 100644 --- a/c/src/lib/libbsp/m68k/mrm332/misc/interr.c +++ b/c/src/lib/libbsp/m68k/mrm332/misc/interr.c @@ -67,7 +67,7 @@ void bsp_cleanup( void ); void volatile _Internal_error_Occurred( Internal_errors_Source the_source, boolean is_internal, - unsigned32 the_error + uint32_t the_error ) { diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/bspstart.c b/c/src/lib/libbsp/m68k/mrm332/startup/bspstart.c index 9e7c5fe067..5287cc5dcd 100644 --- a/c/src/lib/libbsp/m68k/mrm332/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mrm332/startup/bspstart.c @@ -36,7 +36,7 @@ char *rtems_progname; */ void bsp_postdriver_hook(void); -void bsp_libc_init( void *, unsigned32, int ); +void bsp_libc_init( void *, uint32_t, int ); void bsp_pretasking_hook(void); /* m68k version */ /* diff --git a/c/src/lib/libbsp/m68k/mrm332/timer/timer.c b/c/src/lib/libbsp/m68k/mrm332/timer/timer.c index 3dbac44301..d497e4580d 100644 --- a/c/src/lib/libbsp/m68k/mrm332/timer/timer.c +++ b/c/src/lib/libbsp/m68k/mrm332/timer/timer.c @@ -52,7 +52,7 @@ void Timer_initialize( void ) */ int Read_timer( void ) { - rtems_unsigned32 total; + uint32_t total; total = 0; if ( Timer_driver_Find_average_overhead == 1 ) |