RTEMS CPU Kit with SuperCore  4.11.2
mrsp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifndef _RTEMS_SCORE_MRSP_H
16 #define _RTEMS_SCORE_MRSP_H
17 
18 #include <rtems/score/cpuopts.h>
19 
20 #if defined(RTEMS_SMP)
21 
22 #include <rtems/score/chain.h>
23 #include <rtems/score/isrlock.h>
24 #include <rtems/score/scheduler.h>
25 #include <rtems/score/thread.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 
61 typedef enum {
62  MRSP_SUCCESSFUL = 0,
63  MRSP_TIMEOUT = 6,
64  MRSP_INVALID_NUMBER = 10,
65  MRSP_RESOUCE_IN_USE = 12,
66  MRSP_UNSATISFIED = 13,
67  MRSP_INCORRECT_STATE = 14,
68  MRSP_INVALID_PRIORITY = 19,
69  MRSP_NOT_OWNER_OF_RESOURCE = 23,
70  MRSP_NO_MEMORY = 26,
71 
76  MRSP_WAIT_FOR_OWNERSHIP = 255
77 } MRSP_Status;
78 
79 typedef struct MRSP_Control MRSP_Control;
80 
87 typedef struct {
95  Chain_Node Node;
96 
100  MRSP_Control *resource;
101 
105  Thread_Control *thread;
106 
113  Priority_Control initial_priority;
114 
121  Scheduler_Help_state initial_help_state;
122 
130  volatile MRSP_Status status;
131 } MRSP_Rival;
132 
136 struct MRSP_Control {
140  Resource_Control Resource;
141 
147  Chain_Control Rivals;
148 
152  ISR_LOCK_MEMBER( Lock )
153 
154 
158  Priority_Control initial_priority_of_owner;
159 
163  Priority_Control *ceiling_priorities;
164 };
165 
168 #ifdef __cplusplus
169 }
170 #endif /* __cplusplus */
171 
172 #endif /* RTEMS_SMP */
173 
174 #endif /* _RTEMS_SCORE_MRSP_H */
This is used to manage each element (node) which is placed on a chain.
Definition: chain.h:65
#define ISR_LOCK_MEMBER(_designator)
Defines an ISR lock member.
Definition: isrlock.h:89
This is used to manage a chain.
Definition: chain.h:83
Constants and Structures Related with the Thread Control Block.
uint32_t Priority_Control
The following type defines the control block used to manage thread priorities.
Definition: priority.h:56
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
Constants and Structures Associated with the Scheduler.
Chain Handler API.
ISR Locks.
Resource control to manage ownership and rival nodes depending on a resource.
Definition: resource.h:185