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 16 years ago
parent
commit
0ebbbb95fa

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

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

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

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

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

21
 #include <errno.h>
21
 #include <errno.h>
22
 #include <unistd.h>
22
 #include <unistd.h>
23
 #include <assert.h>
23
 #include <assert.h>
24
+#include <gpxe/io.h>
24
 #include <gpxe/pci.h>
25
 #include <gpxe/pci.h>
25
 #include <gpxe/infiniband.h>
26
 #include <gpxe/infiniband.h>
26
 #include <gpxe/i2c.h>
27
 #include <gpxe/i2c.h>
1065
 		return -EINVAL;
1066
 		return -EINVAL;
1066
 	}
1067
 	}
1067
 	if ( len != LINDA_RECV_PAYLOAD_SIZE ) {
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
 		       linda, qp->qpn, len );
1070
 		       linda, qp->qpn, len );
1070
 		return -EINVAL;
1071
 		return -EINVAL;
1071
 	}
1072
 	}

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

133
 /* Structure/enum declaration ------------------------------- */
133
 /* Structure/enum declaration ------------------------------- */
134
 struct tx_desc {
134
 struct tx_desc {
135
 	u32 tdes0, tdes1, tdes2, tdes3;	/* Data for the card */
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
 } __attribute__ ((aligned(32)));
138
 } __attribute__ ((aligned(32)));
139
 
139
 
140
 struct rx_desc {
140
 struct rx_desc {
141
 	u32 rdes0, rdes1, rdes2, rdes3;	/* Data for the card */
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
 } __attribute__ ((aligned(32)));
144
 } __attribute__ ((aligned(32)));
145
 
145
 
146
 static struct dmfe_private {
146
 static struct dmfe_private {
522
 
522
 
523
 	/* Init Transmit chain */
523
 	/* Init Transmit chain */
524
 	for (i = 0; i < TX_DESC_CNT; i++) {
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
 		txd[i].tdes0 = cpu_to_le32(0);
526
 		txd[i].tdes0 = cpu_to_le32(0);
527
 		txd[i].tdes1 = cpu_to_le32(0x81000000);	/* IC, chain */
527
 		txd[i].tdes1 = cpu_to_le32(0x81000000);	/* IC, chain */
528
 		txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i]));
528
 		txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i]));
529
 		txd[i].tdes3 = cpu_to_le32(virt_to_bus(&txd[i + 1]));
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
 	/* Mark the last entry as wrapping the ring */
532
 	/* Mark the last entry as wrapping the ring */
533
 	txd[i - 1].tdes3 = virt_to_le32desc(&txd[0]);
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
 	/* receive descriptor chain */
536
 	/* receive descriptor chain */
537
 	for (i = 0; i < RX_DESC_CNT; i++) {
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
 		rxd[i].rdes0 = cpu_to_le32(0x80000000);
539
 		rxd[i].rdes0 = cpu_to_le32(0x80000000);
540
 		rxd[i].rdes1 = cpu_to_le32(0x01000600);
540
 		rxd[i].rdes1 = cpu_to_le32(0x01000600);
541
 		rxd[i].rdes2 =
541
 		rxd[i].rdes2 =
542
 		    cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE]));
542
 		    cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE]));
543
 		rxd[i].rdes3 = cpu_to_le32(virt_to_bus(&rxd[i + 1]));
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
 	/* Mark the last entry as wrapping the ring */
546
 	/* Mark the last entry as wrapping the ring */
547
 	rxd[i - 1].rdes3 = cpu_to_le32(virt_to_bus(&rxd[0]));
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
 #include <assert.h>
22
 #include <assert.h>
23
 #include <byteswap.h>
23
 #include <byteswap.h>
24
 #include <console.h>
24
 #include <console.h>
25
+#include <gpxe/io.h>
25
 #include <gpxe/pci.h>
26
 #include <gpxe/pci.h>
26
 #include <gpxe/malloc.h>
27
 #include <gpxe/malloc.h>
27
 #include <gpxe/ethernet.h>
28
 #include <gpxe/ethernet.h>
1449
 		return -EINVAL;
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
 		     command, device_id, address, len );
1454
 		     command, device_id, address, len );
1454
 
1455
 
1455
 	/* The bus must be idle */
1456
 	/* The bus must be idle */
1497
 
1498
 
1498
 fail2:
1499
 fail2:
1499
 fail1:
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
 		   command, device_id, address, len );
1502
 		   command, device_id, address, len );
1502
 
1503
 
1503
 	return rc;
1504
 	return rc;
3763
 	assert ( tx_queue->buf[buf_id] == NULL );
3764
 	assert ( tx_queue->buf[buf_id] == NULL );
3764
 	tx_queue->buf[buf_id] = iob;
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
 		     buf_id, iob, iob->data, iob_len ( iob ) );
3768
 		     buf_id, iob, iob->data, iob_len ( iob ) );
3768
 
3769
 
3769
 	/* Form the descriptor, and push it to hardware */
3770
 	/* Form the descriptor, and push it to hardware */

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

37
 #include <gpxe/umalloc.h>
37
 #include <gpxe/umalloc.h>
38
 #include <byteswap.h>
38
 #include <byteswap.h>
39
 #include <unistd.h>
39
 #include <unistd.h>
40
+#include <gpxe/io.h>
40
 #include <gpxe/pci.h>
41
 #include <gpxe/pci.h>
41
 #include <gpxe/ethernet.h>
42
 #include <gpxe/ethernet.h>
42
 #include <gpxe/netdevice.h>
43
 #include <gpxe/netdevice.h>
1618
 
1619
 
1619
                 free(priv->cmd.buf);
1620
                 free(priv->cmd.buf);
1620
 		iounmap(priv->hcr);
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
                 free(priv->eq.buf);
1624
                 free(priv->eq.buf);
1624
 		iounmap(priv->eq_db);
1625
 		iounmap(priv->eq_db);
1625
                 priv->state = CARD_DOWN;
1626
                 priv->state = CARD_DOWN;

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

118
 typedef struct hfa384x
118
 typedef struct hfa384x
119
 {
119
 {
120
   UINT32 iobase;
120
   UINT32 iobase;
121
-  UINT32 membase;
121
+  void *membase;
122
   UINT16 lastcmd;
122
   UINT16 lastcmd;
123
   UINT16 status;         /* in host order */
123
   UINT16 status;         /* in host order */
124
   UINT16 resp0;          /* in host order */
124
   UINT16 resp0;          /* in host order */

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

22
 
22
 
23
 static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
23
 static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
24
   hfa384x_t *hw = &hw_global;
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
   nic->irqno = 0;
30
   nic->irqno = 0;
34
 
31
 
35
   return prism2_probe ( nic, hw );
32
   return prism2_probe ( nic, hw );

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

48
   iobase &= PCI_BASE_ADDRESS_IO_MASK;
48
   iobase &= PCI_BASE_ADDRESS_IO_MASK;
49
 
49
 
50
   /* Fill out hw structure */
50
   /* Fill out hw structure */
51
-  hw->membase = attr_mem;
52
   hw->iobase = iobase;
51
   hw->iobase = iobase;
53
   printf ( "PLX9052 has local config registers at %#x\n", plx_lcr );
52
   printf ( "PLX9052 has local config registers at %#x\n", plx_lcr );
54
   printf ( "Prism2 has attribute memory at %#x and I/O base at %#x\n", attr_mem, iobase );
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
     int ioaddr = tp->ioaddr;
1194
     int ioaddr = tp->ioaddr;
1195
     int i, j;
1195
     int i, j;
1196
     int FDXFlag, CRbak;
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
     /* printf ("rhine_reset\n"); */
1206
     /* printf ("rhine_reset\n"); */
1203
     /* Soft reset the chip. */
1207
     /* Soft reset the chip. */
1204
     /*outb(CmdReset, ioaddr + ChipCmd); */
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
     /* tune RD TD 32 byte alignment */
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
     j = (rx_ring_tmp1 + 32) & (~0x1f);
1217
     j = (rx_ring_tmp1 + 32) & (~0x1f);
1214
     /* printf ("txring[%d]", j); */
1218
     /* printf ("txring[%d]", j); */
1215
     tp->rx_ring = (struct rhine_rx_desc *) bus_to_virt (j);
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
     j = (tx_ring_tmp1 + 32) & (~0x1f);
1222
     j = (tx_ring_tmp1 + 32) & (~0x1f);
1219
     tp->tx_ring = (struct rhine_tx_desc *) bus_to_virt (j);
1223
     tp->tx_ring = (struct rhine_tx_desc *) bus_to_virt (j);
1220
     /* printf ("rxring[%X]", j); */
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
     j = (int) (tx_bufs_tmp1 + 32) & (~0x1f);
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
     /* printf ("txb[%X]", j); */
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
     j = (int) (rx_bufs_tmp1 + 32) & (~0x1f);
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
     /* printf ("rxb[%X][%X]", rx_bufs_tmp1, j); */
1235
     /* printf ("rxb[%X][%X]", rx_bufs_tmp1, j); */
1232
 
1236
 
1233
     for (i = 0; i < RX_RING_SIZE; i++)
1237
     for (i = 0; i < RX_RING_SIZE; i++)

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

550
 		vptr->td_rings[entry].tdesc0.pktsize = pktlen;
550
 		vptr->td_rings[entry].tdesc0.pktsize = pktlen;
551
 		vptr->td_rings[entry].td_buf[0].pa_low = virt_to_bus(ptxb);
551
 		vptr->td_rings[entry].td_buf[0].pa_low = virt_to_bus(ptxb);
552
 		vptr->td_rings[entry].td_buf[0].pa_high &=
552
 		vptr->td_rings[entry].td_buf[0].pa_high &=
553
-		    cpu_to_le32(0xffff0000L);
553
+		    cpu_to_le32(0xffff0000UL);
554
 		vptr->td_rings[entry].td_buf[0].bufsize =
554
 		vptr->td_rings[entry].td_buf[0].bufsize =
555
 		    vptr->td_rings[entry].tdesc0.pktsize;
555
 		    vptr->td_rings[entry].tdesc0.pktsize;
556
 		vptr->td_rings[entry].tdesc1.CMDZ = 2;
556
 		vptr->td_rings[entry].tdesc1.CMDZ = 2;

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

7
  *
7
  *
8
  */
8
  */
9
 
9
 
10
+#include <stdint.h>
11
+
10
 /**
12
 /**
11
  * @defgroup commtypes Communication semantics
13
  * @defgroup commtypes Communication semantics
12
  *
14
  *
14
  */
16
  */
15
 
17
 
16
 /** Connection-based, reliable streams */
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
 /** Connectionless, unreliable streams */
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
 		container_of ( snp, struct efi_snp_device, snp );
173
 		container_of ( snp, struct efi_snp_device, snp );
174
 	int rc;
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
 	if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) {
180
 	if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) {
180
 		DBGC ( snpdev, "SNPDEV %p could not open %s: %s\n",
181
 		DBGC ( snpdev, "SNPDEV %p could not open %s: %s\n",
252
 		container_of ( snp, struct efi_snp_device, snp );
253
 		container_of ( snp, struct efi_snp_device, snp );
253
 	unsigned int i;
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
 		snpdev, enable, disable, ( mcast_reset ? " reset" : "" ),
257
 		snpdev, enable, disable, ( mcast_reset ? " reset" : "" ),
257
-		mcast_count );
258
+		( ( unsigned long ) mcast_count ) );
258
 	for ( i = 0 ; i < mcast_count ; i++ ) {
259
 	for ( i = 0 ; i < mcast_count ; i++ ) {
259
 		DBGC2_HDA ( snpdev, i, &mcast[i],
260
 		DBGC2_HDA ( snpdev, i, &mcast[i],
260
 			    snpdev->netdev->ll_protocol->ll_addr_len );
261
 			    snpdev->netdev->ll_protocol->ll_addr_len );
390
 	struct efi_snp_device *snpdev =
391
 	struct efi_snp_device *snpdev =
391
 		container_of ( snp, struct efi_snp_device, snp );
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
 	if ( ! read )
397
 	if ( ! read )
396
 		DBGC2_HDA ( snpdev, offset, data, len );
398
 		DBGC2_HDA ( snpdev, offset, data, len );
397
 
399
 
492
 	int rc;
494
 	int rc;
493
 	EFI_STATUS efirc;
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
 	if ( ll_header_len ) {
499
 	if ( ll_header_len ) {
497
 		if ( ll_src ) {
500
 		if ( ll_src ) {
498
 			DBGC2 ( snpdev, " src %s",
501
 			DBGC2 ( snpdev, " src %s",
512
 	if ( ll_header_len ) {
515
 	if ( ll_header_len ) {
513
 		if ( ll_header_len != ll_protocol->ll_header_len ) {
516
 		if ( ll_header_len != ll_protocol->ll_header_len ) {
514
 			DBGC ( snpdev, "SNPDEV %p TX invalid header length "
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
 			efirc = EFI_INVALID_PARAMETER;
520
 			efirc = EFI_INVALID_PARAMETER;
517
 			goto err_sanity;
521
 			goto err_sanity;
518
 		}
522
 		}
519
 		if ( len < ll_header_len ) {
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
 			efirc = EFI_BUFFER_TOO_SMALL;
526
 			efirc = EFI_BUFFER_TOO_SMALL;
523
 			goto err_sanity;
527
 			goto err_sanity;
524
 		}
528
 		}
541
 	/* Allocate buffer */
545
 	/* Allocate buffer */
542
 	iobuf = alloc_iob ( len );
546
 	iobuf = alloc_iob ( len );
543
 	if ( ! iobuf ) {
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
 		efirc = EFI_DEVICE_ERROR;
550
 		efirc = EFI_DEVICE_ERROR;
547
 		goto err_alloc_iob;
551
 		goto err_alloc_iob;
548
 	}
552
 	}
610
 	int rc;
614
 	int rc;
611
 	EFI_STATUS efirc;
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
 	/* Poll the network device */
620
 	/* Poll the network device */
616
 	efi_snp_poll ( snpdev );
621
 	efi_snp_poll ( snpdev );
741
 		       driver, device, efi_strerror ( efirc ) );
746
 		       driver, device, efi_strerror ( efirc ) );
742
 		goto out_no_pci_location;
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
 	/* Look up corresponding network device */
754
 	/* Look up corresponding network device */
748
 	pci_busdevfn = PCI_BUSDEVFN ( pci_bus, PCI_DEVFN ( pci_dev, pci_fn ) );
755
 	pci_busdevfn = PCI_BUSDEVFN ( pci_bus, PCI_DEVFN ( pci_dev, pci_fn ) );
858
 	/* Sanity check */
865
 	/* Sanity check */
859
 	if ( netdev->ll_protocol->ll_addr_len > sizeof ( EFI_MAC_ADDRESS ) ) {
866
 	if ( netdev->ll_protocol->ll_addr_len > sizeof ( EFI_MAC_ADDRESS ) ) {
860
 		DBGC ( snpdev, "SNPDEV %p cannot support link-layer address "
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
 		       netdev->ll_protocol->ll_addr_len, netdev->name );
869
 		       netdev->ll_protocol->ll_addr_len, netdev->name );
863
 		efirc = EFI_INVALID_PARAMETER;
870
 		efirc = EFI_INVALID_PARAMETER;
864
 		goto err_ll_addr_len;
871
 		goto err_ll_addr_len;
923
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
930
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
924
 	struct efi_snp_device *snpdev;
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
 	/* Locate SNP device */
936
 	/* Locate SNP device */
930
 	snpdev = efi_snp_snpdev ( driver, device );
937
 	snpdev = efi_snp_snpdev ( driver, device );

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

483
 	tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
483
 	tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
484
 
484
 
485
 	/* Dump header */
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
 	       tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
487
 	       tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
488
 	       ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
488
 	       ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
489
 	       ntohl ( tcphdr->ack ), len );
489
 	       ntohl ( tcphdr->ack ), len );
702
 
702
 
703
 	/* Ignore duplicate or out-of-range ACK */
703
 	/* Ignore duplicate or out-of-range ACK */
704
 	if ( ack_len > tcp->snd_sent ) {
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
 		       "sent only [%08x,%08x)\n", tcp, tcp->snd_seq,
706
 		       "sent only [%08x,%08x)\n", tcp, tcp->snd_seq,
707
 		       ( tcp->snd_seq + ack_len ), tcp->snd_seq,
707
 		       ( tcp->snd_seq + ack_len ), tcp->snd_seq,
708
 		       ( tcp->snd_seq + tcp->snd_sent ) );
708
 		       ( tcp->snd_seq + tcp->snd_sent ) );
894
 	len = iob_len ( iobuf );
894
 	len = iob_len ( iobuf );
895
 
895
 
896
 	/* Dump header */
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
 	       tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
898
 	       tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
899
 	       ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
899
 	       ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
900
 	       ( ntohl ( tcphdr->seq ) + len +
900
 	       ( ntohl ( tcphdr->seq ) + len +
1070
 
1070
 
1071
 /** TCP socket opener */
1071
 /** TCP socket opener */
1072
 struct socket_opener tcp_socket_opener __socket_opener = {
1072
 struct socket_opener tcp_socket_opener __socket_opener = {
1073
-	.semantics	= SOCK_STREAM,
1073
+	.semantics	= TCP_SOCK_STREAM,
1074
 	.family		= AF_INET,
1074
 	.family		= AF_INET,
1075
 	.open		= tcp_open,
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
  * Open TCP URI
1082
  * Open TCP URI

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

438
 
438
 
439
 /** UDP socket opener */
439
 /** UDP socket opener */
440
 struct socket_opener udp_socket_opener __socket_opener = {
440
 struct socket_opener udp_socket_opener __socket_opener = {
441
-	.semantics	= SOCK_DGRAM,
441
+	.semantics	= UDP_SOCK_DGRAM,
442
 	.family		= AF_INET,
442
 	.family		= AF_INET,
443
 	.open		= udp_open,
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
  * Open UDP URI
450
  * Open UDP URI

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

219
 	 */
219
 	 */
220
 	len = ( ( flsl ( value ) + 10 ) / 8 );
220
 	len = ( ( flsl ( value ) + 10 ) / 8 );
221
 	if ( len >= iob_tailroom ( iobuf ) ) {
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
 			slam, len );
223
 			slam, len );
224
 		return -ENOBUFS;
224
 		return -ENOBUFS;
225
 	}
225
 	}
380
 	len = ( *data >> 5 );
380
 	len = ( *data >> 5 );
381
 	if ( ( len == 0 ) ||
381
 	if ( ( len == 0 ) ||
382
 	     ( value && ( len > sizeof ( *value ) ) ) ) {
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
 		       slam, len );
384
 		       slam, len );
385
 		return -EINVAL;
385
 		return -EINVAL;
386
 	}
386
 	}

Loading…
Cancel
Save