From 5017ce769af5bb61942361191be3cba5b09c9da5 Mon Sep 17 00:00:00 2001 From: rusty Date: Mon, 10 Feb 2014 10:29:47 +0000 Subject: C struct specifications. Explicitly specify that our C struct specifications are without padding, and add some definitions for our integer data types. [ Rusty - added /* comments */ and removed redundant old le* explanation ] Signed-off-by: Cornelia Huck Signed-off-by: Rusty Russell git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@212 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652 --- introduction.tex | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'introduction.tex') diff --git a/introduction.tex b/introduction.tex index 5d57f78..83b01f0 100644 --- a/introduction.tex +++ b/introduction.tex @@ -44,5 +44,26 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S \phantomsection\label{intro:S390 Common I/O}\textbf{[S390 Common I/O]} & ESA/390 Common I/O-Device and Self-Description, \newline IBM Publication SA22-7204\\ \end{longtable} +\section{Structure Specifications} + +Many device and driver in-memory structure layouts are documented using +the C struct syntax. All structures are assumed to be without additional +padding. To stress this, cases where common C compilers are known to insert +extra padding within structures are tagged using the GNU C +__attribute__((packed)) syntax. + +For the integer data types used in the structure definitions, the following +conventions are used: + +\begin{description} +\item[u8, u16, u32, u64] An unsigned integer of the specified length in bits. + +\item[le16, le32, le64] An unsigned integer of the specified length in bits, +in little-endian byte order. + +\item[be16, be32, be64] An unsigned integer of the specified length in bits, +in big-endian byte order. +\end{description} + \newpage -- cgit v1.2.3