From: Christian Franke <Christian.Franke@t-online.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Fix packing issue of machine_mmap_entry
Date: Fri, 09 Nov 2007 20:55:49 +0100 [thread overview]
Message-ID: <4734BB45.2030909@t-online.de> (raw)
In-Reply-To: <87hcjvmsc7.fsf@xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]
Marco Gerards wrote:
>> ...
>> Add compile time assert to check packing.
>>
>
> Can you remove the compile time assert?
Done.
> We usually check stuff like
> this using configure. If you can send in a patch for configure.ac,
> that would be appreciated.
>
>
Yes, but be patient.
The configure approach is quite different: In configure, you can check
whether compiler supports attr packed and whether it works as expected.
With the good old typedef compile time assert, you can check whether
this *specific* structure is properly declared and packed.
>> --- 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 */
>>
>
> I do not think this comment is required. It's fixed now :-)
>
>
Hmm...OK removed. Now there is no clue why this struct has packing
requirements. And this also is no longer checked.
Christian
2007-11-09 Christian Franke <franke@computer.org>
* 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.
[-- Attachment #2: grub2-machine_mmap_entry-2.patch --]
[-- Type: text/x-patch, Size: 361 bytes --]
--- grub2.orig/include/grub/i386/pc/init.h 2007-10-31 23:55:57.093750000 +0100
+++ grub2/include/grub/i386/pc/init.h 2007-11-09 20:27:52.312500000 +0100
@@ -39,7 +39,7 @@
grub_uint64_t addr;
grub_uint64_t len;
grub_uint32_t type;
-};
+} __attribute__((packed));
/* Get a memory map entry. Return next continuation value. Zero means
the end. */
next prev parent reply other threads:[~2007-11-09 19:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 21:00 [PATCH] Fix packing issue of machine_mmap_entry Christian Franke
2007-10-23 5:34 ` Robert Millan
2007-10-23 8:09 ` Christian Franke
2007-11-09 14:00 ` Marco Gerards
2007-11-09 19:55 ` Christian Franke [this message]
2007-11-10 15:55 ` Marco Gerards
2007-11-18 7:11 ` Robert Millan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4734BB45.2030909@t-online.de \
--to=christian.franke@t-online.de \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.