EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: linux-xscale port, SYSFS device support
From: Peter Milne <[email protected]>
To: Jeff Hill <[email protected]>
Cc: [email protected], Janet Anderson <[email protected]>
Date: Wed, 09 Nov 2005 10:54:45 +0000
Hi Jeff

Jeff Hill wrote:

A patch (overlapping with the one provided below) for arm archetecture
impure little endian was provided earlier by Larry Doolittle. It was
integrated into EPICS R3.1.4.8. The preprocessor switch in that patch was
_armv4l_. In contrast, the patch below is using just __arm__).

http://www.d-tacq.com/swrel/EPICS/base-linux-xscale.patch

However, TBOMK config file changes for XSCALE have *not* yet been
integrated.

Thanks for the feedback.

_armv4l_ was most likely an older StrongArm processor. It will have the generic __arm__ symbol defined on build as well, and since it's likely that all the ARM processors will use the same floating point lib, the generic __arm__ should work for both and hopefully all cases, and least until someone tries to make a big-endian ARM port.

To cater for that eventuality, a full solution is suggested below, but please note I do _not_ want to make work for Janet by pushing any of this into the mainline, the patch is easy enough for me to maintain, a merge is really only justified if Larry or others are actively using similar code.

Cheers

Peter.

Problem:
Implement BASE port to allow generic ARM little endian with impure float as well as ARM big endian (assumed pure).


Solution:
Predefine CA_LITTLE_ENDIAN, CA_FLOAT_IEEE in the CONFIG.Common.linux-ARCH file, and to check this before setting the values according to arch.


This means a change to net_convert.h, but it can also lose the reference to __arm__, and the file does not have to keep
growing to cater for new processors. (maybe the H8 / PPC / uCDIMM people already do this?).


diff -X dontdiff -urN base-3.14.7.orig/src/ca/net_convert.h base-3.14.7/src/ca/net_convert.h
--- base-3.14.7.orig/src/ca/net_convert.h 2004-10-04 19:55:38.000000000 +0100
+++ base-3.14.7/src/ca/net_convert.h 2005-11-09 09:11:32.000000000 +0000
@@ -27,7 +27,11 @@
* Here are the definitions for architecture dependent byte ordering
* and floating point format
*/
-#if defined (_M_IX86) || defined (_X86_) || defined (__i386__)
+#if defined (CA_FLOAT_IEEE) && defined (CA_LITTLE_ENDIAN)
+/*
+ * CONFIG has already defined the byte ordering, so we don't need to do it here
+ */
+#elif defined (_M_IX86) || defined (_X86_) || defined (__i386__)
# define CA_FLOAT_IEEE
# define CA_LITTLE_ENDIAN
#elif defined (VAX)


We still need the reference to __arm__ in the code to actually sort out the problem, __arm__ doesn't tell you anything about endian-ness, but since the point of use is guarded by "#ifdef CA_LITTLE_ENDIAN" the endian-ness is already known.

We have to add this line to CONFIG.Common.linux-xscale ARCH_DEP_CFLAGS += -DCA_FLOAT_IEEE -DCA_LITTLE_ENDIAN

and similarly for other CONFIG.linux-ARM machines.

To be pedantic, I guess this file should be called CONFIG.Common.linux-xscale-le to allow the possibility of a future linux-xscale-be option, but if the default arch "linux-xscale" is little-endian (I think most of them are, anyway, we got there first :-) ), then if a big-endian port is ever implemented in the future, it can be called "linux-xscale-be", the corresponding CONFIG file sets the CA_ defines appropriately and there is no clash.



--
Peter Milne [email protected]
D-TACQ Solutions Ltd www.d-tacq.com






References:
RE: linux-xscale port, SYSFS device support Jeff Hill

Navigate by Date:
Prev: RE: linux-xscale port, SYSFS device support Jeff Hill
Next: Re: Running softIoc's in the background john sinclair
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: linux-xscale port, SYSFS device support Jeff Hill
Next: Running softIoc's in the background Walters, M (Malcolm)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·