diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-03-31 05:08:13 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-03-31 05:08:13 +0000 |
commit | 6fda59fe9b6c6e6f2df1ac18053b937586265e1b (patch) | |
tree | b43f9ad167d4b2c966ebfe89c8d992c423d3b84d /c/src/lib/libbsp/i386/pc386/clock | |
parent | 2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org> (diff) | |
download | rtems-6fda59fe9b6c6e6f2df1ac18053b937586265e1b.tar.bz2 |
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
* 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.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/clock')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/clock/ckinit.c | 12 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/clock/rtc.c | 26 |
2 files changed, 19 insertions, 19 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c index cba18a77f6..9fa7acbd33 100644 --- a/c/src/lib/libbsp/i386/pc386/clock/ckinit.c +++ b/c/src/lib/libbsp/i386/pc386/clock/ckinit.c @@ -50,9 +50,9 @@ | Global Variables +--------------------------------------------------------------------------*/ -volatile rtems_unsigned32 Clock_driver_ticks; /* Tick (interrupt) counter. */ - rtems_unsigned32 Clock_isrs_per_tick; /* ISRs per tick. */ - rtems_unsigned32 Clock_isrs; /* ISRs until next tick. */ +volatile uint32_t Clock_driver_ticks; /* Tick (interrupt) counter. */ + uint32_t Clock_isrs_per_tick; /* ISRs per tick. */ + uint32_t Clock_isrs; /* ISRs until next tick. */ /* The following variables are set by the clock driver during its init */ @@ -119,7 +119,7 @@ void clockOff(const rtems_irq_connect_data* unused) +--------------------------------------------------------------------------*/ static void clockOn(const rtems_irq_connect_data* unused) { - rtems_unsigned32 microseconds_per_isr; + uint32_t microseconds_per_isr; #if 0 /* Initialize clock from on-board real time clock. This breaks the */ @@ -157,7 +157,7 @@ static void clockOn(const rtems_irq_connect_data* unused) { /* 105/88 approximates TIMER_TICK * 1e-6 */ - rtems_unsigned32 count = US_TO_TICK(microseconds_per_isr); + uint32_t count = US_TO_TICK(microseconds_per_isr); outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN); outport_byte(TIMER_CNTR0, count >> 0 & 0xff); @@ -260,7 +260,7 @@ volatile long long Last_RDTSC; long long Kernel_Time_ns( void ) { - extern rtems_unsigned32 _TOD_Ticks_per_second; + extern uint32_t _TOD_Ticks_per_second; unsigned isrs_per_second = Clock_isrs_per_tick * _TOD_Ticks_per_second; long long now; diff --git a/c/src/lib/libbsp/i386/pc386/clock/rtc.c b/c/src/lib/libbsp/i386/pc386/clock/rtc.c index fbeac20a33..c20d308564 100644 --- a/c/src/lib/libbsp/i386/pc386/clock/rtc.c +++ b/c/src/lib/libbsp/i386/pc386/clock/rtc.c @@ -81,8 +81,8 @@ | Arguments: i - Number to convert. | Returns: BCD representation of number. +--------------------------------------------------------------------------*/ -static inline rtems_unsigned8 -bcd(rtems_unsigned8 i) +static inline uint8_t +bcd(uint8_t i) { return ((i / 16) * 10 + (i % 16)); } /* bcd */ @@ -101,8 +101,8 @@ bcd(rtems_unsigned8 i) | Arguments: y - year to convert (1970 <= y <= 2100). | Returns: number of seconds since 1970. +--------------------------------------------------------------------------*/ -static inline rtems_unsigned32 -ytos(rtems_unsigned16 y) +static inline uint32_t +ytos(uint16_t y) { /* v NUM LEAP YEARS v */ return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY); } /* ytos */ @@ -115,10 +115,10 @@ ytos(rtems_unsigned16 y) | Arguments: m - month to convert, leap - is this a month of a leap year. | Returns: number of seconds since January. +--------------------------------------------------------------------------*/ -static inline rtems_unsigned32 -mtos(rtems_unsigned8 m, rtems_boolean leap) +static inline uint32_t +mtos(uint8_t m, rtems_boolean leap) { - static rtems_unsigned16 daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181, + static uint16_t daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; /* Days since beginning of year until beginning of month. */ @@ -134,10 +134,10 @@ mtos(rtems_unsigned8 m, rtems_boolean leap) | Arguments: what - what to write to RTC port (what to do). | Returns: result received from RTC port after action performed. +--------------------------------------------------------------------------*/ -static inline rtems_unsigned8 -rtcin(rtems_unsigned8 what) +static inline uint8_t +rtcin(uint8_t what) { - rtems_unsigned8 r; + uint8_t r; outport_byte(IO_RTC, what); inport_byte (IO_RTC+1, r); @@ -158,7 +158,7 @@ rtcin(rtems_unsigned8 what) void init_rtc(void) { - rtems_unsigned8 s; + uint8_t s; /* initialize brain-dead battery powered clock */ outport_byte(IO_RTC, RTC_STATUSA); @@ -186,8 +186,8 @@ init_rtc(void) long int rtc_read(rtems_time_of_day *tod) { - rtems_unsigned8 sa; - rtems_unsigned32 sec = 0; + uint8_t sa; + uint32_t sec = 0; memset(tod, 0, sizeof *tod); /* zero tod structure */ |