summaryrefslogtreecommitdiffstats
path: root/cpukit/score (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add function to destroy SMP locksSebastian Huber2014-03-112-4/+44
|
* score: Add local context to SMP lock APISebastian Huber2014-03-1113-149/+280
| | | | | | | | | | | 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.
* arm: Fix stack alignment in interrupt handlerSebastian Huber2014-03-101-29/+19
| | | | | | According to AAPCS, section 5.2.1.2, "Stack constraints at a public interface" the stack must be 8 byte aligned. This was not the case during interrupt processing.
* POSIX keys now enabled in all configurations.Joel Sherrill2014-03-072-1/+18
| | | | | | | Formerly POSIX keys were only enabled when POSIX threads were enabled. Because they are a truly safe alternative to per-task variables in an SMP system, they are being enabled in all configurations.
* Remove trailing whitespace in previous patchesJennifer Averett2014-03-074-9/+9
|
* score: Add cpuset support to Score.Jennifer Averett2014-03-078-1/+361
| | | | | | This new Score Handler provides a structure to manage a cpu_set_t plus helper routines to validate the contents against the current system configuration.
* score: Fix per-CPU state documentationSebastian Huber2014-03-061-3/+3
|
* score: Delete _Thread_Dispatch_set_disable_level()Sebastian Huber2014-03-062-60/+0
| | | | | This function was only used in some tests and can be replaced with other functions.
* score: Add _Atomic_Fence()Sebastian Huber2014-03-062-0/+14
|
* score: Add and use _Giant_Drop()Sebastian Huber2014-03-063-0/+33
| | | | New test smptests/smpfatal03.
* score: SMP initialization and shutdown changesSebastian Huber2014-03-067-118/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* sparc: Fix CPU counter supportSebastian Huber2014-02-243-2/+84
| | | | | | | | The SPARC processors supported by RTEMS have no built-in CPU counter support. We have to use some hardware counter module for this purpose. The BSP must provide a 32-bit register which contains the current CPU counter value and a function for the difference calculation. It can use for example the GPTIMER instance used for the clock driver.
* score: Fix thread TLS area initializationSebastian Huber2014-02-241-8/+13
| | | | | Do not use _TLS_Size here since this will lead GCC to assume that this symbol is not 0 and the later > 0 test will be optimized away.
* score: _CPU_SMP_Get_current_processor()Sebastian Huber2014-02-217-13/+9
| | | | | | | Remove RTEMS_COMPILER_PURE_ATTRIBUTE from _SMP_Get_current_processor() and all _CPU_SMP_Get_current_processor(). Make inline ASM statements volatile again. Test smptests/smpmigration01 showed that GCC optimizes too much otherwise.
* score: _Thread_Start_multitasking()Sebastian Huber2014-02-211-1/+5
| | | | | Fix serious race-condition. Read the heir after the per-CPU lock acquire.
* score: Rename _Internal_error_Occurred()Sebastian Huber2014-02-2119-25/+25
| | | | Rename _Internal_error_Occurred() into _Terminate().
* score: _SMP_Inter_processor_interrupt_handler()Sebastian Huber2014-02-192-42/+23
| | | | | Inline _SMP_Inter_processor_interrupt_handler() to avoid function call overhead. Remove debug output.
* score: Wait for per-CPU state changes laterSebastian Huber2014-02-191-9/+5
| | | | | | Wait for per-CPU changes into PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING later. There is no need to delay the initialization of the main processor at this point.
* score: Initialize per-CPU locksSebastian Huber2014-02-191-0/+6
|
* score: Move _SMP_Handler_initialize()Sebastian Huber2014-02-192-31/+22
|
* score: Rename rtems_smp_process_interrupt()Sebastian Huber2014-02-195-80/+6
| | | | | | Rename rtems_smp_process_interrupt() into _SMP_Inter_processor_interrupt_handler(). Delete unused header file <rtems/bspsmp.h>.
* score: Rename rtems_smp_secondary_cpu_initialize()Sebastian Huber2014-02-193-26/+28
| | | | | | Rename rtems_smp_secondary_cpu_initialize() into _SMP_Start_multitasking_on_secondary_processor(). Move declaration to <rtems/score/smpimpl.h>.
* score: Add and use <rtems/score/smpimpl.h>Sebastian Huber2014-02-197-73/+132
| | | | | Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
* score: Delete bsp_smp_broadcast_interrupt()Sebastian Huber2014-02-192-22/+4
| | | | | | Since the per-CPU SMP lock must be acquired and released to send the message a single interrupt broadcast operations offers no benefits. If synchronization is required, then a SMP barrier must be used anyway.
* score: Rename bsp_smp_initialize()Sebastian Huber2014-02-198-21/+28
| | | | | Rename bsp_smp_initialize() into _CPU_SMP_Initialize() since every CPU port must supply this function.
* score: Remove ASM guardSebastian Huber2014-02-191-4/+0
|
* score: Rename RTEMS_BSP_SMP_SHUTDOWNSebastian Huber2014-02-192-10/+10
| | | | | Rename RTEMS_BSP_SMP_SHUTDOWN in SMP_MESSAGE_SHUTDOWN since SMP messages have nothing to do with the BSP. Use UINT32_C() instead of casts.
* score: Add RTEMS_FATAL_SOURCE_SMPSebastian Huber2014-02-193-5/+16
| | | | | | Use rtems_fatal() instead of _CPU_Fatal_halt() to shutdown processors in SMP configurations since this allows intervention of BSP or application specific fatal extensions.
* score: Add RTEMS_FATAL_SOURCE_BSPSebastian Huber2014-02-191-12/+5
| | | | | | Merge RTEMS_FATAL_SOURCE_BSP_GENERIC and RTEMS_FATAL_SOURCE_BSP_SPECIFIC into new fatal source RTEMS_FATAL_SOURCE_BSP. This makes it easier to figure out the code position given a fatal source and code.
* score: Delete INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UPSebastian Huber2014-02-191-1/+1
| | | | | This error case is no longer required since rtems_shutdown_executive() can be called anytime, anywhere
* score: Move _SMP_Request_other_cores_to_shutdown()Sebastian Huber2014-02-194-12/+29
| | | | | | Move _SMP_Request_other_cores_to_shutdown() invocation from rtems_shutdown_executive() to _Internal_error_Occurred() to allow a proper shutdown on SMP configurations even in the error case.
* score: Disable ISR in _Internal_error_Occurred()Sebastian Huber2014-02-193-3/+11
| | | | | | | Disable interrupts as the first step in _Internal_error_Occurred() to get a defined execution context for the fatal extensions. Make _ISR_Disable_without_giant() available for non-SMP configurations.
* score: Delete _Thread_BSP_contextSebastian Huber2014-02-195-119/+18
| | | | | | | | | | | | Do not return to BSP context in the exit() shutdown path. This makes it possible to re-use the initialization stack. It can be used for the interrupt stack for example. On targets with a small RAM this is a considerable benefit. This change eliminates also some special cases and simplifies the code. Delete _Thread_Set_global_exit_status(), _Thread_Get_global_exit_status() and _Thread_Stop_multitasking().
* score: Add SYSTEM_STATE_TERMINATEDSebastian Huber2014-02-193-19/+7
| | | | | | Merge systems states SYSTEM_STATE_SHUTDOWN and SYSTEM_STATE_FAILED into new system state SYSTEM_STATE_TERMINATED. This reflects that all system termination paths end up in _Internal_error_Occurred().
* powerpc: Change interrupt disable implemetationSebastian Huber2014-02-193-19/+36
| | | | | | | | | | | | Instead of SPRG0 (= special purpose register 272) use the new global symbol _PPC_INTERRUPT_DISABLE_MASK to store the interrupt disable mask. The benefit is that it is now possible to disable interrupts without further run-time initialization in boot_card(). At least on Freescale e500 cores this leads also to a faster execution since the mfmsr and mfspr instruction require four cycles to complete. The instructions to load the mask value can execute while the mfmsr is in progress.
* score: Move SMP interrupt stack initializationSebastian Huber2014-02-192-39/+25
| | | | | | | 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.
* score: Add SMP barrierSebastian Huber2014-02-174-0/+181
|
* score: Use atomic API for SMP lockSebastian Huber2014-02-1716-559/+36
| | | | | Use a ticket lock implementation based on atomic operations. Delete CPU port specific SMP lock implementations.
* Require presence of <stdatomic.h> for SMP supportSebastian Huber2014-02-172-13/+10
|
* sparc: Add atomic support for SPARC V8Sebastian Huber2014-02-172-0/+203
| | | | Use SWAP instruction with one lock for the system in the SMP case.
* sparc: Add LEON3_ASR17_PROCESSOR_INDEX_SHIFTSebastian Huber2014-02-141-0/+14
| | | | Add _LEON3_Get_current_processor().
* score: Add Atomic_UintSebastian Huber2014-02-142-0/+171
|
* score: Fix warnings, C++ compatibility, fix typosSebastian Huber2014-02-141-18/+22
|
* score: Remove volatile from asm statementsSebastian Huber2014-02-142-2/+2
| | | | | The instructions to get the processor current index have no side-effects.
* score: Add CPU counter supportSebastian Huber2014-02-1434-0/+288
| | | | | | | | | Add a CPU counter interface to allow access to a free-running counter. It is useful to measure short time intervals. This can be used for example to enable profiling of critical low-level functions. Add two busy wait functions rtems_counter_delay_ticks() and rtems_counter_delay_nanoseconds() implemented via the CPU counter.
* sparc: Increase CPU_STRUCTURE_ALIGNMENT to 32Sebastian Huber2014-02-131-1/+1
| | | | Recent LEON4 systems use a cache line size of 32 bytes.
* sparc: Save/restore only non-volatile contextSebastian Huber2014-02-122-64/+74
| | | | | | | | | | The _CPU_Context_switch() is a normal function call. The following registers are volatile (the caller must assume that the register contents are destroyed by the callee) according to "SYSTEM V APPLICATION BINARY INTERFACE - SPARC Processor Supplement", Third Edition: g1, o0, o1, o2, o3, o4, o5. Drop these registers from the context. Ensure that offset defines match the structure offsets.
* score: Format _Thread_Get_maximum_internal_threadsSebastian Huber2014-02-101-3/+2
|
* score: _CPU_Context_switch_to_first_task_smp()Sebastian Huber2014-02-056-41/+1
| | | | | Delete _CPU_Context_switch_to_first_task_smp() and use _CPU_Context_restore() instead.
* Add thread-local storage (TLS) supportSebastian Huber2014-02-0446-55/+521
| | | | | Tested and implemented on ARM, m68k, PowerPC and SPARC. Other architectures need more work.