Changeset 6fda59f in rtems
- Timestamp:
- 03/31/04 05:08:13 (20 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- f0cbd19e
- Parents:
- 821b2a9
- Location:
- c/src/lib/libbsp/i386/pc386
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/pc386/ChangeLog
r821b2a9 r6fda59f 1 2004-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 1 7 2004-02-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 8 -
c/src/lib/libbsp/i386/pc386/clock/ckinit.c
r821b2a9 r6fda59f 51 51 +--------------------------------------------------------------------------*/ 52 52 53 volatile rtems_unsigned32Clock_driver_ticks; /* Tick (interrupt) counter. */54 rtems_unsigned32Clock_isrs_per_tick; /* ISRs per tick. */55 rtems_unsigned32Clock_isrs; /* ISRs until next tick. */53 volatile 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. */ 56 56 57 57 /* The following variables are set by the clock driver during its init */ … … 120 120 static void clockOn(const rtems_irq_connect_data* unused) 121 121 { 122 rtems_unsigned32microseconds_per_isr;122 uint32_t microseconds_per_isr; 123 123 124 124 #if 0 … … 158 158 { 159 159 /* 105/88 approximates TIMER_TICK * 1e-6 */ 160 rtems_unsigned32count = US_TO_TICK(microseconds_per_isr);160 uint32_t count = US_TO_TICK(microseconds_per_isr); 161 161 162 162 outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN); … … 261 261 long long Kernel_Time_ns( void ) 262 262 { 263 extern rtems_unsigned32_TOD_Ticks_per_second;263 extern uint32_t _TOD_Ticks_per_second; 264 264 265 265 unsigned isrs_per_second = Clock_isrs_per_tick * _TOD_Ticks_per_second; -
c/src/lib/libbsp/i386/pc386/clock/rtc.c
r821b2a9 r6fda59f 82 82 | Returns: BCD representation of number. 83 83 +--------------------------------------------------------------------------*/ 84 static inline rtems_unsigned885 bcd( rtems_unsigned8i)84 static inline uint8_t 85 bcd(uint8_t i) 86 86 { 87 87 return ((i / 16) * 10 + (i % 16)); … … 102 102 | Returns: number of seconds since 1970. 103 103 +--------------------------------------------------------------------------*/ 104 static inline rtems_unsigned32105 ytos( rtems_unsigned16y)104 static inline uint32_t 105 ytos(uint16_t y) 106 106 { /* v NUM LEAP YEARS v */ 107 107 return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY); … … 116 116 | Returns: number of seconds since January. 117 117 +--------------------------------------------------------------------------*/ 118 static inline rtems_unsigned32119 mtos( rtems_unsigned8m, rtems_boolean leap)120 { 121 static rtems_unsigned16daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181,118 static inline uint32_t 119 mtos(uint8_t m, rtems_boolean leap) 120 { 121 static uint16_t daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181, 122 122 212, 243, 273, 304, 334, 365 }; 123 123 /* Days since beginning of year until beginning of month. */ … … 135 135 | Returns: result received from RTC port after action performed. 136 136 +--------------------------------------------------------------------------*/ 137 static inline rtems_unsigned8138 rtcin( rtems_unsigned8what)139 { 140 rtems_unsigned8r;137 static inline uint8_t 138 rtcin(uint8_t what) 139 { 140 uint8_t r; 141 141 142 142 outport_byte(IO_RTC, what); … … 159 159 init_rtc(void) 160 160 { 161 rtems_unsigned8s;161 uint8_t s; 162 162 163 163 /* initialize brain-dead battery powered clock */ … … 187 187 rtc_read(rtems_time_of_day *tod) 188 188 { 189 rtems_unsigned8sa;190 rtems_unsigned32sec = 0;189 uint8_t sa; 190 uint32_t sec = 0; 191 191 192 192 memset(tod, 0, sizeof *tod); /* zero tod structure */ -
c/src/lib/libbsp/i386/pc386/console/inch.c
r821b2a9 r6fda59f 69 69 70 70 static unsigned short kbd_buffer[KBD_BUF_SIZE]; 71 static rtems_unsigned16kbd_first = 0;72 static rtems_unsigned16kbd_last = 0;73 static rtems_unsigned16kbd_end = KBD_BUF_SIZE - 1;71 static uint16_t kbd_first = 0; 72 static uint16_t kbd_last = 0; 73 static uint16_t kbd_end = KBD_BUF_SIZE - 1; 74 74 75 75 /*-------------------------------------------------------------------------+ -
c/src/lib/libbsp/i386/pc386/ide/ide.c
r821b2a9 r6fda59f 93 93 int minor, /* controller minor number */ 94 94 int reg, /* register index to access */ 95 u nsigned16*value /* ptr to return value location */96 ) 97 /*-------------------------------------------------------------------------*\ 98 | Return Value: | 99 | <none> | 100 \*=========================================================================*/ 101 { 102 u nsigned32port = IDE_Controller_Table[minor].port1;103 u nsigned8bval1,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; 104 104 105 105 if (reg == IDE_REGISTER_DATA_WORD) { … … 130 130 int minor, /* controller minor number */ 131 131 int reg, /* register index to access */ 132 u nsigned16value /* value to write */133 ) 134 /*-------------------------------------------------------------------------*\ 135 | Return Value: | 136 | <none> | 137 \*=========================================================================*/ 138 { 139 u nsigned32port = 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; 140 140 141 141 #ifdef DEBUG_OUT … … 162 162 \*-------------------------------------------------------------------------*/ 163 163 int minor, 164 u nsigned16block_size,164 uint16_t block_size, 165 165 blkdev_sg_buffer *bufs, 166 rtems_unsigned32*cbuf,167 rtems_unsigned32*pos168 ) 169 /*-------------------------------------------------------------------------*\ 170 | Return Value: | 171 | <none> | 172 \*=========================================================================*/ 173 { 174 u nsigned32port = IDE_Controller_Table[minor].port1;175 u nsigned16cnt = 0;176 u nsigned32llength = bufs[(*cbuf)].length;177 u nsigned8status_val;178 u nsigned16 *lbuf = (unsigned16*)179 ((u nsigned8*)(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)); 180 180 181 181 inport_byte(port+IDE_REGISTER_STATUS,status_val); … … 215 215 \*-------------------------------------------------------------------------*/ 216 216 int minor, 217 u nsigned16block_size,217 uint16_t block_size, 218 218 blkdev_sg_buffer *bufs, 219 rtems_unsigned32*cbuf,220 rtems_unsigned32*pos221 ) 222 /*-------------------------------------------------------------------------*\ 223 | Return Value: | 224 | <none> | 225 \*=========================================================================*/ 226 { 227 u nsigned32port = IDE_Controller_Table[minor].port1;228 u nsigned16cnt = 0;229 u nsigned32llength = bufs[(*cbuf)].length;230 u nsigned8status_val;231 u nsigned16 *lbuf = (unsigned16*)232 ((u nsigned8*)(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)); 233 233 234 234 #ifdef DEBUG_OUT … … 267 267 \*-------------------------------------------------------------------------*/ 268 268 int minor, /* controller minor number */ 269 u nsigned32cmd, /* command to send */269 uint32_t cmd, /* command to send */ 270 270 void * arg /* optional argument */ 271 271 ) … … 290 290 \*-------------------------------------------------------------------------*/ 291 291 int minor, /* controller minor number */ 292 u nsigned8modes_avail /* optional argument */292 uint8_t modes_avail /* optional argument */ 293 293 ) 294 294 /*-------------------------------------------------------------------------*\ -
c/src/lib/libbsp/i386/pc386/include/bsp.h
r821b2a9 r6fda59f 174 174 #define rtems_bsp_delay(_microseconds) \ 175 175 { \ 176 rtems_unsigned32_cnt = _microseconds; \176 uint32_t _cnt = _microseconds; \ 177 177 asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt)); \ 178 178 } … … 196 196 extern rtems_configuration_table BSP_Configuration; 197 197 /* User provided BSP configuration table. */ 198 extern rtems_unsigned32rtemsFreeMemStart;198 extern uint32_t rtemsFreeMemStart; 199 199 /* Address of start of free memory - should be used when creating new 200 200 partitions or regions and updated afterwards. */ -
c/src/lib/libbsp/i386/pc386/startup/bspstart.c
r821b2a9 r6fda59f 40 40 | Global Variables 41 41 +--------------------------------------------------------------------------*/ 42 extern rtems_unsigned32_end; /* End of BSS. Defined in 'linkcmds'. */42 extern uint32_t _end; /* End of BSS. Defined in 'linkcmds'. */ 43 43 /* 44 44 * Size of heap if it is 0 it will be dynamically defined by memory size, 45 45 * otherwise the value should be changed by binary patch 46 46 */ 47 rtems_unsigned32_heap_size = 0;47 uint32_t _heap_size = 0; 48 48 49 49 /* Size of stack used during initialization. Defined in 'start.s'. */ 50 extern rtems_unsigned32_stack_size;51 52 rtems_unsigned32rtemsFreeMemStart;50 extern uint32_t _stack_size; 51 52 uint32_t rtemsFreeMemStart; 53 53 /* Address of start of free memory - should be updated 54 54 after creating new partitions or regions. */ … … 67 67 +--------------------------------------------------------------------------*/ 68 68 extern void rtems_irq_mngt_init(void); 69 void bsp_libc_init( void *, u nsigned32, int );69 void bsp_libc_init( void *, uint32_t, int ); 70 70 void bsp_postdriver_hook(void); 71 71 … … 82 82 void bsp_pretasking_hook(void) 83 83 { 84 rtems_unsigned32topAddr, val;84 uint32_t topAddr, val; 85 85 int i; 86 86 … … 99 99 { 100 100 topAddr = i*1024*1024 - 4; 101 *(volatile rtems_unsigned32*)topAddr = topAddr;101 *(volatile uint32_t*)topAddr = topAddr; 102 102 } 103 103 … … 105 105 { 106 106 topAddr = i*1024*1024 - 4; 107 val = *( rtems_unsigned32*)topAddr;107 val = *(uint32_t*)topAddr; 108 108 if(val != topAddr) 109 109 { … … 145 145 Calibrate_loop_1ms(); 146 146 147 rtemsFreeMemStart = ( rtems_unsigned32)&_end + _stack_size;147 rtemsFreeMemStart = (uint32_t)&_end + _stack_size; 148 148 /* set the value of start of free memory. */ 149 149 -
c/src/lib/libbsp/i386/pc386/timer/timer.c
r821b2a9 r6fda59f 52 52 #define SLOW_DOWN_IO 0x80 /* io which does nothing */ 53 53 54 #define TWO_MS ( rtems_unsigned32)(2000) /* TWO_MS = 2000us (sic!) */54 #define TWO_MS (uint32_t)(2000) /* TWO_MS = 2000us (sic!) */ 55 55 56 56 #define MSK_NULL_COUNT 0x40 /* bit counter available for reading */ … … 60 60 | Global Variables 61 61 +--------------------------------------------------------------------------*/ 62 volatile rtems_unsigned32Ttimer_val;62 volatile uint32_t Ttimer_val; 63 63 rtems_boolean Timer_driver_Find_average_overhead = TRUE; 64 64 volatile unsigned int fastLoop1ms, slowLoop1ms; … … 135 135 | Returns: Nothing. 136 136 +--------------------------------------------------------------------------*/ 137 rtems_unsigned32 137 uint32_t 138 138 Read_timer(void) 139 139 { 140 register rtems_unsigned32total;141 142 total = ( rtems_unsigned32)(rdtsc() - Ttimer_val);140 register uint32_t total; 141 142 total = (uint32_t)(rdtsc() - Ttimer_val); 143 143 144 144 if (Timer_driver_Find_average_overhead) … … 257 257 | Returns: Nothing. 258 258 +--------------------------------------------------------------------------*/ 259 rtems_unsigned32 259 uint32_t 260 260 Read_timer(void) 261 261 { 262 register rtems_unsigned32total, clicks;263 register rtems_unsigned8lsb, msb;262 register uint32_t total, clicks; 263 register uint8_t lsb, msb; 264 264 265 265 outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_LATCH);
Note: See TracChangeset
for help on using the changeset viewer.