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

* console/console.c, ide/pcmcia_ide.c, network/network.c,
	startup/bspstart.c, startup/bspstart.c.nocache, startup/imbx8xx.c:
	Convert to using c99 fixed size types.
This commit is contained in:
Ralf Corsepius
2004-03-31 03:29:45 +00:00
parent cba5e8199d
commit 1c17b3ee2c
7 changed files with 65 additions and 59 deletions

View File

@@ -1,3 +1,9 @@
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
* console/console.c, ide/pcmcia_ide.c, network/network.c,
startup/bspstart.c, startup/bspstart.c.nocache, startup/imbx8xx.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

@@ -368,7 +368,7 @@ static rtems_status_code do_poll_read(
pollRead = m8xx_uart_pollRead; pollRead = m8xx_uart_pollRead;
while( (c = (*pollRead)(minor)) == -1 ); while( (c = (*pollRead)(minor)) == -1 );
rw_args->buffer[0] = (unsigned8)c; rw_args->buffer[0] = (uint8_t)c;
if( rw_args->buffer[0] == '\r' ) if( rw_args->buffer[0] == '\r' )
rw_args->buffer[0] = '\n'; rw_args->buffer[0] = '\n';
rw_args->bytes_moved = 1; rw_args->bytes_moved = 1;
@@ -383,7 +383,7 @@ static rtems_status_code do_poll_read(
#endif #endif
while( (c = BSP_READ(minor)) == -1 ); while( (c = BSP_READ(minor)) == -1 );
rw_args->buffer[0] = (unsigned8)c; rw_args->buffer[0] = (uint8_t)c;
if( rw_args->buffer[0] == '\r' ) if( rw_args->buffer[0] == '\r' )
rw_args->buffer[0] = '\n'; rw_args->buffer[0] = '\n';
rw_args->bytes_moved = 1; rw_args->bytes_moved = 1;
@@ -421,7 +421,7 @@ static rtems_status_code do_poll_write(
) )
{ {
rtems_libio_rw_args_t *rw_args = arg; rtems_libio_rw_args_t *rw_args = arg;
unsigned32 i; uint32_t i;
char cr ='\r'; char cr ='\r';
#if NVRAM_CONFIGURE == 1 #if NVRAM_CONFIGURE == 1

View File

@@ -68,14 +68,14 @@ boolean mbx8xx_pcmciaide_probe
* FIXME: this should be depending on state of VS1/2 pins * FIXME: this should be depending on state of VS1/2 pins
* FIXME: there should be a shadow variable for the BSP for CSR2 access * FIXME: there should be a shadow variable for the BSP for CSR2 access
*/ */
*((volatile unsigned8 *)MBX_CSR2) = 0xb0; *((volatile uint8_t*)MBX_CSR2) = 0xb0;
/* /*
* check card information service whether card is a ATA like disk * check card information service whether card is a ATA like disk
* -> scan for tuple of type 0x21 with content 0x04 0xXX (fixed disk) * -> scan for tuple of type 0x21 with content 0x04 0xXX (fixed disk)
* -> scan for tuple of type 0x22 with content 0x01 0x01 * -> scan for tuple of type 0x22 with content 0x01 0x01
*/ */
if (ide_card_plugged) { if (ide_card_plugged) {
#define CIS_BYTE(pos) (((unsigned8 *)PCMCIA_ATTRB_ADDR)[(pos)*2]) #define CIS_BYTE(pos) (((uint8_t*)PCMCIA_ATTRB_ADDR)[(pos)*2])
int cis_pos = 0; int cis_pos = 0;
boolean fixed_disk_tuple_found = FALSE; boolean fixed_disk_tuple_found = FALSE;
boolean ata_disk_tuple_found = FALSE; boolean ata_disk_tuple_found = FALSE;
@@ -144,25 +144,25 @@ void mbx8xx_pcmciaide_read_reg
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
int minor, /* controller minor number */ int minor, /* controller minor number */
int reg, /* register index to access */ int reg, /* register index to access */
unsigned16 *value /* ptr to return value location */ uint16_t *value /* ptr to return value location */
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
| Return Value: | | Return Value: |
| <none> | | <none> |
\*=========================================================================*/ \*=========================================================================*/
{ {
unsigned32 port = IDE_Controller_Table[minor].port1; uint32_t port = IDE_Controller_Table[minor].port1;
if (reg == IDE_REGISTER_DATA_WORD) { if (reg == IDE_REGISTER_DATA_WORD) {
#ifdef DATAREG_16BIT #ifdef DATAREG_16BIT
*value = *(volatile unsigned16 *)(port+reg); *value = *(volatile uint16_t*)(port+reg);
#else #else
*value = ((*(volatile unsigned8 *)(port+reg) << 8) + *value = ((*(volatile uint8_t*)(port+reg) << 8) +
(*(volatile unsigned8 *)(port+reg+1) )); (*(volatile uint8_t*)(port+reg+1) ));
#endif #endif
} }
else { else {
*value = *(volatile unsigned8 *)(port+reg); *value = *(volatile uint8_t*)(port+reg);
} }
#ifdef DEBUG_OUT #ifdef DEBUG_OUT
printk("mbx8xx_pcmciaide_read_reg(0x%x)=0x%x\r\n",reg,*value & 0xff); printk("mbx8xx_pcmciaide_read_reg(0x%x)=0x%x\r\n",reg,*value & 0xff);
@@ -182,28 +182,28 @@ void mbx8xx_pcmciaide_write_reg
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
int minor, /* controller minor number */ int minor, /* controller minor number */
int reg, /* register index to access */ int reg, /* register index to access */
unsigned16 value /* value to write */ uint16_t value /* value to write */
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
| Return Value: | | Return Value: |
| <none> | | <none> |
\*=========================================================================*/ \*=========================================================================*/
{ {
unsigned32 port = IDE_Controller_Table[minor].port1; uint32_t port = IDE_Controller_Table[minor].port1;
#ifdef DEBUG_OUT #ifdef DEBUG_OUT
printk("mbx8xx_pcmciaide_write_reg(0x%x,0x%x)\r\n",reg,value & 0xff); printk("mbx8xx_pcmciaide_write_reg(0x%x,0x%x)\r\n",reg,value & 0xff);
#endif #endif
if (reg == IDE_REGISTER_DATA_WORD) { if (reg == IDE_REGISTER_DATA_WORD) {
#ifdef DATAREG_16BIT #ifdef DATAREG_16BIT
*(volatile unsigned16 *)(port+reg) = value; *(volatile uint16_t*)(port+reg) = value;
#else #else
*(volatile unsigned8 *)(port+reg) = value >> 8; *(volatile uint8_t*)(port+reg) = value >> 8;
*(volatile unsigned8 *)(port+reg+1) = value; *(volatile uint8_t*)(port+reg+1) = value;
#endif #endif
} }
else { else {
*(volatile unsigned8 *)(port+reg)= value; *(volatile uint8_t*)(port+reg)= value;
} }
} }
@@ -219,39 +219,39 @@ void mbx8xx_pcmciaide_read_block
| Input Parameters: | | Input Parameters: |
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
int minor, int minor,
unsigned16 block_size, uint16_t block_size,
blkdev_sg_buffer *bufs, blkdev_sg_buffer *bufs,
rtems_unsigned32 *cbuf, uint32_t *cbuf,
rtems_unsigned32 *pos uint32_t *pos
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
| Return Value: | | Return Value: |
| <none> | | <none> |
\*=========================================================================*/ \*=========================================================================*/
{ {
unsigned32 port = IDE_Controller_Table[minor].port1; uint32_t port = IDE_Controller_Table[minor].port1;
unsigned16 cnt = 0; uint16_t cnt = 0;
#ifdef DEBUG_OUT #ifdef DEBUG_OUT
printk("mbx8xx_pcmciaide_read_block()\r\n"); printk("mbx8xx_pcmciaide_read_block()\r\n");
#endif #endif
#ifdef DATAREG_16BIT #ifdef DATAREG_16BIT
unsigned16 *lbuf = (unsigned16 *) uint16_t *lbuf = (uint16_t*)
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); ((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
#else #else
unsigned8 *lbuf = (unsigned8 *) uint8_t *lbuf = (uint8_t*)
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); ((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
#endif #endif
unsigned32 llength = bufs[(*cbuf)].length; uint32_t llength = bufs[(*cbuf)].length;
while (((*(volatile unsigned8 *)(port+IDE_REGISTER_STATUS)) while (((*(volatile uint8_t*)(port+IDE_REGISTER_STATUS))
& IDE_REGISTER_STATUS_DRQ) && & IDE_REGISTER_STATUS_DRQ) &&
(cnt < block_size)) { (cnt < block_size)) {
#ifdef DATAREG_16BIT #ifdef DATAREG_16BIT
*lbuf++ = *(volatile unsigned16 *)(port+8); /* 16 bit data port */ *lbuf++ = *(volatile uint16_t*)(port+8); /* 16 bit data port */
cnt += 2; cnt += 2;
(*pos) += 2; (*pos) += 2;
#else #else
*lbuf++ = *(volatile unsigned8 *)(port+IDE_REGISTER_DATA); *lbuf++ = *(volatile uint8_t*)(port+IDE_REGISTER_DATA);
cnt += 1; cnt += 1;
(*pos) += 1; (*pos) += 1;
#endif #endif
@@ -276,40 +276,40 @@ void mbx8xx_pcmciaide_write_block
| Input Parameters: | | Input Parameters: |
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
int minor, int minor,
unsigned16 block_size, uint16_t block_size,
blkdev_sg_buffer *bufs, blkdev_sg_buffer *bufs,
rtems_unsigned32 *cbuf, uint32_t *cbuf,
rtems_unsigned32 *pos uint32_t *pos
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
| Return Value: | | Return Value: |
| <none> | | <none> |
\*=========================================================================*/ \*=========================================================================*/
{ {
unsigned32 port = IDE_Controller_Table[minor].port1; uint32_t port = IDE_Controller_Table[minor].port1;
unsigned16 cnt = 0; uint16_t cnt = 0;
#ifdef DEBUG_OUT #ifdef DEBUG_OUT
printk("mbx8xx_pcmciaide_write_block()\r\n"); printk("mbx8xx_pcmciaide_write_block()\r\n");
#endif #endif
#ifdef DATA_REG_16BIT #ifdef DATA_REG_16BIT
unsigned16 *lbuf = (unsigned16 *) uint16_t *lbuf = (uint16_t*)
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); ((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
#else #else
unsigned8 *lbuf = (unsigned8 *) uint8_t *lbuf = (uint8_t*)
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); ((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
#endif #endif
unsigned32 llength = bufs[(*cbuf)].length; uint32_t llength = bufs[(*cbuf)].length;
while (((*(volatile unsigned8 *)(port+IDE_REGISTER_STATUS)) while (((*(volatile uint8_t*)(port+IDE_REGISTER_STATUS))
& IDE_REGISTER_STATUS_DRQ) && & IDE_REGISTER_STATUS_DRQ) &&
(cnt < block_size)) { (cnt < block_size)) {
#ifdef DATAREG_16BIT #ifdef DATAREG_16BIT
*(volatile unsigned16 *)(port+8) = *lbuf++; /* 16 bit data port */ *(volatile uint16_t*)(port+8) = *lbuf++; /* 16 bit data port */
cnt += 2; cnt += 2;
(*pos) += 2; (*pos) += 2;
#else #else
*(volatile unsigned8 *)(port+IDE_REGISTER_DATA) = *lbuf++; *(volatile uint8_t*)(port+IDE_REGISTER_DATA) = *lbuf++;
cnt += 1; cnt += 1;
(*pos) += 1; (*pos) += 1;
#endif #endif
@@ -334,7 +334,7 @@ int mbx8xx_pcmciaide_control
| Input Parameters: | | Input Parameters: |
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
int minor, /* controller minor number */ int minor, /* controller minor number */
unsigned32 cmd, /* command to send */ uint32_t cmd, /* command to send */
void * arg /* optional argument */ void * arg /* optional argument */
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
@@ -357,7 +357,7 @@ rtems_status_code mbx8xx_pcmciaide_config_io_speed
| Input Parameters: | | Input Parameters: |
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
int minor, /* controller minor number */ int minor, /* controller minor number */
unsigned8 modes_avail /* optional argument */ uint8_t modes_avail /* optional argument */
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
| Return Value: | | Return Value: |

View File

@@ -606,7 +606,7 @@ m860_fec_initialize_hardware (struct m860_enet_struct *sc)
static void static void
m8xx_Enet_retire_tx_bd (struct m8xx_enet_struct *sc) m8xx_Enet_retire_tx_bd (struct m8xx_enet_struct *sc)
{ {
rtems_unsigned16 status; uint16_t status;
int i; int i;
int nRetired; int nRetired;
struct mbuf *m, *n; struct mbuf *m, *n;
@@ -679,7 +679,7 @@ scc_rxDaemon (void *arg)
struct m8xx_enet_struct *sc = (struct m8xx_enet_struct *)arg; struct m8xx_enet_struct *sc = (struct m8xx_enet_struct *)arg;
struct ifnet *ifp = &sc->arpcom.ac_if; struct ifnet *ifp = &sc->arpcom.ac_if;
struct mbuf *m; struct mbuf *m;
rtems_unsigned16 status; uint16_t status;
m8xxBufferDescriptor_t *rxBd; m8xxBufferDescriptor_t *rxBd;
int rxBdIndex; int rxBdIndex;
@@ -764,7 +764,7 @@ scc_rxDaemon (void *arg)
m = sc->rxMbuf[rxBdIndex]; m = sc->rxMbuf[rxBdIndex];
m->m_len = m->m_pkthdr.len = rxBd->length - m->m_len = m->m_pkthdr.len = rxBd->length -
sizeof(rtems_unsigned32) - sizeof(uint32_t) -
sizeof(struct ether_header); sizeof(struct ether_header);
eh = mtod (m, struct ether_header *); eh = mtod (m, struct ether_header *);
m->m_data += sizeof(struct ether_header); m->m_data += sizeof(struct ether_header);
@@ -823,7 +823,7 @@ fec_rxDaemon (void *arg)
struct m8xx_enet_struct *sc = (struct m8xx_enet_struct *)arg; struct m8xx_enet_struct *sc = (struct m8xx_enet_struct *)arg;
struct ifnet *ifp = &sc->arpcom.ac_if; struct ifnet *ifp = &sc->arpcom.ac_if;
struct mbuf *m; struct mbuf *m;
rtems_unsigned16 status; uint16_t status;
m8xxBufferDescriptor_t *rxBd; m8xxBufferDescriptor_t *rxBd;
int rxBdIndex; int rxBdIndex;
@@ -900,7 +900,7 @@ fec_rxDaemon (void *arg)
m = sc->rxMbuf[rxBdIndex]; m = sc->rxMbuf[rxBdIndex];
m->m_len = m->m_pkthdr.len = rxBd->length - m->m_len = m->m_pkthdr.len = rxBd->length -
sizeof(rtems_unsigned32) - sizeof(uint32_t) -
sizeof(struct ether_header); sizeof(struct ether_header);
eh = mtod (m, struct ether_header *); eh = mtod (m, struct ether_header *);
m->m_data += sizeof(struct ether_header); m->m_data += sizeof(struct ether_header);
@@ -956,7 +956,7 @@ scc_sendpacket (struct ifnet *ifp, struct mbuf *m)
struct m8xx_enet_struct *sc = ifp->if_softc; struct m8xx_enet_struct *sc = ifp->if_softc;
volatile m8xxBufferDescriptor_t *firstTxBd, *txBd; volatile m8xxBufferDescriptor_t *firstTxBd, *txBd;
struct mbuf *l = NULL; struct mbuf *l = NULL;
rtems_unsigned16 status; uint16_t status;
int nAdded; int nAdded;
/* /*
@@ -1084,7 +1084,7 @@ fec_sendpacket (struct ifnet *ifp, struct mbuf *m)
struct m8xx_enet_struct *sc = ifp->if_softc; struct m8xx_enet_struct *sc = ifp->if_softc;
volatile m8xxBufferDescriptor_t *firstTxBd, *txBd; volatile m8xxBufferDescriptor_t *firstTxBd, *txBd;
/* struct mbuf *l = NULL; */ /* struct mbuf *l = NULL; */
rtems_unsigned16 status; uint16_t status;
int nAdded; int nAdded;
/* /*

View File

@@ -52,7 +52,7 @@ char *rtems_progname;
* rtems/c/src/lib/libbsp/shared/bsplibc.c. * rtems/c/src/lib/libbsp/shared/bsplibc.c.
*/ */
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_panic(char *s) void BSP_panic(char *s)
{ {

View File

@@ -43,7 +43,7 @@ char *rtems_progname;
* rtems/c/src/lib/libbsp/shared/bsplibc.c. * rtems/c/src/lib/libbsp/shared/bsplibc.c.
*/ */
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 );
/* /*
* bsp_pretasking_hook * bsp_pretasking_hook
@@ -114,7 +114,7 @@ void bsp_pretasking_hook(void)
void bsp_start(void) void bsp_start(void)
{ {
extern void *_WorkspaceBase; extern void *_WorkspaceBase;
unsigned32 r1; uint32_t r1;
mmu_init(); mmu_init();

View File

@@ -25,7 +25,7 @@
* course, the code will not be safely restartable, but then again, * course, the code will not be safely restartable, but then again,
* a lot of the library code isn't either, so there! * a lot of the library code isn't either, so there!
*/ */
unsigned32 simask_copy = 0; uint32_t simask_copy = 0;
/* /*
* The memory controller's UPMA Ram array values. * The memory controller's UPMA Ram array values.
@@ -44,7 +44,7 @@ unsigned32 simask_copy = 0;
* as being 50 MHz, while the MBXA/IH2.1 manual lists it as 40 MHz. * as being 50 MHz, while the MBXA/IH2.1 manual lists it as 40 MHz.
* We think the MBX821_001B is an entry level board and thus is 50 MHz, * We think the MBX821_001B is an entry level board and thus is 50 MHz,
*/ */
static unsigned32 upmaTable[64] = { static uint32_t upmaTable[64] = {
#if ( defined(mbx860_001b) || \ #if ( defined(mbx860_001b) || \
defined(mbx821_001b) || \ defined(mbx821_001b) || \
@@ -154,8 +154,8 @@ static unsigned32 upmaTable[64] = {
*/ */
void _InitMBX8xx (void) void _InitMBX8xx (void)
{ {
register unsigned32 r1, i; register uint32_t r1, i;
extern unsigned32 simask_copy; extern uint32_t simask_copy;
/* /*
* Initialize the Debug Enable Register (DER) to an appropriate * Initialize the Debug Enable Register (DER) to an appropriate