summaryrefslogtreecommitdiff
path: root/cpukit/rtems/include/rtems/rtems/semimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/include/rtems/rtems/semimpl.h')
-rw-r--r--cpukit/rtems/include/rtems/rtems/semimpl.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/semimpl.h b/cpukit/rtems/include/rtems/rtems/semimpl.h
index a498927691..813f885d5f 100644
--- a/cpukit/rtems/include/rtems/rtems/semimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/semimpl.h
@@ -26,12 +26,37 @@
extern "C" {
#endif
+typedef enum {
+ SEMAPHORE_VARIANT_MUTEX,
+ SEMAPHORE_VARIANT_COUNTING
+#if defined(RTEMS_SMP)
+ ,
+ SEMAPHORE_VARIANT_MRSP
+#endif
+} Semaphore_Variant;
+
+typedef enum {
+ SEMAPHORE_DISCIPLINE_PRIORITY,
+ SEMAPHORE_DISCIPLINE_FIFO
+} Semaphore_Discipline;
+
/**
* The following defines the information control block used to manage
* this class of objects.
*/
extern Objects_Information _Semaphore_Information;
+RTEMS_INLINE_ROUTINE const Thread_queue_Operations *_Semaphore_Get_operations(
+ const Semaphore_Control *the_semaphore
+)
+{
+ if ( the_semaphore->discipline == SEMAPHORE_DISCIPLINE_PRIORITY ) {
+ return &_Thread_queue_Operations_priority;
+ } else {
+ return &_Thread_queue_Operations_FIFO;
+ }
+}
+
/**
* @brief Allocates a semaphore control block from
* the inactive chain of free semaphore control blocks.