18 #ifdef POK_NEEDS_ARINC653_SEMAPHORE
19 #ifndef APEX_SEMAPHORE
20 #define APEX_SEMAPHORE
22 #ifndef POK_NEEDS_ARINC653_PROCESS
23 #define POK_NEEDS_ARINC653_PROCESS 1
26 #include <arinc653/types.h>
27 #include <arinc653/process.h>
39 #define MAX_NUMBER_OF_SEMAPHORES 63
43 #define MAX_SEMAPHORE_VALUE 32767
52 typedef APEX_INTEGER SEMAPHORE_ID_TYPE;
56 typedef APEX_INTEGER SEMAPHORE_VALUE_TYPE;
60 typedef NAME_TYPE SEMAPHORE_NAME_TYPE;
66 SEMAPHORE_VALUE_TYPE CURRENT_VALUE;
67 SEMAPHORE_VALUE_TYPE MAXIMUM_VALUE;
68 WAITING_RANGE_TYPE WAITING_PROCESSES;
76 extern void CREATE_SEMAPHORE (
77 SEMAPHORE_NAME_TYPE SEMAPHORE_NAME,
78 SEMAPHORE_VALUE_TYPE CURRENT_VALUE,
79 SEMAPHORE_VALUE_TYPE MAXIMUM_VALUE,
80 QUEUING_DISCIPLINE_TYPE QUEUING_DISCIPLINE,
81 SEMAPHORE_ID_TYPE *SEMAPHORE_ID,
82 RETURN_CODE_TYPE *RETURN_CODE );
84 extern void WAIT_SEMAPHORE (
85 SEMAPHORE_ID_TYPE SEMAPHORE_ID,
86 SYSTEM_TIME_TYPE TIME_OUT,
87 RETURN_CODE_TYPE *RETURN_CODE );
89 extern void SIGNAL_SEMAPHORE (
90 SEMAPHORE_ID_TYPE SEMAPHORE_ID,
91 RETURN_CODE_TYPE *RETURN_CODE );
93 extern void GET_SEMAPHORE_ID (
94 SEMAPHORE_NAME_TYPE SEMAPHORE_NAME,
95 SEMAPHORE_ID_TYPE *SEMAPHORE_ID,
96 RETURN_CODE_TYPE *RETURN_CODE );
98 extern void GET_SEMAPHORE_STATUS (
99 SEMAPHORE_ID_TYPE SEMAPHORE_ID,
101 RETURN_CODE_TYPE *RETURN_CODE );