summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-08-09smp: Use ISR lock in per-CPU controlSebastian Huber1-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().
2013-08-09score/cpu: Add CPU_Per_CPU_controlSebastian Huber1-2/+7
Add CPU port specific per-CPU control.
2013-07-31smp: Provide cache optimized Per_CPU_ControlSebastian Huber1-14/+32
Delete _Per_CPU_Information_p.
2013-07-31score: Format <rtems/score/percpu.h>Sebastian Huber1-63/+60
2013-07-30score: Add assert to _Per_CPU_Get()Sebastian Huber1-0/+3
Thread dispatching must be repressed to use the per CPU control of the current processor consistently.
2013-07-30smp: Add and use _Per_CPU_Get()Sebastian Huber1-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.
2013-07-23score: PR1782: CPU_USE_DEFERRED_FP_SWITCHSebastian Huber1-0/+4
Do not redefine CPU_USE_DEFERRED_FP_SWITCH.
2013-07-17smp: Add and use _CPU_SMP_Get_current_processor()Sebastian Huber1-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.
2013-06-12smp: Add and use _Per_CPU_Lock_acquire()Sebastian Huber1-0/+6
Add and use _Per_CPU_Lock_release().
2013-06-12score: Always provide <rtems/score/smplock.h>Sebastian Huber1-3/+1
2013-05-31smp: New SMP lock APISebastian Huber1-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.
2013-05-31score: Remove idle field of Per_CPU_ControlSebastian Huber1-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().
2013-05-29smp: Simplify SMP initialization sequenceSebastian Huber1-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().
2013-05-29smp: Make CPU_ALLOCATE_INTERRUPT_STACK optionalSebastian Huber1-4/+0
2012-11-22score: PR1607: Add and use CPU_SIZEOF_POINTERSebastian Huber1-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.
2012-11-13score: Fix per CPU member offsetsSebastian Huber1-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.
2012-10-02score/percpu.h: _Thread_Time_of_last_context_switch always availableJoel Sherrill1-5/+2
This field is used whether ticks are used for statistics or not.
2012-05-11Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill1-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-142011-09-14 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-1/+1
PR 1898/cpukit * score/include/rtems/score/percpu.h: Use CPU_STRUCTURE_ALIGNMENT for _Per_CPU_Information.
2011-07-152011-07-15 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett1-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-172011-06-17 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-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-262011-05-26 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett1-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.
2011-05-24Remove white-spaces.Ralf Corsepius1-6/+6
2011-05-202011-05-20 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett1-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-122011-05-12 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-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-112011-05-11 Jennifer Averett <Jennifer.Averett@OARcorp.com>Jennifer Averett1-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-162011-03-16 Jennifer Averett <jennifer.averett@OARcorp.com>Joel Sherrill1-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-302010-07-30 Gedare Bloom <giddyup44@yahoo.com>Joel Sherrill1-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-162010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-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-292010-06-29 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-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-292010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-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.