On Fri, 2011-01-28 at 10:22 -0800, Doug Kehn wrote: 
> Hi Inaky/All
> 
> --- On Thu, 1/27/11, Inaky Perez-Gonzalez <[email protected]> wrote:
> 
> > From: Inaky Perez-Gonzalez <[email protected]>
> > Subject: Re: [PATCH 0/6] wimax-network-service big-endian patches
> > To: "Doug Kehn" <[email protected]>
> > Cc: [email protected]
> > Date: Thursday, January 27, 2011, 1:42 PM
> > Hi Doug
> > 
> > On Wed, 2011-01-26 at 14:22 -0800, Doug Kehn wrote: 
> > > Hi All,
> > > 
> > > I've been working toward getting wimax running on an
> > Intel IXP-435 (ARM
> > >  XSCALE big-endian) processor.  wimax is
> > [finally] running on the
> > >  IXP-435.  This patch-set are the changes I
> > made to get wimax working. 
> > >  These patches are against the HEAD of the git
> > repository.  I did
> > >  single-file commits to make reviewing easier.
> > > 
> > > I did not test these changes on a little-endian
> > machine.  The endian
> > >  patches should work on a little-endian
> > machine.  The alignment patches
> > >  may/may-not work.
> > > 
> > > I do have 4 additional patches that are, IMHO,
> > specific to the IXP-435
> > >  and/or my environment.  These patches are
> > not included in the
> > >  patch-set.  I'll be happy to forward them
> > to the list or to anyone who
> > >  wants them.
> > 
> > This is awesome, thanks!
> > 
> > I'll take a pass at them tomorrow (mainly integrate and
> > test on my setup
> > to double check nothing twists the wrong side, but they
> > look pretty
> > straightforward to me).
> > 
> 
> I forgot about some Makefile.in/Makefile.am fix-ups when building for 
> big-endian. Makefile.in/Makefile.am have some hard-coded little-endian 
> defines. I'm too lazy to figure out how to fix the automake stuff so I just 
> alter the makefiles before calling configure.  The fix-ups look like:
> 
> list=`find . -name 'Makefile*' | xargs grep -l 
> BMI_MACHINE_ENDIANNESS_LITTLE`; \
> for f in $$list; do \
>     sed -i -e 's/BMI_MACHINE_ENDIANNESS_LITTLE/BMI_MACHINE_ENDIANNESS_BIG/g' 
> $$f; \
> done
> 
> list=`find . -name 'Makefile*' | xargs grep -l BMI_ENDIANNESS_LITTLE`; \
> for f in $$list; do \
>      sed -i -e 's/BMI_ENDIANNESS_LITTLE/BMI_ENDIANNESS_BIG/g' $$f; \
> done

Actually the proper thing would be to yank that off the Makefiles and
use endian.h. Can you test this patch and tell me if it does the right
thing for you? 
>From befcae11af55ab8987548a01344ee994a83964e6 Mon Sep 17 00:00:00 2001
From: Inaky Perez-Gonzalez <[email protected]>
Date: Fri, 4 Feb 2011 14:27:34 -0800
Subject: [PATCH] endianess: use <endian.h> to determine endianess vs static 
Makefile definitions

Reported-by: Doug Kehn <[email protected]>

Signed-off-by: Inaky Perez-Gonzalez <[email protected]>
---
 .../Common/L4Common/SourceControl/BitmanCommon.h   |    6 ++++--
 .../Instrumantation/MocMsgProxy/Makefile.am        |    2 +-
 .../Instrumantation/MocMsgProxy/Makefile.in        |    2 +-
 .../OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.am  |    2 +-
 .../OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.in  |    2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h 
b/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h
index 874df35..11ff75f 100644
--- a/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h
+++ b/InfraStack/OSAgnostic/Common/L4Common/SourceControl/BitmanCommon.h
@@ -12,6 +12,8 @@
 #ifndef _BITMAN_COMMON_H_
 #define _BITMAN_COMMON_H_
 
+#include <endian.h>
+
 #if defined __ARMCC_VERSION
        #ifndef __arm
                #define __arm
@@ -29,9 +31,9 @@
 #define BMI_MACHINE_INTEL_LITTLE       (3)
 
 // New definitions for machine endianness
-#if defined BMI_MACHINE_ENDIANNESS_LITTLE
+#if BYTE_ORDER == LITTLE_ENDIAN
 #define BMI_ENDIANNESS_LITTLE
-#elif defined BMI_MACHINE_ENDIANNESS_BIG
+#elif BYTE_ORDER == BIG_ENDIAN
 #define BMI_ENDIANNESS_BIG
 #endif
 
diff --git 
a/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.am 
b/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.am
index ff557d1..02bbf28 100644
--- a/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.am
+++ b/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.am
@@ -24,6 +24,6 @@ libMocMsgProxy_la_CFLAGS = \
                        -I 
"$(top_srcdir)/InfraStack/OSAgnostic/Common/L4Common/SourceControl" \
                        -I 
"$(top_srcdir)/InfraStack/OSDependent/Linux/L4Generated" \
                        -I 
"$(top_srcdir)/InfraStack/OSAgnostic/OSInterface/InfraStackModules"  \
-                       -D "_USE_TRACE" -D "BMI_ENDIANNESS_LITTLE" -D "_LINUX" 
-D "_OS_WIN32SIM" 
+                       -D "_USE_TRACE" -D "_LINUX" -D "_OS_WIN32SIM" 
 

diff --git 
a/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.in 
b/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.in
index 287ebc6..0704a3d 100644
--- a/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.in
+++ b/InfraStack/OSAgnostic/Product/Instrumantation/MocMsgProxy/Makefile.in
@@ -218,7 +218,7 @@ libMocMsgProxy_la_CFLAGS = \
                        -I 
"$(top_srcdir)/InfraStack/OSAgnostic/Common/L4Common/SourceControl" \
                        -I 
"$(top_srcdir)/InfraStack/OSDependent/Linux/L4Generated" \
                        -I 
"$(top_srcdir)/InfraStack/OSAgnostic/OSInterface/InfraStackModules"  \
-                       -D "_USE_TRACE" -D "BMI_ENDIANNESS_LITTLE" -D "_LINUX" 
-D "_OS_WIN32SIM" 
+                       -D "_USE_TRACE" -D "_LINUX" -D "_OS_WIN32SIM" 
 
 all: all-am
 
diff --git a/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.am 
b/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.am
index 57c08c6..e66d576 100644
--- a/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.am
+++ b/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.am
@@ -98,7 +98,7 @@ libiWmxSdk_la_CFLAGS =  \
                        -I "$(srcdir)/../../Agents/NDnS/Source" \
                        -I "$(srcdir)/../../Agents/NDnS/APDO/" \
                        -I "$(srcdir)/../../Agents/Supplicant/Source/ds" \
-                       -D "_USE_TRACE" -D "BMI_ENDIANNESS_LITTLE" \
+                       -D "_USE_TRACE" \
                        -D "_OS_WIN32SIM" -D "OMADM_CLIENT_SIMULATOR" \
                        -D _GNU_SOURCE \
                        -D "_LINUX" -D "_WIMAX_SDK_" \
diff --git a/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.in 
b/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.in
index 893ec4c..743d355 100644
--- a/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.in
+++ b/InfraStack/OSAgnostic/WiMax/Wrappers/iWmxSDK/Makefile.in
@@ -333,7 +333,7 @@ libiWmxSdk_la_CFLAGS = \
                        -I "$(srcdir)/../../Agents/NDnS/Source" \
                        -I "$(srcdir)/../../Agents/NDnS/APDO/" \
                        -I "$(srcdir)/../../Agents/Supplicant/Source/ds" \
-                       -D "_USE_TRACE" -D "BMI_ENDIANNESS_LITTLE" \
+                       -D "_USE_TRACE" \
                        -D "_OS_WIN32SIM" -D "OMADM_CLIENT_SIMULATOR" \
                        -D _GNU_SOURCE \
                        -D "_LINUX" -D "_WIMAX_SDK_" \
-- 
1.6.6.1



_______________________________________________
wimax mailing list
[email protected]
http://lists.linuxwimax.org/listinfo/wimax

Reply via email to