[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>
This commit is contained in:
Piotr Jaroszyński
2010-08-19 23:39:17 +02:00
committed by Michael Brown
parent 49d6f57005
commit b9eaf24df2
14 changed files with 17 additions and 26 deletions

View File

@@ -10,9 +10,7 @@
FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/tables.h>
struct net_device;
struct net_protocol;
#include <ipxe/netdevice.h>
/** A network-layer protocol that relies upon ARP */
struct arp_net_protocol {
@@ -35,7 +33,7 @@ struct arp_net_protocol {
/** Declare an ARP protocol */
#define __arp_net_protocol __table_entry ( ARP_NET_PROTOCOLS, 01 )
extern struct net_protocol arp_protocol;
extern struct net_protocol arp_protocol __net_protocol;
extern int arp_resolve ( struct net_device *netdev,
struct net_protocol *net_protocol,

View File

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

View File

@@ -13,10 +13,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/in.h>
#include <ipxe/list.h>
#include <ipxe/retry.h>
#include <ipxe/netdevice.h>
struct io_buffer;
struct net_device;
struct net_protocol;
/* IP constants */
@@ -92,6 +91,6 @@ struct frag_buffer {
extern struct list_head ipv4_miniroutes;
extern struct net_protocol ipv4_protocol;
extern struct net_protocol ipv4_protocol __net_protocol;
#endif /* _IPXE_IP_H */

View File

@@ -11,6 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
#include <ipxe/in.h>
#include <ipxe/netdevice.h>
#include <ipxe/tcpip.h>
/* IP6 constants */
@@ -64,11 +66,9 @@ struct ipv6_pseudo_header {
#define IP6_NO_HEADER 0x59
struct io_buffer;
struct net_device;
struct net_protocol;
extern struct net_protocol ipv6_protocol;
extern struct tcpip_net_protocol ipv6_tcpip_protocol;
extern struct net_protocol ipv6_protocol __net_protocol;
extern struct tcpip_net_protocol ipv6_tcpip_protocol __tcpip_net_protocol;
extern char * inet6_ntoa ( struct in6_addr in6 );
extern int add_ipv6_address ( struct net_device *netdev,

View File

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

View File

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