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

@ -34,7 +34,7 @@ struct grub_acpi_rsdp_v10
grub_uint8_t oemid[6];
grub_uint8_t revision;
grub_uint32_t rsdt_addr;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_acpi_rsdp_v20
{
@ -43,7 +43,7 @@ struct grub_acpi_rsdp_v20
grub_uint64_t xsdt_addr;
grub_uint8_t checksum;
grub_uint8_t reserved[3];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_acpi_table_header
{
@ -56,7 +56,7 @@ struct grub_acpi_table_header
grub_uint32_t oemrev;
grub_uint8_t creator_id[4];
grub_uint32_t creator_rev;
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_ACPI_FADT_SIGNATURE "FACP"
@ -71,7 +71,7 @@ struct grub_acpi_fadt
grub_uint64_t facs_xaddr;
grub_uint64_t dsdt_xaddr;
grub_uint8_t somefields3[96];
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_ACPI_MADT_SIGNATURE "APIC"
@ -124,7 +124,7 @@ struct grub_acpi_madt_entry_interrupt_override
grub_uint8_t source;
grub_uint32_t global_sys_interrupt;
grub_uint16_t flags;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_acpi_madt_entry_lapic_nmi
@ -133,7 +133,7 @@ struct grub_acpi_madt_entry_lapic_nmi
grub_uint8_t acpiid;
grub_uint16_t flags;
grub_uint8_t lint;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_acpi_madt_entry_sapic
{

View file

@ -86,7 +86,7 @@ struct grub_partition_bsd_entry
grub_uint8_t fs_type;
grub_uint8_t fs_fragments;
grub_uint16_t fs_cylinders;
} __attribute__ ((packed));
} GRUB_PACKED;
/* The BSD disk label. Only define members useful for GRUB. */
struct grub_partition_bsd_disk_label
@ -101,6 +101,6 @@ struct grub_partition_bsd_disk_label
grub_uint16_t num_partitions;
grub_uint32_t boot_size;
grub_uint32_t superblock_size;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* ! GRUB_PC_PARTITION_HEADER */

View file

@ -50,7 +50,7 @@ struct grub_btrfs_key
grub_uint64_t object_id;
grub_uint8_t type;
grub_uint64_t offset;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_btrfs_root_backref

View file

@ -98,7 +98,7 @@ struct cbfs_header {
grub_uint32_t offset;
grub_uint32_t architecture;
grub_uint32_t pad[1];
} __attribute__((packed));
} GRUB_PACKED;
/* "Unknown" refers to CBFS headers version 1,
* before the architecture was defined (i.e., x86 only).
@ -130,7 +130,7 @@ struct cbfs_file {
grub_uint32_t type;
grub_uint32_t checksum;
grub_uint32_t offset;
} __attribute__((packed));
} GRUB_PACKED;
/*** Component sub-headers ***/
@ -146,7 +146,7 @@ struct cbfs_stage {
grub_uint64_t load; /** Where to load in memory */
grub_uint32_t len; /** length of data to load */
grub_uint32_t memlen; /** total length of object in memory */
} __attribute__((packed));
} GRUB_PACKED;
/** this is the sub-header for payload components. Payloads
are loaded by coreboot at the end of the boot process */
@ -158,7 +158,7 @@ struct cbfs_payload_segment {
grub_uint64_t load_addr;
grub_uint32_t len;
grub_uint32_t mem_len;
} __attribute__((packed));
} GRUB_PACKED;
struct cbfs_payload {
struct cbfs_payload_segment segments;
@ -173,6 +173,6 @@ struct cbfs_payload {
struct cbfs_optionrom {
grub_uint32_t compression;
grub_uint32_t len;
} __attribute__((packed));
} GRUB_PACKED;
#endif

View file

@ -532,7 +532,7 @@ struct grub_efi_packed_guid
grub_uint16_t data2;
grub_uint16_t data3;
grub_uint8_t data4[8];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_packed_guid grub_efi_packed_guid_t;
/* XXX although the spec does not specify the padding, this actually
@ -545,7 +545,7 @@ struct grub_efi_memory_descriptor
grub_efi_virtual_address_t virtual_start;
grub_efi_uint64_t num_pages;
grub_efi_uint64_t attribute;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_memory_descriptor grub_efi_memory_descriptor_t;
/* Device Path definitions. */
@ -554,7 +554,7 @@ struct grub_efi_device_path
grub_efi_uint8_t type;
grub_efi_uint8_t subtype;
grub_efi_uint16_t length;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_device_path grub_efi_device_path_t;
/* XXX EFI does not define EFI_DEVICE_PATH_PROTOCOL but uses it.
It seems to be identical to EFI_DEVICE_PATH. */
@ -589,7 +589,7 @@ struct grub_efi_pci_device_path
grub_efi_device_path_t header;
grub_efi_uint8_t function;
grub_efi_uint8_t device;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_pci_device_path grub_efi_pci_device_path_t;
#define GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE 2
@ -598,7 +598,7 @@ struct grub_efi_pccard_device_path
{
grub_efi_device_path_t header;
grub_efi_uint8_t function;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_pccard_device_path grub_efi_pccard_device_path_t;
#define GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE 3
@ -609,7 +609,7 @@ struct grub_efi_memory_mapped_device_path
grub_efi_uint32_t memory_type;
grub_efi_physical_address_t start_address;
grub_efi_physical_address_t end_address;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_memory_mapped_device_path grub_efi_memory_mapped_device_path_t;
#define GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE 4
@ -619,7 +619,7 @@ struct grub_efi_vendor_device_path
grub_efi_device_path_t header;
grub_efi_packed_guid_t vendor_guid;
grub_efi_uint8_t vendor_defined_data[0];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_vendor_device_path grub_efi_vendor_device_path_t;
#define GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE 5
@ -628,7 +628,7 @@ struct grub_efi_controller_device_path
{
grub_efi_device_path_t header;
grub_efi_uint32_t controller_number;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_controller_device_path grub_efi_controller_device_path_t;
/* ACPI Device Path. */
@ -641,7 +641,7 @@ struct grub_efi_acpi_device_path
grub_efi_device_path_t header;
grub_efi_uint32_t hid;
grub_efi_uint32_t uid;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_acpi_device_path grub_efi_acpi_device_path_t;
#define GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE 2
@ -653,7 +653,7 @@ struct grub_efi_expanded_acpi_device_path
grub_efi_uint32_t uid;
grub_efi_uint32_t cid;
char hidstr[0];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_expanded_acpi_device_path grub_efi_expanded_acpi_device_path_t;
#define GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp) \
@ -676,7 +676,7 @@ struct grub_efi_atapi_device_path
grub_efi_uint8_t primary_secondary;
grub_efi_uint8_t slave_master;
grub_efi_uint16_t lun;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_atapi_device_path grub_efi_atapi_device_path_t;
#define GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE 2
@ -686,7 +686,7 @@ struct grub_efi_scsi_device_path
grub_efi_device_path_t header;
grub_efi_uint16_t pun;
grub_efi_uint16_t lun;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_scsi_device_path grub_efi_scsi_device_path_t;
#define GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE 3
@ -697,7 +697,7 @@ struct grub_efi_fibre_channel_device_path
grub_efi_uint32_t reserved;
grub_efi_uint64_t wwn;
grub_efi_uint64_t lun;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_fibre_channel_device_path grub_efi_fibre_channel_device_path_t;
#define GRUB_EFI_1394_DEVICE_PATH_SUBTYPE 4
@ -707,7 +707,7 @@ struct grub_efi_1394_device_path
grub_efi_device_path_t header;
grub_efi_uint32_t reserved;
grub_efi_uint64_t guid;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_1394_device_path grub_efi_1394_device_path_t;
#define GRUB_EFI_USB_DEVICE_PATH_SUBTYPE 5
@ -717,7 +717,7 @@ struct grub_efi_usb_device_path
grub_efi_device_path_t header;
grub_efi_uint8_t parent_port_number;
grub_efi_uint8_t usb_interface;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_usb_device_path grub_efi_usb_device_path_t;
#define GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE 15
@ -730,7 +730,7 @@ struct grub_efi_usb_class_device_path
grub_efi_uint8_t device_class;
grub_efi_uint8_t device_subclass;
grub_efi_uint8_t device_protocol;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_usb_class_device_path grub_efi_usb_class_device_path_t;
#define GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE 6
@ -739,7 +739,7 @@ struct grub_efi_i2o_device_path
{
grub_efi_device_path_t header;
grub_efi_uint32_t tid;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_i2o_device_path grub_efi_i2o_device_path_t;
#define GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE 11
@ -749,7 +749,7 @@ struct grub_efi_mac_address_device_path
grub_efi_device_path_t header;
grub_efi_mac_address_t mac_address;
grub_efi_uint8_t if_type;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_mac_address_device_path grub_efi_mac_address_device_path_t;
#define GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE 12
@ -763,7 +763,7 @@ struct grub_efi_ipv4_device_path
grub_efi_uint16_t remote_port;
grub_efi_uint16_t protocol;
grub_efi_uint8_t static_ip_address;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t;
#define GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE 13
@ -777,7 +777,7 @@ struct grub_efi_ipv6_device_path
grub_efi_uint16_t remote_port;
grub_efi_uint16_t protocol;
grub_efi_uint8_t static_ip_address;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_ipv6_device_path grub_efi_ipv6_device_path_t;
#define GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE 9
@ -790,7 +790,7 @@ struct grub_efi_infiniband_device_path
grub_efi_uint64_t remote_id;
grub_efi_uint64_t target_port_id;
grub_efi_uint64_t device_id;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_infiniband_device_path grub_efi_infiniband_device_path_t;
#define GRUB_EFI_UART_DEVICE_PATH_SUBTYPE 14
@ -803,7 +803,7 @@ struct grub_efi_uart_device_path
grub_efi_uint8_t data_bits;
grub_efi_uint8_t parity;
grub_efi_uint8_t stop_bits;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_uart_device_path grub_efi_uart_device_path_t;
#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
@ -813,7 +813,7 @@ struct grub_efi_vendor_messaging_device_path
grub_efi_device_path_t header;
grub_efi_packed_guid_t vendor_guid;
grub_efi_uint8_t vendor_defined_data[0];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_vendor_messaging_device_path grub_efi_vendor_messaging_device_path_t;
/* Media Device Path. */
@ -830,7 +830,7 @@ struct grub_efi_hard_drive_device_path
grub_efi_uint8_t partition_signature[16];
grub_efi_uint8_t partmap_type;
grub_efi_uint8_t signature_type;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_hard_drive_device_path grub_efi_hard_drive_device_path_t;
#define GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE 2
@ -841,7 +841,7 @@ struct grub_efi_cdrom_device_path
grub_efi_uint32_t boot_entry;
grub_efi_lba_t partition_start;
grub_efi_lba_t partition_size;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_cdrom_device_path grub_efi_cdrom_device_path_t;
#define GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE 3
@ -851,7 +851,7 @@ struct grub_efi_vendor_media_device_path
grub_efi_device_path_t header;
grub_efi_packed_guid_t vendor_guid;
grub_efi_uint8_t vendor_defined_data[0];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_vendor_media_device_path grub_efi_vendor_media_device_path_t;
#define GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE 4
@ -860,7 +860,7 @@ struct grub_efi_file_path_device_path
{
grub_efi_device_path_t header;
grub_efi_char16_t path_name[0];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_file_path_device_path grub_efi_file_path_device_path_t;
#define GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE 5
@ -869,7 +869,7 @@ struct grub_efi_protocol_device_path
{
grub_efi_device_path_t header;
grub_efi_packed_guid_t guid;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_path_t;
#define GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE 6
@ -878,7 +878,7 @@ struct grub_efi_piwg_device_path
{
grub_efi_device_path_t header;
grub_efi_packed_guid_t guid;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t;
@ -893,7 +893,7 @@ struct grub_efi_bios_device_path
grub_efi_uint16_t device_type;
grub_efi_uint16_t status_flags;
char description[0];
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_bios_device_path grub_efi_bios_device_path_t;
struct grub_efi_open_protocol_information_entry
@ -918,7 +918,7 @@ struct grub_efi_time
grub_efi_int16_t time_zone;
grub_efi_uint8_t daylight;
grub_efi_uint8_t pad2;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_time grub_efi_time_t;
struct grub_efi_time_capabilities
@ -1236,7 +1236,7 @@ struct grub_efi_configuration_table
{
grub_efi_packed_guid_t vendor_guid;
void *vendor_table;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_configuration_table grub_efi_configuration_table_t;
#define GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL

View file

@ -299,7 +299,7 @@ struct grub_pe32_symbol
grub_uint16_t type;
grub_uint8_t storage_class;
grub_uint8_t num_aux;
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_PE32_SYM_CLASS_EXTERNAL 2
#define GRUB_PE32_SYM_CLASS_STATIC 3
@ -312,7 +312,7 @@ struct grub_pe32_reloc
grub_uint32_t offset;
grub_uint32_t symtab_index;
grub_uint16_t type;
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_PE32_REL_I386_DIR32 0x6
#define GRUB_PE32_REL_I386_REL32 0x14

View file

@ -41,7 +41,7 @@ struct grub_efi_system_table32
grub_efi_uint32_t boot_services;
grub_efi_uint32_t num_table_entries;
grub_efi_uint32_t configuration_table;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_system_table32 grub_efi_system_table32_t;
struct grub_efi_system_table64
@ -60,7 +60,7 @@ struct grub_efi_system_table64
grub_efi_uint64_t boot_services;
grub_efi_uint64_t num_table_entries;
grub_efi_uint64_t configuration_table;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efi_system_table64 grub_efi_system_table64_t;
struct grub_efiemu_runtime_services32
@ -77,7 +77,7 @@ struct grub_efiemu_runtime_services32
grub_efi_uint32_t set_variable;
grub_efi_uint32_t get_next_high_monotonic_count;
grub_efi_uint32_t reset_system;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efiemu_runtime_services32 grub_efiemu_runtime_services32_t;
struct grub_efiemu_runtime_services64
@ -94,7 +94,7 @@ struct grub_efiemu_runtime_services64
grub_efi_uint64_t set_variable;
grub_efi_uint64_t get_next_high_monotonic_count;
grub_efi_uint64_t reset_system;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efiemu_runtime_services64 grub_efiemu_runtime_services64_t;
extern grub_efi_system_table32_t *grub_efiemu_system_table32;
@ -185,13 +185,13 @@ struct grub_efiemu_configuration_table32
{
grub_efi_packed_guid_t vendor_guid;
grub_efi_uint32_t vendor_table;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table32_t;
struct grub_efiemu_configuration_table64
{
grub_efi_packed_guid_t vendor_guid;
grub_efi_uint64_t vendor_table;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_efiemu_configuration_table64 grub_efiemu_configuration_table64_t;
grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid);
grub_err_t

View file

@ -25,7 +25,7 @@ struct grub_efiemu_ptv_rel
grub_efi_memory_type_t plustype;
grub_efi_memory_type_t minustype;
grub_uint32_t size;
} __attribute__ ((packed));
} GRUB_PACKED;
struct efi_variable
{
@ -33,5 +33,5 @@ struct efi_variable
grub_uint32_t namelen;
grub_uint32_t size;
grub_efi_uint32_t attributes;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */

View file

@ -41,7 +41,7 @@ struct grub_exfat_bpb
grub_uint8_t num_fats;
grub_uint8_t num_ph_drive;
grub_uint8_t reserved[8];
} __attribute__ ((packed));
} GRUB_PACKED;
#ifdef GRUB_UTIL
#include <grub/disk.h>

View file

@ -52,7 +52,7 @@ struct grub_fat_bpb
grub_uint32_t num_serial;
grub_uint8_t label[11];
grub_uint8_t fstype[8];
} __attribute__ ((packed)) fat12_or_fat16;
} GRUB_PACKED fat12_or_fat16;
struct
{
grub_uint32_t sectors_per_fat_32;
@ -68,9 +68,9 @@ struct grub_fat_bpb
grub_uint32_t num_serial;
grub_uint8_t label[11];
grub_uint8_t fstype[8];
} __attribute__ ((packed)) fat32;
} __attribute__ ((packed)) version_specific;
} __attribute__ ((packed));
} GRUB_PACKED fat32;
} GRUB_PACKED version_specific;
} GRUB_PACKED;
#ifdef GRUB_UTIL
#include <grub/disk.h>

View file

@ -66,7 +66,7 @@ struct grub_gpt_header
grub_uint32_t maxpart;
grub_uint32_t partentry_size;
grub_uint32_t partentry_crc32;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_gpt_partentry
{
@ -76,7 +76,7 @@ struct grub_gpt_partentry
grub_uint64_t end;
grub_uint64_t attrib;
char name[72];
} __attribute__ ((packed));
} GRUB_PACKED;
grub_err_t
grub_gpt_partition_map_iterate (grub_disk_t disk,

View file

@ -58,6 +58,6 @@ struct grub_hfs_sblock
grub_hfs_datarecord_t extent_recs;
grub_uint32_t catalog_size;
grub_hfs_datarecord_t catalog_recs;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* ! GRUB_HFS_HEADER */

View file

@ -9,7 +9,7 @@ struct grub_hfsplus_extent
grub_uint32_t start;
/* The amount of blocks described by this extent. */
grub_uint32_t count;
} __attribute__ ((packed));
} GRUB_PACKED;
/* The descriptor of a fork. */
struct grub_hfsplus_forkdata
@ -18,7 +18,7 @@ struct grub_hfsplus_forkdata
grub_uint32_t clumpsize;
grub_uint32_t blocks;
struct grub_hfsplus_extent extents[8];
} __attribute__ ((packed));
} GRUB_PACKED;
/* The HFS+ Volume Header. */
struct grub_hfsplus_volheader
@ -37,7 +37,7 @@ struct grub_hfsplus_volheader
struct grub_hfsplus_forkdata catalog_file;
struct grub_hfsplus_forkdata attr_file;
struct grub_hfsplus_forkdata startup_file;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_hfsplus_compress_index
{
@ -116,7 +116,7 @@ struct grub_hfsplus_attrkey
grub_uint16_t unknown2[2];
grub_uint16_t namelen;
grub_uint16_t name[0];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_hfsplus_attrkey_internal
{
@ -142,7 +142,7 @@ struct grub_hfsplus_catkey
grub_uint32_t parent;
grub_uint16_t namelen;
grub_uint16_t name[30];
} __attribute__ ((packed));
} GRUB_PACKED;
/* The on disk layout of an extent overflow file key. */
struct grub_hfsplus_extkey
@ -152,7 +152,7 @@ struct grub_hfsplus_extkey
grub_uint8_t unused;
grub_uint32_t fileid;
grub_uint32_t start;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_hfsplus_key
{
@ -163,7 +163,7 @@ struct grub_hfsplus_key
struct grub_hfsplus_attrkey attrkey;
grub_uint16_t keylen;
};
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_hfsplus_btnode
{
@ -173,7 +173,7 @@ struct grub_hfsplus_btnode
grub_uint8_t height;
grub_uint16_t count;
grub_uint16_t unused;
} __attribute__ ((packed));
} GRUB_PACKED;
/* Return the offset of the record with the index INDEX, in the node
NODE which is part of the B+ tree BTREE. */

View file

@ -64,7 +64,7 @@ struct grub_freebsd_bootinfo
grub_uint32_t kern_end;
grub_uint32_t environment;
grub_uint32_t tags;
} __attribute__ ((packed));
} GRUB_PACKED;
struct freebsd_tag_header
{

View file

@ -35,7 +35,7 @@ struct grub_linuxbios_timestamp_entry
{
grub_uint32_t id;
grub_uint64_t tsc;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_linuxbios_timestamp_table
{
@ -43,7 +43,7 @@ struct grub_linuxbios_timestamp_table
grub_uint32_t capacity;
grub_uint32_t used;
struct grub_linuxbios_timestamp_entry entries[0];
} __attribute__((packed));
} GRUB_PACKED;
struct grub_linuxbios_mainboard
{
@ -86,7 +86,7 @@ struct grub_linuxbios_table_framebuffer {
grub_uint8_t blue_mask_size;
grub_uint8_t reserved_field_pos;
grub_uint8_t reserved_mask_size;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_linuxbios_mem_region
{
@ -94,7 +94,7 @@ struct grub_linuxbios_mem_region
grub_uint64_t size;
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
grub_uint32_t type;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_linuxbios_mem_region *mem_region_t;
grub_err_t

View file

@ -60,13 +60,13 @@ struct grub_cpu_interrupt_gate
grub_uint8_t unused;
grub_uint8_t gate;
grub_uint16_t offset_hi;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_cpu_idt_descriptor
{
grub_uint16_t limit;
grub_uint32_t base;
} __attribute__ ((packed));
} GRUB_PACKED;
extern void (*grub_gdb_trapvec[]) (void);
void grub_gdb_idtinit (void);

View file

@ -74,7 +74,7 @@ struct grub_e820_mmap
grub_uint64_t addr;
grub_uint64_t size;
grub_uint32_t type;
} __attribute__((packed));
} GRUB_PACKED;
enum
{
@ -139,7 +139,7 @@ struct linux_kernel_header
grub_uint64_t setup_data;
grub_uint64_t pref_address;
grub_uint32_t init_size;
} __attribute__ ((packed));
} GRUB_PACKED;
/* Boot parameters for Linux based on 2.6.12. This is used by the setup
sectors of Linux, and must be simulated by GRUB on EFI, because
@ -309,7 +309,7 @@ struct linux_kernel_params
grub_uint8_t pad2[120]; /* 258 */
struct grub_e820_mmap e820_map[(0x400 - 0x2d0) / 20]; /* 2d0 */
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* ! ASM_FILE */
#endif /* ! GRUB_LINUX_MACHINE_HEADER */

View file

@ -36,7 +36,7 @@ struct grub_macho_thread32
grub_uint8_t unknown1[48];
grub_uint32_t entry_point;
grub_uint8_t unknown2[20];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_macho_thread64
@ -46,6 +46,6 @@ struct grub_macho_thread64
grub_uint8_t unknown1[0x88];
grub_uint64_t entry_point;
grub_uint8_t unknown2[0x20];
} __attribute__ ((packed));
} GRUB_PACKED;
#endif

View file

@ -92,7 +92,7 @@ struct grub_netbsd_btinfo_bootwedge {
grub_disk_addr_t matchblk;
grub_uint64_t matchnblks;
grub_uint8_t matchhash[16]; /* MD5 hash */
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_netbsd_btinfo_symtab
{

View file

@ -69,7 +69,7 @@ struct grub_openbsd_bootargs
grub_uint32_t ba_type;
grub_uint32_t ba_size;
grub_uint32_t ba_next;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_openbsd_bootarg_console
{

View file

@ -77,7 +77,7 @@ struct grub_biosdisk_drp
writes a garbage to the tail of drive parameters,
regardless of a size specified in a caller. */
grub_uint8_t dummy[16];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_biosdisk_cdrp
{
@ -94,7 +94,7 @@ struct grub_biosdisk_cdrp
grub_uint8_t sectors;
grub_uint8_t heads;
grub_uint8_t dummy[16];
} __attribute__ ((packed));
} GRUB_PACKED;
/* Disk Address Packet. */
struct grub_biosdisk_dap
@ -104,6 +104,6 @@ struct grub_biosdisk_dap
grub_uint16_t blocks;
grub_uint32_t buffer;
grub_uint64_t block;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* ! GRUB_BIOSDISK_MACHINE_HEADER */

View file

@ -58,7 +58,7 @@ struct grub_i386_idt
{
grub_uint16_t limit;
grub_uint32_t base;
} __attribute__ ((packed));
} GRUB_PACKED;
#ifdef GRUB_MACHINE_PCBIOS
extern struct grub_i386_idt *EXPORT_VAR(grub_realidt);

View file

@ -185,7 +185,7 @@ struct grub_pxenv
grub_uint16_t undi_code_seg; /* UNDI Code segment address. */
grub_uint16_t undi_code_size; /* UNDI Code segment size (bytes). */
grub_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct. */
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxe_bangpxe
{
@ -198,7 +198,7 @@ struct grub_pxe_bangpxe
grub_uint32_t undiromid;
grub_uint32_t baseromid;
grub_uint32_t rm_entry;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_get_cached_info
{
@ -207,7 +207,7 @@ struct grub_pxenv_get_cached_info
grub_uint16_t buffer_size;
grub_uint32_t buffer;
grub_uint16_t buffer_limit;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_tftp_open
{
@ -217,12 +217,12 @@ struct grub_pxenv_tftp_open
grub_uint8_t filename[128];
grub_uint16_t tftp_port;
grub_uint16_t packet_size;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_tftp_close
{
grub_uint16_t status;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_tftp_read
{
@ -230,7 +230,7 @@ struct grub_pxenv_tftp_read
grub_uint16_t packet_number;
grub_uint16_t buffer_size;
grub_uint32_t buffer;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_tftp_get_fsize
{
@ -239,18 +239,18 @@ struct grub_pxenv_tftp_get_fsize
grub_uint32_t gateway_ip;
grub_uint8_t filename[128];
grub_uint32_t file_size;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_udp_open
{
grub_uint16_t status;
grub_uint32_t src_ip;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_udp_close
{
grub_uint16_t status;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_udp_write
{
@ -261,7 +261,7 @@ struct grub_pxenv_udp_write
grub_uint16_t dst_port;
grub_uint16_t buffer_size;
grub_uint32_t buffer;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_udp_read
{
@ -272,13 +272,13 @@ struct grub_pxenv_udp_read
grub_uint16_t dst_port;
grub_uint16_t buffer_size;
grub_uint32_t buffer;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_pxenv_unload_stack
{
grub_uint16_t status;
grub_uint8_t reserved[10];
} __attribute__ ((packed));
} GRUB_PACKED;
int EXPORT_FUNC(grub_pxe_call) (int func, void * data, grub_uint32_t pxe_rm_entry) __attribute__ ((regparm(3)));

View file

@ -84,7 +84,7 @@ struct grub_vbe_info_block
grub_uint8_t reserved[222];
grub_uint8_t oem_data[256];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_vbe_mode_info_block
{
@ -147,7 +147,7 @@ struct grub_vbe_mode_info_block
that doesn't make structure to be 256 bytes. So additional one is
added here. */
grub_uint8_t reserved4[189 + 1];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_vbe_crtc_info_block
{
@ -161,7 +161,7 @@ struct grub_vbe_crtc_info_block
grub_uint32_t pixel_clock;
grub_uint16_t refresh_rate;
grub_uint8_t reserved[40];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_vbe_palette_data
{
@ -169,7 +169,7 @@ struct grub_vbe_palette_data
grub_uint8_t green;
grub_uint8_t red;
grub_uint8_t alignment;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_vbe_flat_panel_info
{
@ -184,7 +184,7 @@ struct grub_vbe_flat_panel_info
grub_vbe_farptr_t reserved_offscreen_mem_ptr;
grub_uint8_t reserved[14];
} __attribute__ ((packed));
} GRUB_PACKED;
/* Prototypes for helper functions. */
/* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */

View file

@ -61,7 +61,7 @@ struct grub_xnu_boot_params_common
grub_uint32_t efi_runtime_first_page;
/* First memory page containing runtime code or data minus previous value. */
grub_uint32_t efi_runtime_npages;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_xnu_boot_params_v1
{
@ -72,7 +72,7 @@ struct grub_xnu_boot_params_v1
grub_uint32_t efi_system_table;
/* Size of grub_efi_uintn_t in bits. */
grub_uint8_t efi_uintnbits;
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_XNU_BOOTARGSV1_VERMINOR 5
#define GRUB_XNU_BOOTARGSV1_VERMAJOR 1
@ -92,7 +92,7 @@ struct grub_xnu_boot_params_v2
grub_uint32_t unused2[11];
grub_uint64_t fsbfreq;
grub_uint32_t unused3[734];
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_XNU_BOOTARGSV2_VERMINOR 0
#define GRUB_XNU_BOOTARGSV2_VERMAJOR 2

View file

@ -41,13 +41,13 @@ struct grub_lvm_label_header {
grub_uint32_t crc_xl; /* From next field to end of sector */
grub_uint32_t offset_xl; /* Offset from start of struct to contents */
grub_int8_t type[8]; /* LVM2 001 */
} __attribute__ ((packed));
} GRUB_PACKED;
/* On disk */
struct grub_lvm_disk_locn {
grub_uint64_t offset; /* Offset in bytes to start sector */
grub_uint64_t size; /* Bytes */
} __attribute__ ((packed));
} GRUB_PACKED;
/* Fields with the suffix _xl should be xlate'd wherever they appear */
/* On disk */
@ -60,7 +60,7 @@ struct grub_lvm_pv_header {
/* NULL-terminated list of data areas followed by */
/* NULL-terminated list of metadata area headers */
struct grub_lvm_disk_locn disk_areas_xl[0]; /* Two lists */
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_LVM_FMTT_MAGIC "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076"
#define GRUB_LVM_FMTT_VERSION 1
@ -72,7 +72,7 @@ struct grub_lvm_raw_locn {
grub_uint64_t size; /* Bytes */
grub_uint32_t checksum;
grub_uint32_t filler;
} __attribute__ ((packed));
} GRUB_PACKED;
/* On disk */
/* Structure size limited to one sector */
@ -84,7 +84,7 @@ struct grub_lvm_mda_header {
grub_uint64_t size; /* Size of metadata area */
struct grub_lvm_raw_locn raw_locns[0]; /* NULL-terminated list */
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* ! GRUB_LVM_H */

View file

@ -25,7 +25,7 @@ struct grub_macho_fat_header
{
grub_uint32_t magic;
grub_uint32_t nfat_arch;
} __attribute__ ((packed));
} GRUB_PACKED;
enum
{
@ -47,7 +47,7 @@ struct grub_macho_fat_arch
grub_uint32_t offset;
grub_uint32_t size;
grub_uint32_t align;
} __attribute__ ((packed));
} GRUB_PACKED;
/* File header for 32-bit. Always in native-endian. */
struct grub_macho_header32
@ -60,7 +60,7 @@ struct grub_macho_header32
grub_uint32_t ncmds;
grub_uint32_t sizeofcmds;
grub_uint32_t flags;
} __attribute__ ((packed));
} GRUB_PACKED;
/* File header for 64-bit. Always in native-endian. */
struct grub_macho_header64
@ -74,14 +74,14 @@ struct grub_macho_header64
grub_uint32_t sizeofcmds;
grub_uint32_t flags;
grub_uint32_t reserved;
} __attribute__ ((packed));
} GRUB_PACKED;
/* Common header of Mach-O commands. */
struct grub_macho_cmd
{
grub_uint32_t cmd;
grub_uint32_t cmdsize;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef grub_uint32_t grub_macho_vmprot_t;
@ -100,7 +100,7 @@ struct grub_macho_segment32
grub_macho_vmprot_t initprot;
grub_uint32_t nsects;
grub_uint32_t flags;
} __attribute__ ((packed));
} GRUB_PACKED;
/* 64-bit segment command. */
struct grub_macho_segment64
@ -117,7 +117,7 @@ struct grub_macho_segment64
grub_macho_vmprot_t initprot;
grub_uint32_t nsects;
grub_uint32_t flags;
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_MACHO_CMD_THREAD 5
@ -137,7 +137,7 @@ union grub_macho_filestart
struct grub_macho_header32 thin32;
struct grub_macho_header64 thin64;
struct grub_macho_lzss_header lzss;
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_MACHO_LZSS_OFFSET 0x180

View file

@ -88,7 +88,7 @@ struct grub_msdos_partition_entry
/* The length in sector units. */
grub_uint32_t length;
} __attribute__ ((packed));
} GRUB_PACKED;
/* The structure of MBR. */
struct grub_msdos_partition_mbr
@ -101,7 +101,7 @@ struct grub_msdos_partition_mbr
/* The signature 0xaa55. */
grub_uint16_t signature;
} __attribute__ ((packed));
} GRUB_PACKED;

View file

@ -416,7 +416,7 @@ struct grub_net_bootp_packet
char server_name[64];
char boot_file[128];
grub_uint8_t vendor[0];
} __attribute__ ((packed));
} GRUB_PACKED;
#define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63
#define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82

View file

@ -27,7 +27,7 @@ struct udphdr
grub_uint16_t dst;
grub_uint16_t len;
grub_uint16_t chksum;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_net_udp_socket;
typedef struct grub_net_udp_socket *grub_net_udp_socket_t;

View file

@ -125,7 +125,7 @@ struct grub_ntfs_bpb
grub_int8_t reserved_6[3];
grub_uint64_t num_serial;
grub_uint32_t checksum;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_ntfs_attr
{

View file

@ -153,7 +153,7 @@ struct grub_pc_bios_boot_blocklist
grub_uint64_t start;
grub_uint16_t len;
grub_uint16_t segment;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif
#endif

View file

@ -34,7 +34,7 @@ struct grub_scsi_test_unit_ready
grub_uint8_t reserved3;
grub_uint8_t control;
grub_uint8_t pad[6]; /* To be ATAPI compatible */
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_inquiry
{
@ -45,7 +45,7 @@ struct grub_scsi_inquiry
grub_uint8_t alloc_length;
grub_uint8_t control;
grub_uint8_t pad[6]; /* To be ATAPI compatible */
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_inquiry_data
{
@ -57,7 +57,7 @@ struct grub_scsi_inquiry_data
char vendor[8];
char prodid[16];
char prodrev[4];
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_request_sense
{
@ -68,7 +68,7 @@ struct grub_scsi_request_sense
grub_uint8_t alloc_length;
grub_uint8_t control;
grub_uint8_t pad[6]; /* To be ATAPI compatible */
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_request_sense_data
{
@ -83,7 +83,7 @@ struct grub_scsi_request_sense_data
grub_uint8_t field_replaceable_unit_code;
grub_uint8_t sense_key_specific[3];
/* there can be additional sense field */
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read_capacity10
{
@ -95,13 +95,13 @@ struct grub_scsi_read_capacity10
grub_uint8_t PMI;
grub_uint8_t control;
grub_uint16_t pad; /* To be ATAPI compatible */
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read_capacity10_data
{
grub_uint32_t last_block;
grub_uint32_t blocksize;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read_capacity16
{
@ -111,14 +111,14 @@ struct grub_scsi_read_capacity16
grub_uint32_t alloc_len;
grub_uint8_t PMI;
grub_uint8_t control;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read_capacity16_data
{
grub_uint64_t last_block;
grub_uint32_t blocksize;
grub_uint8_t pad[20];
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read10
{
@ -129,7 +129,7 @@ struct grub_scsi_read10
grub_uint16_t size;
grub_uint8_t reserved2;
grub_uint16_t pad;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read12
{
@ -139,7 +139,7 @@ struct grub_scsi_read12
grub_uint32_t size;
grub_uint8_t reserved;
grub_uint8_t control;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_read16
{
@ -149,7 +149,7 @@ struct grub_scsi_read16
grub_uint32_t size;
grub_uint8_t reserved;
grub_uint8_t control;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_write10
{
@ -160,7 +160,7 @@ struct grub_scsi_write10
grub_uint16_t size;
grub_uint8_t reserved2;
grub_uint16_t pad;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_write12
{
@ -170,7 +170,7 @@ struct grub_scsi_write12
grub_uint32_t size;
grub_uint8_t reserved;
grub_uint8_t control;
} __attribute__((packed));
} GRUB_PACKED;
struct grub_scsi_write16
{
@ -180,7 +180,7 @@ struct grub_scsi_write16
grub_uint32_t size;
grub_uint8_t reserved;
grub_uint8_t control;
} __attribute__((packed));
} GRUB_PACKED;
typedef enum
{

View file

@ -57,7 +57,7 @@ struct grub_boot_blocklist
{
grub_uint64_t start;
grub_uint32_t len;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif
#endif /* ! BOOT_MACHINE_HEADER */

View file

@ -24,6 +24,12 @@
#include <grub/cpu/types.h>
#endif
#ifdef __MINGW32__
#define GRUB_PACKED __attribute__ ((packed,gcc_struct))
#else
#define GRUB_PACKED __attribute__ ((packed))
#endif
#ifdef GRUB_BUILD
# define GRUB_CPU_SIZEOF_VOID_P BUILD_SIZEOF_VOID_P
# define GRUB_CPU_SIZEOF_LONG BUILD_SIZEOF_LONG
@ -253,7 +259,7 @@ static inline grub_uint16_t grub_get_unaligned16 (const void *ptr)
struct grub_unaligned_uint16_t
{
grub_uint16_t d;
} __attribute__ ((packed));
} GRUB_PACKED;
const struct grub_unaligned_uint16_t *dd
= (const struct grub_unaligned_uint16_t *) ptr;
return dd->d;
@ -264,7 +270,7 @@ static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val)
struct grub_unaligned_uint16_t
{
grub_uint16_t d;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_unaligned_uint16_t *dd = (struct grub_unaligned_uint16_t *) ptr;
dd->d = val;
}
@ -274,7 +280,7 @@ static inline grub_uint32_t grub_get_unaligned32 (const void *ptr)
struct grub_unaligned_uint32_t
{
grub_uint32_t d;
} __attribute__ ((packed));
} GRUB_PACKED;
const struct grub_unaligned_uint32_t *dd
= (const struct grub_unaligned_uint32_t *) ptr;
return dd->d;
@ -285,7 +291,7 @@ static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
struct grub_unaligned_uint32_t
{
grub_uint32_t d;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_unaligned_uint32_t *dd = (struct grub_unaligned_uint32_t *) ptr;
dd->d = val;
}
@ -293,7 +299,7 @@ static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
struct grub_unaligned_uint64
{
grub_uint64_t val;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;
@ -309,7 +315,7 @@ static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)
struct grub_unaligned_uint64_t
{
grub_uint64_t d;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_unaligned_uint64_t *dd = (struct grub_unaligned_uint64_t *) ptr;
dd->d = val;
}

View file

@ -37,7 +37,7 @@ struct grub_unicode_compact_range
unsigned comb_type:8;
unsigned bidi_mirror:1;
unsigned join_type:3;
} __attribute__ ((packed));
} GRUB_PACKED;
/* Old-style Arabic shaping. Used for "visual UTF-8" and
in grub-mkfont to find variant glyphs in absence of GPOS tables. */

View file

@ -36,7 +36,7 @@ struct grub_usb_desc
{
grub_uint8_t length;
grub_uint8_t type;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_usb_desc_device
{
@ -54,7 +54,7 @@ struct grub_usb_desc_device
grub_uint8_t strprod;
grub_uint8_t strserial;
grub_uint8_t configcnt;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_usb_desc_config
{
@ -66,7 +66,7 @@ struct grub_usb_desc_config
grub_uint8_t strconfig;
grub_uint8_t attrib;
grub_uint8_t maxpower;
} __attribute__ ((packed));
} GRUB_PACKED;
#if 0
struct grub_usb_desc_if_association
@ -79,7 +79,7 @@ struct grub_usb_desc_if_association
grub_uint8_t subclass;
grub_uint8_t protocol;
grub_uint8_t function;
} __attribute__ ((packed));
} GRUB_PACKED;
#endif
struct grub_usb_desc_if
@ -93,7 +93,7 @@ struct grub_usb_desc_if
grub_uint8_t subclass;
grub_uint8_t protocol;
grub_uint8_t strif;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_usb_desc_endp
{
@ -103,14 +103,14 @@ struct grub_usb_desc_endp
grub_uint8_t attrib;
grub_uint16_t maxpacket;
grub_uint8_t interval;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_usb_desc_str
{
grub_uint8_t length;
grub_uint8_t type;
grub_uint16_t str[0];
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_usb_desc_debug
{
@ -118,7 +118,7 @@ struct grub_usb_desc_debug
grub_uint8_t type;
grub_uint8_t in_endp;
grub_uint8_t out_endp;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_usb_usb_hubdesc
{
@ -129,6 +129,6 @@ struct grub_usb_usb_hubdesc
grub_uint8_t pwdgood;
grub_uint8_t current;
/* Removable and power control bits follow. */
} __attribute__ ((packed));
} GRUB_PACKED;
#endif /* GRUB_USBDESC_H */

View file

@ -149,7 +149,7 @@ struct grub_usb_packet_setup
grub_uint16_t value;
grub_uint16_t index;
grub_uint16_t length;
} __attribute__((packed));
} GRUB_PACKED;
#endif /* GRUB_USBTRANS_H */

View file

@ -273,7 +273,7 @@ struct grub_video_edid_info
grub_uint8_t extension_flag;
grub_uint8_t checksum;
} __attribute__ ((packed));
} GRUB_PACKED;
typedef enum grub_video_driver_id
{

View file

@ -46,7 +46,7 @@ struct grub_xnu_hibernate_header
Used only to skip it.
*/
grub_uint32_t extmapsize;
} __attribute__ ((packed));
} GRUB_PACKED;
/* In-memory structure for temporary keeping device tree. */
struct grub_xnu_devtree_key
@ -67,7 +67,7 @@ grub_xnu_extdesc
{
grub_uint32_t addr;
grub_uint32_t size;
} __attribute__ ((packed));
} GRUB_PACKED;
/* Header describing extension in the memory. */
struct grub_xnu_extheader
@ -78,7 +78,7 @@ struct grub_xnu_extheader
grub_uint32_t binarysize;
grub_uint32_t nameaddr;
grub_uint32_t namesize;
} __attribute__ ((packed));
} GRUB_PACKED;
struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
const char *name);

View file

@ -91,7 +91,7 @@ typedef union zap_leaf_chunk {
{
grub_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES];
grub_uint64_t la_array64;
} __attribute__ ((packed));
} GRUB_PACKED;
grub_uint16_t la_next; /* next blk or CHAIN_END */
} l_array;
struct zap_leaf_free {

View file

@ -30,7 +30,7 @@
typedef struct zio_eck {
grub_uint64_t zec_magic; /* for validation, endianness */
zio_cksum_t zec_cksum; /* 256-bit checksum */
} __attribute__ ((packed)) zio_eck_t;
} GRUB_PACKED zio_eck_t;
/*
* Gang block headers are self-checksumming and contain an array