[x86_64] Fix assorted 64-bit compilation errors and warnings

Remove various 32-bit assumptions scattered throughout the codebase.
The code is still not necessarily 64-bit clean, but will at least
compile.
pull/1/head
Michael Brown 2008-11-19 19:33:05 +00:00
parent 7d36a1b7b0
commit 0ebbbb95fa
16 changed files with 88 additions and 70 deletions

View File

@ -27,6 +27,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <byteswap.h> #include <byteswap.h>
#include <gpxe/io.h>
#include <gpxe/pci.h> #include <gpxe/pci.h>
#include <gpxe/malloc.h> #include <gpxe/malloc.h>
#include <gpxe/umalloc.h> #include <gpxe/umalloc.h>

View File

@ -25,6 +25,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <byteswap.h> #include <byteswap.h>
#include <gpxe/io.h>
#include <gpxe/pci.h> #include <gpxe/pci.h>
#include <gpxe/malloc.h> #include <gpxe/malloc.h>
#include <gpxe/umalloc.h> #include <gpxe/umalloc.h>

View File

@ -21,6 +21,7 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <assert.h> #include <assert.h>
#include <gpxe/io.h>
#include <gpxe/pci.h> #include <gpxe/pci.h>
#include <gpxe/infiniband.h> #include <gpxe/infiniband.h>
#include <gpxe/i2c.h> #include <gpxe/i2c.h>
@ -1065,7 +1066,7 @@ static int linda_post_recv ( struct ib_device *ibdev,
return -EINVAL; return -EINVAL;
} }
if ( len != LINDA_RECV_PAYLOAD_SIZE ) { if ( len != LINDA_RECV_PAYLOAD_SIZE ) {
DBGC ( linda, "Linda %p QPN %ld wrong RX buffer size (%d)\n", DBGC ( linda, "Linda %p QPN %ld wrong RX buffer size (%zd)\n",
linda, qp->qpn, len ); linda, qp->qpn, len );
return -EINVAL; return -EINVAL;
} }

View File

@ -133,14 +133,14 @@
/* Structure/enum declaration ------------------------------- */ /* Structure/enum declaration ------------------------------- */
struct tx_desc { struct tx_desc {
u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
u32 tx_buf_ptr; /* Data for us */ void * tx_buf_ptr; /* Data for us */
u32 /* struct tx_desc * */ next_tx_desc; struct tx_desc * next_tx_desc;
} __attribute__ ((aligned(32))); } __attribute__ ((aligned(32)));
struct rx_desc { struct rx_desc {
u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */
u32 rx_skb_ptr; /* Data for us */ void * rx_skb_ptr; /* Data for us */
u32 /* struct rx_desc * */ next_rx_desc; struct rx_desc * next_rx_desc;
} __attribute__ ((aligned(32))); } __attribute__ ((aligned(32)));
static struct dmfe_private { static struct dmfe_private {
@ -522,30 +522,30 @@ static void dmfe_descriptor_init(struct nic *nic __unused, unsigned long ioaddr)
/* Init Transmit chain */ /* Init Transmit chain */
for (i = 0; i < TX_DESC_CNT; i++) { for (i = 0; i < TX_DESC_CNT; i++) {
txd[i].tx_buf_ptr = (u32) & txb[i]; txd[i].tx_buf_ptr = &txb[i];
txd[i].tdes0 = cpu_to_le32(0); txd[i].tdes0 = cpu_to_le32(0);
txd[i].tdes1 = cpu_to_le32(0x81000000); /* IC, chain */ txd[i].tdes1 = cpu_to_le32(0x81000000); /* IC, chain */
txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i])); txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i]));
txd[i].tdes3 = cpu_to_le32(virt_to_bus(&txd[i + 1])); txd[i].tdes3 = cpu_to_le32(virt_to_bus(&txd[i + 1]));
txd[i].next_tx_desc = virt_to_le32desc(&txd[i + 1]); txd[i].next_tx_desc = &txd[i + 1];
} }
/* Mark the last entry as wrapping the ring */ /* Mark the last entry as wrapping the ring */
txd[i - 1].tdes3 = virt_to_le32desc(&txd[0]); txd[i - 1].tdes3 = virt_to_le32desc(&txd[0]);
txd[i - 1].next_tx_desc = (u32) & txd[0]; txd[i - 1].next_tx_desc = &txd[0];
/* receive descriptor chain */ /* receive descriptor chain */
for (i = 0; i < RX_DESC_CNT; i++) { for (i = 0; i < RX_DESC_CNT; i++) {
rxd[i].rx_skb_ptr = (u32) & rxb[i * RX_ALLOC_SIZE]; rxd[i].rx_skb_ptr = &rxb[i * RX_ALLOC_SIZE];
rxd[i].rdes0 = cpu_to_le32(0x80000000); rxd[i].rdes0 = cpu_to_le32(0x80000000);
rxd[i].rdes1 = cpu_to_le32(0x01000600); rxd[i].rdes1 = cpu_to_le32(0x01000600);
rxd[i].rdes2 = rxd[i].rdes2 =
cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE])); cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE]));
rxd[i].rdes3 = cpu_to_le32(virt_to_bus(&rxd[i + 1])); rxd[i].rdes3 = cpu_to_le32(virt_to_bus(&rxd[i + 1]));
rxd[i].next_rx_desc = virt_to_le32desc(&rxd[i + 1]); rxd[i].next_rx_desc = &rxd[i + 1];
} }
/* Mark the last entry as wrapping the ring */ /* Mark the last entry as wrapping the ring */
rxd[i - 1].rdes3 = cpu_to_le32(virt_to_bus(&rxd[0])); rxd[i - 1].rdes3 = cpu_to_le32(virt_to_bus(&rxd[0]));
rxd[i - 1].next_rx_desc = virt_to_le32desc(&rxd[0]); rxd[i - 1].next_rx_desc = &rxd[0];
} }

View File

@ -22,6 +22,7 @@
#include <assert.h> #include <assert.h>
#include <byteswap.h> #include <byteswap.h>
#include <console.h> #include <console.h>
#include <gpxe/io.h>
#include <gpxe/pci.h> #include <gpxe/pci.h>
#include <gpxe/malloc.h> #include <gpxe/malloc.h>
#include <gpxe/ethernet.h> #include <gpxe/ethernet.h>
@ -1449,7 +1450,7 @@ falcon_spi_rw ( struct spi_bus* bus, struct spi_device *device,
return -EINVAL; return -EINVAL;
} }
EFAB_TRACE ( "Executing spi command %d on device %d at %d for %d bytes\n", EFAB_TRACE ( "Executing spi command %d on device %d at %d for %zd bytes\n",
command, device_id, address, len ); command, device_id, address, len );
/* The bus must be idle */ /* The bus must be idle */
@ -1497,7 +1498,7 @@ falcon_spi_rw ( struct spi_bus* bus, struct spi_device *device,
fail2: fail2:
fail1: fail1:
EFAB_ERR ( "Failed SPI command %d to device %d address 0x%x len 0x%x\n", EFAB_ERR ( "Failed SPI command %d to device %d address 0x%x len 0x%zx\n",
command, device_id, address, len ); command, device_id, address, len );
return rc; return rc;
@ -3763,7 +3764,7 @@ efab_transmit ( struct net_device *netdev, struct io_buffer *iob )
assert ( tx_queue->buf[buf_id] == NULL ); assert ( tx_queue->buf[buf_id] == NULL );
tx_queue->buf[buf_id] = iob; tx_queue->buf[buf_id] = iob;
EFAB_TRACE ( "tx_buf[%d] for iob %p data %p len %d\n", EFAB_TRACE ( "tx_buf[%d] for iob %p data %p len %zd\n",
buf_id, iob, iob->data, iob_len ( iob ) ); buf_id, iob, iob->data, iob_len ( iob ) );
/* Form the descriptor, and push it to hardware */ /* Form the descriptor, and push it to hardware */

View File

@ -37,6 +37,7 @@
#include <gpxe/umalloc.h> #include <gpxe/umalloc.h>
#include <byteswap.h> #include <byteswap.h>
#include <unistd.h> #include <unistd.h>
#include <gpxe/io.h>
#include <gpxe/pci.h> #include <gpxe/pci.h>
#include <gpxe/ethernet.h> #include <gpxe/ethernet.h>
#include <gpxe/netdevice.h> #include <gpxe/netdevice.h>
@ -1618,8 +1619,8 @@ mtnic_disable(struct pci_device *pci)
free(priv->cmd.buf); free(priv->cmd.buf);
iounmap(priv->hcr); iounmap(priv->hcr);
ufree((u32)priv->fw.fw_pages.buf); ufree((intptr_t)priv->fw.fw_pages.buf);
ufree((u32)priv->fw.extra_pages.buf); ufree((intptr_t)priv->fw.extra_pages.buf);
free(priv->eq.buf); free(priv->eq.buf);
iounmap(priv->eq_db); iounmap(priv->eq_db);
priv->state = CARD_DOWN; priv->state = CARD_DOWN;

View File

@ -118,7 +118,7 @@ static const char hardcoded_ssid[] = "";
typedef struct hfa384x typedef struct hfa384x
{ {
UINT32 iobase; UINT32 iobase;
UINT32 membase; void *membase;
UINT16 lastcmd; UINT16 lastcmd;
UINT16 status; /* in host order */ UINT16 status; /* in host order */
UINT16 resp0; /* in host order */ UINT16 resp0; /* in host order */

View File

@ -22,14 +22,11 @@ $Id$
static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) { static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
hfa384x_t *hw = &hw_global; hfa384x_t *hw = &hw_global;
uint32_t membase = 0; /* Prism2.5 Memory Base */
pci_read_config_dword( pci, PRISM2_PCI_MEM_BASE, &membase); printf ( "Prism2.5 has registers at %#lx\n", pci->membase );
membase &= PCI_BASE_ADDRESS_MEM_MASK; hw->membase = ioremap ( pci->membase, 0x100 );
hw->membase = (uint32_t) phys_to_virt(membase);
printf ( "Prism2.5 has registers at %#lx\n", hw->membase );
nic->ioaddr = hw->membase; nic->ioaddr = pci->membase;
nic->irqno = 0; nic->irqno = 0;
return prism2_probe ( nic, hw ); return prism2_probe ( nic, hw );

View File

@ -48,7 +48,6 @@ static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p )
iobase &= PCI_BASE_ADDRESS_IO_MASK; iobase &= PCI_BASE_ADDRESS_IO_MASK;
/* Fill out hw structure */ /* Fill out hw structure */
hw->membase = attr_mem;
hw->iobase = iobase; hw->iobase = iobase;
printf ( "PLX9052 has local config registers at %#x\n", plx_lcr ); printf ( "PLX9052 has local config registers at %#x\n", plx_lcr );
printf ( "Prism2 has attribute memory at %#x and I/O base at %#x\n", attr_mem, iobase ); printf ( "Prism2 has attribute memory at %#x and I/O base at %#x\n", attr_mem, iobase );

View File

@ -1194,40 +1194,44 @@ rhine_reset (struct nic *nic)
int ioaddr = tp->ioaddr; int ioaddr = tp->ioaddr;
int i, j; int i, j;
int FDXFlag, CRbak; int FDXFlag, CRbak;
int rx_ring_tmp, rx_ring_tmp1; void *rx_ring_tmp;
int tx_ring_tmp, tx_ring_tmp1; void *tx_ring_tmp;
int rx_bufs_tmp, rx_bufs_tmp1; void *rx_bufs_tmp;
int tx_bufs_tmp, tx_bufs_tmp1; void *tx_bufs_tmp;
unsigned long rx_ring_tmp1;
unsigned long tx_ring_tmp1;
unsigned long rx_bufs_tmp1;
unsigned long tx_bufs_tmp1;
/* printf ("rhine_reset\n"); */ /* printf ("rhine_reset\n"); */
/* Soft reset the chip. */ /* Soft reset the chip. */
/*outb(CmdReset, ioaddr + ChipCmd); */ /*outb(CmdReset, ioaddr + ChipCmd); */
tx_bufs_tmp = (int) rhine_buffers.txbuf; tx_bufs_tmp = rhine_buffers.txbuf;
tx_ring_tmp = (int) rhine_buffers.txdesc; tx_ring_tmp = rhine_buffers.txdesc;
rx_bufs_tmp = (int) rhine_buffers.rxbuf; rx_bufs_tmp = rhine_buffers.rxbuf;
rx_ring_tmp = (int) rhine_buffers.rxdesc; rx_ring_tmp = rhine_buffers.rxdesc;
/* tune RD TD 32 byte alignment */ /* tune RD TD 32 byte alignment */
rx_ring_tmp1 = (int) virt_to_bus ((char *) rx_ring_tmp); rx_ring_tmp1 = virt_to_bus ( rx_ring_tmp );
j = (rx_ring_tmp1 + 32) & (~0x1f); j = (rx_ring_tmp1 + 32) & (~0x1f);
/* printf ("txring[%d]", j); */ /* printf ("txring[%d]", j); */
tp->rx_ring = (struct rhine_rx_desc *) bus_to_virt (j); tp->rx_ring = (struct rhine_rx_desc *) bus_to_virt (j);
tx_ring_tmp1 = (int) virt_to_bus ((char *) tx_ring_tmp); tx_ring_tmp1 = virt_to_bus ( tx_ring_tmp );
j = (tx_ring_tmp1 + 32) & (~0x1f); j = (tx_ring_tmp1 + 32) & (~0x1f);
tp->tx_ring = (struct rhine_tx_desc *) bus_to_virt (j); tp->tx_ring = (struct rhine_tx_desc *) bus_to_virt (j);
/* printf ("rxring[%X]", j); */ /* printf ("rxring[%X]", j); */
tx_bufs_tmp1 = (int) virt_to_bus ((char *) tx_bufs_tmp); tx_bufs_tmp1 = virt_to_bus ( tx_bufs_tmp );
j = (int) (tx_bufs_tmp1 + 32) & (~0x1f); j = (int) (tx_bufs_tmp1 + 32) & (~0x1f);
tx_bufs_tmp = (int) bus_to_virt (j); tx_bufs_tmp = bus_to_virt (j);
/* printf ("txb[%X]", j); */ /* printf ("txb[%X]", j); */
rx_bufs_tmp1 = (int) virt_to_bus ((char *) rx_bufs_tmp); rx_bufs_tmp1 = virt_to_bus ( rx_bufs_tmp );
j = (int) (rx_bufs_tmp1 + 32) & (~0x1f); j = (int) (rx_bufs_tmp1 + 32) & (~0x1f);
rx_bufs_tmp = (int) bus_to_virt (j); rx_bufs_tmp = bus_to_virt (j);
/* printf ("rxb[%X][%X]", rx_bufs_tmp1, j); */ /* printf ("rxb[%X][%X]", rx_bufs_tmp1, j); */
for (i = 0; i < RX_RING_SIZE; i++) for (i = 0; i < RX_RING_SIZE; i++)

View File

@ -550,7 +550,7 @@ static void velocity_transmit(struct nic *nic, const char *dest, /* Destination
vptr->td_rings[entry].tdesc0.pktsize = pktlen; vptr->td_rings[entry].tdesc0.pktsize = pktlen;
vptr->td_rings[entry].td_buf[0].pa_low = virt_to_bus(ptxb); vptr->td_rings[entry].td_buf[0].pa_low = virt_to_bus(ptxb);
vptr->td_rings[entry].td_buf[0].pa_high &= vptr->td_rings[entry].td_buf[0].pa_high &=
cpu_to_le32(0xffff0000L); cpu_to_le32(0xffff0000UL);
vptr->td_rings[entry].td_buf[0].bufsize = vptr->td_rings[entry].td_buf[0].bufsize =
vptr->td_rings[entry].tdesc0.pktsize; vptr->td_rings[entry].tdesc0.pktsize;
vptr->td_rings[entry].tdesc1.CMDZ = 2; vptr->td_rings[entry].tdesc1.CMDZ = 2;

View File

@ -7,6 +7,8 @@
* *
*/ */
#include <stdint.h>
/** /**
* @defgroup commtypes Communication semantics * @defgroup commtypes Communication semantics
* *
@ -14,12 +16,14 @@
*/ */
/** Connection-based, reliable streams */ /** Connection-based, reliable streams */
#define SOCK_STREAM ( ( int ) TCP_SOCK_STREAM ) extern int tcp_sock_stream;
extern char TCP_SOCK_STREAM[]; #define TCP_SOCK_STREAM 0x1
#define SOCK_STREAM tcp_sock_stream
/** Connectionless, unreliable streams */ /** Connectionless, unreliable streams */
#define SOCK_DGRAM ( ( int ) UDP_SOCK_DGRAM ) extern int udp_sock_dgram;
extern char UDP_SOCK_DGRAM[]; #define UDP_SOCK_DGRAM 0x2
#define SOCK_DGRAM udp_sock_dgram
/** @} */ /** @} */

View File

@ -173,8 +173,9 @@ efi_snp_initialize ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
container_of ( snp, struct efi_snp_device, snp ); container_of ( snp, struct efi_snp_device, snp );
int rc; int rc;
DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%d extra RX, %d extra TX)\n", DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%ld extra RX, %ld extra TX)\n",
snpdev, extra_rx_bufsize, extra_tx_bufsize ); snpdev, ( ( unsigned long ) extra_rx_bufsize ),
( ( unsigned long ) extra_tx_bufsize ) );
if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) { if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) {
DBGC ( snpdev, "SNPDEV %p could not open %s: %s\n", DBGC ( snpdev, "SNPDEV %p could not open %s: %s\n",
@ -252,9 +253,9 @@ efi_snp_receive_filters ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, UINT32 enable,
container_of ( snp, struct efi_snp_device, snp ); container_of ( snp, struct efi_snp_device, snp );
unsigned int i; unsigned int i;
DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %d mcast\n", DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %ld mcast\n",
snpdev, enable, disable, ( mcast_reset ? " reset" : "" ), snpdev, enable, disable, ( mcast_reset ? " reset" : "" ),
mcast_count ); ( ( unsigned long ) mcast_count ) );
for ( i = 0 ; i < mcast_count ; i++ ) { for ( i = 0 ; i < mcast_count ; i++ ) {
DBGC2_HDA ( snpdev, i, &mcast[i], DBGC2_HDA ( snpdev, i, &mcast[i],
snpdev->netdev->ll_protocol->ll_addr_len ); snpdev->netdev->ll_protocol->ll_addr_len );
@ -390,8 +391,9 @@ efi_snp_nvdata ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, BOOLEAN read,
struct efi_snp_device *snpdev = struct efi_snp_device *snpdev =
container_of ( snp, struct efi_snp_device, snp ); container_of ( snp, struct efi_snp_device, snp );
DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %x+%x\n", snpdev, DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %lx+%lx\n", snpdev,
( read ? "read" : "write" ), offset, len ); ( read ? "read" : "write" ), ( ( unsigned long ) offset ),
( ( unsigned long ) len ) );
if ( ! read ) if ( ! read )
DBGC2_HDA ( snpdev, offset, data, len ); DBGC2_HDA ( snpdev, offset, data, len );
@ -492,7 +494,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
int rc; int rc;
EFI_STATUS efirc; EFI_STATUS efirc;
DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%x", snpdev, data, len ); DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%lx", snpdev, data,
( ( unsigned long ) len ) );
if ( ll_header_len ) { if ( ll_header_len ) {
if ( ll_src ) { if ( ll_src ) {
DBGC2 ( snpdev, " src %s", DBGC2 ( snpdev, " src %s",
@ -512,13 +515,14 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
if ( ll_header_len ) { if ( ll_header_len ) {
if ( ll_header_len != ll_protocol->ll_header_len ) { if ( ll_header_len != ll_protocol->ll_header_len ) {
DBGC ( snpdev, "SNPDEV %p TX invalid header length " DBGC ( snpdev, "SNPDEV %p TX invalid header length "
"%d\n", snpdev, ll_header_len ); "%ld\n", snpdev,
( ( unsigned long ) ll_header_len ) );
efirc = EFI_INVALID_PARAMETER; efirc = EFI_INVALID_PARAMETER;
goto err_sanity; goto err_sanity;
} }
if ( len < ll_header_len ) { if ( len < ll_header_len ) {
DBGC ( snpdev, "SNPDEV %p invalid packet length %d\n", DBGC ( snpdev, "SNPDEV %p invalid packet length %ld\n",
snpdev, len ); snpdev, ( ( unsigned long ) len ) );
efirc = EFI_BUFFER_TOO_SMALL; efirc = EFI_BUFFER_TOO_SMALL;
goto err_sanity; goto err_sanity;
} }
@ -541,8 +545,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
/* Allocate buffer */ /* Allocate buffer */
iobuf = alloc_iob ( len ); iobuf = alloc_iob ( len );
if ( ! iobuf ) { if ( ! iobuf ) {
DBGC ( snpdev, "SNPDEV %p TX could not allocate %d-byte " DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte "
"buffer\n", snpdev, len ); "buffer\n", snpdev, ( ( unsigned long ) len ) );
efirc = EFI_DEVICE_ERROR; efirc = EFI_DEVICE_ERROR;
goto err_alloc_iob; goto err_alloc_iob;
} }
@ -610,7 +614,8 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
int rc; int rc;
EFI_STATUS efirc; EFI_STATUS efirc;
DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%x)", snpdev, data, *len ); DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%lx)", snpdev, data,
( ( unsigned long ) *len ) );
/* Poll the network device */ /* Poll the network device */
efi_snp_poll ( snpdev ); efi_snp_poll ( snpdev );
@ -741,8 +746,10 @@ efi_snp_netdev ( EFI_DRIVER_BINDING_PROTOCOL *driver, EFI_HANDLE device ) {
driver, device, efi_strerror ( efirc ) ); driver, device, efi_strerror ( efirc ) );
goto out_no_pci_location; goto out_no_pci_location;
} }
DBGCP ( driver, "SNPDRV %p device %p is PCI %04x:%02x:%02x.%x\n", DBGCP ( driver, "SNPDRV %p device %p is PCI %04lx:%02lx:%02lx.%lx\n",
driver, device, pci_segment, pci_bus, pci_dev, pci_fn ); driver, device, ( ( unsigned long ) pci_segment ),
( ( unsigned long ) pci_bus ), ( ( unsigned long ) pci_dev ),
( ( unsigned long ) pci_fn ) );
/* Look up corresponding network device */ /* Look up corresponding network device */
pci_busdevfn = PCI_BUSDEVFN ( pci_bus, PCI_DEVFN ( pci_dev, pci_fn ) ); pci_busdevfn = PCI_BUSDEVFN ( pci_bus, PCI_DEVFN ( pci_dev, pci_fn ) );
@ -858,7 +865,7 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
/* Sanity check */ /* Sanity check */
if ( netdev->ll_protocol->ll_addr_len > sizeof ( EFI_MAC_ADDRESS ) ) { if ( netdev->ll_protocol->ll_addr_len > sizeof ( EFI_MAC_ADDRESS ) ) {
DBGC ( snpdev, "SNPDEV %p cannot support link-layer address " DBGC ( snpdev, "SNPDEV %p cannot support link-layer address "
"length %zd for %s\n", snpdev, "length %d for %s\n", snpdev,
netdev->ll_protocol->ll_addr_len, netdev->name ); netdev->ll_protocol->ll_addr_len, netdev->name );
efirc = EFI_INVALID_PARAMETER; efirc = EFI_INVALID_PARAMETER;
goto err_ll_addr_len; goto err_ll_addr_len;
@ -923,8 +930,8 @@ efi_snp_driver_stop ( EFI_DRIVER_BINDING_PROTOCOL *driver,
EFI_BOOT_SERVICES *bs = efi_systab->BootServices; EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
struct efi_snp_device *snpdev; struct efi_snp_device *snpdev;
DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%d %p)\n", DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%ld %p)\n",
driver, device, num_children, children ); driver, device, ( ( unsigned long ) num_children ), children );
/* Locate SNP device */ /* Locate SNP device */
snpdev = efi_snp_snpdev ( driver, device ); snpdev = efi_snp_snpdev ( driver, device );

View File

@ -483,7 +483,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) ); tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
/* Dump header */ /* Dump header */
DBGC ( tcp, "TCP %p TX %d->%d %08x..%08x %08x %4zd", DBGC ( tcp, "TCP %p TX %d->%d %08x..%08zx %08x %4zd",
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ), tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ), ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
ntohl ( tcphdr->ack ), len ); ntohl ( tcphdr->ack ), len );
@ -702,7 +702,7 @@ static int tcp_rx_ack ( struct tcp_connection *tcp, uint32_t ack,
/* Ignore duplicate or out-of-range ACK */ /* Ignore duplicate or out-of-range ACK */
if ( ack_len > tcp->snd_sent ) { if ( ack_len > tcp->snd_sent ) {
DBGC ( tcp, "TCP %p received ACK for [%08x,%08x), " DBGC ( tcp, "TCP %p received ACK for [%08x,%08zx), "
"sent only [%08x,%08x)\n", tcp, tcp->snd_seq, "sent only [%08x,%08x)\n", tcp, tcp->snd_seq,
( tcp->snd_seq + ack_len ), tcp->snd_seq, ( tcp->snd_seq + ack_len ), tcp->snd_seq,
( tcp->snd_seq + tcp->snd_sent ) ); ( tcp->snd_seq + tcp->snd_sent ) );
@ -894,7 +894,7 @@ static int tcp_rx ( struct io_buffer *iobuf,
len = iob_len ( iobuf ); len = iob_len ( iobuf );
/* Dump header */ /* Dump header */
DBGC ( tcp, "TCP %p RX %d<-%d %08x %08x..%08x %4zd", DBGC ( tcp, "TCP %p RX %d<-%d %08x %08x..%08zx %4zd",
tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ), tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ), ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
( ntohl ( tcphdr->seq ) + len + ( ntohl ( tcphdr->seq ) + len +
@ -1070,12 +1070,13 @@ static struct xfer_interface_operations tcp_xfer_operations = {
/** TCP socket opener */ /** TCP socket opener */
struct socket_opener tcp_socket_opener __socket_opener = { struct socket_opener tcp_socket_opener __socket_opener = {
.semantics = SOCK_STREAM, .semantics = TCP_SOCK_STREAM,
.family = AF_INET, .family = AF_INET,
.open = tcp_open, .open = tcp_open,
}; };
char TCP_SOCK_STREAM[1]; /** Linkage hack */
int tcp_sock_stream = TCP_SOCK_STREAM;
/** /**
* Open TCP URI * Open TCP URI

View File

@ -438,12 +438,13 @@ static struct xfer_interface_operations udp_xfer_operations = {
/** UDP socket opener */ /** UDP socket opener */
struct socket_opener udp_socket_opener __socket_opener = { struct socket_opener udp_socket_opener __socket_opener = {
.semantics = SOCK_DGRAM, .semantics = UDP_SOCK_DGRAM,
.family = AF_INET, .family = AF_INET,
.open = udp_open, .open = udp_open,
}; };
char UDP_SOCK_DGRAM[1]; /** Linkage hack */
int udp_sock_dgram = UDP_SOCK_DGRAM;
/** /**
* Open UDP URI * Open UDP URI

View File

@ -219,7 +219,7 @@ static int slam_put_value ( struct slam_request *slam,
*/ */
len = ( ( flsl ( value ) + 10 ) / 8 ); len = ( ( flsl ( value ) + 10 ) / 8 );
if ( len >= iob_tailroom ( iobuf ) ) { if ( len >= iob_tailroom ( iobuf ) ) {
DBGC2 ( slam, "SLAM %p cannot add %d-byte value\n", DBGC2 ( slam, "SLAM %p cannot add %zd-byte value\n",
slam, len ); slam, len );
return -ENOBUFS; return -ENOBUFS;
} }
@ -380,7 +380,7 @@ static int slam_pull_value ( struct slam_request *slam,
len = ( *data >> 5 ); len = ( *data >> 5 );
if ( ( len == 0 ) || if ( ( len == 0 ) ||
( value && ( len > sizeof ( *value ) ) ) ) { ( value && ( len > sizeof ( *value ) ) ) ) {
DBGC ( slam, "SLAM %p invalid value length %d bytes\n", DBGC ( slam, "SLAM %p invalid value length %zd bytes\n",
slam, len ); slam, len );
return -EINVAL; return -EINVAL;
} }