Browse Source

[build] Fix misaligned table entries when using gcc 4.5

Declarations without the accompanying __table_entry cause misalignment
of the table entries when using gcc 4.5.  Fix by adding the
appropriate __table_entry macro or (where possible) by removing
unnecessary forward declarations.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Piotr Jaroszyński 14 years ago
parent
commit
b9eaf24df2

+ 1
- 1
src/arch/i386/core/video_subr.c View File

@@ -12,7 +12,7 @@
12 12
 #include <ipxe/init.h>
13 13
 #include "vga.h"
14 14
 
15
-struct console_driver vga_console;
15
+struct console_driver vga_console __console_driver;
16 16
 
17 17
 static char *vidmem;		/* The video buffer */
18 18
 static int video_line, video_col;

+ 2
- 4
src/include/ipxe/arp.h View File

@@ -10,9 +10,7 @@
10 10
 FILE_LICENCE ( GPL2_OR_LATER );
11 11
 
12 12
 #include <ipxe/tables.h>
13
-
14
-struct net_device;
15
-struct net_protocol;
13
+#include <ipxe/netdevice.h>
16 14
 
17 15
 /** A network-layer protocol that relies upon ARP */
18 16
 struct arp_net_protocol {
@@ -35,7 +33,7 @@ struct arp_net_protocol {
35 33
 /** Declare an ARP protocol */
36 34
 #define __arp_net_protocol __table_entry ( ARP_NET_PROTOCOLS, 01 )
37 35
 
38
-extern struct net_protocol arp_protocol;
36
+extern struct net_protocol arp_protocol __net_protocol;
39 37
 
40 38
 extern int arp_resolve ( struct net_device *netdev,
41 39
 			 struct net_protocol *net_protocol,

+ 1
- 1
src/include/ipxe/icmp6.h View File

@@ -15,7 +15,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
15 15
 #define ICMP6_NSOLICIT 135
16 16
 #define ICMP6_NADVERT 136
17 17
 
18
-extern struct tcpip_protocol icmp6_protocol;
18
+extern struct tcpip_protocol icmp6_protocol __tcpip_protocol;
19 19
 
20 20
 struct icmp6_header {
21 21
 	uint8_t type;

+ 2
- 3
src/include/ipxe/ip.h View File

@@ -13,10 +13,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
13 13
 #include <ipxe/in.h>
14 14
 #include <ipxe/list.h>
15 15
 #include <ipxe/retry.h>
16
+#include <ipxe/netdevice.h>
16 17
 
17 18
 struct io_buffer;
18
-struct net_device;
19
-struct net_protocol;
20 19
 
21 20
 /* IP constants */
22 21
 
@@ -92,6 +91,6 @@ struct frag_buffer {
92 91
 
93 92
 extern struct list_head ipv4_miniroutes;
94 93
 
95
-extern struct net_protocol ipv4_protocol;
94
+extern struct net_protocol ipv4_protocol __net_protocol;
96 95
 
97 96
 #endif /* _IPXE_IP_H */

+ 4
- 4
src/include/ipxe/ip6.h View File

@@ -11,6 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
11 11
 
12 12
 #include <stdint.h>
13 13
 #include <ipxe/in.h>
14
+#include <ipxe/netdevice.h>
15
+#include <ipxe/tcpip.h>
14 16
 
15 17
 /* IP6 constants */
16 18
 
@@ -64,11 +66,9 @@ struct ipv6_pseudo_header {
64 66
 #define IP6_NO_HEADER		0x59
65 67
 
66 68
 struct io_buffer;
67
-struct net_device;
68
-struct net_protocol;
69 69
 
70
-extern struct net_protocol ipv6_protocol;
71
-extern struct tcpip_net_protocol ipv6_tcpip_protocol;
70
+extern struct net_protocol ipv6_protocol __net_protocol;
71
+extern struct tcpip_net_protocol ipv6_tcpip_protocol __tcpip_net_protocol;
72 72
 extern char * inet6_ntoa ( struct in6_addr in6 );
73 73
 
74 74
 extern int add_ipv6_address ( struct net_device *netdev,

+ 2
- 2
src/include/ipxe/rarp.h View File

@@ -9,8 +9,8 @@
9 9
 
10 10
 FILE_LICENCE ( GPL2_OR_LATER );
11 11
 
12
-struct net_protocol;
12
+#include <ipxe/netdevice.h>
13 13
 
14
-extern struct net_protocol rarp_protocol;
14
+extern struct net_protocol rarp_protocol __net_protocol;
15 15
 
16 16
 #endif /* _IPXE_RARP_H */

+ 1
- 1
src/include/ipxe/tcp.h View File

@@ -342,6 +342,6 @@ static inline int tcp_in_window ( uint32_t seq, uint32_t start,
342 342
 	return ( ( seq - start ) < len );
343 343
 }
344 344
 
345
-extern struct tcpip_protocol tcp_protocol;
345
+extern struct tcpip_protocol tcp_protocol __tcpip_protocol;
346 346
 
347 347
 #endif /* _IPXE_TCP_H */

+ 1
- 1
src/net/aoe.c View File

@@ -44,7 +44,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
44 44
 
45 45
 FEATURE ( FEATURE_PROTOCOL, "AoE", DHCP_EB_FEATURE_AOE, 1 );
46 46
 
47
-struct net_protocol aoe_protocol;
47
+struct net_protocol aoe_protocol __net_protocol;
48 48
 
49 49
 /** List of all AoE sessions */
50 50
 static LIST_HEAD ( aoe_sessions );

+ 1
- 1
src/net/arp.c View File

@@ -63,7 +63,7 @@ static struct arp_entry arp_table[NUM_ARP_ENTRIES];
63 63
 
64 64
 static unsigned int next_new_arp_entry = 0;
65 65
 
66
-struct net_protocol arp_protocol;
66
+struct net_protocol arp_protocol __net_protocol;
67 67
 
68 68
 /**
69 69
  * Find entry in the ARP cache

+ 1
- 1
src/net/eth_slow.c View File

@@ -40,7 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
40 40
  * partner sends us.
41 41
  */
42 42
 
43
-struct net_protocol eth_slow_protocol;
43
+struct net_protocol eth_slow_protocol __net_protocol;
44 44
 
45 45
 /** Slow protocols multicast address */
46 46
 static const uint8_t eth_slow_address[ETH_ALEN] =

+ 0
- 2
src/net/icmpv6.c View File

@@ -11,8 +11,6 @@
11 11
 #include <ipxe/tcpip.h>
12 12
 #include <ipxe/netdevice.h>
13 13
 
14
-struct tcpip_protocol icmp6_protocol;
15
-
16 14
 /**
17 15
  * Send neighbour solicitation packet
18 16
  *

+ 0
- 2
src/net/ipv4.c View File

@@ -26,8 +26,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
26 26
 /* Unique IP datagram identification number */
27 27
 static uint16_t next_ident = 0;
28 28
 
29
-struct net_protocol ipv4_protocol;
30
-
31 29
 /** List of IPv4 miniroutes */
32 30
 struct list_head ipv4_miniroutes = LIST_HEAD_INIT ( ipv4_miniroutes );
33 31
 

+ 0
- 2
src/net/ipv6.c View File

@@ -15,8 +15,6 @@
15 15
 #include <ipxe/netdevice.h>
16 16
 #include <ipxe/if_ether.h>
17 17
 
18
-struct net_protocol ipv6_protocol;
19
-
20 18
 /* Unspecified IP6 address */
21 19
 static struct in6_addr ip6_none = {
22 20
         .in6_u.u6_addr32 = { 0,0,0,0 }

+ 1
- 1
src/net/udp.c View File

@@ -44,7 +44,7 @@ static LIST_HEAD ( udp_conns );
44 44
 
45 45
 /* Forward declatations */
46 46
 static struct interface_descriptor udp_xfer_desc;
47
-struct tcpip_protocol udp_protocol;
47
+struct tcpip_protocol udp_protocol __tcpip_protocol;
48 48
 
49 49
 /**
50 50
  * Bind UDP connection to local port

Loading…
Cancel
Save