summaryrefslogtreecommitdiffstats
path: root/cpukit/score/macros/rtems/score/coresem.inl
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-30 14:08:30 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-30 14:08:30 +0000
commit43b6f757ce6127d95778fe2eaa9e3a9fc3a06ae3 (patch)
treeb8cce290191ffcee0ce79451897a0ce89aec6af2 /cpukit/score/macros/rtems/score/coresem.inl
parent7f8c11c73d834cbaec472fd2b35cb9f76aaae76b (diff)
downloadrtems-43b6f757ce6127d95778fe2eaa9e3a9fc3a06ae3.tar.bz2
2000-11-30 Joel Sherrill <joel@OARcorp.com>
* General effort to make things compile with macros not inlines * inline/rtems/score/coremutex.inl: Added comment indicating for macros there is another copy of _CORE_mutex_Seize_interrupt_trylock() in src/coremutexseize.c. * src/coremutexseize.c: Added body of _CORE_mutex_Seize_interrupt_trylock() for macro case. * macros/rtems/score/coremutex.inl: Added prototype for _CORE_mutex_Seize_interrupt_trylock() since there is a real body when macros are enabled. * macros/rtems/score/coresem.inl: Added macro implementation of _CORE_semaphore_Seize_isr_disable. * macros/score/Makefile.am: Fixed typos. * rtems/score/address.inl: Correct macro implementation of _Addresses_Is_aligned() so it would compile. * macros/rtems/score/coremsg.inl: Added closing parentheses.
Diffstat (limited to '')
-rw-r--r--cpukit/score/macros/rtems/score/coresem.inl43
1 files changed, 43 insertions, 0 deletions
diff --git a/cpukit/score/macros/rtems/score/coresem.inl b/cpukit/score/macros/rtems/score/coresem.inl
index 904b004cc6..01590c23b4 100644
--- a/cpukit/score/macros/rtems/score/coresem.inl
+++ b/cpukit/score/macros/rtems/score/coresem.inl
@@ -34,6 +34,49 @@
#define _Core_semaphore_Get_count( _the_semaphore ) \
( (_the_semaphore)->count )
+/*PAGE
+ *
+ * _CORE_semaphore_Seize_isr_disable
+ *
+ * DESCRIPTION:
+ *
+ * This routine attempts to receive a unit from the_semaphore.
+ * If a unit is available or if the wait flag is FALSE, then the routine
+ * returns. Otherwise, the calling task is blocked until a unit becomes
+ * available.
+ *
+ * NOTE: There is currently no MACRO version of this routine.
+ */
+
+#define _CORE_semaphore_Seize_isr_disable( \
+ _the_semaphore, _id, _wait, _timeout, _level_p) \
+{ \
+ Thread_Control *executing; \
+ ISR_Level level = *(_level_p); \
+ \
+ /* disabled when you get here */ \
+ \
+ executing = _Thread_Executing; \
+ executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; \
+ if ( (_the_semaphore)->count != 0 ) { \
+ (_the_semaphore)->count -= 1; \
+ _ISR_Enable( level ); \
+ } else if ( !(_wait) ) { \
+ _ISR_Enable( level ); \
+ executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; \
+ } else { \
+ _Thread_Disable_dispatch(); \
+ _ISR_Enable( level ); \
+ _Thread_queue_Enter_critical_section( &(_the_semaphore)->Wait_queue ); \
+ executing->Wait.queue = &(_the_semaphore)->Wait_queue; \
+ executing->Wait.id = (_id); \
+ _ISR_Enable( level ); \
+ \
+ _Thread_queue_Enqueue( &(_the_semaphore)->Wait_queue, (_timeout) ); \
+ _Thread_Enable_dispatch(); \
+ } \
+}
+
#endif
/* end of include file */