RTEMS CPU Kit with SuperCore  4.11.2
corespinlockimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2008.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_SCORE_CORESPINLOCKIMPL_H
20 #define _RTEMS_SCORE_CORESPINLOCKIMPL_H
21 
23 #include <rtems/score/watchdog.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
37 typedef enum {
61 
63 #define CORE_SPINLOCK_STATUS_LAST CORE_SPINLOCK_UNAVAILABLE
64 
66 #define CORE_SPINLOCK_UNLOCKED 0
67 
69 #define CORE_SPINLOCK_LOCKED 1
70 
80  CORE_spinlock_Control *the_spinlock,
81  CORE_spinlock_Attributes *the_spinlock_attributes
82 );
83 
99 CORE_spinlock_Status _CORE_spinlock_Wait(
100  CORE_spinlock_Control *the_spinlock,
101  bool wait,
102  Watchdog_Interval timeout
103 );
104 
113 CORE_spinlock_Status _CORE_spinlock_Release(
114  CORE_spinlock_Control *the_spinlock
115 );
116 
123  CORE_spinlock_Attributes *the_attributes
124 )
125 {
126  the_attributes->XXX = 0;
127 }
128 
138  CORE_spinlock_Control *the_spinlock
139 )
140 {
141  return (the_spinlock->users != 0);
142 }
143 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif
151 /* end of include file */
The following defines the control block used to manage the attributes of each spinlock.
Definition: corespinlock.h:42
Constants and Structures Associated with the Spinlock Handler.
CORE_spinlock_Status
Core Spinlock handler return statuses.
Definition: corespinlockimpl.h:37
The following defines the control block used to manage each spinlock.
Definition: corespinlock.h:52
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
This status indicates that the current thread already holds the spinlock.
Definition: corespinlockimpl.h:43
Constants and Structures Associated with Watchdog Timers.
This status indicates that the current thread is attempting to unlock a spinlock that is held by anot...
Definition: corespinlockimpl.h:47
This status indicates that the operation completed successfully.
Definition: corespinlockimpl.h:39
volatile uint32_t users
This field is a count of the current number of threads using this spinlock.
Definition: corespinlock.h:64
RTEMS_INLINE_ROUTINE void _CORE_spinlock_Initialize_attributes(CORE_spinlock_Attributes *the_attributes)
This method is used to initialize core spinlock attributes.
Definition: corespinlockimpl.h:122
CORE_spinlock_Status _CORE_spinlock_Wait(CORE_spinlock_Control *the_spinlock, bool wait, Watchdog_Interval timeout)
Wait for spinlock.
Definition: corespinlockwait.c:40
This status indicates that the spinlock is currently locked and thus unavailable. ...
Definition: corespinlockimpl.h:59
uint32_t XXX
This element indicates XXX.
Definition: corespinlock.h:45
CORE_spinlock_Status _CORE_spinlock_Release(CORE_spinlock_Control *the_spinlock)
Manually release the spinlock.
Definition: corespinlockrelease.c:26
void _CORE_spinlock_Initialize(CORE_spinlock_Control *the_spinlock, CORE_spinlock_Attributes *the_spinlock_attributes)
Initialize the spinlock.
Definition: corespinlock.c:26
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdog.h:47
RTEMS_INLINE_ROUTINE bool _CORE_spinlock_Is_busy(CORE_spinlock_Control *the_spinlock)
This method is used to determine if the spinlock is available or not.
Definition: corespinlockimpl.h:137
This status indicates that a thread reached the limit of time it was willing to wait on the spin lock...
Definition: corespinlockimpl.h:51
This status indicates that a thread is currently waiting for this spin lock.
Definition: corespinlockimpl.h:55