> hi, all,
> I am building a rtems application with some hardware device/driver support. And the host arch is linux-x86,while the target is rtems-pc386.
> I must invoke rtems APIs in my device support,
Please consider avoiding any OS specific APIs if possible but use
epicsThread, epicsEvent, epicsMutex etc.
For VME access, you can use devLib (I have a devLib implementation
for powerpc-rtems [any board using the Tundra Universe VME-PCI
bridge - porting to x86 should be easy]).
> so I have to include header files of rtems in my device support source,
Some more tips to write portable code (sorry for the "lecture")
- If you really _must_ use RTEMS specific code, try to use 'wrapper'
inlines or macros and concentrate their definition in one file.
- Dont do device I/O using simple memory access, i.e. DONT access
a device register like an ordinary variable but do every access
using an inline or macro to ease porting your device support to
a different CPU/endianness.
RTEMS has suitable macros in libcpu/io.h. I can provide a portable
header for other architectures.
- Dont use 'fancy' API features - think twice if you could implement
the required functionality using and EPICS OSI API.
> such as "#include <rtems.h>". Then some codes in the device support are target arch related. But the Makefile created by "makeBaseApp.pl" are still trying to build the application for both host(linux-x86) and target(rtems-pc386).
> How to turn off this feature of the building system?
If you want to build an IOC application (e.g. 'zzz') just for RTEMS
PROD_IOC_RTEMS = zzz
PROD_IOC = zzz
which would build for all target architectures.
Also, if you have a source file that is relevant only on
a specific target, use e.g.
zzz_SRCS += some_code_for_all_targets.c
zzz_SRCS_RTEMS += foo_rtems_implementation.c
zzz_SRCS_vxWorks += foo_vxWorks_implementation.c
Architecture dependent code can be conditionally
although it's much better to use an EPICS OSI API.
- how to prevent ioc app from being built for both target and host? M.C.Shao
- Navigate by Date:
RE: epicsMutexLockWithTimeout not supported in 3.14.1 Jeff Hill
Channel Access disconnect/reconnect Nick Rees
- Navigate by Thread:
Re: how to prevent ioc app from being built for both target and host? Marty Kraimer
ways to add driver support layer for rtems ioc M.C.Shao