| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Add _Per_CPU_State_wait_for_ready_to_start_multitasking(). Add new
fatal SMP error SMP_FATAL_SHUTDOWN_EARLY.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Add per-CPU profiling stats API. Implement the thread dispatch disable
level profiling. The interrupt profiling must be implemented in CPU
port specific parts (mostly assembler code). Add a support function
_Profiling_Outer_most_interrupt_entry_and_exit() for this purpose.
|
|
|
|
|
|
|
|
|
|
|
| |
Add a local context structure to the SMP lock API for acquire and
release pairs. This context can be used to store the ISR level and
profiling information. It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.
There is only one lock that cannot be used with a local context. This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename _SMP_Request_other_cores_to_perform_first_context_switch() into
_SMP_Request_start_multitasking() since this requests now a multitasking
start on all configured and available processors. The name corresponds
_Thread_Start_multitasking() and
_SMP_Start_multitasking_on_secondary_processor() actions issued in
response to this request. Move in source file to right place.
Rename PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING into
PER_CPU_STATE_READY_TO_START_MULTITASKING.
Rename PER_CPU_STATE_BEGIN_MULTITASKING into
PER_CPU_STATE_REQUEST_START_MULTITASKING.
Rename _SMP_Request_other_cores_to_shutdown() into
_SMP_Request_shutdown().
Add a per-CPU state lock to protect all changes. This was necessary to
offer a controlled shutdown of the system (atomic read/writes alone are
not sufficient for this kind of synchronization).
Add documentation for Per_CPU_State.
Delete debug output.
New tests smptests/smpfatal01 and smptests/smpfatal02.
|
|
|
|
|
| |
Collect SMP implementation specific parts in the
<rtems/score/smpimpl.h> header file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a per-CPU thread dispatch disable level. So instead of one global
thread dispatch disable level we have now one instance per processor.
This is a major performance improvement for SMP. On non-SMP
configurations this may simplifiy the interrupt entry/exit code.
The giant lock is still present, but it is now decoupled from the thread
dispatching in _Thread_Dispatch(), _Thread_Handler(),
_Thread_Restart_self() and the interrupt entry/exit. Access to the
giant lock is now available via _Giant_Acquire() and _Giant_Release().
The giant lock is still implicitly acquired via
_Thread_Dispatch_decrement_disable_level().
The giant lock is only acquired for high-level operations in interrupt
handlers (e.g. release of a semaphore, sending of an event).
As a side-effect this change fixes the lost thread dispatch necessary
indication bug in _Thread_Dispatch().
A per-CPU thread dispatch disable level greatly simplifies the SMP
support for the interrupt entry/exit code since no spin locks have to be
acquired in this area. It is only necessary to get the current
processor index and use this to calculate the address of the own per-CPU
control. This reduces the interrupt latency considerably.
All elements for the interrupt entry/exit code are now part of the
Per_CPU_Control structure: thread dispatch disable level, ISR nest level
and thread dispatch necessary. Nothing else is required (except CPU
port specific stuff like on SPARC).
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
| |
Rename _Per_CPU_Lock_acquire() to _Per_CPU_ISR_disable_and_acquire().
Rename _Per_CPU_Lock_release() to _Per_CPU_Release_and_ISR_enable().
Add _Per_CPU_Acquire() and _Per_CPU_Release().
|
|
|
|
| |
Add CPU port specific per-CPU control.
|
|
|
|
| |
Delete _Per_CPU_Information_p.
|
| |
|
|
|
|
|
| |
Thread dispatching must be repressed to use the per CPU control of the
current processor consistently.
|
|
|
|
|
|
| |
Add and use _Per_CPU_Get_by_index() and _Per_CPU_Get_index(). Add
_Per_CPU_Send_interrupt(). This avoids direct access of
_Per_CPU_Information.
|
|
|
|
| |
Do not redefine CPU_USE_DEFERRED_FP_SWITCH.
|
|
|
|
|
|
|
|
|
|
| |
Add and use _SMP_Get_current_processor() and
rtems_smp_get_current_processor().
Delete bsp_smp_interrupt_cpu().
Change type of current processor index from int to uint32_t to match
_SMP_Processor_count type.
|
|
|
|
| |
Add and use _Per_CPU_Lock_release().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the SMP lock implementation to the CPU port. An optimal SMP lock
implementation is highly architecture dependent. For example the memory
models may be fundamentally different.
The new SMP lock API has a flaw. It does not provide the ability to use
a local context for acquire and release pairs. Such a context is
necessary to implement for example the Mellor-Crummey and Scott (MCS)
locks. The SMP lock is currently used in _Thread_Disable_dispatch() and
_Thread_Enable_dispatch() and makes them to a giant lock acquire and
release. Since these functions do not pass state information via a
local context there is currently no use case for such a feature.
|
|
|
|
|
|
| |
This field is unused except for special case simulator clock drivers.
In these places use an alternative. Add and use
_Thread_Set_global_exit_status() and _Thread_Get_global_exit_status().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Delete bsp_smp_wait_for(). Other parts of the system work without
timeout, e.g. the spinlocks. Using a timeout here does not make the
system more robust.
Delete bsp_smp_cpu_state and replace it with Per_CPU_State. The
Per_CPU_State follows the Score naming conventions. Add
_Per_CPU_Change_state() and _Per_CPU_Wait_for_state() functions to
change and observe states.
Use Per_CPU_State in Per_CPU_Control instead of the anonymous integer.
Add _CPU_Processor_event_broadcast() and _CPU_Processor_event_receive()
functions provided by the CPU port. Use these functions in
_Per_CPU_Change_state() and _Per_CPU_Wait_for_state().
Add prototype for _SMP_Send_message().
Delete RTEMS_BSP_SMP_FIRST_TASK message. The first context switch is
now performed in rtems_smp_secondary_cpu_initialize(). Issuing the
first context switch in the context of the inter-processor interrupt is
not possible on systems with a modern interrupt controller. Such an
interrupt controler usually requires a handshake protocol with interrupt
acknowledge and end of interrupt signals. A direct context switch in an
interrupt handler circumvents the interrupt processing epilogue and may
leave the system in an inconsistent state.
Release lock in rtems_smp_process_interrupt() even if no message was
delivered. This prevents deadlock of the system.
Simplify and format _SMP_Send_message(),
_SMP_Request_other_cores_to_perform_first_context_switch(),
_SMP_Request_other_cores_to_dispatch() and
_SMP_Request_other_cores_to_shutdown().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add and use new CPU port define CPU_SIZEOF_POINTER. It must be an
integer literal that can be used by the assembler. This value will be
used to calculate offsets of structure members. These offsets will be
used in assembler code.
The size of a pointer is part of the application binary interface (ABI)
and thus independent of the actual programming language. The compiler
will provide defines to determine the current ABI. We use these defines
to select the appropriate CPU_SIZEOF_POINTER value.
Static assertions in the new file "cpukit/score/src/percpuasm.c" will
ensure that the value of CPU_SIZEOF_POINTER is consistent with the
current compiler settings. Also the offset values used by assembler
code are verfied.
|
|
|
|
|
|
|
|
| |
Offset calculation was wrong for 16-bit and 64-bit pointer targets.
Remove unused offsets. Move Per_CPU_Control::dispatch_necessary after
Per_CPU_Control::isr_nest_level. Move SMP members to end of structure.
All assembler relevant members are now at the structure beginning.
|
|
|
|
| |
This field is used whether ticks are used for statistics or not.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
PR 1898/cpukit
* score/include/rtems/score/percpu.h: Use CPU_STRUCTURE_ALIGNMENT for
_Per_CPU_Information.
|
|
|
|
|
|
|
|
| |
* score/Makefile.am, score/preinstall.am,
score/include/rtems/score/isr.h, score/include/rtems/score/percpu.h:
Split isrlevel into its own file to avoid a circular dependancy in
smp code.
* score/include/rtems/score/isrlevel.h: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* rtems/include/rtems/rtems/types.h,
score/include/rtems/score/address.h,
score/include/rtems/score/apiext.h,
score/include/rtems/score/bitfield.h,
score/include/rtems/score/context.h,
score/include/rtems/score/corebarrier.h,
score/include/rtems/score/coremsg.h,
score/include/rtems/score/coremutex.h,
score/include/rtems/score/corerwlock.h,
score/include/rtems/score/coresem.h,
score/include/rtems/score/corespinlock.h,
score/include/rtems/score/interr.h, score/include/rtems/score/isr.h,
score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h,
score/include/rtems/score/objectmp.h,
score/include/rtems/score/percpu.h,
score/include/rtems/score/priority.h,
score/include/rtems/score/rbtree.h,
score/include/rtems/score/scheduler.h,
score/include/rtems/score/smp.h, score/include/rtems/score/smplock.h,
score/include/rtems/score/stack.h,
score/include/rtems/score/states.h,
score/include/rtems/score/thread.h,
score/include/rtems/score/threadq.h,
score/include/rtems/score/threadsync.h,
score/include/rtems/score/timespec.h,
score/include/rtems/score/timestamp.h,
score/include/rtems/score/timestamp64.h,
score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h,
score/include/rtems/score/watchdog.h,
score/include/rtems/score/wkspace.h: Mark Score files as in Score
Group to improve Doxygen output.
|
|
|
|
|
|
|
|
| |
PR 1796/cpukit
* sapi/src/exshutdown.c, score/include/rtems/score/percpu.h,
score/include/rtems/score/smp.h, score/src/smp.c,
score/src/threaddispatch.c, score/src/threadhandler.c: Added SMP
interprocess communications.
|
| |
|
|
|
|
|
|
|
| |
PR 1787/cpukit
* score/include/rtems/score/percpu.h,
score/include/rtems/score/smplock.h, score/src/smp.c,
score/src/smplock.c: Add nesting support to smp spinlock.
|
|
|
|
|
|
|
|
| |
PR 1788/cpukit
* score/include/rtems/score/percpu.h,
score/include/rtems/score/thread.h: Make time of last context switch
part of per cpu information since each core has a different context
switch to track.
|
|
|
|
|
|
|
|
| |
* score/Makefile.am, score/preinstall.am,
score/include/rtems/score/percpu.h, score/src/percpu.c,
score/src/threadcreateidle.c: Modifications to restrict compilation
of SMP only code to when SMP is enabled. Entire SMP specific files
are disabled via Makefile.am.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 1729/cpukit
* configure.ac, sapi/include/confdefs.h, sapi/src/exinit.c,
score/Makefile.am, score/preinstall.am,
score/cpu/i386/rtems/score/cpu.h, score/cpu/sparc/cpu_asm.S,
score/cpu/sparc/rtems/score/cpu.h,
score/include/rtems/score/basedefs.h,
score/include/rtems/score/context.h,
score/include/rtems/score/percpu.h, score/src/percpu.c,
score/src/thread.c, score/src/threadcreateidle.c: Add next step in
SMP support. This adds an allocated array of the Per_CPU structures
to support multiple cpus vs a single instance of the structure which
is still used if SMP support is disabled. Configuration support is
also added to explicitly enable or disable SMP. But SMP can only be
enabled for the CPUs which will support it initially -- SPARC and
i386. With the stub BSP support, a BSP can be run as a single core
SMP system from an RTEMS data structure standpoint.
* aclocal/check-smp.m4, aclocal/enable-smp.m4,
score/include/rtems/bspsmp.h, score/include/rtems/score/smplock.h,
score/src/smp.c, score/src/smplock.c: New files.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR 1599/cpukit
* posix/src/psignalunblockthread.c, posix/src/pthreadkill.c,
rtems/src/signalsend.c, score/include/rtems/score/percpu.h,
score/inline/rtems/score/thread.inl, score/src/thread.c,
score/src/threadchangepriority.c, score/src/threadclearstate.c,
score/src/threaddispatch.c, score/src/threadready.c,
score/src/threadresume.c, score/src/threadsetstate.c,
score/src/threadstartmultitasking.c, score/src/threadsuspend.c,
score/src/threadyieldprocessor.c: Rename _Context_Switch_necessary to
_Thread_Dispatch_necessary to more properly reflect the intent.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* score/include/rtems/score/basedefs.h: New file.
* score/Makefile.am, score/preinstall.am: Reflect change above.
* score/include/rtems/score/percpu.h: Include <rtems/score/cpu.h>.
* score/include/rtems/system.h: Moved definition of SCORE_EXTERN,
SAPI_EXTERN, RTEMS_EXTERN, POSIX_EXTERN, RTEMS_INLINE_ROUTINE,
RTEMS_COMPILER_MEMORY_BARRIER, RTEMS_COMPILER_NO_RETURN_ATTRIBUTE,
RTEMS_COMPILER_DEPRECATED_ATTRIBUTE, TRUE, and FALSE to
<rtems/score/basedefs.h>.
Removed include of <rtems/score/cpu.h>, <stdint.h> and <stddef.h>.
|
|
|
|
|
|
| |
* configure.ac, score/include/rtems/score/percpu.h: Add
__RTEMS_SIZEOF_VOID_P__ to cpuopts.h so percpu.h has this information
available during build and after installation.
|
|
PR 1573/cpukit
* configure.ac, posix/src/killinfo.c,
posix/src/psignalclearprocesssignals.c,
posix/src/psignalsetprocesssignals.c,
posix/src/psignalunblockthread.c, posix/src/pthreadcreate.c,
posix/src/pthreadkill.c, posix/src/pthreadsigmask.c,
rtems/src/signalsend.c, rtems/src/taskmode.c, score/Makefile.am,
score/preinstall.am, score/include/rtems/system.h,
score/include/rtems/score/context.h, score/include/rtems/score/isr.h,
score/include/rtems/score/thread.h, score/src/isr.c,
score/src/isrthreaddispatch.c, score/src/thread.c,
score/src/threaddispatch.c, score/src/threadloadenv.c: Add a per cpu
data structure which contains the information required by RTEMS for
each CPU core. This encapsulates information such as thread
executing, heir, idle and dispatch needed.
* score/include/rtems/score/percpu.h, score/src/percpu.c: New files.
|