38#ifndef _RTEMS_SCORE_CORESEMIMPL_H
39#define _RTEMS_SCORE_CORESEMIMPL_H
73 uint32_t initial_value
84static inline void _CORE_semaphore_Acquire_critical(
89 _Thread_queue_Acquire_critical( &the_semaphore->
Wait_queue, queue_context );
100static inline void _CORE_semaphore_Release(
105 _Thread_queue_Release( &the_semaphore->
Wait_queue, queue_context );
117static inline void _CORE_semaphore_Destroy(
129 _Thread_queue_Destroy( &the_semaphore->
Wait_queue );
151 uint32_t maximum_count,
158 status = STATUS_SUCCESSFUL;
160 _CORE_semaphore_Acquire_critical( the_semaphore, queue_context );
164 if ( heads != NULL ) {
172 if ( the_semaphore->
count < maximum_count )
173 the_semaphore->
count += 1;
175 status = STATUS_MAXIMUM_COUNT_EXCEEDED;
177 _CORE_semaphore_Release( the_semaphore, queue_context );
190static inline uint32_t _CORE_semaphore_Get_count(
194 return the_semaphore->
count;
227 _CORE_semaphore_Acquire_critical( the_semaphore, queue_context );
228 if ( the_semaphore->
count != 0 ) {
229 the_semaphore->
count -= 1;
230 _CORE_semaphore_Release( the_semaphore, queue_context );
231 return STATUS_SUCCESSFUL;
235 _CORE_semaphore_Release( the_semaphore, queue_context );
236 return STATUS_UNSATISFIED;
239 _Thread_queue_Context_set_thread_state(
249 return _Thread_Wait_get_status( executing );
This header file provides interfaces of the Semaphore Handler which are used by the implementation an...
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG and static analysis runs.
Definition: assert.h:96
#define _ISR_Get_level()
Return current interrupt level.
Definition: isrlevel.h:147
void _CORE_semaphore_Initialize(CORE_semaphore_Control *the_semaphore, uint32_t initial_value)
Initializes the semaphore based on the parameters passed.
Definition: coresem.c:44
#define STATES_WAITING_FOR_SEMAPHORE
Definition: statesimpl.h:68
Status_Control
Status codes.
Definition: status.h:111
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:407
void _Thread_queue_Surrender_no_priority(Thread_queue_Queue *queue, Thread_queue_Heads *heads, Thread_queue_Context *queue_context, const Thread_queue_Operations *operations)
Surrenders the thread queue previously owned by the thread to the first enqueued thread.
Definition: threadqenqueue.c:739
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:60
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:86
This header file provides interfaces of the Object Handler which are only used by the implementation.
This header file provides the interfaces of the Operation Status Support.
This header file provides interfaces of the Thread States which are only used by the implementation.
Thread_queue_Control Wait_queue
Definition: coresem.h:68
uint32_t count
Definition: coresem.h:71
Thread queue context for the thread queue methods.
Definition: threadq.h:216
Thread_queue_Queue Queue
The actual thread queue.
Definition: threadq.h:640
The thread queue operations are used to manage the threads of a thread queue.
Definition: threadq.h:554
Thread_queue_Heads * heads
The thread queue heads.
Definition: threadq.h:451
Thread queue heads.
Definition: threadq.h:385
This header file provides the interfaces of the Thread Handler related to thread dispatching.
This header file provides interfaces of the Thread Handler which are only used by the implementation.
This header file provides interfaces of the Thread Queue Handler which are only used by the implement...