From patchwork Tue Dec 6 22:52:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9463365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E63A260231 for ; Tue, 6 Dec 2016 22:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D23F627D5D for ; Tue, 6 Dec 2016 22:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C737D284E9; Tue, 6 Dec 2016 22:57:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 798EB27D5D for ; Tue, 6 Dec 2016 22:57:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEOcl-0007gx-F9; Tue, 06 Dec 2016 22:54:11 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEOcj-0007el-VC for xen-devel@lists.xenproject.org; Tue, 06 Dec 2016 22:54:10 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id BE/6A-16850-19147485; Tue, 06 Dec 2016 22:54:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRWlGSWpSXmKPExsXSO6nOVbff0T3 C4PwHBYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWP+lyssBQ1cFd1NRxgbGKdwdDFycQgJTGCS WHLqNxOE84dRYue+V0AOJ5CzgVHiyz4TCHsCo8ThdW4gNpuAjsTFLw/ZQWwRATOJZzMbGEGam QUOMko0bdsC1iwsUCFx/vBHFhCbRUBVouHuHWYQm1fAQ6L5wi4wW0JAUaL72QQ2EJsTKP7n1x 9miGXuEicaLrBC1BhKnH64jXECI98CRoZVjBrFqUVlqUW6hpZ6SUWZ6RkluYmZObqGBqZ6uan FxYnpqTmJScV6yfm5mxiBoVLPwMC4g/FRv98hRkkOJiVRXnEF9wghvqT8lMqMxOKM+KLSnNTi Q4wyHBxKEry2DkA5waLU9NSKtMwcYNDCpCU4eJREeDfZAaV5iwsSc4sz0yFSpxgVpcR5GUH6B EASGaV5cG2wSLnEKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZi3xx5oCk9mXgnc9FdAi5mAFp 847gyyuCQRISXVwMjbdO1M0VS+6o2Pcw6lM7ftiVEVVrSTPSlenvB18cOziwRjPdy+a2ucPOm qOtOwQaMveu4yg8pblROmO3zTjHKYFJTDEtnHtzZ0u8P6LzkXy6sFbirOXBE+t+bB1rca6pYs 84NN1ZVvhnLJLJleZDfliMbzqmhHi5OXrq6frHuYY6pU3MuNF5RYijMSDbWYi4oTAQuxRomPA gAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1481064844!58214312!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23030 invoked from network); 6 Dec 2016 22:54:06 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-16.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 6 Dec 2016 22:54:06 -0000 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 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] Cc: jgross@suse.com, eric.snowberg@oracle.com, arvidjaar@gmail.com, andrew.cooper3@citrix.com, tsoome@me.com, seth.goldberg@oracle.com, phcoder@gmail.com Subject: [Xen-devel] [MULTIBOOT2 DOC PATCH v3 11/13] multiboot2: Add C structure members alignment and padding consideration section X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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