summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/corespinlockimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-23 13:37:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-26 21:44:31 +0200
commitdce487912d98835b8168e755b60514f5a8592b27 (patch)
tree8778547fbb0f2dbb07bb6a83f28d3f4464924141 /cpukit/score/include/rtems/score/corespinlockimpl.h
parentposix: Fix sem_init() with too large initial value (diff)
downloadrtems-dce487912d98835b8168e755b60514f5a8592b27.tar.bz2
score: Add Status_Control for all APIs
Unify the status codes of the Classic and POSIX API to use the new enum Status_Control. This eliminates the Thread_Control::Wait::timeout_code field and the timeout parameter of _Thread_queue_Enqueue_critical() and _MPCI_Send_request_packet(). It gets rid of the status code translation tables and instead uses simple bit operations to get the status for a particular API. This enables translation of status code constants at compile time. Add _Thread_Wait_get_status() to avoid direct access of thread internal data structures.
Diffstat (limited to 'cpukit/score/include/rtems/score/corespinlockimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/corespinlockimpl.h36
1 files changed, 3 insertions, 33 deletions
diff --git a/cpukit/score/include/rtems/score/corespinlockimpl.h b/cpukit/score/include/rtems/score/corespinlockimpl.h
index fd4fcf29db..140529b573 100644
--- a/cpukit/score/include/rtems/score/corespinlockimpl.h
+++ b/cpukit/score/include/rtems/score/corespinlockimpl.h
@@ -20,6 +20,7 @@
#define _RTEMS_SCORE_CORESPINLOCKIMPL_H
#include <rtems/score/corespinlock.h>
+#include <rtems/score/status.h>
#include <rtems/score/watchdog.h>
#include <string.h>
@@ -33,37 +34,6 @@ extern "C" {
*/
/**@{**/
-/**
- * Core Spinlock handler return statuses.
- */
-typedef enum {
- /** This status indicates that the operation completed successfully. */
- CORE_SPINLOCK_SUCCESSFUL,
- /** This status indicates that the current thread already holds the spinlock.
- * An attempt to relock it will result in deadlock.
- */
- CORE_SPINLOCK_HOLDER_RELOCKING,
- /** This status indicates that the current thread is attempting to unlock a
- * spinlock that is held by another thread.
- */
- CORE_SPINLOCK_NOT_HOLDER,
- /** This status indicates that a thread reached the limit of time it
- * was willing to wait on the spin lock.
- */
- CORE_SPINLOCK_TIMEOUT,
- /** This status indicates that a thread is currently waiting for this
- * spin lock.
- */
- CORE_SPINLOCK_IS_BUSY,
- /** This status indicates that the spinlock is currently locked and thus
- * unavailable.
- */
- CORE_SPINLOCK_UNAVAILABLE
-} CORE_spinlock_Status;
-
-/** This is a shorthand for the last status code. */
-#define CORE_SPINLOCK_STATUS_LAST CORE_SPINLOCK_UNAVAILABLE
-
/** This indicates the lock is available. */
#define CORE_SPINLOCK_UNLOCKED 0
@@ -115,7 +85,7 @@ RTEMS_INLINE_ROUTINE void _CORE_spinlock_Release(
* @retval A status is returned which indicates the success or failure of
* this operation.
*/
-CORE_spinlock_Status _CORE_spinlock_Seize(
+Status_Control _CORE_spinlock_Seize(
CORE_spinlock_Control *the_spinlock,
bool wait,
Watchdog_Interval timeout,
@@ -130,7 +100,7 @@ CORE_spinlock_Status _CORE_spinlock_Seize(
*
* @param[in] the_spinlock is the spinlock to surrender
*/
-CORE_spinlock_Status _CORE_spinlock_Surrender(
+Status_Control _CORE_spinlock_Surrender(
CORE_spinlock_Control *the_spinlock,
ISR_lock_Context *lock_context
);