18 #ifndef _RTEMS_SCORE_USEREXTIMPL_H 19 #define _RTEMS_SCORE_USEREXTIMPL_H 122 extension->Callouts = *extension_table;
234 Internal_errors_t error;
291 static inline bool _User_extensions_Thread_create(
Thread_Control *created )
309 static inline void _User_extensions_Thread_delete(
Thread_Control *deleted )
323 static inline void _User_extensions_Thread_start(
Thread_Control *started )
337 static inline void _User_extensions_Thread_restart(
Thread_Control *restarted )
351 static inline void _User_extensions_Thread_begin(
Thread_Control *executing )
366 static inline void _User_extensions_Thread_switch(
379 if ( node != tail ) {
380 #if defined(RTEMS_SMP) 384 cpu_self = _Per_CPU_Get();
387 _Per_CPU_Acquire( cpu_self, &lock_context );
389 executing = cpu_self->ancestor;
390 cpu_self->ancestor = heir;
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 );
423 static inline void _User_extensions_Thread_exitted(
Thread_Control *executing )
438 static inline void _User_extensions_Fatal(
440 Internal_errors_t error
457 static inline void _User_extensions_Thread_terminate(
473 static inline void _User_extensions_Acquire(
ISR_lock_Context *lock_context )
486 static inline void _User_extensions_Release(
ISR_lock_Context *lock_context )
500 static inline void _User_extensions_Destroy_iterators(
507 _User_extensions_Acquire( &lock_context );
511 while ( iter !=
NULL ) {
513 iter = iter->previous;
516 _User_extensions_Release( &lock_context );
Manages the switch callouts.
Definition: userextdata.h:39
Definition: userextimpl.h:232
RTEMS_INLINE_ROUTINE void _Chain_Iterator_destroy(Chain_Iterator *the_iterator)
Destroys the iterator.
Definition: chainimpl.h:1121
User Extension Handler Data Structures.
RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set(User_extensions_Control *extension)
Adds a user extension.
Definition: userextimpl.h:104
A chain iterator which is updated during node extraction if it is properly registered.
Definition: chainimpl.h:902
#define _ISR_lock_Release_and_ISR_enable(_lock, _context)
Releases an ISR lock.
Definition: isrlock.h:263
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_next(const Chain_Node *the_node)
Returns pointer to the immutable next node from this node.
Definition: chainimpl.h:343
void _User_extensions_Thread_delete_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Deletes a visitor.
Definition: userextiterate.c:55
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.
Definition: userextiterate.c:107
Chain iterator for dynamic user extensions.
Definition: userextimpl.h:46
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
Definition: isrlock.h:419
Chain_Control _User_extensions_Switches_list
List of active task switch extensions.
RTEMS_INLINE_ROUTINE 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.
Definition: userextimpl.h:117
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.
Definition: userextiterate.c:120
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_first(const Chain_Control *the_chain)
Returns pointer to immutable chain's first node.
Definition: chainimpl.h:277
struct User_extensions_Iterator * last_user_extensions_iterator
LIFO list of user extensions iterators.
Definition: thread.h:876
void _User_extensions_Handler_initialization(void)
Initializes the user extensions handler.
Definition: userext.c:24
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
Definition: interr.h:47
void _User_extensions_Thread_restart_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Restarts a visitor.
Definition: userextiterate.c:81
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.
Definition: userextiterate.c:94
struct User_extensions_Iterator User_extensions_Iterator
Chain iterator for dynamic user extensions.
User_extensions_List _User_extensions_List
List of active extensions.
Definition: userextiterate.c:31
#define ISR_LOCK_MEMBER(_designator)
Defines an ISR lock member.
Definition: isrlock.h:89
Per CPU Core Structure.
Definition: percpu.h:347
void _User_extensions_Add_set(User_extensions_Control *extension)
Adds a user extension.
Definition: userextaddset.c:45
void _User_extensions_Remove_set(User_extensions_Control *extension)
Removes a user extension.
Definition: userextremoveset.c:25
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_tail(const Chain_Control *the_chain)
Returns pointer to immutable chain tail.
Definition: chainimpl.h:243
Definition: userextimpl.h:51
Definition: userextimpl.h:149
#define _ISR_lock_ISR_disable_and_acquire(_lock, _context)
Acquires an ISR lock.
Definition: isrlock.h:238
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.
Definition: userextiterate.c:149
void(* User_extensions_Visitor)(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
User extension visitor.
Definition: userextimpl.h:143
Iteration from head to tail.
Definition: chainimpl.h:888
#define _ISR_lock_ISR_disable(_context)
Disables interrupts and saves the previous interrupt state in the ISR lock context.
Definition: isrlock.h:398
User extension table.
Definition: userext.h:232
Chain_Iterator_registry Iterators
Chain iterator registration.
Definition: userextimpl.h:60
Manages each user extension set.
Definition: userextdata.h:50
Chain_Control Active
Active dynamically added user extensions.
Definition: userextimpl.h:55
void _User_extensions_Thread_create_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Creates a visitor.
Definition: userextiterate.c:40
void _User_extensions_Thread_terminate_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Terminates a visitor.
Definition: userextiterate.c:135
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
Chain_Iterator_direction
The chain iterator direction.
Definition: chainimpl.h:884
Iteration from tail to head.
Definition: chainimpl.h:893
void _User_extensions_Thread_start_visitor(Thread_Control *executing, void *arg, const User_extensions_Table *callouts)
Starts a visitor.
Definition: userextiterate.c:68
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
Constants and Structures Related with the Thread Control Block.
A registry for chain iterators.
Definition: chainimpl.h:934
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77