Experimental Physics and
| |||||||||||||||||
|
Jeff Hill wrote: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
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |