From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cEOcm-0006VD-S8 for mharc-grub-devel@gnu.org; Tue, 06 Dec 2016 17:54:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEOci-0006Qv-Jd for grub-devel@gnu.org; Tue, 06 Dec 2016 17:54:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEOcf-0005qo-HT for grub-devel@gnu.org; Tue, 06 Dec 2016 17:54:08 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:33241) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cEOcf-0005qV-7o for grub-devel@gnu.org; Tue, 06 Dec 2016 17:54:05 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uB6MrwHM003290 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Dec 2016 22:53:59 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uB6MrwMm010384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Dec 2016 22:53:58 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uB6MrvAT014930; Tue, 6 Dec 2016 22:53:57 GMT Received: from olila.local.net-space.pl (/10.175.227.19) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Dec 2016 14:53:57 -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, tsoome@me.com Subject: [MULTIBOOT2 DOC PATCH v3 11/13] multiboot2: Add C structure members alignment and padding consideration section Date: Tue, 6 Dec 2016 23:52:59 +0100 Message-Id: <1481064781-16949-12-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1481064781-16949-1-git-send-email-daniel.kiper@oracle.com> References: <1481064781-16949-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] 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: Tue, 06 Dec 2016 22:54:11 -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 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 -- 1.7.10.4