Subject: |
PowerPC again: Use of floating point in vxWorks shell |
From: |
Andrew Johnson <[email protected]> |
To: |
EPICS tech-talk <[email protected]> |
Date: |
Mon, 02 Oct 2000 17:34:30 -0500 |
I have just discovered something about vxWorks on the PPC (603/604/750
CPUs but not 860) that unnerves me, and I am surprised that we haven't
spotted it before but it may explain some issues: it is not possible to
pass a floating point number as a subroutine argument using the vxWorks
shell. The PPC EABI requires that float and double values be passed in
the floating point registers, whereas integers are passed in the normal
registers. The shell assumes that all function arguments are integers.
The relevent Wind River SPR says:
> spr 6201:
>
> From the shell level, calling functions with parameters of type float does
> not work on architectures where there is a different parameter passing
> mechanism for floats and integers, namely, PowerPC, MIPS, PA-RISC and ARM.
There is no fix available (nor likely IMHO given how old that SPR is).
Looking through the standard EPICS APIs though I don't think this is a
major problem for EPICS base, although individual device/drivers may have
to be modified. dbpf is not affected because its argument is a string.
Surprisingly a quick egrep through the st.cmd scripts in the APS R3.13.2
IOC startup scripts implies that this will only affect the following
routines here:
create_monitor_set() - the most common use, part of save/restore
vmeXycom566CVTInit() - next largest use
srBpmCoefficientLinearInit() - an APS internal routine.
Other routines intended for debugging may also be affected, and this also
means that some programmatic interfaces can't be tested through the target
shell. I don't know whether this also affects the host shell or not,
although I suspect it will.
Note that you can successfully set variables to fp values, and do fp math
using the standard builtin operators (but math.h function calls such as
fmod() and sin() are out). However passing a float variable as a function
argument doesn't work, you'd have to change your API to pass a pointer to
that variable to use this approach.
A similar problem (actually the same thing but in reverse) can occur if a
float or double value is passed into logMsg(), which is designed to accept
a fixed number of integer arguments only. However the compiler will
correctly reject any code that attempts to do this as long as logLib.h is
properly included.
- Andrew
--
Every great idea appears crazy to start with.
- Navigate by Date:
- Prev:
PowerPC Users: struct timespec problems Andrew Johnson
- Next:
Re: medm icon Ken Evans
- Index:
1994
1995
1996
1997
1998
1999
<2000>
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
PowerPC Users: struct timespec problems Andrew Johnson
- Next:
Job Opportunity in Astronomy Nick Rees
- Index:
1994
1995
1996
1997
1998
1999
<2000>
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|