vxWorks
Eric Norum
eric at cls.usask.ca
Tue Oct 24 14:56:02 UTC 2000
Joel Sherrill wrote:
>
> Just to let everyone know. Eric Norum and I have worked on the binary
> semaphore code over the past few months as part of his porting EPICS
> to RTEMS. We added a simple binary semaphore that is supposed to
> match the semantics of one of the VxWorks mutex types. I have no
> documentation but Eric N can comment.
In the OS-dependent semaphore creation portion of EPICS there is the
following code for vxWorks:
binary semaphore creation:
return((semBinaryId)semBCreate(
SEM_Q_FIFO,((initialState==semEmpty) ? SEM_EMPTY : SEM_FULL)));
mutex semaphore creation:
return((semMutexId)
semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY));
The corresponding sections for RTEMS are:
binary semaphore creation:
sc = rtems_semaphore_create (rtems_build_name ('B', c3, c2, c1),
initialState,
RTEMS_FIFO | RTEMS_SIMPLE_BINARY_SEMAPHORE |
RTEMS_NO_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING |
RTEMS_LOCAL,
0,
&sid);
mutex semaphore creation:
sc = rtems_semaphore_create (rtems_build_name ('M', c3, c2, c1),
1,
RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
0,
&sid);
Joel is also working on some lighter-weight routines (macros?) to
obtain/release the above style of mutex semaphore.
--
Eric Norum eric at cls.usask.ca
Canadian Light Source Phone: (306) 966-6308
University of Saskatchewan FAX: (306) 966-6058
Saskatoon, Canada.
More information about the users
mailing list