Age | Commit message (Collapse) | Author |
|
Use the following variant which was already used by most source files:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
|
|
In uniprocessor and SMP configurations, the context switch extensions
were called during _Thread_Do_dispatch():
void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level )
{
Thread_Control *executing;
executing = cpu_self->executing;
...
do {
Thread_Control *heir;
heir = _Thread_Get_heir_and_make_it_executing( cpu_self );
...
_User_extensions_Thread_switch( executing, heir );
...
_Context_Switch( &executing->Registers, &heir->Registers );
...
} while ( cpu_self->dispatch_necessary );
...
}
In uniprocessor configurations, this is fine and the context switch
extensions are called for all thread switches except the very first
thread switch to the initialization thread. However, in SMP
configurations, the context switch may be invalidated and updated in the
low-level _Context_Switch() routine. See:
https://docs.rtems.org/branches/master/c-user/symmetric_multiprocessing_services.html#thread-dispatch-details
In case such an update happens, a thread will execute on the processor
which was not seen in the previous call of the context switch
extensions. This can confuse for example event record consumers which
use events generated by a context switch extension.
Fixing this is not straight forward. The context switch extensions call
must move after the low-level context switch. The problem here is that
we may end up in _Thread_Handler(). Adding the context switch
extensions call to _Thread_Handler() covers now also the thread switch
to the initialization thread. We also have to save the last executing
thread (ancestor) of the processor. Registers or the stack cannot be
used for this purpose. We have to add it to the per-processor
information. Existing extensions may be affected, since now context
switch extensions use the stack of the heir thread. The stack checker
is affected by this.
Calling the thread switch extensions in the low-level context switch is
difficult since at this point an intermediate stack is used which is
only large enough to enable servicing of interrupts.
Update #3885.
|
|
The use of a hand crafted lock for Per_CPU_Control::Lock was necessary
at some point in the SMP support development, but it is no longer
justified.
|
|
Update #3706
|
|
|
|
Add a lock and use a chain iterator for safe iteration during concurrent
user extension addition and removal.
Ensure that dynamically added thread delete and fatal extensions are
called in reverse order.
Update #2555.
Update #2692.
|
|
The rtems_extension_create() no longer uses the Giant lock. Ensure that
we call _User_extensions_Add_set() only in the right context.
Update #2555.
|
|
|
|
Add and use _Per_CPU_Release_all().
The context switch user extensions are invoked in _Thread_Dispatch().
This change is necessary to avoid the giant lock in _Thread_Dispatch().
|
|
This file contains the parts of <rtems/score/userext.h> that are only
necessary for the RTEMS implementation.
|
|
Script does what is expected and tries to do it as
smartly as possible.
+ remove occurrences of two blank comment lines
next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
contain CVS Ids
+ If the processing left a blank line at the top of
a file, it was removed.
|
|
* sapi/include/rtems/extension.h, sapi/src/extensiondelete.c,
sapi/src/extensionident.c, sapi/src/extensioncreate.c,
sapi/inline/rtems/extension.inl, score/include/rtems/score/userext.h,
score/src/userextthreaddelete.c, score/src/userext.c,
score/src/userextthreadcreate.c, score/src/userextremoveset.c,
score/src/userextthreadbegin.c, score/src/userextaddset.c,
score/src/userextthreadstart.c, score/src/userextthreadswitch.c,
score/src/userextthreadrestart.c: Documentation. The types
User_extensions_routine and rtems_extension are now deprecated.
Removed unused types User_extensions_thread_post_switch_extension and
rtems_task_post_switch_extension. Renamed _User_extensions_Add_API_set()
in _User_extensions_Add_set(). Renamed _User_extensions_Add_set() in
_User_extensions_Add_set_with_table().
* score/src/userextaddapiset.c: Removed file.
* score/Makefile.am: Update.
|
|
* libcsupport/include/rtems/libcsupport.h, libcsupport/src/newlibc.c,
sapi/Makefile.am, sapi/include/confdefs.h, sapi/src/exinit.c,
score/Makefile.am, score/preinstall.am,
score/include/rtems/score/userext.h, score/src/chain.c,
score/src/userext.c: Switch to newlib reentrancy extension being
installed in the initial set instead of using rtems_extension_create.
While implementing this, noticed that user extensions and chain code
had multiple functions in a single file which is not desirable in the
SuperCore and API portions of RTEMS, so split these into multiple
files with one function per file. Also noticed that some of user
extension code was inlined for no particular reason so moved that to
C bodies. Split executive shutdown from initialization since not
every application shuts down. Moved __fini call to executive shutdown
to be more symmetrical with where it is called at startup.
* sapi/src/exshutdown.c, score/src/chainappend.c,
score/src/chainextract.c, score/src/chainget.c,
score/src/chaininsert.c, score/src/userextaddapiset.c,
score/src/userextaddset.c, score/src/userextremoveset.c,
score/src/userextthreadbegin.c, score/src/userextthreadcreate.c,
score/src/userextthreaddelete.c, score/src/userextthreadrestart.c,
score/src/userextthreadstart.c, score/src/userextthreadswitch.c: New
files.
* score/inline/rtems/score/userext.inl: Removed.
|