From bad8092cbf5305cd339b16fdcced0597e4f5b115 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Wed, 31 Mar 2004 03:49:17 +0000 Subject: 2004-03-31 Ralf Corsepius * clock/clock.c, console/config.c, console/console.c, console/debugio.c, console/i8042.c, console/ns16550cfg.c, console/ns16550cfg.h, console/vga.c, console/vga_p.h, console/z85c30cfg.c, console/z85c30cfg.h, include/bsp.h, include/nvram.h, include/pci.h, network/amd79c970.c, network/amd79c970.h, nvram/mk48t18.h, nvram/nvram.c, nvram/stk11c68.h, pci/pci.c, startup/bspstart.c, startup/genpvec.c, startup/spurious.c, startup/swap.c, timer/timer.c, tod/cmos.h, tod/tod.c, universe/universe.c: Convert to using c99 fixed size types. --- .../libbsp/powerpc/ppcn_60x/network/amd79c970.c | 46 ++++----- .../libbsp/powerpc/ppcn_60x/network/amd79c970.h | 108 ++++++++++----------- 2 files changed, 77 insertions(+), 77 deletions(-) (limited to 'c/src/lib/libbsp/powerpc/ppcn_60x/network') diff --git a/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.c b/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.c index ba3849df9a..2ad0b8e02a 100644 --- a/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.c +++ b/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.c @@ -100,7 +100,7 @@ typedef struct amd79c970Context { tmde_t txBdBase[TX_RING_SIZE]; initblk_t initBlk; pc_net_t *pPCNet; - unsigned32 ulIntVector; + uint32_t ulIntVector; struct mbuf **rxMbuf; struct mbuf **txMbuf; int rxBdCount; @@ -142,7 +142,7 @@ static amd79c970Context_t *pAmd79c970Context[NPCNETDRIVER]; static rtems_isr amd79c970_isr (rtems_vector_number v) { - unsigned32 ulCSR0, ulCSR4, ulCSR5; + uint32_t ulCSR0, ulCSR4, ulCSR5; amd79c970Context_t *dp; int i; @@ -220,15 +220,15 @@ amd79c970_initialize_hardware (int instance, int broadcastFlag) amd79c970Context_t *dp; struct mbuf *bp; int i; - unsigned8 ucPCIBusCount; - unsigned8 ucBusNumber; - unsigned8 ucSlotNumber; - unsigned32 ulDeviceID; - unsigned32 ulBAR0; - unsigned8 ucIntVector; - unsigned32 ulInitClkPCIAddr; - unsigned32 ulAPROM; - unsigned32 ulCSR0; + uint8_t ucPCIBusCount; + uint8_t ucBusNumber; + uint8_t ucSlotNumber; + uint32_t ulDeviceID; + uint32_t ulBAR0; + uint8_t ucIntVector; + uint32_t ulInitClkPCIAddr; + uint32_t ulAPROM; + uint32_t ulCSR0; ucPCIBusCount=BusCountPCI(); @@ -334,7 +334,7 @@ amd79c970_initialize_hardware (int instance, int broadcastFlag) dp->rxMbuf[i]=bp=ambufw (RBUF_SIZE); bp->data += sizeof (struct iface *); dp->rxBdBase[i].rmde_addr= - Swap32((unsigned32)bp->data+PCI_SYS_MEM_BASE); + Swap32((uint32_t)bp->data+PCI_SYS_MEM_BASE); dp->rxBdBase[i].rmde_bcnt= Swap16(-(bp->size-sizeof (struct iface *))); dp->rxBdBase[i].rmde_flags=Swap16(RFLG_OWN); @@ -369,7 +369,7 @@ amd79c970_initialize_hardware (int instance, int broadcastFlag) /* * Set the receive descriptor ring address */ - dp->initBlk.ib_rdra=Swap32((unsigned32)&dp->rxBdBase[0]+ + dp->initBlk.ib_rdra=Swap32((uint32_t)&dp->rxBdBase[0]+ PCI_SYS_MEM_BASE); /* @@ -379,7 +379,7 @@ amd79c970_initialize_hardware (int instance, int broadcastFlag) /* * Set the tranmit descriptor ring address */ - dp->initBlk.ib_tdra=Swap32((unsigned32)&dp->txBdBase[0]+ + dp->initBlk.ib_tdra=Swap32((uint32_t)&dp->txBdBase[0]+ PCI_SYS_MEM_BASE); for(i=0;i<6;i++) @@ -403,7 +403,7 @@ amd79c970_initialize_hardware (int instance, int broadcastFlag) WR_CSR32(dp, CSR5, 0); - ulInitClkPCIAddr=(unsigned32)&dp->initBlk+PCI_SYS_MEM_BASE; + ulInitClkPCIAddr=(uint32_t)&dp->initBlk+PCI_SYS_MEM_BASE; /* * CSR2 must contain the high order 16 bits of the first word in * the initialization block @@ -461,8 +461,8 @@ amd79c970_initialize_hardware (int instance, int broadcastFlag) static void amd79c970_retire_tx_bd (amd79c970Context_t *dp) { - unsigned16 status; - unsigned32 error; + uint16_t status; + uint32_t error; int i; int nRetired; @@ -525,7 +525,7 @@ amd79c970_raw (struct iface *iface, struct mbuf **bpp) amd79c970Context_t *dp; struct mbuf *bp; tmde_t *firstTxBd, *txBd; - unsigned16 status; + uint16_t status; int nAdded; dp = pAmd79c970Context[iface->dev]; @@ -607,7 +607,7 @@ amd79c970_raw (struct iface *iface, struct mbuf **bpp) /* * Fill in the buffer descriptor */ - txBd->tmde_addr=Swap32((unsigned32)bp->data+PCI_SYS_MEM_BASE); + txBd->tmde_addr=Swap32((uint32_t)bp->data+PCI_SYS_MEM_BASE); txBd->tmde_bcnt=Swap16(-bp->cnt); dp->txMbuf[dp->txBdHead] = bp; @@ -676,7 +676,7 @@ amd79c970_rx (int dev, void *p1, void *p2) struct iface *iface=(struct iface *)p1; amd79c970Context_t *dp=(amd79c970Context_t *)p2; struct mbuf *bp; - rtems_unsigned16 status; + uint16_t status; rmde_t *rxBd; int rxBdIndex; int continuousCount; @@ -770,7 +770,7 @@ amd79c970_rx (int dev, void *p1, void *p2) dp->rxMbuf[rxBdIndex]=bp=ambufw (RBUF_SIZE); bp->data += sizeof (struct iface *); rxBd->rmde_addr=Swap32( - (unsigned32)bp->data+PCI_SYS_MEM_BASE); + (uint32_t)bp->data+PCI_SYS_MEM_BASE); rxBd->rmde_bcnt=Swap16( -(bp->size-sizeof (struct iface *))); } @@ -797,7 +797,7 @@ static int amd79c970_stop (struct iface *iface) { amd79c970Context_t *dp; - unsigned32 ulCSR0; + uint32_t ulCSR0; int i; dp=pAmd79c970Context[iface->dev]; @@ -913,7 +913,7 @@ rtems_ka9q_driver_attach (int argc, char *argv[], void *p) * Note that this structure must be aligned to a 16 byte boundary */ pAmd79c970Context[i]=(amd79c970Context_t *) - (((unsigned32)callocw(1, + (((uint32_t)callocw(1, sizeof(amd79c970Context_t)+16)+16) & ~15); dp=pAmd79c970Context[i]; diff --git a/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.h b/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.h index dd30d90b0d..f600611418 100644 --- a/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.h +++ b/c/src/lib/libbsp/powerpc/ppcn_60x/network/amd79c970.h @@ -25,18 +25,18 @@ typedef volatile struct pc_net union { struct { - unsigned16 aprom[8]; /* 0x00 */ - unsigned16 rdp; /* 0x10 */ - unsigned16 rap; /* 0x14 */ - unsigned16 reset; /* 0x18 */ - unsigned16 bdp; /* 0x1C */ + uint16_t aprom[8]; /* 0x00 */ + uint16_t rdp; /* 0x10 */ + uint16_t rap; /* 0x14 */ + uint16_t reset; /* 0x18 */ + uint16_t bdp; /* 0x1C */ } wio; struct { - unsigned32 aprom[4]; /* 0x00 */ - unsigned32 rdp; /* 0x10 */ - unsigned32 rap; /* 0x12 */ - unsigned32 reset; /* 0x14 */ - unsigned32 bdp; /* 0x16 */ + uint32_t aprom[4]; /* 0x00 */ + uint32_t rdp; /* 0x10 */ + uint32_t rap; /* 0x12 */ + uint32_t reset; /* 0x14 */ + uint32_t bdp; /* 0x16 */ } dwio; } u; } pc_net_t; @@ -48,24 +48,24 @@ typedef volatile struct pc_net #define EEPROM_HEAD_SIZE 36 typedef struct pc_net_eeprom { - unsigned8 EthNumber[6]; - unsigned16 Reserved1; /* Must be 0x0000 */ - unsigned16 Reserved2; /* Must be 0x1000 */ - unsigned16 User1; - unsigned16 checksum; - unsigned16 Reserved3; /* Must be 0x5757 */ - unsigned16 bcr16; - unsigned16 bcr17; - unsigned16 bcr18; - unsigned16 bcr2; - unsigned16 bcr21; - unsigned16 Reserved4; /* Must be 0x0000 */ - unsigned16 Reserved5; /* Must be 0x0000 */ - unsigned8 Reserved6; /* Must be 0x00 */ - unsigned8 checksumAdjust; - unsigned16 Reserved7; /* Must be 0x0000 */ - unsigned16 crc; /* CCITT checksum from Serial[] onwards */ - unsigned8 Serial[16]; /* Radstone Serial Number */ + uint8_t EthNumber[6]; + uint16_t Reserved1; /* Must be 0x0000 */ + uint16_t Reserved2; /* Must be 0x1000 */ + uint16_t User1; + uint16_t checksum; + uint16_t Reserved3; /* Must be 0x5757 */ + uint16_t bcr16; + uint16_t bcr17; + uint16_t bcr18; + uint16_t bcr2; + uint16_t bcr21; + uint16_t Reserved4; /* Must be 0x0000 */ + uint16_t Reserved5; /* Must be 0x0000 */ + uint8_t Reserved6; /* Must be 0x00 */ + uint8_t checksumAdjust; + uint16_t Reserved7; /* Must be 0x0000 */ + uint16_t crc; /* CCITT checksum from Serial[] onwards */ + uint8_t Serial[16]; /* Radstone Serial Number */ } pc_net_eeprom_t; /* @@ -219,9 +219,9 @@ typedef struct pc_net_eeprom { typedef volatile struct initblk { /* mode can be set in csr15 */ - unsigned16 ib_mode; /* Chip's operating parameters */ - unsigned8 ib_rlen; /* rx ring length (power of 2) */ - unsigned8 ib_tlen; /* tx ring length (power of 2) */ + uint16_t ib_mode; /* Chip's operating parameters */ + uint8_t ib_rlen; /* rx ring length (power of 2) */ + uint8_t ib_tlen; /* tx ring length (power of 2) */ /* * The bytes must be swapped within the word, so that, for example, * the address 8:0:20:1:25:5a is written in the order @@ -229,10 +229,10 @@ typedef volatile struct initblk { * For PCI970 that is long word swapped: so no swapping needed, since * the bus will swap. */ - unsigned8 ib_padr[8]; /* physical address */ - unsigned16 ib_ladrf[4]; /* logical address filter */ - unsigned32 ib_rdra; /* rcv ring desc addr */ - unsigned32 ib_tdra; /* xmit ring desc addr */ + uint8_t ib_padr[8]; /* physical address */ + uint16_t ib_ladrf[4]; /* logical address filter */ + uint32_t ib_rdra; /* rcv ring desc addr */ + uint32_t ib_tdra; /* xmit ring desc addr */ } initblk_t; @@ -275,15 +275,15 @@ typedef volatile struct initblk { */ typedef volatile struct rmde { - unsigned32 rmde_addr; /* buf addr */ + uint32_t rmde_addr; /* buf addr */ - unsigned16 rmde_bcnt; - unsigned16 rmde_flags; + uint16_t rmde_bcnt; + uint16_t rmde_flags; - unsigned16 rmde_mcnt; - unsigned16 rmde_misc; + uint16_t rmde_mcnt; + uint16_t rmde_misc; - unsigned32 align; + uint32_t align; } rmde_t; @@ -319,14 +319,14 @@ typedef volatile struct rmde { * 16 and 32 byte field will require swapping. */ typedef volatile struct tmde { - unsigned32 tmde_addr; /* buf addr */ + uint32_t tmde_addr; /* buf addr */ - unsigned16 tmde_bcnt; - unsigned16 tmde_status; /* misc error and status bits */ + uint16_t tmde_bcnt; + uint16_t tmde_status; /* misc error and status bits */ - unsigned32 tmde_error; + uint32_t tmde_error; - unsigned32 align; + uint32_t align; } tmde_t; /* @@ -414,13 +414,13 @@ typedef volatile struct tmde { /* * Bit definitions for BCR19 */ -#define prom_EDI (unsigned16)0x0001 -#define prom_EDO (unsigned16)0x0001 -#define prom_ESK (unsigned16)0x0002 -#define prom_ECS (unsigned16)0x0004 -#define prom_EEN (unsigned16)0x0010 -#define prom_EEDET (unsigned16)0x2000 -#define prom_PVALID (unsigned16)0x8000 -#define prom_PREAD (unsigned16)0x4000 +#define prom_EDI (uint16_t)0x0001 +#define prom_EDO (uint16_t)0x0001 +#define prom_ESK (uint16_t)0x0002 +#define prom_ECS (uint16_t)0x0004 +#define prom_EEN (uint16_t)0x0010 +#define prom_EEDET (uint16_t)0x2000 +#define prom_PVALID (uint16_t)0x8000 +#define prom_PREAD (uint16_t)0x4000 #endif -- cgit v1.2.3