Changeset 6fda59f in rtems


Ignore:
Timestamp:
Mar 31, 2004, 5:08:13 AM (16 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
f0cbd19e
Parents:
821b2a9
Message:

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

  • clock/ckinit.c, clock/rtc.c, console/inch.c, ide/ide.c, include/bsp.h, startup/bspstart.c, timer/timer.c: Convert to using c99 fixed size types.
Location:
c/src/lib/libbsp/i386/pc386
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ChangeLog

    r821b2a9 r6fda59f  
     12004-03-31      Ralf Corsepius <ralf_corsepius@rtems.org>
     2
     3        * clock/ckinit.c, clock/rtc.c, console/inch.c, ide/ide.c,
     4        include/bsp.h, 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/i386/pc386/clock/ckinit.c

    r821b2a9 r6fda59f  
    5151+--------------------------------------------------------------------------*/
    5252
    53 volatile rtems_unsigned32 Clock_driver_ticks;   /* Tick (interrupt) counter. */
    54          rtems_unsigned32 Clock_isrs_per_tick;  /* ISRs per tick.            */
    55          rtems_unsigned32 Clock_isrs;           /* ISRs until next tick.     */
     53volatile uint32_t        Clock_driver_ticks;   /* Tick (interrupt) counter. */
     54         uint32_t        Clock_isrs_per_tick;  /* ISRs per tick.            */
     55         uint32_t        Clock_isrs;           /* ISRs until next tick.     */
    5656
    5757/* The following variables are set by the clock driver during its init */
     
    120120static void clockOn(const rtems_irq_connect_data* unused)
    121121{
    122   rtems_unsigned32  microseconds_per_isr;
     122  uint32_t          microseconds_per_isr;
    123123
    124124#if 0
     
    158158  {
    159159    /* 105/88 approximates TIMER_TICK * 1e-6 */
    160     rtems_unsigned32 count = US_TO_TICK(microseconds_per_isr);
     160    uint32_t        count = US_TO_TICK(microseconds_per_isr);
    161161
    162162    outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
     
    261261long long Kernel_Time_ns( void )
    262262{
    263   extern rtems_unsigned32 _TOD_Ticks_per_second;
     263  extern uint32_t        _TOD_Ticks_per_second;
    264264
    265265  unsigned  isrs_per_second = Clock_isrs_per_tick * _TOD_Ticks_per_second;
  • c/src/lib/libbsp/i386/pc386/clock/rtc.c

    r821b2a9 r6fda59f  
    8282|          Returns: BCD representation of number.
    8383+--------------------------------------------------------------------------*/
    84 static inline rtems_unsigned8
    85 bcd(rtems_unsigned8 i)
     84static inline uint8_t       
     85bcd(uint8_t        i)
    8686{
    8787  return ((i / 16) * 10 + (i % 16));
     
    102102|          Returns: number of seconds since 1970.
    103103+--------------------------------------------------------------------------*/
    104 static inline rtems_unsigned32
    105 ytos(rtems_unsigned16 y)
     104static inline uint32_t       
     105ytos(uint16_t        y)
    106106{                                       /* v NUM LEAP YEARS v */
    107107  return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY);
     
    116116|          Returns: number of seconds since January.
    117117+--------------------------------------------------------------------------*/
    118 static inline rtems_unsigned32
    119 mtos(rtems_unsigned8 m, rtems_boolean leap)
    120 {
    121   static rtems_unsigned16 daysMonth[] = { 0, 0, 31,  59,  90, 120, 151, 181,
     118static inline uint32_t       
     119mtos(uint8_t        m, rtems_boolean leap)
     120{
     121  static uint16_t        daysMonth[] = { 0, 0, 31,  59,  90, 120, 151, 181,
    122122                                               212, 243, 273, 304, 334, 365 };
    123123    /* Days since beginning of year until beginning of month. */
     
    135135|          Returns: result received from RTC port after action performed.
    136136+--------------------------------------------------------------------------*/
    137 static inline rtems_unsigned8
    138 rtcin(rtems_unsigned8 what)
    139 {
    140     rtems_unsigned8 r;
     137static inline uint8_t       
     138rtcin(uint8_t        what)
     139{
     140    uint8_t        r;
    141141
    142142    outport_byte(IO_RTC,   what);
     
    159159init_rtc(void)
    160160{
    161   rtems_unsigned8 s;
     161  uint8_t        s;
    162162
    163163  /* initialize brain-dead battery powered clock */
     
    187187rtc_read(rtems_time_of_day *tod)
    188188{
    189   rtems_unsigned8  sa;
    190   rtems_unsigned32 sec = 0;
     189  uint8_t          sa;
     190  uint32_t        sec = 0;
    191191
    192192  memset(tod, 0, sizeof *tod); /* zero tod structure */
  • c/src/lib/libbsp/i386/pc386/console/inch.c

    r821b2a9 r6fda59f  
    6969
    7070static unsigned short   kbd_buffer[KBD_BUF_SIZE];
    71 static rtems_unsigned16 kbd_first = 0;
    72 static rtems_unsigned16 kbd_last  = 0;
    73 static rtems_unsigned16 kbd_end   = KBD_BUF_SIZE - 1;
     71static uint16_t        kbd_first = 0;
     72static uint16_t        kbd_last  = 0;
     73static uint16_t        kbd_end   = KBD_BUF_SIZE - 1;
    7474
    7575/*-------------------------------------------------------------------------+
  • c/src/lib/libbsp/i386/pc386/ide/ide.c

    r821b2a9 r6fda59f  
    9393 int                        minor,  /* controller minor number       */
    9494 int                        reg,    /* register index to access      */
    95  unsigned16                *value   /* ptr to return value location  */
    96  )
    97 /*-------------------------------------------------------------------------*\
    98 | Return Value:                                                             |
    99 |    <none>                                                                 |
    100 \*=========================================================================*/
    101 {
    102   unsigned32  port = IDE_Controller_Table[minor].port1;
    103   unsigned8 bval1,bval2;
     95 uint16_t                  *value   /* ptr to return value location  */
     96 )
     97/*-------------------------------------------------------------------------*\
     98| Return Value:                                                             |
     99|    <none>                                                                 |
     100\*=========================================================================*/
     101{
     102  uint32_t    port = IDE_Controller_Table[minor].port1;
     103  uint8_t  bval1,bval2;
    104104
    105105  if (reg == IDE_REGISTER_DATA_WORD) {
     
    130130 int                        minor,  /* controller minor number       */
    131131 int                        reg,    /* register index to access      */
    132  unsigned16                 value   /* value to write                */
    133  )
    134 /*-------------------------------------------------------------------------*\
    135 | Return Value:                                                             |
    136 |    <none>                                                                 |
    137 \*=========================================================================*/
    138 {
    139   unsigned32  port = IDE_Controller_Table[minor].port1;
     132 uint16_t                   value   /* value to write                */
     133 )
     134/*-------------------------------------------------------------------------*\
     135| Return Value:                                                             |
     136|    <none>                                                                 |
     137\*=========================================================================*/
     138{
     139  uint32_t    port = IDE_Controller_Table[minor].port1;
    140140
    141141#ifdef DEBUG_OUT
     
    162162\*-------------------------------------------------------------------------*/
    163163 int minor,
    164  unsigned16 block_size,
     164 uint16_t  block_size,
    165165 blkdev_sg_buffer *bufs,
    166  rtems_unsigned32 *cbuf,
    167  rtems_unsigned32 *pos
    168  )
    169 /*-------------------------------------------------------------------------*\
    170 | Return Value:                                                             |
    171 |    <none>                                                                 |
    172 \*=========================================================================*/
    173 {
    174   unsigned32  port = IDE_Controller_Table[minor].port1;
    175   unsigned16  cnt = 0;
    176   unsigned32  llength = bufs[(*cbuf)].length;
    177   unsigned8 status_val;
    178   unsigned16 *lbuf = (unsigned16 *)
    179     ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos));
     166 uint32_t        *cbuf,
     167 uint32_t        *pos
     168 )
     169/*-------------------------------------------------------------------------*\
     170| Return Value:                                                             |
     171|    <none>                                                                 |
     172\*=========================================================================*/
     173{
     174  uint32_t    port = IDE_Controller_Table[minor].port1;
     175  uint16_t    cnt = 0;
     176  uint32_t    llength = bufs[(*cbuf)].length;
     177  uint8_t  status_val;
     178  uint16_t   *lbuf = (uint16_t*)
     179    ((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
    180180
    181181  inport_byte(port+IDE_REGISTER_STATUS,status_val);
     
    215215\*-------------------------------------------------------------------------*/
    216216 int minor,
    217  unsigned16 block_size,
     217 uint16_t  block_size,
    218218 blkdev_sg_buffer *bufs,
    219  rtems_unsigned32 *cbuf,
    220  rtems_unsigned32 *pos
    221  )
    222 /*-------------------------------------------------------------------------*\
    223 | Return Value:                                                             |
    224 |    <none>                                                                 |
    225 \*=========================================================================*/
    226 {
    227   unsigned32  port = IDE_Controller_Table[minor].port1;
    228   unsigned16  cnt = 0;
    229   unsigned32  llength = bufs[(*cbuf)].length;
    230   unsigned8   status_val;
    231   unsigned16 *lbuf = (unsigned16 *)
    232     ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos));
     219 uint32_t        *cbuf,
     220 uint32_t        *pos
     221 )
     222/*-------------------------------------------------------------------------*\
     223| Return Value:                                                             |
     224|    <none>                                                                 |
     225\*=========================================================================*/
     226{
     227  uint32_t    port = IDE_Controller_Table[minor].port1;
     228  uint16_t    cnt = 0;
     229  uint32_t    llength = bufs[(*cbuf)].length;
     230  uint8_t     status_val;
     231  uint16_t   *lbuf = (uint16_t*)
     232    ((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
    233233   
    234234#ifdef DEBUG_OUT
     
    267267\*-------------------------------------------------------------------------*/
    268268 int  minor,                        /* controller minor number       */
    269  unsigned32 cmd,                    /* command to send               */
     269 uint32_t  cmd,                    /* command to send               */
    270270 void * arg                         /* optional argument             */
    271271 )
     
    290290\*-------------------------------------------------------------------------*/
    291291 int       minor,                   /* controller minor number       */
    292  unsigned8 modes_avail              /* optional argument             */
     292 uint8_t  modes_avail              /* optional argument             */
    293293 )
    294294/*-------------------------------------------------------------------------*\
  • c/src/lib/libbsp/i386/pc386/include/bsp.h

    r821b2a9 r6fda59f  
    174174#define rtems_bsp_delay(_microseconds) \
    175175{ \
    176   rtems_unsigned32 _cnt = _microseconds; \
     176  uint32_t        _cnt = _microseconds; \
    177177  asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt)); \
    178178}
     
    196196extern rtems_configuration_table BSP_Configuration;
    197197                                    /* User provided BSP configuration table. */
    198 extern rtems_unsigned32          rtemsFreeMemStart;
     198extern uint32_t                  rtemsFreeMemStart;
    199199  /* Address of start of free memory - should be used when creating new
    200200     partitions or regions and updated afterwards. */
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r821b2a9 r6fda59f  
    4040| Global Variables
    4141+--------------------------------------------------------------------------*/
    42 extern rtems_unsigned32 _end;         /* End of BSS. Defined in 'linkcmds'. */
     42extern uint32_t        _end;         /* End of BSS. Defined in 'linkcmds'. */
    4343/*
    4444 * Size of heap if it is 0 it will be dynamically defined by memory size,
    4545 * otherwise the value should be changed by binary patch
    4646 */
    47 rtems_unsigned32 _heap_size = 0;
     47uint32_t        _heap_size = 0;
    4848
    4949/* Size of stack used during initialization. Defined in 'start.s'.  */
    50 extern rtems_unsigned32 _stack_size;
    51 
    52 rtems_unsigned32 rtemsFreeMemStart;
     50extern uint32_t        _stack_size;
     51
     52uint32_t        rtemsFreeMemStart;
    5353                         /* Address of start of free memory - should be updated
    5454                            after creating new partitions or regions.         */
     
    6767+--------------------------------------------------------------------------*/
    6868extern void rtems_irq_mngt_init(void);
    69 void bsp_libc_init( void *, unsigned32, int );
     69void bsp_libc_init( void *, uint32_t, int );
    7070void bsp_postdriver_hook(void);
    7171
     
    8282void bsp_pretasking_hook(void)
    8383{
    84   rtems_unsigned32 topAddr, val;
     84  uint32_t        topAddr, val;
    8585  int i;
    8686 
     
    9999        {
    100100          topAddr = i*1024*1024 - 4;
    101           *(volatile rtems_unsigned32 *)topAddr = topAddr;
     101          *(volatile uint32_t*)topAddr = topAddr;
    102102        }
    103103
     
    105105        {
    106106          topAddr = i*1024*1024 - 4;
    107           val =  *(rtems_unsigned32 *)topAddr;
     107          val =  *(uint32_t*)topAddr;
    108108          if(val != topAddr)
    109109            {
     
    145145  Calibrate_loop_1ms();
    146146
    147   rtemsFreeMemStart = (rtems_unsigned32)&_end + _stack_size;
     147  rtemsFreeMemStart = (uint32_t)&_end + _stack_size;
    148148                                    /* set the value of start of free memory. */
    149149
  • c/src/lib/libbsp/i386/pc386/timer/timer.c

    r821b2a9 r6fda59f  
    5252#define SLOW_DOWN_IO  0x80      /* io which does nothing */
    5353
    54 #define TWO_MS  (rtems_unsigned32)(2000)     /* TWO_MS = 2000us (sic!) */
     54#define TWO_MS  (uint32_t)(2000)     /* TWO_MS = 2000us (sic!) */
    5555
    5656#define MSK_NULL_COUNT 0x40     /* bit counter available for reading */
     
    6060| Global Variables
    6161+--------------------------------------------------------------------------*/
    62 volatile rtems_unsigned32 Ttimer_val;
     62volatile uint32_t        Ttimer_val;
    6363rtems_boolean             Timer_driver_Find_average_overhead = TRUE;
    6464volatile unsigned int     fastLoop1ms, slowLoop1ms;
     
    135135|          Returns: Nothing.
    136136+--------------------------------------------------------------------------*/
    137 rtems_unsigned32
     137uint32_t       
    138138Read_timer(void)
    139139{
    140   register rtems_unsigned32 total;
    141 
    142   total =  (rtems_unsigned32)(rdtsc() - Ttimer_val);
     140  register uint32_t        total;
     141
     142  total =  (uint32_t)(rdtsc() - Ttimer_val);
    143143
    144144  if (Timer_driver_Find_average_overhead)
     
    257257|          Returns: Nothing.
    258258+--------------------------------------------------------------------------*/
    259 rtems_unsigned32
     259uint32_t       
    260260Read_timer(void)
    261261{
    262   register rtems_unsigned32 total, clicks;
    263   register rtems_unsigned8  lsb, msb;
     262  register uint32_t        total, clicks;
     263  register uint8_t          lsb, msb;
    264264
    265265  outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH);
Note: See TracChangeset for help on using the changeset viewer.