From: Daniel Kiper Date: Wed, 8 Jun 2016 21:27:28 +0000 (+0200) Subject: multiboot2: Add C structure members alignment and padding consideration section X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5409d17bd30871568733992e49a2e3dcf55616c4;p=thirdparty%2Fgrub.git multiboot2: Add C structure members alignment and padding consideration section Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk --- diff --git a/doc/multiboot.texi b/doc/multiboot.texi index 1729c855d..0e073fa46 100644 --- a/doc/multiboot.texi +++ b/doc/multiboot.texi @@ -1398,6 +1398,7 @@ document, but are included for prospective operating system and boot loader writers. @menu +* C structure members alignment and padding consideration:: * Notes on PC:: * BIOS device mapping techniques:: * Example OS code:: @@ -1405,6 +1406,16 @@ loader writers. @end menu +@node C structure members alignment and padding consideration +@section C structure members alignment and padding consideration + +It is preferred that the structures used for communication between the bootloader +and the OS image conform to chosen ABI for a given architecture. If it is not +possible then GCC @samp{__attribute__ ((__packed__))} (or anything else which has +similar meaning for chosen C compiler) have to be added to relevant structures +definitions to avoid spurious, in this case, padding and alignment. + + @node Notes on PC @section Notes on PC