diff options
| author | Michael Brown | 2008-11-19 20:33:05 +0100 |
|---|---|---|
| committer | Michael Brown | 2008-11-19 20:33:05 +0100 |
| commit | 0ebbbb95fa03622423154a3e56251dd58832654d (patch) | |
| tree | 3bb6fa8df8158cf546a3fe42364cfd3d0b4ef831 /src/net | |
| parent | [build] Explicitly link efilink against -liberty (diff) | |
| download | ipxe-0ebbbb95fa03622423154a3e56251dd58832654d.tar.gz ipxe-0ebbbb95fa03622423154a3e56251dd58832654d.tar.xz ipxe-0ebbbb95fa03622423154a3e56251dd58832654d.zip | |
[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.
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/tcp.c | 11 | ||||
| -rw-r--r-- | src/net/udp.c | 5 | ||||
| -rw-r--r-- | src/net/udp/slam.c | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c index 3a9ab6217..4e0db464c 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -483,7 +483,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) { tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) ); /* 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 ), ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_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 */ 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, ( tcp->snd_seq + ack_len ), tcp->snd_seq, ( tcp->snd_seq + tcp->snd_sent ) ); @@ -894,7 +894,7 @@ static int tcp_rx ( struct io_buffer *iobuf, len = iob_len ( iobuf ); /* 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 ), ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + len + @@ -1070,12 +1070,13 @@ static struct xfer_interface_operations tcp_xfer_operations = { /** TCP socket opener */ struct socket_opener tcp_socket_opener __socket_opener = { - .semantics = SOCK_STREAM, + .semantics = TCP_SOCK_STREAM, .family = AF_INET, .open = tcp_open, }; -char TCP_SOCK_STREAM[1]; +/** Linkage hack */ +int tcp_sock_stream = TCP_SOCK_STREAM; /** * Open TCP URI diff --git a/src/net/udp.c b/src/net/udp.c index 407ea14db..fddf81df9 100644 --- a/src/net/udp.c +++ b/src/net/udp.c @@ -438,12 +438,13 @@ static struct xfer_interface_operations udp_xfer_operations = { /** UDP socket opener */ struct socket_opener udp_socket_opener __socket_opener = { - .semantics = SOCK_DGRAM, + .semantics = UDP_SOCK_DGRAM, .family = AF_INET, .open = udp_open, }; -char UDP_SOCK_DGRAM[1]; +/** Linkage hack */ +int udp_sock_dgram = UDP_SOCK_DGRAM; /** * Open UDP URI diff --git a/src/net/udp/slam.c b/src/net/udp/slam.c index cb0dfa5c3..6add99bc2 100644 --- a/src/net/udp/slam.c +++ b/src/net/udp/slam.c @@ -219,7 +219,7 @@ static int slam_put_value ( struct slam_request *slam, */ len = ( ( flsl ( value ) + 10 ) / 8 ); 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 ); return -ENOBUFS; } @@ -380,7 +380,7 @@ static int slam_pull_value ( struct slam_request *slam, len = ( *data >> 5 ); if ( ( len == 0 ) || ( 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 ); return -EINVAL; } |
