The Samba-Bugzilla – Attachment 9918 Details for
Bug 10590
Multi-byte storage/retrieval broken on little endian Power8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix for 4.1 branch, cherry-picked from master (without ccan include)
0001-byteorder-do-not-assume-PowerPC-is-big-endian_v2_41t.patch (text/plain), 1.46 KB, created by
David Disseldorp
on 2014-05-07 09:57:15 UTC
(
hide
)
Description:
fix for 4.1 branch, cherry-picked from master (without ccan include)
Filename:
MIME Type:
Creator:
David Disseldorp
Created:
2014-05-07 09:57:15 UTC
Size:
1.46 KB
patch
obsolete
>From 961c35bd35a6b2536bdfc454c6340e98fdbc6adc Mon Sep 17 00:00:00 2001 >From: David Disseldorp <ddiss@samba.org> >Date: Mon, 5 May 2014 13:42:36 +0200 >Subject: [PATCH] byteorder: do not assume PowerPC is big-endian > >byteorder.h currently uses reverse-indexing ASM instructions for little >endian multi-byte storage/retrieval on PowerPC. With Power8 this is an >incorrect assumption, as it can be big or little endian. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=10590 > >Signed-off-by: David Disseldorp <ddiss@samba.org> >Reviewed-by: Christof Schmitt <cs@samba.org> >(cherry picked from commit 5bf6ed5ebd0dc5ecdc5bcfb1d4720e9251849adc) >--- > lib/util/byteorder.h | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h >index 58cd68a..297be52 100644 >--- a/lib/util/byteorder.h >+++ b/lib/util/byteorder.h >@@ -89,10 +89,12 @@ it also defines lots of intermediate macros, just ignore those :-) > > > /* >- on powerpc we can use the magic instructions to load/store >- in little endian >-*/ >-#if (defined(__powerpc__) && defined(__GNUC__)) >+ * On powerpc we can use the magic instructions to load/store in little endian. >+ * The instructions are reverse-indexing, so assume a big endian Power >+ * processor. Power8 can be big or little endian, so we need to explicitly >+ * check. >+ */ >+#if (defined(__powerpc__) && defined(__GNUC__) && HAVE_BIG_ENDIAN) > static __inline__ uint16_t ld_le16(const uint16_t *addr) > { > uint16_t val; >-- >1.8.4.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
cs
:
review+
Actions:
View
Attachments on
bug 10590
:
9900
|
9901
|
9902
|
9917
| 9918