diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-21 09:23:58 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 10:05:43 +0100 |
commit | 3a2724805421098df505c0acea106fb294bc2f6a (patch) | |
tree | 07b225c4fdc140786851750df34433526ed2ddff /cpukit/score/include/rtems/score/mrsp.h | |
parent | score: Use scheduler instance specific locks (diff) | |
download | rtems-3a2724805421098df505c0acea106fb294bc2f6a.tar.bz2 |
score: First part of new MrsP implementation
Update #2556.
Diffstat (limited to 'cpukit/score/include/rtems/score/mrsp.h')
-rw-r--r-- | cpukit/score/include/rtems/score/mrsp.h | 80 |
1 files changed, 3 insertions, 77 deletions
diff --git a/cpukit/score/include/rtems/score/mrsp.h b/cpukit/score/include/rtems/score/mrsp.h index 5af3a06901..85cbff784f 100644 --- a/cpukit/score/include/rtems/score/mrsp.h +++ b/cpukit/score/include/rtems/score/mrsp.h @@ -19,9 +19,6 @@ #if defined(RTEMS_SMP) -#include <rtems/score/chain.h> -#include <rtems/score/scheduler.h> -#include <rtems/score/thread.h> #include <rtems/score/threadq.h> #ifdef __cplusplus @@ -51,87 +48,16 @@ extern "C" { * @{ */ -typedef struct MRSP_Control MRSP_Control; - -/** - * @brief MrsP rival. - * - * The rivals are used by threads waiting for resource ownership. They are - * registered in the MrsP control block. - */ -typedef struct { - /** - * @brief The node for registration in the MrsP rival chain. - * - * The chain operations are protected by the MrsP control lock. - * - * @see MRSP_Control::Rivals. - */ - Chain_Node Node; - - /** - * @brief The corresponding MrsP control block. - */ - MRSP_Control *resource; - - /** - * @brief Identification of the rival thread. - */ - Thread_Control *thread; - - /** - * @brief The ceiling priority used by the rival thread. - */ - Priority_Node Ceiling_priority; - - /** - * @brief The initial help state of the thread at the begin of the resource - * obtain sequence. - * - * Used to restore this state after a timeout. - */ - Scheduler_Help_state initial_help_state; - - /** - * @brief The rival status. - * - * Initially the status is set to MRSP_WAIT_FOR_OWNERSHIP. The rival will - * busy wait until a status change happens. This can be STATUS_SUCCESSFUL or - * STATUS_TIMEOUT. State changes are protected by the MrsP control lock. - */ - volatile int status; - - /** - * @brief Watchdog for timeouts. - */ - Watchdog_Control Watchdog; -} MRSP_Rival; - /** * @brief MrsP control block. */ -struct MRSP_Control { +typedef struct { /** - * @brief Lock to protect the resource dependency tree. - * - * This is a thread queue since this simplifies the Classic semaphore - * implementation. Only the lock part of the thread queue is used. + * @brief The thread queue to manage ownership and waiting threads. */ Thread_queue_Control Wait_queue; /** - * @brief Basic resource control. - */ - Resource_Control Resource; - - /** - * @brief A chain of MrsP rivals waiting for resource ownership. - * - * @see MRSP_Rival::Node. - */ - Chain_Control Rivals; - - /** * @brief The ceiling priority used by the owner thread. */ Priority_Node Ceiling_priority; @@ -140,7 +66,7 @@ struct MRSP_Control { * @brief One ceiling priority per scheduler instance. */ Priority_Control *ceiling_priorities; -}; +} MRSP_Control; /** @} */ |