19 #ifndef _RTEMS_SCORE_CORESEMIMPL_H 20 #define _RTEMS_SCORE_CORESEMIMPL_H 24 #include <rtems/score/threaddispatch.h> 28 #include <rtems/score/status.h> 53 uint32_t initial_value
61 _Thread_queue_Acquire_critical( &the_semaphore->
Wait_queue, queue_context );
69 _Thread_queue_Release( &the_semaphore->
Wait_queue, queue_context );
84 _Thread_queue_Destroy( &the_semaphore->
Wait_queue );
104 uint32_t maximum_count,
109 Status_Control status;
111 status = STATUS_SUCCESSFUL;
113 _CORE_semaphore_Acquire_critical( the_semaphore, queue_context );
119 if ( the_thread !=
NULL ) {
127 if ( the_semaphore->
count < maximum_count )
128 the_semaphore->
count += 1;
130 status = STATUS_MAXIMUM_COUNT_EXCEEDED;
132 _CORE_semaphore_Release( the_semaphore, queue_context );
149 return the_semaphore->
count;
175 _CORE_semaphore_Acquire_critical( the_semaphore, queue_context );
176 if ( the_semaphore->
count != 0 ) {
177 the_semaphore->
count -= 1;
178 _CORE_semaphore_Release( the_semaphore, queue_context );
179 return STATUS_SUCCESSFUL;
183 _CORE_semaphore_Release( the_semaphore, queue_context );
184 return STATUS_UNSATISFIED;
197 return _Thread_Wait_get_status( executing );
RTEMS_INLINE_ROUTINE Thread_Control * _Thread_queue_First_locked(Thread_queue_Control *the_thread_queue, const Thread_queue_Operations *operations)
Returns the first thread on the thread queue if it exists, otherwise NULL.
Definition: threadqimpl.h:971
Thread queue context for the thread queue methods.
Definition: threadq.h:193
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Seize(CORE_semaphore_Control *the_semaphore, const Thread_queue_Operations *operations, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
Definition: coresemimpl.h:165
RTEMS_INLINE_ROUTINE uint32_t _CORE_semaphore_Get_count(const CORE_semaphore_Control *the_semaphore)
Definition: coresemimpl.h:145
Thread_Control * _Thread_queue_Flush_status_object_was_deleted(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Status object was deleted thread queue flush filter function.
Definition: threadqflush.c:36
void _Thread_queue_Enqueue(Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
Blocks the thread and places it on the thread queue.
Definition: threadqenqueue.c:379
#define _ISR_Get_level()
Return current interrupt level.
Definition: isrlevel.h:125
void _CORE_semaphore_Initialize(CORE_semaphore_Control *the_semaphore, uint32_t initial_value)
Initialize the semaphore based on the parameters passed.
Definition: coresem.c:23
Thread queue operations.
Definition: threadq.h:512
Thread_queue_Queue Queue
The actual thread queue.
Definition: threadq.h:578
RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Surrender(CORE_semaphore_Control *the_semaphore, const Thread_queue_Operations *operations, uint32_t maximum_count, Thread_queue_Context *queue_context)
Surrender a unit to a semaphore.
Definition: coresemimpl.h:101
size_t _Thread_queue_Flush_critical(Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
Unblocks all threads enqueued on the thread queue.
Definition: threadqflush.c:62
void _Thread_queue_Extract_critical(Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
Extracts the thread from the thread queue and unblocks it.
Definition: threadqenqueue.c:599
Inlined Routines Associated with Thread State Information.
RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_thread_state(Thread_queue_Context *queue_context, States_Control thread_state)
Sets the thread state for the thread to enqueue in the thread queue context.
Definition: threadqimpl.h:134
Inlined Routines from the Thread Handler.
#define STATES_WAITING_FOR_SEMAPHORE
Definition: statesimpl.h:48
Inlined Routines in the Object Handler.
Thread_queue_Control Wait_queue
Definition: coresem.h:48
Data Associated with the Counting Semaphore Handler.
uint32_t count
Definition: coresem.h:51
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77