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

* clock/ckinit.c, include/bare.h, include/bsp.h, include/crc.h,
	startup/bspstart.c, startup/cpuboot.c, startup/crc.c,
	startup/gdb-hooks.c, startup/m68302scc.c, timer/timer.c: Convert to
	using c99 fixed size types.
This commit is contained in:
Ralf Corsepius
2004-03-31 04:39:50 +00:00
parent 629e12a5e0
commit a4318d0ccc
11 changed files with 47 additions and 40 deletions

View File

@@ -1,3 +1,10 @@
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
* clock/ckinit.c, include/bare.h, include/bsp.h, include/crc.h,
startup/bspstart.c, startup/cpuboot.c, startup/crc.c,
startup/gdb-hooks.c, startup/m68302scc.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

@@ -38,7 +38,7 @@
* Clock_driver_ticks is a monotonically increasing counter of the * Clock_driver_ticks is a monotonically increasing counter of the
* number of clock ticks since the driver was initialized. * number of clock ticks since the driver was initialized.
*/ */
volatile rtems_unsigned32 Clock_driver_ticks; volatile uint32_t Clock_driver_ticks;
/* /*
* Clock_isrs is the number of clock ISRs until the next invocation of * Clock_isrs is the number of clock ISRs until the next invocation of
@@ -47,7 +47,7 @@ volatile rtems_unsigned32 Clock_driver_ticks;
* length of time between the user configured microseconds per tick * length of time between the user configured microseconds per tick
* has passed. * has passed.
*/ */
rtems_unsigned32 Clock_isrs; uint32_t Clock_isrs;
void Clock_exit( void ); void Clock_exit( void );
@@ -129,7 +129,7 @@ rtems_device_driver Clock_control(
void *pargp void *pargp
) )
{ {
rtems_unsigned32 isrlevel; uint32_t isrlevel;
rtems_libio_ioctl_args_t *args = pargp; rtems_libio_ioctl_args_t *args = pargp;
if (args == 0) if (args == 0)

View File

@@ -156,15 +156,15 @@ extern "C"
/* Write */ /* Write */
#define WRITE_REGISTER_8(address, data) \ #define WRITE_REGISTER_8(address, data) \
*((rtems_unsigned8 *) (address)) = ((rtems_unsigned8) (data)) *((uint8_t*) (address)) = ((uint8_t) (data))
#define WRITE_REGISTER_16(address, data) \ #define WRITE_REGISTER_16(address, data) \
*((rtems_unsigned16 *) (address)) = ((rtems_unsigned16) (data)) *((uint16_t*) (address)) = ((uint16_t) (data))
#define WRITE_REGISTER_32(address, data) \ #define WRITE_REGISTER_32(address, data) \
*((rtems_unsigned32 *) (address)) = ((rtems_unsigned32) (data)) *((uint32_t*) (address)) = ((uint32_t) (data))
/* Read */ /* Read */
#define READ_REGISTER_8(address, data) data = *((rtems_unsigned8 *) (address)) #define READ_REGISTER_8(address, data) data = *((uint8_t*) (address))
#define READ_REGISTER_16(address, data) data = *((rtems_unsigned16 *) (address)) #define READ_REGISTER_16(address, data) data = *((uint16_t*) (address))
#define READ_REGISTER_32(address, data) data = *((rtems_unsigned32 *) (address)) #define READ_REGISTER_32(address, data) data = *((uint32_t*) (address))
/* CS2 : Peripherials */ /* CS2 : Peripherials */
#define PERIPHERIALS_BASE (CSEL_2_BASE) #define PERIPHERIALS_BASE (CSEL_2_BASE)
@@ -228,10 +228,10 @@ extern "C"
/* update the display, needs a long word */ /* update the display, needs a long word */
#define UPDATE_DISPLAY(LongWordPtr) \ #define UPDATE_DISPLAY(LongWordPtr) \
( WRITE_REGISTER_16(DISPLAY_BASE, *(((rtems_unsigned8 *) LongWordPtr) + 3)), \ ( WRITE_REGISTER_16(DISPLAY_BASE, *(((uint8_t*) LongWordPtr) + 3)), \
WRITE_REGISTER_16(DISPLAY_BASE + 2, *(((rtems_unsigned8 *) LongWordPtr) + 2)), \ WRITE_REGISTER_16(DISPLAY_BASE + 2, *(((uint8_t*) LongWordPtr) + 2)), \
WRITE_REGISTER_16(DISPLAY_BASE + 4, *(((rtems_unsigned8 *) LongWordPtr) + 1)), \ WRITE_REGISTER_16(DISPLAY_BASE + 4, *(((uint8_t*) LongWordPtr) + 1)), \
WRITE_REGISTER_16(DISPLAY_BASE + 6, *((rtems_unsigned8 *) LongWordPtr)) ) WRITE_REGISTER_16(DISPLAY_BASE + 6, *((uint8_t*) LongWordPtr)) )
/* make a better test, say switches */ /* make a better test, say switches */
#if defined(GDB_MONITOR_ACTIVE) #if defined(GDB_MONITOR_ACTIVE)

View File

@@ -78,8 +78,8 @@ extern "C" {
*/ */
#define rtems_bsp_delay( microseconds ) \ #define rtems_bsp_delay( microseconds ) \
{ register rtems_unsigned32 _delay=(microseconds); \ { register uint32_t _delay=(microseconds); \
register rtems_unsigned32 _tmp=123; \ register uint32_t _tmp=123; \
asm volatile( "0: \ asm volatile( "0: \
nbcd %0 ; \ nbcd %0 ; \
nbcd %0 ; \ nbcd %0 ; \

View File

@@ -18,7 +18,7 @@ extern "C"
{ {
#endif #endif
rtems_unsigned16 calc_crc(void *data, rtems_unsigned32 count); uint16_t calc_crc(void *data, uint32_t count);
#if __cplusplus #if __cplusplus
} }

View File

@@ -38,7 +38,7 @@ char *rtems_progname;
*/ */
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 );
void bsp_pretasking_hook(void); /* m68k version */ void bsp_pretasking_hook(void); /* m68k version */
/* /*

View File

@@ -95,7 +95,7 @@ void boot_phase_1()
void boot_phase_2(void) void boot_phase_2(void)
{ {
rtems_unsigned32 stack; uint32_t stack;
#if defined(LED_CONTROL) #if defined(LED_CONTROL)
LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF, LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF,
@@ -111,7 +111,7 @@ void boot_phase_2(void)
#endif #endif
/* seems to want 2, looked at assember code output */ /* seems to want 2, looked at assember code output */
*((volatile rtems_unsigned32*) (&stack + 2)) |= ROM_BASE; *((volatile uint32_t*) (&stack + 2)) |= ROM_BASE;
} }
/* /*

View File

@@ -18,7 +18,7 @@
*/ */
static const rtems_unsigned16 factor[] = static const uint16_t factor[] =
{ {
0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
@@ -66,12 +66,12 @@ static const rtems_unsigned16 factor[] =
Calculates the CRC value of a block of memory Calculates the CRC value of a block of memory
*/ */
rtems_unsigned16 calc_crc(void* vdata, /* pointer to memory block */ uint16_t calc_crc(void* vdata, /* pointer to memory block */
rtems_unsigned32 count) /* length of block in bytes */ uint32_t count) /* length of block in bytes */
{ {
register rtems_unsigned8 *data = vdata; register uint8_t *data = vdata;
register rtems_unsigned16 crc; register uint16_t crc;
register rtems_unsigned32 byte; register uint32_t byte;
/* initialise to either 0x0 or 0xffff depending on the /* initialise to either 0x0 or 0xffff depending on the
CRC implementation */ CRC implementation */

View File

@@ -45,10 +45,10 @@ char getDebugChar(void)
void (*exceptionHook)(unsigned int) = 0; void (*exceptionHook)(unsigned int) = 0;
typedef struct { typedef struct {
rtems_unsigned16 move_a7; /* move #FORMAT_ID,%a7@- */ uint16_t move_a7; /* move #FORMAT_ID,%a7@- */
rtems_unsigned16 format_id; uint16_t format_id;
rtems_unsigned16 jmp; /* jmp _ISR_Handlers */ uint16_t jmp; /* jmp _ISR_Handlers */
rtems_unsigned32 isr_handler; uint32_t isr_handler;
} GDB_HANDLER_ENTRY; } GDB_HANDLER_ENTRY;
#if !defined(M68K_MOVE_A7) #if !defined(M68K_MOVE_A7)
@@ -64,13 +64,13 @@ static GDB_HANDLER_ENTRY gdb_jump_table[256];
void exceptionHandler(unsigned int vector, void *handler) void exceptionHandler(unsigned int vector, void *handler)
{ {
rtems_unsigned32 *interrupt_table = 0; uint32_t *interrupt_table = 0;
gdb_jump_table[vector].move_a7 = M68K_MOVE_A7; gdb_jump_table[vector].move_a7 = M68K_MOVE_A7;
gdb_jump_table[vector].format_id = vector; gdb_jump_table[vector].format_id = vector;
gdb_jump_table[vector].jmp = M68K_JMP; gdb_jump_table[vector].jmp = M68K_JMP;
gdb_jump_table[vector].isr_handler = (rtems_unsigned32) handler; gdb_jump_table[vector].isr_handler = (uint32_t) handler;
interrupt_table[vector] = (rtems_unsigned32) &gdb_jump_table[vector]; interrupt_table[vector] = (uint32_t) &gdb_jump_table[vector];
} }

View File

@@ -18,7 +18,7 @@ static volatile m302_SCC_t *scc[M68302_SCC_COUNT] = { 0, 0, 0 };
static volatile m302_SCC_Registers_t *scc_reg[M68302_SCC_COUNT] = { 0, 0, 0 }; static volatile m302_SCC_Registers_t *scc_reg[M68302_SCC_COUNT] = { 0, 0, 0 };
static int scc_translate[M68302_SCC_COUNT] = { 0, 0, 0 }; static int scc_translate[M68302_SCC_COUNT] = { 0, 0, 0 };
static const rtems_unsigned16 baud_clocks[] = static const uint16_t baud_clocks[] =
{ {
(SYSTEM_CLOCK / ( 4800 * 16)), (SYSTEM_CLOCK / ( 4800 * 16)),
(SYSTEM_CLOCK / ( 9600 * 16)), (SYSTEM_CLOCK / ( 9600 * 16)),
@@ -30,7 +30,7 @@ static const rtems_unsigned16 baud_clocks[] =
void scc_initialise(int channel, int baud, int translate) void scc_initialise(int channel, int baud, int translate)
{ {
rtems_unsigned16 scon; uint16_t scon;
if (channel < M68302_SCC_COUNT) if (channel < M68302_SCC_COUNT)
{ {
@@ -47,12 +47,12 @@ void scc_initialise(int channel, int baud, int translate)
scc[channel]->bd.tx[0].status = 0x2000; scc[channel]->bd.tx[0].status = 0x2000;
scc[channel]->bd.tx[0].length = 0; scc[channel]->bd.tx[0].length = 0;
scc[channel]->bd.tx[0].buffer = scc[channel]->bd.tx[0].buffer =
(rtems_unsigned8*) &(scc[channel]->bd.tx[1].buffer); (uint8_t*) &(scc[channel]->bd.tx[1].buffer);
scc[channel]->bd.rx[0].status = 0x2000; scc[channel]->bd.rx[0].status = 0x2000;
scc[channel]->bd.rx[0].length = 0; scc[channel]->bd.rx[0].length = 0;
scc[channel]->bd.rx[0].buffer = scc[channel]->bd.rx[0].buffer =
(rtems_unsigned8*) &(scc[channel]->bd.rx[1].buffer); (uint8_t*) &(scc[channel]->bd.rx[1].buffer);
scc[channel]->parm.rfcr = 0x50; scc[channel]->parm.rfcr = 0x50;
scc[channel]->parm.tfcr = 0x50; scc[channel]->parm.tfcr = 0x50;
@@ -78,7 +78,7 @@ void scc_initialise(int channel, int baud, int translate)
unsigned char scc_status(int channel, unsigned char status) unsigned char scc_status(int channel, unsigned char status)
{ {
rtems_unsigned16 rx_status; uint16_t rx_status;
m302.reg.wcn = 0; m302.reg.wcn = 0;

View File

@@ -40,7 +40,7 @@
* 2000 ticks @ (16MHz/1)/8 = 1-ms count * 2000 ticks @ (16MHz/1)/8 = 1-ms count
*/ */
rtems_unsigned32 Timer_interrupts; uint32_t Timer_interrupts;
rtems_boolean Timer_driver_Find_average_overhead; rtems_boolean Timer_driver_Find_average_overhead;
@@ -79,8 +79,8 @@ void Timer_initialize( void )
*/ */
int Read_timer( void ) int Read_timer( void )
{ {
rtems_unsigned16 clicks; uint16_t clicks;
rtems_unsigned32 total; uint32_t total;
/* /*
* Read the timer and see how many clicks it has been since counter * Read the timer and see how many clicks it has been since counter