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

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

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

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

15
 #define ICMP6_NSOLICIT 135
15
 #define ICMP6_NSOLICIT 135
16
 #define ICMP6_NADVERT 136
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
 struct icmp6_header {
20
 struct icmp6_header {
21
 	uint8_t type;
21
 	uint8_t type;

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

13
 #include <ipxe/in.h>
13
 #include <ipxe/in.h>
14
 #include <ipxe/list.h>
14
 #include <ipxe/list.h>
15
 #include <ipxe/retry.h>
15
 #include <ipxe/retry.h>
16
+#include <ipxe/netdevice.h>
16
 
17
 
17
 struct io_buffer;
18
 struct io_buffer;
18
-struct net_device;
19
-struct net_protocol;
20
 
19
 
21
 /* IP constants */
20
 /* IP constants */
22
 
21
 
92
 
91
 
93
 extern struct list_head ipv4_miniroutes;
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
 #endif /* _IPXE_IP_H */
96
 #endif /* _IPXE_IP_H */

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

11
 
11
 
12
 #include <stdint.h>
12
 #include <stdint.h>
13
 #include <ipxe/in.h>
13
 #include <ipxe/in.h>
14
+#include <ipxe/netdevice.h>
15
+#include <ipxe/tcpip.h>
14
 
16
 
15
 /* IP6 constants */
17
 /* IP6 constants */
16
 
18
 
64
 #define IP6_NO_HEADER		0x59
66
 #define IP6_NO_HEADER		0x59
65
 
67
 
66
 struct io_buffer;
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
 extern char * inet6_ntoa ( struct in6_addr in6 );
72
 extern char * inet6_ntoa ( struct in6_addr in6 );
73
 
73
 
74
 extern int add_ipv6_address ( struct net_device *netdev,
74
 extern int add_ipv6_address ( struct net_device *netdev,

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

9
 
9
 
10
 FILE_LICENCE ( GPL2_OR_LATER );
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
 #endif /* _IPXE_RARP_H */
16
 #endif /* _IPXE_RARP_H */

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

342
 	return ( ( seq - start ) < len );
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
 #endif /* _IPXE_TCP_H */
347
 #endif /* _IPXE_TCP_H */

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

44
 
44
 
45
 FEATURE ( FEATURE_PROTOCOL, "AoE", DHCP_EB_FEATURE_AOE, 1 );
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
 /** List of all AoE sessions */
49
 /** List of all AoE sessions */
50
 static LIST_HEAD ( aoe_sessions );
50
 static LIST_HEAD ( aoe_sessions );

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

63
 
63
 
64
 static unsigned int next_new_arp_entry = 0;
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
  * Find entry in the ARP cache
69
  * Find entry in the ARP cache

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

40
  * partner sends us.
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
 /** Slow protocols multicast address */
45
 /** Slow protocols multicast address */
46
 static const uint8_t eth_slow_address[ETH_ALEN] =
46
 static const uint8_t eth_slow_address[ETH_ALEN] =

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

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

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

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

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

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

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

44
 
44
 
45
 /* Forward declatations */
45
 /* Forward declatations */
46
 static struct interface_descriptor udp_xfer_desc;
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
  * Bind UDP connection to local port
50
  * Bind UDP connection to local port

Loading…
Cancel
Save