2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>

* clock/ckinit.c, clock/rtc.c, include/bsp.h, startup/bspstart.c,
	timer/timer.c: Convert to using c99 fixed size types.
This commit is contained in:
Ralf Corsepius
2004-03-31 05:07:48 +00:00
parent 492bb092a8
commit 821b2a91eb
6 changed files with 30 additions and 25 deletions

View File

@@ -1,3 +1,8 @@
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
* clock/ckinit.c, clock/rtc.c, include/bsp.h, startup/bspstart.c,
timer/timer.c: Convert to using c99 fixed size types.
2004-02-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2004-02-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Reflect changes to bsp.am. * Makefile.am: Reflect changes to bsp.am.

View File

@@ -26,10 +26,10 @@
#include <stdlib.h> #include <stdlib.h>
rtems_unsigned32 Clock_isrs; /* ISRs until next tick */ uint32_t Clock_isrs; /* ISRs until next tick */
static rtems_unsigned32 Clock_initial_isr_value; static uint32_t Clock_initial_isr_value;
volatile rtems_unsigned32 Clock_driver_ticks; volatile uint32_t Clock_driver_ticks;
void Clock_exit( void ); void Clock_exit( void );

View File

@@ -81,8 +81,8 @@
| Arguments: i - Number to convert. | Arguments: i - Number to convert.
| Returns: BCD representation of number. | Returns: BCD representation of number.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
static inline rtems_unsigned8 static inline uint8_t
bcd(rtems_unsigned8 i) bcd(uint8_t i)
{ {
return ((i / 16) * 10 + (i % 16)); return ((i / 16) * 10 + (i % 16));
} /* bcd */ } /* bcd */
@@ -101,8 +101,8 @@ bcd(rtems_unsigned8 i)
| Arguments: y - year to convert (1970 <= y <= 2100). | Arguments: y - year to convert (1970 <= y <= 2100).
| Returns: number of seconds since 1970. | Returns: number of seconds since 1970.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
static inline rtems_unsigned32 static inline uint32_t
ytos(rtems_unsigned16 y) ytos(uint16_t y)
{ /* v NUM LEAP YEARS v */ { /* v NUM LEAP YEARS v */
return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY); return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY);
} /* ytos */ } /* ytos */
@@ -115,10 +115,10 @@ ytos(rtems_unsigned16 y)
| Arguments: m - month to convert, leap - is this a month of a leap year. | Arguments: m - month to convert, leap - is this a month of a leap year.
| Returns: number of seconds since January. | Returns: number of seconds since January.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
static inline rtems_unsigned32 static inline uint32_t
mtos(rtems_unsigned8 m, rtems_boolean leap) 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 }; 212, 243, 273, 304, 334, 365 };
/* Days since beginning of year until beginning of month. */ /* 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). | Arguments: what - what to write to RTC port (what to do).
| Returns: result received from RTC port after action performed. | Returns: result received from RTC port after action performed.
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
static inline rtems_unsigned8 static inline uint8_t
rtcin(rtems_unsigned8 what) rtcin(uint8_t what)
{ {
rtems_unsigned8 r; uint8_t r;
outport_byte(IO_RTC, what); outport_byte(IO_RTC, what);
inport_byte (IO_RTC+1, r); inport_byte (IO_RTC+1, r);
@@ -158,7 +158,7 @@ rtcin(rtems_unsigned8 what)
void void
init_rtc(void) init_rtc(void)
{ {
rtems_unsigned8 s; uint8_t s;
/* initialize brain-dead battery powered clock */ /* initialize brain-dead battery powered clock */
outport_byte(IO_RTC, RTC_STATUSA); outport_byte(IO_RTC, RTC_STATUSA);
@@ -186,8 +186,8 @@ init_rtc(void)
long int long int
rtc_read(rtems_time_of_day *tod) rtc_read(rtems_time_of_day *tod)
{ {
rtems_unsigned8 sa; uint8_t sa;
rtems_unsigned32 sec = 0; uint32_t sec = 0;
memset(tod, 0, sizeof *tod); /* zero tod structure */ memset(tod, 0, sizeof *tod); /* zero tod structure */

View File

@@ -118,7 +118,7 @@ extern void Wait_X_ms (unsigned);
#define rtems_bsp_delay( _microseconds ) \ #define rtems_bsp_delay( _microseconds ) \
{ \ { \
rtems_unsigned32 _counter; \ uint32_t _counter; \
\ \
_counter = (_microseconds); \ _counter = (_microseconds); \
\ \

View File

@@ -40,14 +40,14 @@ rtems_cpu_table Cpu_table;
* Tells us where to put the workspace in case remote debugger is present. * Tells us where to put the workspace in case remote debugger is present.
*/ */
extern rtems_unsigned32 rdb_start; extern uint32_t rdb_start;
/* /*
* Use the shared implementations of the following routines * Use the shared implementations of the following routines
*/ */
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); void bsp_libc_init( void *, uint32_t, int );
/* /*
* Function: bsp_pretasking_hook * Function: bsp_pretasking_hook
@@ -66,10 +66,10 @@ void bsp_libc_init( void *, unsigned32, int );
void bsp_pretasking_hook(void) void bsp_pretasking_hook(void)
{ {
extern int heap_bottom; extern int heap_bottom;
rtems_unsigned32 heap_start; uint32_t heap_start;
rtems_unsigned32 heap_size; uint32_t heap_size;
heap_start = (rtems_unsigned32) &heap_bottom; heap_start = (uint32_t) &heap_bottom;
if (heap_start & (CPU_ALIGNMENT-1)) if (heap_start & (CPU_ALIGNMENT-1))
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);

View File

@@ -28,7 +28,7 @@
#include <bsp.h> #include <bsp.h>
#include <stdlib.h> #include <stdlib.h>
volatile rtems_unsigned32 Ttimer_val; /* Updated from ISR!!! */ volatile uint32_t Ttimer_val; /* Updated from ISR!!! */
rtems_boolean Timer_driver_Find_average_overhead; rtems_boolean Timer_driver_Find_average_overhead;
extern void timerisr(); extern void timerisr();
@@ -137,8 +137,8 @@ void Timer_initialize(void)
int Read_timer(void) int Read_timer(void)
{ {
register rtems_unsigned32 clicks, total; register uint32_t clicks, total;
register rtems_unsigned8 lsb, msb; register uint8_t lsb, msb;
/* latch the count */ /* latch the count */
outport_byte (TIMER_MODE, TIMER_SEL0|TIMER_LATCH ); outport_byte (TIMER_MODE, TIMER_SEL0|TIMER_LATCH );