Commit Graph

1481 Commits

Author SHA1 Message Date
Sebastian Huber
b437a36064 arm: Fix CPU context validation for Cortex-R4
Do not touch the FPSCR[QC] bit since this is DNM/RAZ on Cortex-R4.
2017-03-09 14:32:04 +01:00
Sebastian Huber
2433a8ab1c arm: Remove legacy execption support 2017-03-08 15:36:54 +01:00
Sebastian Huber
f61195b2f9 powerpc: Fix PPC_CONTEXT_VOLATILE_SIZE 2017-03-06 11:16:40 +01:00
Sebastian Huber
e2b1c47d8c sparc: Fix volatile clobber
Do not adjust the stack pointer, since this is already done by the
restor instruction.

Update #2270.
2017-02-03 10:17:38 +01:00
Christian Mauderer
180107e971 bsps/arm: Fix Cortex-M DWT CPU counter.
It is necessary to enable the DWT using a special initialization
sequence before the CYCCNT can be enabled. See for example the
RESET_CYCLE_COUNTER in libbsp/arm/atsam/utils/utility.h.

Note that this problem only occurs if no debugger is connected. A
debugger most likely already enables the necessary module.
2017-01-30 11:35:31 +01:00
Sebastian Huber
27bfcd88f7 score: Delete _CPU_Context_Fp_start()
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-26 07:31:09 +01:00
Kevin Kirspel
b43c2e8952 Adding ARM VFP V2 support 2017-01-24 15:42:05 +01:00
Sebastian Huber
3d20f5fbb7 sparc: Relax CPU_STACK_ALIGNMENT
Close #2352.
2017-01-24 08:39:22 +01:00
Sebastian Huber
4aa23c9641 Remove CPU_BIG_ENDIAN and CPU_LITTLE_ENDIAN
Use de-facto standard BYTE_ORDER instead.

Close #2803.
2017-01-24 08:39:22 +01:00
Sebastian Huber
3a659b0481 score: Introduce _Internal_error() 2016-12-12 08:03:29 +01:00
Sebastian Huber
b6606e8d99 score: Remove fatal is internal indicator
The fatal is internal indicator is redundant since the fatal source and
error code uniquely identify a fatal error.  Keep the fatal user
extension is internal parameter for backward compatibility and set it to
false always.

Update #2825.
2016-12-09 08:47:51 +01:00
Sebastian Huber
f65dcc712a score: Fix ARM and PowerPC context initialization
Update #2751.
2016-12-02 13:11:13 +01:00
Sebastian Huber
6a1b9e4152 sparc: Optimize _ISR_Handler()
Use _Thread_Do_dispatch() instead of _Thread_Dispatch().  Restore the
PSR[EF] state of the interrupted context via new system call
syscall_irqdis_fp in case floating-point support is enabled.
2016-11-28 16:08:43 +01:00
Sebastian Huber
bd0d585807 arm: Fix _CPU_ISR_Is_enabled() for ARMv7-M
Update #2811.
2016-11-24 11:53:59 +01:00
Sebastian Huber
84e6f15c82 score: Robust thread dispatch
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-23 12:52:06 +01:00
Sebastian Huber
1d18a9027d arm: Fix _ARMV4_Exception_interrupt
Use the right register to determine if a thread dispatch is allowed and
necessary.

Update #2751.
2016-11-23 12:52:05 +01:00
Sebastian Huber
4e2bc0a308 arm: Fix Thumb-1 targets
We cannot use the MRS or MSR instructions in Thumb-1 mode.  Stay in ARM
mode for the Thumb-1 targets during interrupt low-level processing.

Update #2751.
2016-11-21 13:15:35 +01:00
Sebastian Huber
27eccdad87 sparc64: Fix _CPU_ISR_Is_enabled()
Update #2820.
2016-11-21 10:25:58 +01:00
Sebastian Huber
fd6d3f1f03 nios2: Fix _CPU_ISR_Is_enabled()
Close #2818.
2016-11-21 10:13:37 +01:00
Sebastian Huber
9f225dea19 arm: Fix ARM_CONTEXT_CONTROL_ISR_DISPATCH_DISABLE
Close #2816.
2016-11-21 10:11:18 +01:00
Sebastian Huber
c6f446bd70 bfin: ASM compatibility for <rtems/score/cpu.h>
Close #2817.
2016-11-21 10:06:36 +01:00
Sebastian Huber
408609f6b9 score: Add _ISR_Is_enabled()
In contrast to _ISR_Get_level() the _ISR_Is_enabled() function evaluates
a level parameter and returns a boolean value.

Update #2811.
2016-11-18 07:30:35 +01:00
Sebastian Huber
7ce60b378d powerpc: Use Per_CPU_Control::isr_dispatch_disable
Update #2751.
2016-11-18 07:30:35 +01:00
Sebastian Huber
d59585db26 arm: Use Per_CPU_Control::isr_dispatch_disable
Update #2751.
2016-11-18 07:30:35 +01:00
Sebastian Huber
2668e4f639 arm: Simplify _ARMV4_Exception_interrupt
Move profiling code closer to bsp_interrupt_disable() to allow re-use of
r9 later.
2016-11-18 07:30:34 +01:00
Sebastian Huber
4924756f69 arm: Use local labels 2016-11-18 07:30:34 +01:00
Sebastian Huber
c11ac2d59d sparc: Use Per_CPU_Control::isr_dispatch_disable
Update #2751.
2016-11-18 07:30:34 +01:00
Sebastian Huber
d5e073cde7 score: Allow interrupts during thread dispatch
Use a processor-specific interrupt frame during context switches in case
the executing thread is longer executes on the processor and the heir
thread is about to start execution.  During this period we must not use
a thread stack for interrupt processing.

Update #2809.
2016-11-18 07:30:34 +01:00
Sebastian Huber
f9aa34ddd9 score: Add Per_CPU_Control::Interrupt_frame
Update #2809.
2016-11-18 07:30:34 +01:00
Sebastian Huber
dbeccf0ec0 arm: Provide CPU_Interrupt_frame for ARMv4
Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
2599c8e63e powerpc: Add up to date CPU_Interrupt_frame
Rename ppc_exc_min_frame to CPU_Interrupt_frame.  Move it and the
corresponding defines to <rtems/score/cpuimpl.h>.

Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
bf4fdb1f1d powerpc: Move legacy CPU_Interrupt_frame
The only remaining user of CPU_Interrupt_frame on PowerPC is the mpc5xx
support.  Move it to here.

Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
c539a865f4 sparc: Move CPU_Interrupt_frame related defines
Move CPU_Interrupt_frame related defines to <rtems/score/cpuimpl.h>.

Update #2809.
2016-11-18 07:30:33 +01:00
Sebastian Huber
427dcee837 sparc: Rename CPU_Minimum_stack_frame
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-18 07:30:32 +01:00
Sebastian Huber
d18560ae05 sparc64: Rename CPU_Minimum_stack_frame
Rename SPARC64-specific CPU_Minimum_stack_frame to
SPARC64_Minimum_stack_frame.  Rename SPARC64-specific
CPU_MINIMUM_STACK_FRAME_SIZE to SPARC64_MINIMUM_STACK_FRAME_SIZE.

Update #2809.
2016-11-18 07:30:32 +01:00
Sebastian Huber
141e16d225 rtems: Conditionally define rtems_interrupt_frame
Update #2808.
2016-11-18 07:30:32 +01:00
Sebastian Huber
82d30a310c score: Move CPU_PER_CPU_CONTROL_SIZE
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-18 07:30:32 +01:00
Sebastian Huber
acc6d9bf37 score: Remove obsolete defines
The thread dispatch inline option is no longer used.
2016-11-18 07:30:31 +01:00
Sebastian Huber
04bd261726 arm: Use TPIDRPRW for current per-CPU control
Use the previously unused TPIDRPRW register to get the per-CPU control
of the current processor.  This avoids instructions in
GET_SELF_CPU_CONTROL which are not available in Thumb mode.
2016-11-18 07:30:31 +01:00
Sebastian Huber
38a1449fd4 powerpc: Add _CPU_Get_current_per_CPU_control()
Add _CPU_Get_current_per_CPU_control() on SMP configurations.  Use SPRG0
for the current per-CPU control.  This reduces the code size by three
instructions and is slightly faster.

Update #2805.
2016-11-10 09:58:37 +01:00
Sebastian Huber
58bced64b9 score: Move _CPU_Get_current_per_CPU_control()
Move _CPU_Get_current_per_CPU_control() from <rtems/score/cpu.h> to
<rtems/score/cpuimpl.h>.
2016-11-10 09:22:18 +01:00
Sebastian Huber
7790d95f0a sparc: Provide _CPU_Get_thread_executing() 2016-11-07 07:39:42 +01:00
Sebastian Huber
df48ed2cba score: Add optional _CPU_Get_thread_executing() 2016-11-07 07:39:42 +01:00
Sebastian Huber
df63fbd1ac score: Add <rtems/score/cpuimpl.h>
The aim of this file is to encapsulate CPU port implementation details.
This helps to hide implementation details from <rtems.h> which
indirectly includes <rtems/score/cpu.h>.
2016-11-07 07:39:41 +01:00
Pavel Pisa
8714684129 score/arm: Correct logic to select 64 byte cache line maximum size for Cortex-A.
The use of actual cache line max bytes and minimum required alignment
in architecture but not-BSP dependent code could be problematic
because there exists even ARM instruction set implementations
with 128 byte line length and real maximum can be quite problematic
to say. But actually supported ARM BSPs should be OK with these values.
2016-10-04 23:30:22 +02:00
Sebastian Huber
9149c87ec7 score: Fix C/C++ compatibility issue
Only use CPU_Per_CPU_control if it contains at least one filed.  In GNU
C empty structures have a size of zero.  In C++ structures have a
non-zero size.  In case CPU_PER_CPU_CONTROL_SIZE is defined to zero,
then this structure is not used anymore.
2016-09-23 06:57:03 +02:00
Sebastian Huber
8bb9d4100c stackchk: Use a const pattern to check 2016-09-08 07:43:02 +02:00
Kevin Kirspel
36fad91f00 arm: Add VFP context validate support for ARMv5 2016-08-19 07:40:45 +02:00
Sebastian Huber
75fc27ad39 score: Fix printk() format specifiers 2016-07-26 07:54:05 +02:00
Pavel Pisa
0cb50ab25b score/arm: Ensure that copile time alignment is 64 bytes for Cortex-A multilib.
Some/many Cortex-A cores have data cache line length 64 bytes and maximum
value has to be used for system structures alignment.
2016-07-04 15:55:57 +02:00