From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cA0pK-0000BL-Nf for mharc-grub-devel@gnu.org; Thu, 24 Nov 2016 15:41:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cA0pI-00008j-5z for grub-devel@gnu.org; Thu, 24 Nov 2016 15:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cA0pE-00026r-42 for grub-devel@gnu.org; Thu, 24 Nov 2016 15:41:00 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:37621) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cA0pD-00026B-Qu for grub-devel@gnu.org; Thu, 24 Nov 2016 15:40:56 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAOKepC6004708 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Nov 2016 20:40:51 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id uAOKeoSE000707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Nov 2016 20:40:51 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAOKeoOq025441; Thu, 24 Nov 2016 20:40:50 GMT Received: from olila.local.net-space.pl (/10.175.249.101) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Nov 2016 12:40:50 -0800 From: Daniel Kiper To: grub-devel@gnu.org, xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, arvidjaar@gmail.com, eric.snowberg@oracle.com, jgross@suse.com, konrad.wilk@oracle.com, phcoder@gmail.com, seth.goldberg@oracle.com Subject: [MULTIBOOT2 DOC PATCH v2 09/11] multiboot2: Add C structure members alignment and padding consideration section Date: Thu, 24 Nov 2016 21:40:08 +0100 Message-Id: <1480020010-18421-10-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1480020010-18421-1-git-send-email-daniel.kiper@oracle.com> References: <1480020010-18421-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2016 20:41:01 -0000 Signed-off-by: Daniel Kiper --- v2 - suggestions/fixes: - rephrase whole section (suggested by Andrew Cooper). --- doc/multiboot.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/multiboot.texi b/doc/multiboot.texi index 9461890..fe134bc 100644 --- a/doc/multiboot.texi +++ b/doc/multiboot.texi @@ -1391,6 +1391,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:: @@ -1398,6 +1399,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 -- 1.7.10.4