Changeset f74d9f1f in rtems


Ignore:
Timestamp:
Mar 31, 2004, 4:37:05 AM (16 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
2a7e204
Parents:
f3e486aa
Message:

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • 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.
Location:
c/src/lib/libbsp/m68k/mrm332
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mrm332/ChangeLog

    rf3e486aa rf74d9f1f  
     12004-03-31      Ralf Corsepius <ralf_corsepius@rtems.org>
     2
     3        * clock/ckinit.c, console/sci.c, console/sci.h, include/bsp.h,
     4        misc/interr.c, startup/bspstart.c, timer/timer.c: Convert to using
     5        c99 fixed size types.
     6
    172004-02-19      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • c/src/lib/libbsp/m68k/mrm332/clock/ckinit.c

    rf3e486aa rf74d9f1f  
    2525#define CLOCK_VECTOR   MRM_PIV
    2626
    27 rtems_unsigned32 Clock_isrs;        /* ISRs until next tick */
    28 volatile rtems_unsigned32 Clock_driver_ticks;
     27uint32_t        Clock_isrs;        /* ISRs until next tick */
     28volatile uint32_t        Clock_driver_ticks;
    2929                                    /* ticks since initialization */
    3030rtems_isr_entry  Old_ticker;
     
    102102)
    103103{
    104     rtems_unsigned32 isrlevel;
     104    uint32_t        isrlevel;
    105105    rtems_libio_ioctl_args_t *args = pargp;
    106106 
  • c/src/lib/libbsp/m68k/mrm332/console/sci.c

    rf3e486aa rf74d9f1f  
    3737*
    3838* $Log$
     39* Revision 1.4  2004/01/07 21:13:50  joel
     40* 2004-01-07    Joel Sherrill <joel@OARcorp.com>
     41*
     42*       * times, console/sci.c: Remove efi68k and efi332 references as they are
     43*       no longer in the tree.
     44*
    3945* Revision 1.3  2003/01/20 20:33:17  joel
    4046* 2003-01-20    Duane Gustavus <duane@unt.edu>
     
    197203rtems_isr SciIsr( rtems_vector_number vector );         // interrupt handler
    198204
    199 const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled );
     205const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t  polled );
    200206
    201207rtems_device_driver SciInitialize ();                   // device driver api
     
    206212rtems_device_driver SciControl ();                      // device driver api
    207213
    208 signed32 SciInterruptOpen();                            // termios api
    209 signed32 SciInterruptClose();                           // termios api
    210 signed32 SciInterruptWrite();                           // termios api
    211 
    212 signed32 SciSetAttributes();                            // termios api
    213 
    214 signed32 SciPolledOpen();                               // termios api
    215 signed32 SciPolledClose();                              // termios api
    216 signed32 SciPolledRead();                               // termios api
    217 signed32 SciPolledWrite();                              // termios api
    218 
    219 static void SciSetBaud(unsigned32 rate);                // hardware routine
    220 static void SciSetDataBits(unsigned16 bits);            // hardware routine
    221 static void SciSetParity(unsigned16 parity);            // hardware routine
     214int32_t  SciInterruptOpen();                            // termios api
     215int32_t  SciInterruptClose();                           // termios api
     216int32_t  SciInterruptWrite();                           // termios api
     217
     218int32_t  SciSetAttributes();                            // termios api
     219
     220int32_t  SciPolledOpen();                               // termios api
     221int32_t  SciPolledClose();                              // termios api
     222int32_t  SciPolledRead();                               // termios api
     223int32_t  SciPolledWrite();                              // termios api
     224
     225static void SciSetBaud(uint32_t  rate);                // hardware routine
     226static void SciSetDataBits(uint16_t  bits);            // hardware routine
     227static void SciSetParity(uint16_t  parity);            // hardware routine
    222228
    223229static void inline SciDisableAllInterrupts( void );     // hardware routine
     
    234240static void inline SciEnableTransmitter( void );        // hardware routine
    235241
    236 void SciWriteCharWait  ( unsigned8 );                   // hardware routine
    237 void SciWriteCharNoWait( unsigned8 );                   // hardware routine
    238 
    239 unsigned8 inline SciCharAvailable( void );              // hardware routine
    240 
    241 unsigned8 inline SciReadCharWait( void );               // hardware routine
    242 unsigned8 inline SciReadCharNoWait( void );             // hardware routine
     242void SciWriteCharWait  ( uint8_t);                   // hardware routine
     243void SciWriteCharNoWait( uint8_t);                   // hardware routine
     244
     245uint8_t  inline SciCharAvailable( void );              // hardware routine
     246
     247uint8_t  inline SciReadCharWait( void );               // hardware routine
     248uint8_t  inline SciReadCharNoWait( void );             // hardware routine
    243249
    244250void SciSendBreak( void );                              // test routine
    245251
    246 static signed8 SciRcvBufGetChar();                      // circular rcv buf
    247 static void    SciRcvBufPutChar( unsigned8 );           // circular rcv buf
     252static int8_t  SciRcvBufGetChar();                      // circular rcv buf
     253static void    SciRcvBufPutChar( uint8_t);           // circular rcv buf
    248254//atic void    SciRcvBufFlush( void );                  // circular rcv buf
    249255
     
    260266
    261267
    262 static unsigned8 SciInited = 0;             // has the driver been inited
    263 
    264 static unsigned8 SciOpened;                 // has the driver been opened
    265 
    266 static unsigned8 SciMajor;                  // major device number
    267 
    268 static unsigned16 SciBaud;                  // current value in baud register
    269 
    270 static unsigned32 SciBytesIn  = 0;          // bytes received
    271 static unsigned32 SciBytesOut = 0;          // bytes transmitted
    272 
    273 static unsigned32 SciErrorsParity  = 0;     // error counter
    274 static unsigned32 SciErrorsNoise   = 0;     // error counter
    275 static unsigned32 SciErrorsFraming = 0;     // error counter
    276 static unsigned32 SciErrorsOverrun = 0;     // error counter
     268static uint8_t  SciInited = 0;             // has the driver been inited
     269
     270static uint8_t  SciOpened;                 // has the driver been opened
     271
     272static uint8_t  SciMajor;                  // major device number
     273
     274static uint16_t  SciBaud;                  // current value in baud register
     275
     276static uint32_t  SciBytesIn  = 0;          // bytes received
     277static uint32_t  SciBytesOut = 0;          // bytes transmitted
     278
     279static uint32_t  SciErrorsParity  = 0;     // error counter
     280static uint32_t  SciErrorsNoise   = 0;     // error counter
     281static uint32_t  SciErrorsFraming = 0;     // error counter
     282static uint32_t  SciErrorsOverrun = 0;     // error counter
    277283
    278284#if defined(CONSOLE_SCI)
     
    306312// instead of sending them up to the termios module for the console
    307313
    308 static unsigned8 SciRcvBuffer[SCI_RCV_BUF_SIZE];
    309 
    310 static unsigned8 SciRcvBufPutIndex = 0;     // array index to put in next char
    311 
    312 static unsigned8 SciRcvBufGetIndex = 0;     // array index to take out next char
    313 
    314 static unsigned8 SciRcvBufCount = 0;        // how many bytes are in the buffer
     314static uint8_t  SciRcvBuffer[SCI_RCV_BUF_SIZE];
     315
     316static uint8_t  SciRcvBufPutIndex = 0;     // array index to put in next char
     317
     318static uint8_t  SciRcvBufGetIndex = 0;     // array index to take out next char
     319
     320static uint8_t  SciRcvBufCount = 0;        // how many bytes are in the buffer
    315321
    316322
     
    390396****************************************************************************/
    391397
    392 const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled )
     398const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t  polled )
    393399{
    394400    if ( polled )
     
    415421rtems_isr SciIsr( rtems_vector_number vector )
    416422{
    417     unsigned8 ch;
     423    uint8_t  ch;
    418424
    419425
     
    484490****************************************************************************/
    485491
    486 static signed8 SciRcvBufGetChar()
     492static int8_t  SciRcvBufGetChar()
    487493{
    488494    rtems_interrupt_level level;
    489     unsigned8 ch;
     495    uint8_t  ch;
    490496   
    491497    if ( SciRcvBufCount == 0 )
     
    521527****************************************************************************/
    522528
    523 static void SciRcvBufPutChar( unsigned8 ch )
     529static void SciRcvBufPutChar( uint8_t  ch )
    524530{
    525531    rtems_interrupt_level level;
     
    601607****************************************************************************/
    602608
    603 signed32 SciInterruptOpen(
    604     signed32  major,
    605     signed32  minor,
     609int32_t  SciInterruptOpen(
     610    int32_t    major,
     611    int32_t    minor,
    606612    void     *arg
    607613)
     
    668674****************************************************************************/
    669675
    670 signed32 SciInterruptClose(
    671     signed32  major,
    672     signed32  minor,
     676int32_t  SciInterruptClose(
     677    int32_t    major,
     678    int32_t    minor,
    673679    void     *arg
    674680)
     
    692698****************************************************************************/
    693699
    694 signed32 SciInterruptWrite(
    695     signed32    minor,
     700int32_t  SciInterruptWrite(
     701    int32_t      minor,
    696702    const char *buf,
    697     signed32    len
     703    int32_t      len
    698704)
    699705{
     
    737743****************************************************************************/
    738744
    739 signed32 SciSetAttributes(
    740     signed32 minor,
     745int32_t  SciSetAttributes(
     746    int32_t  minor,
    741747    const struct termios *t
    742748)
    743749{
    744     unsigned32  baud_requested;
    745     unsigned32  sci_rate = 0;
    746     unsigned16  sci_parity = 0;
    747     unsigned16  sci_databits = 0;
     750    uint32_t    baud_requested;
     751    uint32_t    sci_rate = 0;
     752    uint16_t    sci_parity = 0;
     753    uint16_t    sci_databits = 0;
    748754
    749755    if ( minor != SCI_MINOR )                   // check the minor dev num
     
    841847****************************************************************************/
    842848
    843 signed32 SciPolledOpen(
    844     signed32 major,
    845     signed32 minor,
     849int32_t  SciPolledOpen(
     850    int32_t  major,
     851    int32_t  minor,
    846852    void    *arg
    847853)
     
    896902****************************************************************************/
    897903
    898 signed32 SciPolledClose(
    899     signed32  major,
    900     signed32  minor,
     904int32_t  SciPolledClose(
     905    int32_t    major,
     906    int32_t    minor,
    901907    void     *arg
    902908)
     
    918924****************************************************************************/
    919925
    920 signed32 SciPolledRead(
    921     signed32 minor
     926int32_t  SciPolledRead(
     927    int32_t  minor
    922928)
    923929{
     
    949955****************************************************************************/
    950956
    951 signed32 SciPolledWrite(
    952     signed32      minor,
     957int32_t  SciPolledWrite(
     958    int32_t        minor,
    953959    const char   *buf,
    954     signed32      len
     960    int32_t        len
    955961)
    956962{
    957     signed32 written = 0;
     963    int32_t  written = 0;
    958964
    959965    if ( minor != SCI_MINOR )                   // check minor device num
     
    11371143{
    11381144    rtems_libio_rw_args_t *rw_args;             // ptr to argument struct
    1139     unsigned8 *buffer;
    1140     unsigned16 length;
     1145    uint8_t  *buffer;
     1146    uint16_t  length;
    11411147 
    11421148    rw_args = (rtems_libio_rw_args_t *) arg;    // arguments to read()
     
    11991205{
    12001206    rtems_libio_rw_args_t *rw_args;             // ptr to argument struct
    1201     unsigned8 *buffer;
    1202     unsigned16 length;
     1207    uint8_t  *buffer;
     1208    uint16_t  length;
    12031209 
    12041210    rw_args = (rtems_libio_rw_args_t *) arg;
     
    12141220    }
    12151221
    1216     buffer = (unsigned8*)rw_args->buffer;       // points to data
     1222    buffer = (uint8_t*)rw_args->buffer;       // points to data
    12171223
    12181224    length = rw_args->count;                    // how many bytes
     
    12491255{
    12501256    rtems_libio_ioctl_args_t *args = arg;       // rtems arg struct
    1251     unsigned16 command;                         // the cmd to execute
    1252     unsigned16 unused;                          // maybe later
    1253     unsigned16 *ptr;                            // ptr to user data
     1257    uint16_t  command;                         // the cmd to execute
     1258    uint16_t  unused;                          // maybe later
     1259    uint16_t  *ptr;                            // ptr to user data
    12541260 
    12551261//printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor);
     
    13071313****************************************************************************/
    13081314
    1309 static void SciSetBaud(unsigned32 rate)
    1310 {
    1311     unsigned16 value;
    1312     unsigned16 save_sccr1;
     1315static void SciSetBaud(uint32_t  rate)
     1316{
     1317    uint16_t  value;
     1318    uint16_t  save_sccr1;
    13131319
    13141320// when you open the console you need to set the termio struct baud rate
     
    13221328    // see mrm332.h for an example
    13231329
    1324     value = ( (unsigned16) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
     1330    value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
    13251331
    13261332    save_sccr1 = *SCCR1;                        // save register
     
    13481354****************************************************************************/
    13491355
    1350 static void SciSetParity(unsigned16 parity)
    1351 {
    1352     unsigned16 value;
     1356static void SciSetParity(uint16_t  parity)
     1357{
     1358    uint16_t  value;
    13531359
    13541360    value = *SCCR1;                             // get the register
     
    13891395****************************************************************************/
    13901396
    1391 static void SciSetDataBits(unsigned16 bits)
    1392 {
    1393     unsigned16 value;
     1397static void SciSetDataBits(uint16_t  bits)
     1398{
     1399    uint16_t  value;
    13941400
    13951401    value = *SCCR1;                             // get the register
     
    14971503****************************************************************************/
    14981504
    1499 void SciWriteCharWait(unsigned8 c)
     1505void SciWriteCharWait(uint8_t  c)
    15001506{
    15011507    // poll the fifo, waiting for room for another character
     
    15301536****************************************************************************/
    15311537
    1532 void SciWriteCharNoWait(unsigned8 c)
     1538void SciWriteCharNoWait(uint8_t  c)
    15331539{
    15341540    if ( ( *SCSR & SCI_XMTR_AVAILABLE ) == 0 )
     
    15551561****************************************************************************/
    15561562
    1557 unsigned8 inline SciReadCharWait( void )
    1558 {
    1559     unsigned8 ch;
     1563uint8_t  inline SciReadCharWait( void )
     1564{
     1565    uint8_t  ch;
    15601566
    15611567    while ( SciCharAvailable() == 0 )           // anything there?
     
    15861592****************************************************************************/
    15871593
    1588 unsigned8 inline SciReadCharNoWait( void )
    1589 {
    1590     unsigned8 ch;
     1594uint8_t  inline SciReadCharNoWait( void )
     1595{
     1596    uint8_t  ch;
    15911597
    15921598    if ( SciCharAvailable() == 0 )              // anything there?
     
    16121618****************************************************************************/
    16131619
    1614 unsigned8 inline SciCharAvailable( void )
     1620uint8_t  inline SciCharAvailable( void )
    16151621{
    16161622    return ( *SCSR & SCI_RCVR_READY );          // char in data register?
     
    16671673void SciUnitTest()
    16681674{
    1669     unsigned8 byte;                             // a character
    1670     unsigned16 fd;                              // file descriptor for device
    1671     unsigned16 result;                          // result of ioctl
     1675    uint8_t  byte;                             // a character
     1676    uint16_t  fd;                              // file descriptor for device
     1677    uint16_t  result;                          // result of ioctl
    16721678
    16731679
  • c/src/lib/libbsp/m68k/mrm332/console/sci.h

    rf3e486aa rf74d9f1f  
    219219// look at console_open to see how this is called
    220220
    221 const rtems_termios_callbacks * SciGetTermiosHandlers( signed32 polled );
     221const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t  polled );
    222222
    223223
     
    227227
    228228
    229 //signed32 SciOpenPolled    ( signed32 major, signed32 minor, void *arg );
    230 //signed32 SciOpenInterrupt ( signed32 major, signed32 minor, void *arg );
    231 
    232 //signed32 SciClose         ( signed32 major, signed32 minor, void *arg );
    233 
    234 //signed32 SciWritePolled   ( signed32 minor, const char *buf, signed32 len );
    235 //signed32 SciWriteInterrupt( signed32 minor, const char *buf, signed32 len );
    236 
    237 //signed32 SciReadPolled    ( signed32 minor );
    238 
    239 //signed32 SciSetAttributes ( signed32 minor, const struct termios *t );
     229//int32_t   SciOpenPolled    ( int32_t   major, int32_t  minor, void *arg );
     230//int32_t   SciOpenInterrupt ( int32_t   major, int32_t  minor, void *arg );
     231
     232//int32_t   SciClose         ( int32_t   major, int32_t  minor, void *arg );
     233
     234//int32_t   SciWritePolled   ( int32_t   minor, const char *buf, int32_t  len );
     235//int32_t   SciWriteInterrupt( int32_t   minor, const char *buf, int32_t  len );
     236
     237//int32_t   SciReadPolled    ( int32_t  minor );
     238
     239//int32_t   SciSetAttributes ( int32_t  minor, const struct termios *t );
    240240
    241241
  • c/src/lib/libbsp/m68k/mrm332/include/bsp.h

    rf3e486aa rf74d9f1f  
    7474
    7575#define rtems_bsp_delay( microseconds ) \
    76   { register rtems_unsigned32 _delay=(microseconds); \
    77     register rtems_unsigned32 _tmp=123; \
     76  { register uint32_t        _delay=(microseconds); \
     77    register uint32_t        _tmp=123; \
    7878    asm volatile( "0: \
    7979                     nbcd      %0 ; \
  • c/src/lib/libbsp/m68k/mrm332/misc/interr.c

    rf3e486aa rf74d9f1f  
    6868  Internal_errors_Source  the_source,
    6969  boolean                 is_internal,
    70   unsigned32              the_error
     70  uint32_t                the_error
    7171)
    7272{
  • c/src/lib/libbsp/m68k/mrm332/startup/bspstart.c

    rf3e486aa rf74d9f1f  
    3737 
    3838void bsp_postdriver_hook(void);
    39 void bsp_libc_init( void *, unsigned32, int );
     39void bsp_libc_init( void *, uint32_t, int );
    4040void bsp_pretasking_hook(void);               /* m68k version */
    4141
  • c/src/lib/libbsp/m68k/mrm332/timer/timer.c

    rf3e486aa rf74d9f1f  
    5353int Read_timer( void )
    5454{
    55   rtems_unsigned32 total;
     55  uint32_t        total;
    5656  total = 0;
    5757
Note: See TracChangeset for help on using the changeset viewer.