forked from Imagelibrary/rtems
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:
@@ -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>
|
||||
|
||||
* Makefile.am: Reflect changes to bsp.am.
|
||||
|
||||
@@ -368,7 +368,7 @@ static rtems_status_code do_poll_read(
|
||||
pollRead = m8xx_uart_pollRead;
|
||||
|
||||
while( (c = (*pollRead)(minor)) == -1 );
|
||||
rw_args->buffer[0] = (unsigned8)c;
|
||||
rw_args->buffer[0] = (uint8_t)c;
|
||||
if( rw_args->buffer[0] == '\r' )
|
||||
rw_args->buffer[0] = '\n';
|
||||
rw_args->bytes_moved = 1;
|
||||
@@ -383,7 +383,7 @@ static rtems_status_code do_poll_read(
|
||||
#endif
|
||||
|
||||
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' )
|
||||
rw_args->buffer[0] = '\n';
|
||||
rw_args->bytes_moved = 1;
|
||||
@@ -421,7 +421,7 @@ static rtems_status_code do_poll_write(
|
||||
)
|
||||
{
|
||||
rtems_libio_rw_args_t *rw_args = arg;
|
||||
unsigned32 i;
|
||||
uint32_t i;
|
||||
char cr ='\r';
|
||||
|
||||
#if NVRAM_CONFIGURE == 1
|
||||
|
||||
@@ -68,14 +68,14 @@ boolean mbx8xx_pcmciaide_probe
|
||||
* FIXME: this should be depending on state of VS1/2 pins
|
||||
* 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
|
||||
* -> scan for tuple of type 0x21 with content 0x04 0xXX (fixed disk)
|
||||
* -> scan for tuple of type 0x22 with content 0x01 0x01
|
||||
*/
|
||||
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;
|
||||
boolean fixed_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 reg, /* register index to access */
|
||||
unsigned16 *value /* ptr to return value location */
|
||||
uint16_t *value /* ptr to return value location */
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| <none> |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
unsigned32 port = IDE_Controller_Table[minor].port1;
|
||||
uint32_t port = IDE_Controller_Table[minor].port1;
|
||||
|
||||
if (reg == IDE_REGISTER_DATA_WORD) {
|
||||
#ifdef DATAREG_16BIT
|
||||
*value = *(volatile unsigned16 *)(port+reg);
|
||||
*value = *(volatile uint16_t*)(port+reg);
|
||||
#else
|
||||
*value = ((*(volatile unsigned8 *)(port+reg) << 8) +
|
||||
(*(volatile unsigned8 *)(port+reg+1) ));
|
||||
*value = ((*(volatile uint8_t*)(port+reg) << 8) +
|
||||
(*(volatile uint8_t*)(port+reg+1) ));
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
*value = *(volatile unsigned8 *)(port+reg);
|
||||
*value = *(volatile uint8_t*)(port+reg);
|
||||
}
|
||||
#ifdef DEBUG_OUT
|
||||
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 reg, /* register index to access */
|
||||
unsigned16 value /* value to write */
|
||||
uint16_t value /* value to write */
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| <none> |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
unsigned32 port = IDE_Controller_Table[minor].port1;
|
||||
uint32_t port = IDE_Controller_Table[minor].port1;
|
||||
|
||||
#ifdef DEBUG_OUT
|
||||
printk("mbx8xx_pcmciaide_write_reg(0x%x,0x%x)\r\n",reg,value & 0xff);
|
||||
#endif
|
||||
if (reg == IDE_REGISTER_DATA_WORD) {
|
||||
#ifdef DATAREG_16BIT
|
||||
*(volatile unsigned16 *)(port+reg) = value;
|
||||
*(volatile uint16_t*)(port+reg) = value;
|
||||
#else
|
||||
*(volatile unsigned8 *)(port+reg) = value >> 8;
|
||||
*(volatile unsigned8 *)(port+reg+1) = value;
|
||||
*(volatile uint8_t*)(port+reg) = value >> 8;
|
||||
*(volatile uint8_t*)(port+reg+1) = value;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
*(volatile unsigned8 *)(port+reg)= value;
|
||||
*(volatile uint8_t*)(port+reg)= value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,39 +219,39 @@ void mbx8xx_pcmciaide_read_block
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int minor,
|
||||
unsigned16 block_size,
|
||||
uint16_t block_size,
|
||||
blkdev_sg_buffer *bufs,
|
||||
rtems_unsigned32 *cbuf,
|
||||
rtems_unsigned32 *pos
|
||||
uint32_t *cbuf,
|
||||
uint32_t *pos
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| <none> |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
unsigned32 port = IDE_Controller_Table[minor].port1;
|
||||
unsigned16 cnt = 0;
|
||||
uint32_t port = IDE_Controller_Table[minor].port1;
|
||||
uint16_t cnt = 0;
|
||||
#ifdef DEBUG_OUT
|
||||
printk("mbx8xx_pcmciaide_read_block()\r\n");
|
||||
#endif
|
||||
#ifdef DATAREG_16BIT
|
||||
unsigned16 *lbuf = (unsigned16 *)
|
||||
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
uint16_t *lbuf = (uint16_t*)
|
||||
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
#else
|
||||
unsigned8 *lbuf = (unsigned8 *)
|
||||
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
uint8_t *lbuf = (uint8_t*)
|
||||
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
#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) &&
|
||||
(cnt < block_size)) {
|
||||
#ifdef DATAREG_16BIT
|
||||
*lbuf++ = *(volatile unsigned16 *)(port+8); /* 16 bit data port */
|
||||
*lbuf++ = *(volatile uint16_t*)(port+8); /* 16 bit data port */
|
||||
cnt += 2;
|
||||
(*pos) += 2;
|
||||
#else
|
||||
*lbuf++ = *(volatile unsigned8 *)(port+IDE_REGISTER_DATA);
|
||||
*lbuf++ = *(volatile uint8_t*)(port+IDE_REGISTER_DATA);
|
||||
cnt += 1;
|
||||
(*pos) += 1;
|
||||
#endif
|
||||
@@ -276,40 +276,40 @@ void mbx8xx_pcmciaide_write_block
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int minor,
|
||||
unsigned16 block_size,
|
||||
uint16_t block_size,
|
||||
blkdev_sg_buffer *bufs,
|
||||
rtems_unsigned32 *cbuf,
|
||||
rtems_unsigned32 *pos
|
||||
uint32_t *cbuf,
|
||||
uint32_t *pos
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
| <none> |
|
||||
\*=========================================================================*/
|
||||
{
|
||||
unsigned32 port = IDE_Controller_Table[minor].port1;
|
||||
unsigned16 cnt = 0;
|
||||
uint32_t port = IDE_Controller_Table[minor].port1;
|
||||
uint16_t cnt = 0;
|
||||
|
||||
#ifdef DEBUG_OUT
|
||||
printk("mbx8xx_pcmciaide_write_block()\r\n");
|
||||
#endif
|
||||
#ifdef DATA_REG_16BIT
|
||||
unsigned16 *lbuf = (unsigned16 *)
|
||||
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
uint16_t *lbuf = (uint16_t*)
|
||||
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
#else
|
||||
unsigned8 *lbuf = (unsigned8 *)
|
||||
((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
uint8_t *lbuf = (uint8_t*)
|
||||
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
#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) &&
|
||||
(cnt < block_size)) {
|
||||
#ifdef DATAREG_16BIT
|
||||
*(volatile unsigned16 *)(port+8) = *lbuf++; /* 16 bit data port */
|
||||
*(volatile uint16_t*)(port+8) = *lbuf++; /* 16 bit data port */
|
||||
cnt += 2;
|
||||
(*pos) += 2;
|
||||
#else
|
||||
*(volatile unsigned8 *)(port+IDE_REGISTER_DATA) = *lbuf++;
|
||||
*(volatile uint8_t*)(port+IDE_REGISTER_DATA) = *lbuf++;
|
||||
cnt += 1;
|
||||
(*pos) += 1;
|
||||
#endif
|
||||
@@ -334,7 +334,7 @@ int mbx8xx_pcmciaide_control
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int minor, /* controller minor number */
|
||||
unsigned32 cmd, /* command to send */
|
||||
uint32_t cmd, /* command to send */
|
||||
void * arg /* optional argument */
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
@@ -357,7 +357,7 @@ rtems_status_code mbx8xx_pcmciaide_config_io_speed
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int minor, /* controller minor number */
|
||||
unsigned8 modes_avail /* optional argument */
|
||||
uint8_t modes_avail /* optional argument */
|
||||
)
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| Return Value: |
|
||||
|
||||
@@ -606,7 +606,7 @@ m860_fec_initialize_hardware (struct m860_enet_struct *sc)
|
||||
static void
|
||||
m8xx_Enet_retire_tx_bd (struct m8xx_enet_struct *sc)
|
||||
{
|
||||
rtems_unsigned16 status;
|
||||
uint16_t status;
|
||||
int i;
|
||||
int nRetired;
|
||||
struct mbuf *m, *n;
|
||||
@@ -679,7 +679,7 @@ scc_rxDaemon (void *arg)
|
||||
struct m8xx_enet_struct *sc = (struct m8xx_enet_struct *)arg;
|
||||
struct ifnet *ifp = &sc->arpcom.ac_if;
|
||||
struct mbuf *m;
|
||||
rtems_unsigned16 status;
|
||||
uint16_t status;
|
||||
m8xxBufferDescriptor_t *rxBd;
|
||||
int rxBdIndex;
|
||||
|
||||
@@ -764,7 +764,7 @@ scc_rxDaemon (void *arg)
|
||||
|
||||
m = sc->rxMbuf[rxBdIndex];
|
||||
m->m_len = m->m_pkthdr.len = rxBd->length -
|
||||
sizeof(rtems_unsigned32) -
|
||||
sizeof(uint32_t) -
|
||||
sizeof(struct ether_header);
|
||||
eh = mtod (m, 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 ifnet *ifp = &sc->arpcom.ac_if;
|
||||
struct mbuf *m;
|
||||
rtems_unsigned16 status;
|
||||
uint16_t status;
|
||||
m8xxBufferDescriptor_t *rxBd;
|
||||
int rxBdIndex;
|
||||
|
||||
@@ -900,7 +900,7 @@ fec_rxDaemon (void *arg)
|
||||
|
||||
m = sc->rxMbuf[rxBdIndex];
|
||||
m->m_len = m->m_pkthdr.len = rxBd->length -
|
||||
sizeof(rtems_unsigned32) -
|
||||
sizeof(uint32_t) -
|
||||
sizeof(struct ether_header);
|
||||
eh = mtod (m, 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;
|
||||
volatile m8xxBufferDescriptor_t *firstTxBd, *txBd;
|
||||
struct mbuf *l = NULL;
|
||||
rtems_unsigned16 status;
|
||||
uint16_t status;
|
||||
int nAdded;
|
||||
|
||||
/*
|
||||
@@ -1084,7 +1084,7 @@ fec_sendpacket (struct ifnet *ifp, struct mbuf *m)
|
||||
struct m8xx_enet_struct *sc = ifp->if_softc;
|
||||
volatile m8xxBufferDescriptor_t *firstTxBd, *txBd;
|
||||
/* struct mbuf *l = NULL; */
|
||||
rtems_unsigned16 status;
|
||||
uint16_t status;
|
||||
int nAdded;
|
||||
|
||||
/*
|
||||
|
||||
@@ -52,7 +52,7 @@ char *rtems_progname;
|
||||
* rtems/c/src/lib/libbsp/shared/bsplibc.c.
|
||||
*/
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ char *rtems_progname;
|
||||
* rtems/c/src/lib/libbsp/shared/bsplibc.c.
|
||||
*/
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
void bsp_libc_init( void *, uint32_t, int );
|
||||
|
||||
/*
|
||||
* bsp_pretasking_hook
|
||||
@@ -114,7 +114,7 @@ void bsp_pretasking_hook(void)
|
||||
void bsp_start(void)
|
||||
{
|
||||
extern void *_WorkspaceBase;
|
||||
unsigned32 r1;
|
||||
uint32_t r1;
|
||||
|
||||
mmu_init();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* course, the code will not be safely restartable, but then again,
|
||||
* 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.
|
||||
@@ -44,7 +44,7 @@ unsigned32 simask_copy = 0;
|
||||
* 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,
|
||||
*/
|
||||
static unsigned32 upmaTable[64] = {
|
||||
static uint32_t upmaTable[64] = {
|
||||
|
||||
#if ( defined(mbx860_001b) || \
|
||||
defined(mbx821_001b) || \
|
||||
@@ -154,8 +154,8 @@ static unsigned32 upmaTable[64] = {
|
||||
*/
|
||||
void _InitMBX8xx (void)
|
||||
{
|
||||
register unsigned32 r1, i;
|
||||
extern unsigned32 simask_copy;
|
||||
register uint32_t r1, i;
|
||||
extern uint32_t simask_copy;
|
||||
|
||||
/*
|
||||
* Initialize the Debug Enable Register (DER) to an appropriate
|
||||
|
||||
Reference in New Issue
Block a user