diff options
author | rusty <rusty@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652> | 2014-02-10 10:29:47 +0000 |
---|---|---|
committer | rusty <rusty@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652> | 2014-02-10 10:29:47 +0000 |
commit | 5017ce769af5bb61942361191be3cba5b09c9da5 (patch) | |
tree | 793797364dd1395a806d0d0c2199f262c7966948 /introduction.tex | |
parent | 27fd1f8fb14e977ee61fed8fc9b863d0f2212eef (diff) | |
download | virtio-spec-5017ce769af5bb61942361191be3cba5b09c9da5.tar.gz |
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 <cornelia.huck@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@212 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Diffstat (limited to 'introduction.tex')
-rw-r--r-- | introduction.tex | 21 |
1 files changed, 21 insertions, 0 deletions
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 |