summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/sparc/rtems/score/cpu.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-01-25Remove make preinstallChris Johns1-1202/+0
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
2017-07-25sparc: Add lazy floating point switchSebastian Huber1-66/+49
The SPARC ABI is a bit special with respect to the floating point context. The complete floating point context is volatile. Thus, from an ABI point of view nothing needs to be saved and restored during a context switch. Instead the floating point context must be saved and restored during interrupt processing. Historically, the deferred floating point switch was used for SPARC and the complete floating point context is saved and restored during a context switch to the new floating point unit owner. This is a bit dangerous since post-switch actions (e.g. signal handlers) and context switch extensions may silently corrupt the floating point context. The floating point unit is disabled for interrupt handlers. Thus, in case an interrupt handler uses the floating point unit then this will result in a trap (INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT). In uniprocessor configurations, a lazy floating point context switch is used. In case an active floating point thread is interrupted (PSR[EF] == 1) and a thread dispatch is carried out, then this thread is registered as the floating point owner. When a floating point owner is present during a context switch, the floating point unit is disabled for the heir thread (PSR[EF] == 0). The floating point disabled trap checks that the use of the floating point unit is allowed and saves/restores the floating point context on demand. Update #3077.
2017-07-25sparc: Rename SPARC_USE_SAFE_FP_SUPPORTSebastian Huber1-25/+27
Rename SPARC_USE_SAFE_FP_SUPPORT in SPARC_USE_SYNCHRONOUS_FP_SWITCH. Update comment. Update #3077.
2017-01-26score: Delete _CPU_Context_Fp_start()Sebastian Huber1-7/+0
Since the FP area pointer is passed by reference in _CPU_Context_Initialize_fp() the optional FP area adjustment via _CPU_Context_Fp_start() is superfluous. It is also wrong with respect to memory management, e.g. pointer passed to _Workspace_Free() may be not the one returned by _Workspace_Allocate(). Close #1400.
2017-01-24sparc: Relax CPU_STACK_ALIGNMENTSebastian Huber1-12/+3
Close #2352.
2017-01-24Remove CPU_BIG_ENDIAN and CPU_LITTLE_ENDIANSebastian Huber1-16/+0
Use de-facto standard BYTE_ORDER instead. Close #2803.
2016-11-23score: Robust thread dispatchSebastian Huber1-0/+2
On SMP configurations, it is a fatal error to call blocking operating system with interrupts disabled, since this prevents delivery of inter-processor interrupts. This could lead to executing threads which are not allowed to execute resulting in undefined behaviour. The ARM Cortex-M port has a similar problem, since the interrupt state is not a part of the thread context. Update #2811.
2016-11-18score: Add _ISR_Is_enabled()Sebastian Huber1-0/+8
In contrast to _ISR_Get_level() the _ISR_Is_enabled() function evaluates a level parameter and returns a boolean value. Update #2811.
2016-11-18sparc: Move CPU_Interrupt_frame related definesSebastian Huber1-50/+0
Move CPU_Interrupt_frame related defines to <rtems/score/cpuimpl.h>. Update #2809.
2016-11-18sparc: Rename CPU_Minimum_stack_frameSebastian Huber1-23/+23
Rename SPARC-specific CPU_Minimum_stack_frame to SPARC_Minimum_stack_frame. Rename SPARC-specific CPU_MINIMUM_STACK_FRAME_SIZE to SPARC_MINIMUM_STACK_FRAME_SIZE. Update #2809.
2016-11-18rtems: Conditionally define rtems_interrupt_frameSebastian Huber1-1/+1
Update #2808.
2016-11-18score: Move CPU_PER_CPU_CONTROL_SIZESebastian Huber1-41/+0
Move CPU_PER_CPU_CONTROL_SIZE and the optional CPU_Per_CPU_control to <rtems/score/cpuimpl.h> to hide it from <rtems.h>.
2016-11-18score: Remove obsolete definesSebastian Huber1-10/+0
The thread dispatch inline option is no longer used.
2016-11-10score: Move _CPU_Get_current_per_CPU_control()Sebastian Huber1-8/+0
Move _CPU_Get_current_per_CPU_control() from <rtems/score/cpu.h> to <rtems/score/cpuimpl.h>.
2016-06-22sparc: Optimize CPU counter supportSebastian Huber1-37/+2
2016-06-21sparc: Rework CPU counter supportSebastian Huber1-18/+31
Rework CPU counter support to enable use of the GR740 up-counter via %asr22 and %asr23.
2016-06-08score: Delete CPU_USE_GENERIC_BITFIELD_DATASebastian Huber1-6/+0
Rename __log2table into _Bitfield_Leading_zeros since it acually returns the count of leading zeros of an 8-bit integer. The value for zero is a bit odd. Provide it unconditionally.
2016-03-04score: Add CPU_MAXIMUM_PROCESSORSSebastian Huber1-0/+2
Maximum number of processors of all systems supported by this CPU port.
2016-02-17sparc: Avoid SCORE_EXTERNSebastian Huber1-1/+1
Update #2559.
2016-01-26sparc: Adjust CPU_CACHE_LINE_BYTES for LEON3Sebastian Huber1-2/+2
Fix for commit a8865f8b415788c4e9bb7f68e38d41aec0e485db.
2016-01-26score: Introduce CPU_CACHE_LINE_BYTESSebastian Huber1-11/+4
Add CPU_CACHE_LINE_BYTES for the maximum cache line size in bytes. The actual processor may use no cache or a smaller cache line size.
2016-01-26sparc: No explicit align of _CPU_Null_fp_contextSebastian Huber1-1/+1
This structure is not performance critical.
2016-01-25score: Delete obsolete CPU_TIMESTAMP_* definesSebastian Huber1-2/+0
Update #2271.
2015-12-10sparc: Simplify _CPU_Get_current_per_CPU_control()Sebastian Huber1-1/+1
Drop the superfluous parenthesis since this confuses the C++ compiler of some GCC versions. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67064
2015-10-26basedefs.h: Add and use RTEMS_NO_RETURNSebastian Huber1-2/+2
2015-06-09sparc: Add SPARC_USE_SAFE_FP_SUPPORTSebastian Huber1-2/+27
The SPARC ABI is a bit special with respect to the floating point context. The complete floating point context is volatile. Thus from an ABI point of view nothing needs to be saved and restored during a context switch. Instead the floating point context must be saved and restored during interrupt processing. Historically the deferred floating point switch is used for SPARC and the complete floating point context is saved and restored during a context switch to the new floating point unit owner. This is a bit dangerous since post-switch actions (e.g. signal handlers) and context switch extensions may silently corrupt the floating point context. The floating point unit is disabled for interrupt handlers. Thus in case an interrupt handler uses the floating point unit then this will result in a trap. On SMP configurations the deferred floating point switch is not supported in principle. So use here a safe floating point support. Safe means that the volatile floating point context is saved and restored around a thread dispatch issued during interrupt processing. Thus post-switch actions and context switch extensions may safely use the floating point unit. Update #2270.
2015-05-30sparc: Disable FPU in interrupt contextAlexander Krutwig1-1/+24
Update #2270.
2015-05-26sparc: Delete unused CONTEXT_CONTROL_SIZESebastian Huber1-3/+0
2015-05-26sparc: Delete unused ISF_STACK_FRAME_OFFSETSebastian Huber1-2/+0
2015-05-21sparc: Add support for sptests/spcontext01Alexander Krutwig1-10/+2
Implement _CPU_Context_validate() and _CPU_Context_volatile_clobber(). Update #2270.
2015-03-05score: Delete unused CPU_UNROLL_ENQUEUE_PRIORITYSebastian Huber1-16/+0
2015-02-17score: Add _CPU_SMP_Prepare_start_multitasking()Sebastian Huber1-6/+2
Update #2268.
2014-10-06SPARC: Fatal_halt use source and exit codesDaniel Hellstrom1-8/+2
The Fatal_halt handler now have two options, either halt as before or enter system error state to return to debugger or simulator. The exit-code is now also propagated to the debugger which is very useful for testing. The CPU_Fatal_halt handler was split up into two, since the only the LEON3 support the CPU power down. The LEON3 halt now uses the power-down instruction to save CPU power. This doesn't stop a potential watch-dog timer from expiring.
2014-09-11score: Rename _BSP_Exception_frame_print()Sebastian Huber1-8/+1
Rename _BSP_Exception_frame_print() to _CPU_Exception_frame_print() to be in line with other CPU port functions.
2014-09-10Let CPU/BSP Fatal handler have access to sourceDaniel Hellstrom1-1/+1
Without the source the error code does not say that much. Let it be up to the CPU/BSP to determine the error code reported on fatal shutdown. This patch does not change the current behaviour, just adds the option to handle the source of the fatal halt.
2014-09-01score: Define _CPU_Start_multitasking only for LEON SPARC, not SPARC in generalDaniel Cederman1-2/+4
Rename _BSP_Start_multitasking to _LEON3_Start_multitasking to show that it is LEON specific
2014-08-22bsp/sparc: Flush icache before first time enabling interruptsDaniel Cederman1-0/+4
A secondary processor might miss changes done to the trap table if the instruction cache is not flushed. Once interrupts are enabled any other required cache flushes can be ordered via the cache manager.
2014-07-04score: PR2183: Fix context switch on SMPSebastian Huber1-1/+1
Fix context switch on SMP for ARM, PowerPC and SPARC. Atomically test and set the is executing indicator of the heir context to ensure that at most one processor uses the heir context. Break the busy wait loop also due to heir updates.
2014-06-03score/sparc: Add support for paravirtualizationChristian Mauderer1-1/+1
Guest systems in paravirtualization environments run usually in user mode. Thus it is not possible to directly access the PSR and TBR registers. Use functions instead of inline assembler to access these registers if RTEMS_PARAVIRT is defined.
2014-05-14sparc: Change asm to __asm__ to compile with -std=c99.Daniel Cederman1-1/+1
2014-05-08score: Fix CPU context usage on SMPSebastian Huber1-2/+14
We must not alter the is executing indicator in _CPU_Context_Initialize() since this would cause an invalid state during a self restart. The is executing indicator must be valid at creation time since otherwise _Thread_Kill_zombies() uses an undefined value for not started threads. This could result in a system life lock.
2014-05-07score: Implement forced thread migrationSebastian Huber1-0/+13
The current implementation of task migration in RTEMS has some implications with respect to the interrupt latency. It is crucial to preserve the system invariant that a task can execute on at most one processor in the system at a time. This is accomplished with a boolean indicator in the task context. The processor architecture specific low-level task context switch code will mark that a task context is no longer executing and waits that the heir context stopped execution before it restores the heir context and resumes execution of the heir task. So there is one point in time in which a processor is without a task. This is essential to avoid cyclic dependencies in case multiple tasks migrate at once. Otherwise some supervising entity is necessary to prevent life-locks. Such a global supervisor would lead to scalability problems so this approach is not used. Currently the thread dispatch is performed with interrupts disabled. So in case the heir task is currently executing on another processor then this prolongs the time of disabled interrupts since one processor has to wait for another processor to make progress. It is difficult to avoid this issue with the interrupt latency since interrupts normally store the context of the interrupted task on its stack. In case a task is marked as not executing we must not use its task stack to store such an interrupt context. We cannot use the heir stack before it stopped execution on another processor. So if we enable interrupts during this transition we have to provide an alternative task independent stack for this time frame. This issue needs further investigation.
2014-04-28sparc: Add _CPU_Get_current_per_CPU_control()Sebastian Huber1-32/+36
Use register g6 for the per-CPU control of the current processor. The register g6 is reserved for the operating system by the SPARC ABI. On Linux register g6 is used for a similar purpose with the same method since 1996. The register g6 must be initialized during system startup and then must remain unchanged. Since the per-CPU control is used in all critical sections of the operating system, this is a performance optimization for the operating system core procedures. An additional benefit is that the low-level context switch and interrupt processing code is now identical on non-SMP and SMP configurations.
2014-04-28sparc: Optimize context switchSebastian Huber1-41/+37
The registers g2 through g4 are reserved for applications. GCC uses them as volatile registers by default. So they are treated like volatile registers in RTEMS as well.
2014-04-14score: SMP initialization changesSebastian Huber1-1/+5
Add and use _CPU_SMP_Start_processor(). Add and use _CPU_SMP_Finalize_initialization(). This makes most _CPU_SMP_Initialize() functions a bit simpler since we can calculate the minimum value of the count of processors requested by the application configuration and the count of physically or virtually available processors in the high-level code. The CPU port has now the ability to signal a processor start failure. With the support for clustered/partitioned scheduling the presence of particular processors can be configured to be optional or mandatory. There will be a fatal error only in case mandatory processors are not present. The CPU port may use a timeout to monitor the start of a processor.
2014-04-14sparc: Use __leon__ multilib defineSebastian Huber1-1/+8
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2014-02-24sparc: Fix CPU counter supportSebastian Huber1-2/+49
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.
2014-02-21score: _CPU_SMP_Get_current_processor()Sebastian Huber1-1/+1
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.
2014-02-19score: Rename bsp_smp_initialize()Sebastian Huber1-0/+2
Rename bsp_smp_initialize() into _CPU_SMP_Initialize() since every CPU port must supply this function.