18 #ifndef _RTEMS_SCORE_USEREXTIMPL_H 19 #define _RTEMS_SCORE_USEREXTIMPL_H 122 extension->Callouts = *extension_table;
234 Internal_errors_t error;
379 if ( node != tail ) {
380 #if defined(RTEMS_SMP) 384 cpu_self = _Per_CPU_Get();
387 _Per_CPU_Acquire( cpu_self, &lock_context );
398 if ( executing != heir ) {
401 while ( node != tail ) {
406 (*extension->thread_switch)( executing, heir );
409 #if defined(RTEMS_SMP) 412 _Per_CPU_Release( cpu_self, &lock_context );
440 Internal_errors_t error
511 while ( iter != NULL ) {
513 iter = iter->previous;
Manages the switch callouts.
static void _User_extensions_Thread_terminate(Thread_Control *executing)
Terminates the executing thread.
static __inline__ void _Chain_Iterator_destroy(Chain_Iterator *the_iterator)
Destroys the iterator.
User Extension Handler Data Structures.
A chain iterator which is updated during node extraction if it is properly registered.
#define _ISR_lock_Release_and_ISR_enable(_lock, _context)
Releases an ISR lock.
static void _User_extensions_Thread_restart(Thread_Control *restarted)
Restarts a thread.
static void _User_extensions_Fatal(Internal_errors_Source source, Internal_errors_t error)
Forwards all visitors that there was a fatal failure.
void _User_extensions_Thread_delete_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Deletes a visitor.
void _User_extensions_Thread_exitted_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Calls the exitted function of the thread callout for the visitor.
static void _User_extensions_Thread_delete(Thread_Control *deleted)
Deletes a thread.
Chain iterator for dynamic user extensions.
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
Chain_Control _User_extensions_Switches_list
List of active task switch extensions.
struct _Thread_Control * ancestor
The ancestor of the executing thread.
void _User_extensions_Fatal_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Calls the fatal function of the thread callout for the visitor.
static bool _User_extensions_Thread_create(Thread_Control *created)
Creates a thread.
struct User_extensions_Iterator * last_user_extensions_iterator
LIFO list of user extensions iterators.
void _User_extensions_Handler_initialization(void)
Initializes the user extensions handler.
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
static void _User_extensions_Thread_switch(Thread_Control *executing, Thread_Control *heir)
Switches the thread from the executing to the heir.
void _User_extensions_Thread_restart_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Restarts a visitor.
void _User_extensions_Thread_begin_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Calls the begin function of the thread callout for the visitor.
struct User_extensions_Iterator User_extensions_Iterator
Chain iterator for dynamic user extensions.
User_extensions_List _User_extensions_List
List of active extensions.
#define ISR_LOCK_MEMBER(_designator)
Defines an ISR lock member.
static void _User_extensions_Destroy_iterators(Thread_Control *the_thread)
Destroys all user extension iterators of a thread.
void _User_extensions_Add_set(User_extensions_Control *extension)
Adds a user extension.
void _User_extensions_Remove_set(User_extensions_Control *extension)
Removes a user extension.
static __inline__ void _User_extensions_Add_set_with_table(User_extensions_Control *extension, const User_extensions_Table *extension_table)
Adds a user extension with the given extension table as callouts.
static __inline__ const Chain_Node * _Chain_Immutable_next(const Chain_Node *the_node)
Returns pointer to the immutable next node from this node.
static void _User_extensions_Thread_begin(Thread_Control *executing)
Begins a thread.
static void _User_extensions_Release(ISR_lock_Context *lock_context)
Releases the lock context and enables interrupts.
static void _User_extensions_Thread_start(Thread_Control *started)
Starts a thread.
#define _ISR_lock_ISR_disable_and_acquire(_lock, _context)
Acquires an ISR lock.
void _User_extensions_Iterate(void *arg, User_extensions_Visitor visitor, Chain_Iterator_direction direction)
Iterates through all user extensions and calls the visitor for each.
void(* User_extensions_Visitor)(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
User extension visitor.
static __inline__ const Chain_Node * _Chain_Immutable_first(const Chain_Control *the_chain)
Returns pointer to immutable chain's first node.
Iteration from head to tail.
#define _ISR_lock_ISR_disable(_context)
Disables interrupts and saves the previous interrupt state in the ISR lock context.
Chain_Iterator_registry Iterators
Chain iterator registration.
Manages each user extension set.
Chain_Control Active
Active dynamically added user extensions.
void _User_extensions_Thread_create_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Creates a visitor.
void _User_extensions_Thread_terminate_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Terminates a visitor.
static __inline__ void _User_extensions_Add_API_set(User_extensions_Control *extension)
Adds a user extension.
Local ISR lock context for acquire and release pairs.
Chain_Iterator_direction
The chain iterator direction.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
static void _User_extensions_Acquire(ISR_lock_Context *lock_context)
Disables interrupts and acquires the lock context.
Iteration from tail to head.
void _User_extensions_Thread_start_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Starts a visitor.
Constants and Structures Related with the Thread Control Block.
static void _User_extensions_Thread_exitted(Thread_Control *executing)
A user extension thread exitted.
static __inline__ const Chain_Node * _Chain_Immutable_tail(const Chain_Control *the_chain)
Returns pointer to immutable chain tail.
A registry for chain iterators.