Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
pjaroszynski authored and mcb30 committed Aug 20, 2010
1 parent 49d6f57 commit b9eaf24
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/arch/i386/core/video_subr.c
Expand Up @@ -12,7 +12,7 @@
#include <ipxe/init.h>
#include "vga.h"

struct console_driver vga_console;
struct console_driver vga_console __console_driver;

static char *vidmem; /* The video buffer */
static int video_line, video_col;
Expand Down
6 changes: 2 additions & 4 deletions src/include/ipxe/arp.h
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/include/ipxe/icmp6.h
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/include/ipxe/ip.h
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 */
8 changes: 4 additions & 4 deletions src/include/ipxe/ip6.h
Expand Up @@ -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 */

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/include/ipxe/rarp.h
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion src/include/ipxe/tcp.h
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion src/net/aoe.c
Expand Up @@ -44,7 +44,7 @@ FILE_LICENCE ( GPL2_OR_LATER );

FEATURE ( FEATURE_PROTOCOL, "AoE", DHCP_EB_FEATURE_AOE, 1 );

struct net_protocol aoe_protocol;
struct net_protocol aoe_protocol __net_protocol;

/** List of all AoE sessions */
static LIST_HEAD ( aoe_sessions );
Expand Down
2 changes: 1 addition & 1 deletion src/net/arp.c
Expand Up @@ -63,7 +63,7 @@ static struct arp_entry arp_table[NUM_ARP_ENTRIES];

static unsigned int next_new_arp_entry = 0;

struct net_protocol arp_protocol;
struct net_protocol arp_protocol __net_protocol;

/**
* Find entry in the ARP cache
Expand Down
2 changes: 1 addition & 1 deletion src/net/eth_slow.c
Expand Up @@ -40,7 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
* partner sends us.
*/

struct net_protocol eth_slow_protocol;
struct net_protocol eth_slow_protocol __net_protocol;

/** Slow protocols multicast address */
static const uint8_t eth_slow_address[ETH_ALEN] =
Expand Down
2 changes: 0 additions & 2 deletions src/net/icmpv6.c
Expand Up @@ -11,8 +11,6 @@
#include <ipxe/tcpip.h>
#include <ipxe/netdevice.h>

struct tcpip_protocol icmp6_protocol;

/**
* Send neighbour solicitation packet
*
Expand Down
2 changes: 0 additions & 2 deletions src/net/ipv4.c
Expand Up @@ -26,8 +26,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
/* Unique IP datagram identification number */
static uint16_t next_ident = 0;

struct net_protocol ipv4_protocol;

/** List of IPv4 miniroutes */
struct list_head ipv4_miniroutes = LIST_HEAD_INIT ( ipv4_miniroutes );

Expand Down
2 changes: 0 additions & 2 deletions src/net/ipv6.c
Expand Up @@ -15,8 +15,6 @@
#include <ipxe/netdevice.h>
#include <ipxe/if_ether.h>

struct net_protocol ipv6_protocol;

/* Unspecified IP6 address */
static struct in6_addr ip6_none = {
.in6_u.u6_addr32 = { 0,0,0,0 }
Expand Down
2 changes: 1 addition & 1 deletion src/net/udp.c
Expand Up @@ -44,7 +44,7 @@ static LIST_HEAD ( udp_conns );

/* Forward declatations */
static struct interface_descriptor udp_xfer_desc;
struct tcpip_protocol udp_protocol;
struct tcpip_protocol udp_protocol __tcpip_protocol;

/**
* Bind UDP connection to local port
Expand Down

0 comments on commit b9eaf24

Please sign in to comment.