introduction: add note on bitfield portability
PATCH 1/1 introduction: add note on bitfield portability
Signed-off-by Michael S. Tsirkin <[email protected]>
--- introduction.tex | 7 +++++++ 1 file changed, 7 insertions(+)
introduction.tex +7 -0
@@ -175,5 +175,12 @@ packed by C compilers on little-endian architectures but not the way bitfields are packed by C compilers on big-endian architectures. +Assuming that CPU_TO_BE16 converts a 16-bit integer from a native +CPU to the big-endian byte order, the following is the equivalent +portable C code to generate a value in this format: +\begin{lstlisting} +CPU_TO_BE16(B << 15 | A) +\end{lstlisting} + \newpage
Signature · 6 lines
MST --------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
On Tue, 6 Mar 2018 16:35:46 +0200
"Michael S. Tsirkin" <[email protected]> wrote:
[You picked my old email address :)]
Quoted 12 lines
Signed-off-by Michael S. Tsirkin <[email protected]>--- introduction.tex | 7 +++++++ 1 file changed, 7 insertions(+)introduction.tex +0
-0@@ -175,5 +175,12 @@ packed by C compilers on little-endian architectures but not the way bitfields are packed by C compilers on big-endian architectures.
introduction.tex packed by C compilers on little-endian architectures but not the · line 186
Quoted 10 lines
introduction.tex +7
-0+Assuming that CPU_TO_BE16 converts a 16-bit integer from a native +CPU to the big-endian byte order, the following is the equivalent +portable C code to generate a value in this format: +\begin{lstlisting} +CPU_TO_BE16(B << 15 | A) +\end{lstlisting} + \newpage
Reviewed-by Cornelia Huck <[email protected]>
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php