Add gcc_struct to all packed structures when compiling with mingw.

Just "packed" doesn't always pack the way we expect.
This commit is contained in:
Vladimir Serbinenko 2013-12-15 14:14:30 +01:00
parent ae8159b9ca
commit 7e47e27bd8
105 changed files with 403 additions and 391 deletions

View file

@ -43,7 +43,7 @@ struct arphdr {
grub_uint8_t hln;
grub_uint8_t pln;
grub_uint16_t op;
} __attribute__ ((packed));
} GRUB_PACKED;
static int have_pending;
static grub_uint32_t pending_req;

View file

@ -86,7 +86,7 @@ struct dns_header
grub_uint16_t ancount;
grub_uint16_t nscount;
grub_uint16_t arcount;
} __attribute__ ((packed));
} GRUB_PACKED;
enum
{

View file

@ -45,7 +45,7 @@ struct grub_pxe_undi_open
grub_uint16_t pkt_filter;
grub_uint16_t mcast_count;
grub_uint8_t mcast[8][6];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxe_undi_info
{
@ -60,7 +60,7 @@ struct grub_pxe_undi_info
grub_uint32_t romaddr;
grub_uint16_t rxbufct;
grub_uint16_t txbufct;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxe_undi_isr
@ -73,7 +73,7 @@ struct grub_pxe_undi_isr
grub_uint32_t buffer;
grub_uint8_t prot_type;
grub_uint8_t pkt_type;
} __attribute__ ((packed));
} GRUB_PACKED;
enum
{
@ -104,7 +104,7 @@ struct grub_pxe_undi_transmit
grub_uint32_t dest;
grub_uint32_t tbd;
grub_uint32_t reserved[2];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxe_undi_tbd
{
@ -118,7 +118,7 @@ struct grub_pxe_undi_tbd
grub_uint16_t len;
grub_uint32_t ptr;
} blocks[8];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxe_bangpxe *grub_pxe_pxenv;
static grub_uint32_t pxe_rm_entry = 0;

View file

@ -33,20 +33,20 @@ struct etherhdr
grub_uint8_t dst[6];
grub_uint8_t src[6];
grub_uint16_t type;
} __attribute__ ((packed));
} GRUB_PACKED;
struct llchdr
{
grub_uint8_t dsap;
grub_uint8_t ssap;
grub_uint8_t ctrl;
} __attribute__ ((packed));
} GRUB_PACKED;
struct snaphdr
{
grub_uint8_t oui[3];
grub_uint16_t type;
} __attribute__ ((packed));
} GRUB_PACKED;
grub_err_t
send_ethernet_packet (struct grub_net_network_level_interface *inf,

View file

@ -25,13 +25,13 @@ struct icmp_header
grub_uint8_t type;
grub_uint8_t code;
grub_uint16_t checksum;
} __attribute__ ((packed));
} GRUB_PACKED;
struct ping_header
{
grub_uint16_t id;
grub_uint16_t seq;
} __attribute__ ((packed));
} GRUB_PACKED;
enum
{

View file

@ -25,13 +25,13 @@ struct icmp_header
grub_uint8_t type;
grub_uint8_t code;
grub_uint16_t checksum;
} __attribute__ ((packed));
} GRUB_PACKED;
struct ping_header
{
grub_uint16_t id;
grub_uint16_t seq;
} __attribute__ ((packed));
} GRUB_PACKED;
struct router_adv
{
@ -41,13 +41,13 @@ struct router_adv
grub_uint32_t reachable_time;
grub_uint32_t retrans_timer;
grub_uint8_t options[0];
} __attribute__ ((packed));
} GRUB_PACKED;
struct option_header
{
grub_uint8_t type;
grub_uint8_t len;
} __attribute__ ((packed));
} GRUB_PACKED;
struct prefix_option
{
@ -58,19 +58,19 @@ struct prefix_option
grub_uint32_t preferred_lifetime;
grub_uint32_t reserved;
grub_uint64_t prefix[2];
} __attribute__ ((packed));
} GRUB_PACKED;
struct neighbour_solicit
{
grub_uint32_t reserved;
grub_uint64_t target[2];
} __attribute__ ((packed));
} GRUB_PACKED;
struct neighbour_advertise
{
grub_uint32_t flags;
grub_uint64_t target[2];
} __attribute__ ((packed));
} GRUB_PACKED;
enum
{

View file

@ -38,7 +38,7 @@ struct iphdr {
grub_uint16_t chksum;
grub_uint32_t src;
grub_uint32_t dest;
} __attribute__ ((packed)) ;
} GRUB_PACKED ;
enum
{
@ -56,7 +56,7 @@ struct ip6hdr {
grub_uint8_t ttl;
ip6addr src;
ip6addr dest;
} __attribute__ ((packed)) ;
} GRUB_PACKED ;
static int
cmp (const void *a__, const void *b__)

View file

@ -104,7 +104,7 @@ struct tcphdr
grub_uint16_t window;
grub_uint16_t checksum;
grub_uint16_t urgent;
} __attribute__ ((packed));
} GRUB_PACKED;
struct tcp_pseudohdr
{
@ -113,7 +113,7 @@ struct tcp_pseudohdr
grub_uint8_t zero;
grub_uint8_t proto;
grub_uint16_t tcp_length;
} __attribute__ ((packed));
} GRUB_PACKED;
struct tcp6_pseudohdr
{
@ -122,7 +122,7 @@ struct tcp6_pseudohdr
grub_uint32_t tcp_length;
grub_uint8_t zero[3];
grub_uint8_t proto;
} __attribute__ ((packed));
} GRUB_PACKED;
static struct grub_net_tcp_socket *tcp_sockets;
static struct grub_net_tcp_listen *tcp_listens;

View file

@ -94,7 +94,7 @@ struct tftphdr {
grub_int8_t data[TFTP_DEFAULTSIZE_PACKET+2];
} oack;
} u;
} __attribute__ ((packed)) ;
} GRUB_PACKED ;
typedef struct tftp_data