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:
parent
ae8159b9ca
commit
7e47e27bd8
105 changed files with 403 additions and 391 deletions
|
@ -88,7 +88,7 @@ struct grub_nv_super
|
|||
char prodrev[NV_PRODREV_LEN]; /* 0x2C - 0x2F Array product revision */
|
||||
grub_uint32_t unit_flags; /* 0x30 - 0x33 Flags for this disk */
|
||||
struct grub_nv_array array; /* Array information */
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
static struct grub_diskfilter_vg *
|
||||
grub_dmraid_nv_detect (grub_disk_t disk,
|
||||
|
|
|
@ -95,7 +95,7 @@ struct grub_geli_key
|
|||
grub_uint8_t iv_key[64];
|
||||
grub_uint8_t cipher_key[64];
|
||||
grub_uint8_t hmac[64];
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
struct grub_geli_phdr
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ struct grub_geli_phdr
|
|||
grub_uint32_t niter;
|
||||
grub_uint8_t salt[64];
|
||||
struct grub_geli_key keys[2];
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -144,7 +144,7 @@ geli_rekey (struct grub_cryptodisk *dev, grub_uint64_t zoneno)
|
|||
const struct {
|
||||
char magic[4];
|
||||
grub_uint64_t zone;
|
||||
} __attribute__ ((packed)) tohash
|
||||
} GRUB_PACKED tohash
|
||||
= { {'e', 'k', 'e', 'y'}, grub_cpu_to_le64 (zoneno) };
|
||||
GRUB_PROPERLY_ALIGNED_ARRAY (key, GRUB_CRYPTO_MAX_MDLEN);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ struct grub_ldm_vblk {
|
|||
grub_uint8_t type;
|
||||
grub_uint32_t unused2;
|
||||
grub_uint8_t dynamic[104];
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
#define LDM_VBLK_MAGIC "VBLK"
|
||||
|
||||
enum
|
||||
|
@ -83,7 +83,7 @@ struct grub_ldm_label
|
|||
grub_uint64_t pv_size;
|
||||
grub_uint64_t config_start;
|
||||
grub_uint64_t config_size;
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
|
||||
#define LDM_MAGIC "PRIVHEAD"
|
||||
|
|
|
@ -56,7 +56,7 @@ struct grub_luks_phdr
|
|||
grub_uint32_t keyMaterialOffset;
|
||||
grub_uint32_t stripes;
|
||||
} keyblock[8];
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
typedef struct grub_luks_phdr *grub_luks_phdr_t;
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ struct grub_raid_super_1x
|
|||
*/
|
||||
grub_uint16_t dev_roles[0]; /* Role in array, or 0xffff for a spare, or 0xfffe for faulty. */
|
||||
};
|
||||
/* Could be __attribute__ ((packed)), but since all members in this struct
|
||||
/* Could be GRUB_PACKED, but since all members in this struct
|
||||
are already appropriately aligned, we can omit this and avoid suboptimal
|
||||
assembly in some cases. */
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ struct grub_raid_super_09
|
|||
* Active descriptor
|
||||
*/
|
||||
struct grub_raid_disk_09 this_disk;
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
static struct grub_diskfilter_vg *
|
||||
grub_mdraid_detect (grub_disk_t disk,
|
||||
|
|
|
@ -44,7 +44,7 @@ struct grub_usbms_cbw
|
|||
grub_uint8_t lun;
|
||||
grub_uint8_t length;
|
||||
grub_uint8_t cbwcb[16];
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
struct grub_usbms_csw
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ struct grub_usbms_csw
|
|||
grub_uint32_t tag;
|
||||
grub_uint32_t residue;
|
||||
grub_uint8_t status;
|
||||
} __attribute__ ((packed));
|
||||
} GRUB_PACKED;
|
||||
|
||||
struct grub_usbms_dev
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue