summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add _Per_CPU_Get_snapshot()Sebastian Huber2014-04-141-3/+12
|
* score: Add per-CPU state functionSebastian Huber2014-03-311-0/+39
| | | | | Add _Per_CPU_State_wait_for_ready_to_start_multitasking(). Add new fatal SMP error SMP_FATAL_SHUTDOWN_EARLY.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: Add SMP lock profiling supportSebastian Huber2014-03-141-3/+18
|
* score: Add per-CPU profilingSebastian Huber2014-03-141-0/+74
| | | | | | | 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.
* score: Add local context to SMP lock APISebastian Huber2014-03-111-16/+62
| | | | | | | | | | | 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: Fix per-CPU state documentationSebastian Huber2014-03-061-3/+3
|
* score: SMP initialization and shutdown changesSebastian Huber2014-03-061-34/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add and use <rtems/score/smpimpl.h>Sebastian Huber2014-02-191-7/+0
| | | | | Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
* score: Per-CPU thread dispatch disable levelSebastian Huber2013-08-091-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* score: Add and use _Per_CPU_Acquire_all().Sebastian Huber2013-08-091-0/+30
| | | | | | | 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().
* smp: Use ISR lock in per-CPU controlSebastian Huber2013-08-091-11/+19
| | | | | | | 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().
* score/cpu: Add CPU_Per_CPU_controlSebastian Huber2013-08-091-2/+7
| | | | Add CPU port specific per-CPU control.
* smp: Provide cache optimized Per_CPU_ControlSebastian Huber2013-07-311-14/+32
| | | | Delete _Per_CPU_Information_p.
* score: Format <rtems/score/percpu.h>Sebastian Huber2013-07-311-63/+60
|
* score: Add assert to _Per_CPU_Get()Sebastian Huber2013-07-301-0/+3
| | | | | Thread dispatching must be repressed to use the per CPU control of the current processor consistently.
* smp: Add and use _Per_CPU_Get()Sebastian Huber2013-07-301-7/+31
| | | | | | 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: PR1782: CPU_USE_DEFERRED_FP_SWITCHSebastian Huber2013-07-231-0/+4
| | | | Do not redefine CPU_USE_DEFERRED_FP_SWITCH.
* smp: Add and use _CPU_SMP_Get_current_processor()Sebastian Huber2013-07-171-14/+9
| | | | | | | | | | 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.
* smp: Add and use _Per_CPU_Lock_acquire()Sebastian Huber2013-06-121-0/+6
| | | | Add and use _Per_CPU_Lock_release().
* score: Always provide <rtems/score/smplock.h>Sebastian Huber2013-06-121-3/+1
|
* smp: New SMP lock APISebastian Huber2013-05-311-1/+1
| | | | | | | | | | | | | | 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.
* score: Remove idle field of Per_CPU_ControlSebastian Huber2013-05-311-5/+0
| | | | | | 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().
* smp: Simplify SMP initialization sequenceSebastian Huber2013-05-291-17/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Make CPU_ALLOCATE_INTERRUPT_STACK optionalSebastian Huber2013-05-291-4/+0
|
* score: PR1607: Add and use CPU_SIZEOF_POINTERSebastian Huber2012-11-221-4/+4
| | | | | | | | | | | | | | | | | 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.
* score: Fix per CPU member offsetsSebastian Huber2012-11-131-65/+47
| | | | | | | | 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.
* score/percpu.h: _Thread_Time_of_last_context_switch always availableJoel Sherrill2012-10-021-5/+2
| | | | This field is used whether ticks are used for statistics or not.
* 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-09-14 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber2011-09-141-1/+1
| | | | | | PR 1898/cpukit * score/include/rtems/score/percpu.h: Use CPU_STRUCTURE_ALIGNMENT for _Per_CPU_Information.
* 2011-07-15 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett2011-07-151-0/+1
| | | | | | | | * 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.
* 2011-06-17 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2011-06-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2011-05-26 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett2011-05-261-1/+7
| | | | | | | | 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.
* Remove white-spaces.Ralf Corsepius2011-05-241-6/+6
|
* 2011-05-20 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett2011-05-201-4/+3
| | | | | | | 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.
* 2011-05-12 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2011-05-121-0/+10
| | | | | | | | 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.
* 2011-05-11 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett2011-05-111-0/+5
| | | | | | | | * 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-03-16 Jennifer Averett <jennifer.averett@OARcorp.com>Joel Sherrill2011-03-161-24/+107
| | | | | | | | | | | | | | | | | | | | | | 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-07-30 Gedare Bloom <giddyup44@yahoo.com>Joel Sherrill2010-07-301-2/+2
| | | | | | | | | | | | | 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.
* 2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber2010-07-161-0/+2
| | | | | | | | | | | | * 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>.
* 2010-06-29 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2010-06-291-9/+15
| | | | | | * 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.
* 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2010-06-291-0/+166
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.