summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/percpu.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score/src/[n-s]*.c: Change license to BSD-2Joel Sherrill2022-02-281-3/+22
| | | | Updates #3053.
* score: Simplify SMP processor state handlingSebastian Huber2021-07-281-148/+3
| | | | | | | | The per-CPU states which control the SMP system initialization were added quite early during the SMP support development. Replace this initial implementation with a simplified one. There is no longer a global SMP lock required which serialized the state changes of all processors. The new implementation better integrates with the per-CPU jobs.
* score: Remove processor event broadcast/receiveSebastian Huber2021-07-281-11/+9
| | | | | | Remove _CPU_SMP_Processor_event_broadcast() and _CPU_SMP_Processor_event_receive(). These functions are hard to use since they are subject to the lost wake up problem.
* score: Canonicalize Doxygen @file commentsSebastian Huber2020-12-021-2/+3
| | | | | | Use common phrases for the file brief descriptions. Update #3706.
* doxygen: Switch @brief and @ingroupSebastian Huber2020-04-281-1/+2
| | | | This order change fixes the Latex documentation build via Doxygen.
* Canonicalize config.h includeSebastian Huber2020-04-161-1/+1
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* score: Remove _SMP_Before_multitasking_action()Sebastian Huber2019-04-121-70/+0
| | | | Use _SMP_Multicast_action() instead.
* score: Improve _SMP_Multicast_action()Sebastian Huber2019-04-121-0/+2
| | | | Let it work during system initialization.
* score: Add _SMP_Before_multitasking_action()Sebastian Huber2016-03-041-7/+85
| | | | | | | | | The use case for this is the Cortex-A9 MPCore which has per-processor registers (only accessible by a particular processor) for the global timer used by the clock driver. This might be useful for other drivers as well. Update #2554.
* score: Ensure properties of CPU_Uint32ptrSebastian Huber2015-03-171-0/+10
|
* score: Use common names for per-CPU variablesSebastian Huber2014-04-221-16/+16
| | | | | | | | | | | | | | | | Use "cpu" for an arbitrary Per_CPU_Control variable. Use "cpu_self" for the Per_CPU_Control of the current processor. Use "cpu_index" for an arbitrary processor index. Use "cpu_index_self" for the processor index of the current processor. Use "cpu_count" for the processor count obtained via _SMP_Get_processor_count(). Use "cpu_max" for the processor maximum obtained by rtems_configuration_get_maximum_processors().
* score: Add clustered/partitioned schedulingSebastian Huber2014-04-151-2/+1
| | | | | | | | | | | | | | | Clustered/partitioned scheduling helps to control the worst-case latencies in the system. The goal is to reduce the amount of shared state in the system and thus prevention of lock contention. Modern multi-processor systems tend to have several layers of data and instruction caches. With clustered/partitioned scheduling it is possible to honour the cache topology of a system and thus avoid expensive cache synchronization traffic. We have clustered scheduling in case the set of processors of a system is partitioned into non-empty pairwise-disjoint subsets. These subsets are called clusters. Clusters with a cardinality of one are partitions. Each cluster is owned by exactly one scheduler instance.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: Add SMP lock profiling supportSebastian Huber2014-03-141-1/+2
|
* score: Add local context to SMP lock APISebastian Huber2014-03-111-17/+5
| | | | | | | | | | | 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.
* score: SMP initialization and shutdown changesSebastian Huber2014-03-061-14/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* score: Move _SMP_Handler_initialize()Sebastian Huber2014-02-191-31/+0
|
* score: Rename bsp_smp_initialize()Sebastian Huber2014-02-191-2/+1
| | | | | Rename bsp_smp_initialize() into _CPU_SMP_Initialize() since every CPU port must supply this function.
* score: Move SMP interrupt stack initializationSebastian Huber2014-02-191-21/+0
| | | | | | | Move SMP interrupt stack initialization for secondary processors from _SMP_Handler_initialize() to _ISR_Handler_initialization() to avoid code duplication. Apply _CPU_Interrupt_stack_setup() to all interrupt stacks.
* smp: Provide cache optimized Per_CPU_ControlSebastian Huber2013-07-311-4/+1
| | | | Delete _Per_CPU_Information_p.
* smp: Add and use _Per_CPU_Get()Sebastian Huber2013-07-301-3/+5
| | | | | | 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.
* score: Include missing <rtems/score/address.h>Sebastian Huber2013-07-231-0/+1
|
* score: Include missing header filesSebastian Huber2013-07-221-0/+1
|
* smp: Rename _CPU_Processor_event_receive()Sebastian Huber2013-07-171-1/+1
| | | | Rename to _CPU_SMP_Processor_event_receive().
* smp: Rename _CPU_Processor_event_broadcast()Sebastian Huber2013-07-171-1/+1
| | | | Rename to _CPU_SMP_Processor_event_broadcast().
* smp: Simplify SMP initialization sequenceSebastian Huber2013-05-291-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* smp: Simplify main CPU initializationSebastian Huber2013-05-291-2/+10
| | | | | | Call _SMP_Handler_initialize() later and move bsp_smp_initialize() into _SMP_Handler_initialize(). Change bsp_smp_initialize() prototype to match integer types of calling context.
* smp: Make CPU_ALLOCATE_INTERRUPT_STACK optionalSebastian Huber2013-05-291-9/+13
|
* smp: Rely on BSS initializationSebastian Huber2013-05-291-5/+0
| | | | | | The _Per_CPU_Information is part of the BSS segment and must be zero initialized. Some processors may already poll some per-CPU fields and wait for a state change at this point.
* smp: Add maximum_processors field to configSebastian Huber2013-05-161-1/+1
| | | | | | | Delete rtems_configuration_get_smp_maximum_processors(). Delete rtems_configuration_smp_maximum_processors variable. Add maximum_processors field to rtems_configuration_table if RTEMS_SMP is defined. Add rtems_configuration_get_maximum_processors().
* score misc: Clean up Doxygen (GCI 2012)Alex Ivanov2012-11-281-0/+7
| | | | | | This patch is a task from GCI 2012 which improves the Doxygen comments in the RTEMS source. https://google-melange.appspot.com/gci/task/view/google/gci2012/7978208
* sapi: Use rtems_config*_get_interrupt_stack_sizeSebastian Huber2012-11-071-1/+1
|
* Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill2012-05-111-2/+0
| | | | | | | | | | | | 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.
* 2011-10-07 Daniel Hellstrom <daniel@gaisler.com>Joel Sherrill2011-10-071-1/+1
| | | | | | PR 1931/cpukit * score/src/percpu.c: The stack must be aligned to CPU alignment requirement.
* 2011-05-11 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett2011-05-111-2/+3
| | | | | | | | * 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.
* 2011-04-27 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett2011-04-271-1/+1
| | | | | | | | | PR 1784 * sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/include/rtems/bspsmp.h, score/src/percpu.c, score/src/smp.c, score/src/threadcreateidle.c: Split bspsmp.h into two files smp.h and bspsmp.h * score/include/rtems/score/smp.h: New file.
* 2011-04-04 Joel Sherrill <joel.sherrilL@OARcorp.com>Joel Sherrill2011-04-041-3/+1
| | | | | | | | PR 1773/cpukit * sapi/include/confdefs.h, sapi/src/exinit.c, score/include/rtems/bspsmp.h, score/src/percpu.c, score/src/thread.c: Rename rtems_smp_maximum_processor to rtems_configuration_smp_maximum_processor. Eliminate printk().
* All possible cpus must be initialized prior to determining how many are ↵Jennifer Averett2011-03-181-1/+4
| | | | actually used.
* 2011-03-16 Jennifer Averett <jennifer.averett@OARcorp.com>Joel Sherrill2011-03-161-7/+42
| | | | | | | | | | | | | | | | | | | | | | 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.
* 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2010-06-291-0/+29
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.