[MULTIBOOT2,DOC,v3,11/13] multiboot2: Add C structure members alignment and padding consideration section
diff mbox

Message ID 1481064781-16949-12-git-send-email-daniel.kiper@oracle.com
State New, archived
Headers show

Commit Message

Daniel Kiper Dec. 6, 2016, 10:52 p.m. UTC
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
v2 - suggestions/fixes:
   - rephrase whole section
     (suggested by Andrew Cooper).
---
 doc/multiboot.texi |   11 +++++++++++
 1 file changed, 11 insertions(+)

Patch
diff mbox

diff --git a/doc/multiboot.texi b/doc/multiboot.texi
index 35f2bed..f566114 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