Browse Source

[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.
tags/v0.9.6
Michael Brown 15 years ago
parent
commit
0ebbbb95fa

+ 1
- 0
src/drivers/infiniband/arbel.c View File

@@ -27,6 +27,7 @@
27 27
 #include <unistd.h>
28 28
 #include <errno.h>
29 29
 #include <byteswap.h>
30
+#include <gpxe/io.h>
30 31
 #include <gpxe/pci.h>
31 32
 #include <gpxe/malloc.h>
32 33
 #include <gpxe/umalloc.h>

+ 1
- 0
src/drivers/infiniband/hermon.c View File

@@ -25,6 +25,7 @@
25 25
 #include <unistd.h>
26 26
 #include <errno.h>
27 27
 #include <byteswap.h>
28
+#include <gpxe/io.h>
28 29
 #include <gpxe/pci.h>
29 30
 #include <gpxe/malloc.h>
30 31
 #include <gpxe/umalloc.h>

+ 2
- 1
src/drivers/infiniband/linda.c View File

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

+ 10
- 10
src/drivers/net/dmfe.c View File

@@ -133,14 +133,14 @@
133 133
 /* Structure/enum declaration ------------------------------- */
134 134
 struct tx_desc {
135 135
 	u32 tdes0, tdes1, tdes2, tdes3;	/* Data for the card */
136
-	u32 tx_buf_ptr;		/* Data for us */
137
-	 u32 /* struct tx_desc * */ next_tx_desc;
136
+	void * tx_buf_ptr;		/* Data for us */
137
+	struct tx_desc * next_tx_desc;
138 138
 } __attribute__ ((aligned(32)));
139 139
 
140 140
 struct rx_desc {
141 141
 	u32 rdes0, rdes1, rdes2, rdes3;	/* Data for the card */
142
-	u32 rx_skb_ptr;		/* Data for us */
143
-	 u32 /* struct rx_desc * */ next_rx_desc;
142
+	void * rx_skb_ptr;		/* Data for us */
143
+	struct rx_desc * next_rx_desc;
144 144
 } __attribute__ ((aligned(32)));
145 145
 
146 146
 static struct dmfe_private {
@@ -522,30 +522,30 @@ static void dmfe_descriptor_init(struct nic *nic __unused, unsigned long ioaddr)
522 522
 
523 523
 	/* Init Transmit chain */
524 524
 	for (i = 0; i < TX_DESC_CNT; i++) {
525
-		txd[i].tx_buf_ptr = (u32) & txb[i];
525
+		txd[i].tx_buf_ptr = &txb[i];
526 526
 		txd[i].tdes0 = cpu_to_le32(0);
527 527
 		txd[i].tdes1 = cpu_to_le32(0x81000000);	/* IC, chain */
528 528
 		txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i]));
529 529
 		txd[i].tdes3 = cpu_to_le32(virt_to_bus(&txd[i + 1]));
530
-		txd[i].next_tx_desc = virt_to_le32desc(&txd[i + 1]);	
530
+		txd[i].next_tx_desc = &txd[i + 1];
531 531
 	}
532 532
 	/* Mark the last entry as wrapping the ring */
533 533
 	txd[i - 1].tdes3 = virt_to_le32desc(&txd[0]);
534
-	txd[i - 1].next_tx_desc = (u32) & txd[0];
534
+	txd[i - 1].next_tx_desc = &txd[0];
535 535
 
536 536
 	/* receive descriptor chain */
537 537
 	for (i = 0; i < RX_DESC_CNT; i++) {
538
-		rxd[i].rx_skb_ptr = (u32) & rxb[i * RX_ALLOC_SIZE];
538
+		rxd[i].rx_skb_ptr = &rxb[i * RX_ALLOC_SIZE];
539 539
 		rxd[i].rdes0 = cpu_to_le32(0x80000000);
540 540
 		rxd[i].rdes1 = cpu_to_le32(0x01000600);
541 541
 		rxd[i].rdes2 =
542 542
 		    cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE]));
543 543
 		rxd[i].rdes3 = cpu_to_le32(virt_to_bus(&rxd[i + 1]));
544
-		rxd[i].next_rx_desc = virt_to_le32desc(&rxd[i + 1]);
544
+		rxd[i].next_rx_desc = &rxd[i + 1];
545 545
 	}
546 546
 	/* Mark the last entry as wrapping the ring */
547 547
 	rxd[i - 1].rdes3 = cpu_to_le32(virt_to_bus(&rxd[0]));
548
-	rxd[i - 1].next_rx_desc = virt_to_le32desc(&rxd[0]);
548
+	rxd[i - 1].next_rx_desc = &rxd[0];
549 549
 
550 550
 }
551 551
 

+ 4
- 3
src/drivers/net/etherfabric.c View File

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

+ 3
- 2
src/drivers/net/mtnic.c View File

@@ -37,6 +37,7 @@
37 37
 #include <gpxe/umalloc.h>
38 38
 #include <byteswap.h>
39 39
 #include <unistd.h>
40
+#include <gpxe/io.h>
40 41
 #include <gpxe/pci.h>
41 42
 #include <gpxe/ethernet.h>
42 43
 #include <gpxe/netdevice.h>
@@ -1618,8 +1619,8 @@ mtnic_disable(struct pci_device *pci)
1618 1619
 
1619 1620
                 free(priv->cmd.buf);
1620 1621
 		iounmap(priv->hcr);
1621
-                ufree((u32)priv->fw.fw_pages.buf);
1622
-		ufree((u32)priv->fw.extra_pages.buf);
1622
+                ufree((intptr_t)priv->fw.fw_pages.buf);
1623
+		ufree((intptr_t)priv->fw.extra_pages.buf);
1623 1624
                 free(priv->eq.buf);
1624 1625
 		iounmap(priv->eq_db);
1625 1626
                 priv->state = CARD_DOWN;

+ 1
- 1
src/drivers/net/prism2.c View File

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

+ 3
- 6
src/drivers/net/prism2_pci.c View File

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

+ 0
- 1
src/drivers/net/prism2_plx.c View File

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

+ 18
- 14
src/drivers/net/via-rhine.c View File

@@ -1194,40 +1194,44 @@ rhine_reset (struct nic *nic)
1194 1194
     int ioaddr = tp->ioaddr;
1195 1195
     int i, j;
1196 1196
     int FDXFlag, CRbak;
1197
-    int rx_ring_tmp, rx_ring_tmp1;
1198
-    int tx_ring_tmp, tx_ring_tmp1;
1199
-    int rx_bufs_tmp, rx_bufs_tmp1;
1200
-    int tx_bufs_tmp, tx_bufs_tmp1;
1197
+    void *rx_ring_tmp;
1198
+    void *tx_ring_tmp;
1199
+    void *rx_bufs_tmp;
1200
+    void *tx_bufs_tmp;
1201
+    unsigned long rx_ring_tmp1;
1202
+    unsigned long tx_ring_tmp1;
1203
+    unsigned long rx_bufs_tmp1;
1204
+    unsigned long tx_bufs_tmp1;
1201 1205
 
1202 1206
     /* printf ("rhine_reset\n"); */
1203 1207
     /* Soft reset the chip. */
1204 1208
     /*outb(CmdReset, ioaddr + ChipCmd); */
1205 1209
 
1206
-    tx_bufs_tmp = (int) rhine_buffers.txbuf;
1207
-    tx_ring_tmp = (int) rhine_buffers.txdesc;
1208
-    rx_bufs_tmp = (int) rhine_buffers.rxbuf;
1209
-    rx_ring_tmp = (int) rhine_buffers.rxdesc;
1210
+    tx_bufs_tmp = rhine_buffers.txbuf;
1211
+    tx_ring_tmp = rhine_buffers.txdesc;
1212
+    rx_bufs_tmp = rhine_buffers.rxbuf;
1213
+    rx_ring_tmp = rhine_buffers.rxdesc;
1210 1214
 
1211 1215
     /* tune RD TD 32 byte alignment */
1212
-    rx_ring_tmp1 = (int) virt_to_bus ((char *) rx_ring_tmp);
1216
+    rx_ring_tmp1 = virt_to_bus ( rx_ring_tmp );
1213 1217
     j = (rx_ring_tmp1 + 32) & (~0x1f);
1214 1218
     /* printf ("txring[%d]", j); */
1215 1219
     tp->rx_ring = (struct rhine_rx_desc *) bus_to_virt (j);
1216 1220
 
1217
-    tx_ring_tmp1 = (int) virt_to_bus ((char *) tx_ring_tmp);
1221
+    tx_ring_tmp1 = virt_to_bus ( tx_ring_tmp );
1218 1222
     j = (tx_ring_tmp1 + 32) & (~0x1f);
1219 1223
     tp->tx_ring = (struct rhine_tx_desc *) bus_to_virt (j);
1220 1224
     /* printf ("rxring[%X]", j); */
1221 1225
 
1222 1226
 
1223
-    tx_bufs_tmp1 = (int) virt_to_bus ((char *) tx_bufs_tmp);
1227
+    tx_bufs_tmp1 = virt_to_bus ( tx_bufs_tmp );
1224 1228
     j = (int) (tx_bufs_tmp1 + 32) & (~0x1f);
1225
-    tx_bufs_tmp = (int) bus_to_virt (j);
1229
+    tx_bufs_tmp = bus_to_virt (j);
1226 1230
     /* printf ("txb[%X]", j); */
1227 1231
 
1228
-    rx_bufs_tmp1 = (int) virt_to_bus ((char *) rx_bufs_tmp);
1232
+    rx_bufs_tmp1 = virt_to_bus ( rx_bufs_tmp );
1229 1233
     j = (int) (rx_bufs_tmp1 + 32) & (~0x1f);
1230
-    rx_bufs_tmp = (int) bus_to_virt (j);
1234
+    rx_bufs_tmp = bus_to_virt (j);
1231 1235
     /* printf ("rxb[%X][%X]", rx_bufs_tmp1, j); */
1232 1236
 
1233 1237
     for (i = 0; i < RX_RING_SIZE; i++)

+ 1
- 1
src/drivers/net/via-velocity.c View File

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

+ 8
- 4
src/include/gpxe/socket.h View File

@@ -7,6 +7,8 @@
7 7
  *
8 8
  */
9 9
 
10
+#include <stdint.h>
11
+
10 12
 /**
11 13
  * @defgroup commtypes Communication semantics
12 14
  *
@@ -14,12 +16,14 @@
14 16
  */
15 17
 
16 18
 /** Connection-based, reliable streams */
17
-#define SOCK_STREAM	( ( int ) TCP_SOCK_STREAM )
18
-extern char TCP_SOCK_STREAM[];
19
+extern int tcp_sock_stream;
20
+#define TCP_SOCK_STREAM 0x1
21
+#define SOCK_STREAM tcp_sock_stream
19 22
 
20 23
 /** Connectionless, unreliable streams */
21
-#define SOCK_DGRAM	( ( int ) UDP_SOCK_DGRAM )
22
-extern char UDP_SOCK_DGRAM[];
24
+extern int udp_sock_dgram;
25
+#define UDP_SOCK_DGRAM 0x2
26
+#define SOCK_DGRAM udp_sock_dgram
23 27
 
24 28
 /** @} */
25 29
 

+ 25
- 18
src/interface/efi/efi_snp.c View File

@@ -173,8 +173,9 @@ efi_snp_initialize ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
173 173
 		container_of ( snp, struct efi_snp_device, snp );
174 174
 	int rc;
175 175
 
176
-	DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%d extra RX, %d extra TX)\n",
177
-		snpdev, extra_rx_bufsize, extra_tx_bufsize );
176
+	DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%ld extra RX, %ld extra TX)\n",
177
+		snpdev, ( ( unsigned long ) extra_rx_bufsize ),
178
+		( ( unsigned long ) extra_tx_bufsize ) );
178 179
 
179 180
 	if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) {
180 181
 		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,
252 253
 		container_of ( snp, struct efi_snp_device, snp );
253 254
 	unsigned int i;
254 255
 
255
-	DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %d mcast\n",
256
+	DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %ld mcast\n",
256 257
 		snpdev, enable, disable, ( mcast_reset ? " reset" : "" ),
257
-		mcast_count );
258
+		( ( unsigned long ) mcast_count ) );
258 259
 	for ( i = 0 ; i < mcast_count ; i++ ) {
259 260
 		DBGC2_HDA ( snpdev, i, &mcast[i],
260 261
 			    snpdev->netdev->ll_protocol->ll_addr_len );
@@ -390,8 +391,9 @@ efi_snp_nvdata ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, BOOLEAN read,
390 391
 	struct efi_snp_device *snpdev =
391 392
 		container_of ( snp, struct efi_snp_device, snp );
392 393
 
393
-	DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %x+%x\n", snpdev,
394
-		( read ? "read" : "write" ), offset, len );
394
+	DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %lx+%lx\n", snpdev,
395
+		( read ? "read" : "write" ), ( ( unsigned long ) offset ),
396
+		( ( unsigned long ) len ) );
395 397
 	if ( ! read )
396 398
 		DBGC2_HDA ( snpdev, offset, data, len );
397 399
 
@@ -492,7 +494,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
492 494
 	int rc;
493 495
 	EFI_STATUS efirc;
494 496
 
495
-	DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%x", snpdev, data, len );
497
+	DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%lx", snpdev, data,
498
+		( ( unsigned long ) len ) );
496 499
 	if ( ll_header_len ) {
497 500
 		if ( ll_src ) {
498 501
 			DBGC2 ( snpdev, " src %s",
@@ -512,13 +515,14 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
512 515
 	if ( ll_header_len ) {
513 516
 		if ( ll_header_len != ll_protocol->ll_header_len ) {
514 517
 			DBGC ( snpdev, "SNPDEV %p TX invalid header length "
515
-			       "%d\n", snpdev, ll_header_len );
518
+			       "%ld\n", snpdev,
519
+			       ( ( unsigned long ) ll_header_len ) );
516 520
 			efirc = EFI_INVALID_PARAMETER;
517 521
 			goto err_sanity;
518 522
 		}
519 523
 		if ( len < ll_header_len ) {
520
-			DBGC ( snpdev, "SNPDEV %p invalid packet length %d\n",
521
-			       snpdev, len );
524
+			DBGC ( snpdev, "SNPDEV %p invalid packet length %ld\n",
525
+			       snpdev, ( ( unsigned long ) len ) );
522 526
 			efirc = EFI_BUFFER_TOO_SMALL;
523 527
 			goto err_sanity;
524 528
 		}
@@ -541,8 +545,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
541 545
 	/* Allocate buffer */
542 546
 	iobuf = alloc_iob ( len );
543 547
 	if ( ! iobuf ) {
544
-		DBGC ( snpdev, "SNPDEV %p TX could not allocate %d-byte "
545
-		       "buffer\n", snpdev, len );
548
+		DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte "
549
+		       "buffer\n", snpdev, ( ( unsigned long ) len ) );
546 550
 		efirc = EFI_DEVICE_ERROR;
547 551
 		goto err_alloc_iob;
548 552
 	}
@@ -610,7 +614,8 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
610 614
 	int rc;
611 615
 	EFI_STATUS efirc;
612 616
 
613
-	DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%x)", snpdev, data, *len );
617
+	DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%lx)", snpdev, data,
618
+		( ( unsigned long ) *len ) );
614 619
 
615 620
 	/* Poll the network device */
616 621
 	efi_snp_poll ( snpdev );
@@ -741,8 +746,10 @@ efi_snp_netdev ( EFI_DRIVER_BINDING_PROTOCOL *driver, EFI_HANDLE device ) {
741 746
 		       driver, device, efi_strerror ( efirc ) );
742 747
 		goto out_no_pci_location;
743 748
 	}
744
-	DBGCP ( driver, "SNPDRV %p device %p is PCI %04x:%02x:%02x.%x\n",
745
-		driver, device, pci_segment, pci_bus, pci_dev, pci_fn );
749
+	DBGCP ( driver, "SNPDRV %p device %p is PCI %04lx:%02lx:%02lx.%lx\n",
750
+		driver, device, ( ( unsigned long ) pci_segment ),
751
+		( ( unsigned long ) pci_bus ), ( ( unsigned long ) pci_dev ),
752
+		( ( unsigned long ) pci_fn ) );
746 753
 
747 754
 	/* Look up corresponding network device */
748 755
 	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,
858 865
 	/* Sanity check */
859 866
 	if ( netdev->ll_protocol->ll_addr_len > sizeof ( EFI_MAC_ADDRESS ) ) {
860 867
 		DBGC ( snpdev, "SNPDEV %p cannot support link-layer address "
861
-		       "length %zd for %s\n", snpdev,
868
+		       "length %d for %s\n", snpdev,
862 869
 		       netdev->ll_protocol->ll_addr_len, netdev->name );
863 870
 		efirc = EFI_INVALID_PARAMETER;
864 871
 		goto err_ll_addr_len;
@@ -923,8 +930,8 @@ efi_snp_driver_stop ( EFI_DRIVER_BINDING_PROTOCOL *driver,
923 930
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
924 931
 	struct efi_snp_device *snpdev;
925 932
 
926
-	DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%d %p)\n",
927
-		driver, device, num_children, children );
933
+	DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%ld %p)\n",
934
+		driver, device, ( ( unsigned long ) num_children ), children );
928 935
 
929 936
 	/* Locate SNP device */
930 937
 	snpdev = efi_snp_snpdev ( driver, device );

+ 6
- 5
src/net/tcp.c View File

@@ -483,7 +483,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
483 483
 	tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
484 484
 
485 485
 	/* Dump header */
486
-	DBGC ( tcp, "TCP %p TX %d->%d %08x..%08x           %08x %4zd",
486
+	DBGC ( tcp, "TCP %p TX %d->%d %08x..%08zx           %08x %4zd",
487 487
 	       tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
488 488
 	       ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
489 489
 	       ntohl ( tcphdr->ack ), len );
@@ -702,7 +702,7 @@ static int tcp_rx_ack ( struct tcp_connection *tcp, uint32_t ack,
702 702
 
703 703
 	/* Ignore duplicate or out-of-range ACK */
704 704
 	if ( ack_len > tcp->snd_sent ) {
705
-		DBGC ( tcp, "TCP %p received ACK for [%08x,%08x), "
705
+		DBGC ( tcp, "TCP %p received ACK for [%08x,%08zx), "
706 706
 		       "sent only [%08x,%08x)\n", tcp, tcp->snd_seq,
707 707
 		       ( tcp->snd_seq + ack_len ), tcp->snd_seq,
708 708
 		       ( tcp->snd_seq + tcp->snd_sent ) );
@@ -894,7 +894,7 @@ static int tcp_rx ( struct io_buffer *iobuf,
894 894
 	len = iob_len ( iobuf );
895 895
 
896 896
 	/* Dump header */
897
-	DBGC ( tcp, "TCP %p RX %d<-%d           %08x %08x..%08x %4zd",
897
+	DBGC ( tcp, "TCP %p RX %d<-%d           %08x %08x..%08zx %4zd",
898 898
 	       tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
899 899
 	       ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
900 900
 	       ( ntohl ( tcphdr->seq ) + len +
@@ -1070,12 +1070,13 @@ static struct xfer_interface_operations tcp_xfer_operations = {
1070 1070
 
1071 1071
 /** TCP socket opener */
1072 1072
 struct socket_opener tcp_socket_opener __socket_opener = {
1073
-	.semantics	= SOCK_STREAM,
1073
+	.semantics	= TCP_SOCK_STREAM,
1074 1074
 	.family		= AF_INET,
1075 1075
 	.open		= tcp_open,
1076 1076
 };
1077 1077
 
1078
-char TCP_SOCK_STREAM[1];
1078
+/** Linkage hack */
1079
+int tcp_sock_stream = TCP_SOCK_STREAM;
1079 1080
 
1080 1081
 /**
1081 1082
  * Open TCP URI

+ 3
- 2
src/net/udp.c View File

@@ -438,12 +438,13 @@ static struct xfer_interface_operations udp_xfer_operations = {
438 438
 
439 439
 /** UDP socket opener */
440 440
 struct socket_opener udp_socket_opener __socket_opener = {
441
-	.semantics	= SOCK_DGRAM,
441
+	.semantics	= UDP_SOCK_DGRAM,
442 442
 	.family		= AF_INET,
443 443
 	.open		= udp_open,
444 444
 };
445 445
 
446
-char UDP_SOCK_DGRAM[1];
446
+/** Linkage hack */
447
+int udp_sock_dgram = UDP_SOCK_DGRAM;
447 448
 
448 449
 /**
449 450
  * Open UDP URI

+ 2
- 2
src/net/udp/slam.c View File

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

Loading…
Cancel
Save