From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ik4On-00087j-RU for mharc-grub-devel@gnu.org; Mon, 22 Oct 2007 17:01:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ik4On-00086u-02 for grub-devel@gnu.org; Mon, 22 Oct 2007 17:01:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ik4Ok-00082p-3Y for grub-devel@gnu.org; Mon, 22 Oct 2007 17:01:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ik4Oj-00082h-Nq for grub-devel@gnu.org; Mon, 22 Oct 2007 17:01:17 -0400 Received: from mailout09.sul.t-online.de ([194.25.134.84] helo=mailout09.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ik4Ns-0004Qi-4p for grub-devel@gnu.org; Mon, 22 Oct 2007 17:00:24 -0400 Received: from fwd35.aul.t-online.de by mailout09.sul.t-online.com with smtp id 1Ik4Nn-0003YK-02; Mon, 22 Oct 2007 23:00:19 +0200 Received: from [10.3.2.2] (T5N2CcZvohlmiufSvhBeYgpwwA3hsUWeaYln7LNwWjYtzf6lGTzAbLVYFrZ74zBZdh@[217.235.227.40]) by fwd35.aul.t-online.de with esmtp id 1Ik4Nd-1Xk2lM0; Mon, 22 Oct 2007 23:00:09 +0200 Message-ID: <471D0F5B.20805@t-online.de> Date: Mon, 22 Oct 2007 23:00:11 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------050603030008090805000608" X-ID: T5N2CcZvohlmiufSvhBeYgpwwA3hsUWeaYln7LNwWjYtzf6lGTzAbLVYFrZ74zBZdh X-TOI-MSGID: 17c8efcf-0671-49eb-83dd-07432f184a53 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] Fix packing issue of machine_mmap_entry X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2007 21:01:21 -0000 This is a multi-part message in MIME format. --------------050603030008090805000608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 * 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. --------------050603030008090805000608 Content-Type: text/x-patch; name="grub2-machine_mmap_entry.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-machine_mmap_entry.patch" --- 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. */ --------------050603030008090805000608--