[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix packing issue of machine_mmap_entry
From: |
Christian Franke |
Subject: |
[PATCH] Fix packing issue of machine_mmap_entry |
Date: |
Mon, 22 Oct 2007 23:00:11 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 |
First patch related to the Cygwin port:
struct machine_mmap_entry is sensitive to packing of 64 bit values which
apparently differs between gcc releases.
Christian
2007-10-22 Christian Franke <address@hidden>
* include/grub/i386/pc/init.h (struct grub_machine_mmap_entry):
Add attribute packed, gcc 3.4.4 on Cygwin aligns this
to 64 bit boundary by default.
Add compile time assert to check packing.
--- grub2.orig/include/grub/i386/pc/init.h 2007-07-22 01:32:23.000000000
+0200
+++ grub2/include/grub/i386/pc/init.h 2007-10-13 21:25:24.000000000 +0200
@@ -40,10 +40,14 @@ grub_uint32_t grub_get_eisa_mmap (void);
struct grub_machine_mmap_entry
{
grub_uint32_t size;
- grub_uint64_t addr;
+ grub_uint64_t addr; /* must be at offset 4, see startup.S */
grub_uint64_t len;
grub_uint32_t type;
-};
+} __attribute__((packed));
+
+/* Compile time assert to check packing */
+typedef char ASSERT_sizeof_grub_machine_mmap_entry[
+ sizeof (struct grub_machine_mmap_entry) == 4+8+8+4 ? 1 : -1];
/* Get a memory map entry. Return next continuation value. Zero means
the end. */
- [PATCH] Fix packing issue of machine_mmap_entry,
Christian Franke <=