Commit Graph

1379 Commits

Author SHA1 Message Date
Sebastian Huber
b318cb138f sparc: Simplify _CPU_Get_current_per_CPU_control()
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-12-10 08:32:36 +01:00
Daniel Cederman
78cac9b092 sparc: Fix context switch on SMP
We must not load registers (e.g. PSR) from the heir context area before
the heir stopped execution.

With this patch the write to PSR is divided into two steps. We first update
the current window pointer and then we restore the status registers and
enable traps. This allows us to move the first write to PSR to be before
the write to WIM, as there is now no risk that we get an interrupt where
the CWP and WIM would be inconsistent. We only need to make sure that we
do not use any of the non-global registers or instructions that affects
CWP for three instructions after the write.

In the earlier code the non-global %o1 register was used right after the
write to PSR, which required the use of three nop:s.
2015-11-16 14:48:54 +01:00
Sebastian Huber
5c7bfcf82e Fix interrupt epilogue for ARMv7-AR and PowerPC 2015-11-12 08:21:45 +01:00
Sebastian Huber
e96feebdd1 powerpc: Add FSL cache defines 2015-10-28 13:04:19 +01:00
Sebastian Huber
143696acbd basedefs.h: Add and use RTEMS_NO_RETURN 2015-10-26 09:13:19 +01:00
Sebastian Huber
6959e663e4 epiphany: Delete CPU_UNROLL_ENQUEUE_PRIORITY 2015-10-07 09:13:23 +02:00
Sebastian Huber
08317ef3ff powerpc: Use wrtee for e6500 multilib
This reduces the code size.
2015-10-02 07:30:13 +02:00
Sebastian Huber
258ad71e96 SMP: Fix and optimize thread dispatching
According to the C11 and C++11 memory models only a read-modify-write
operation guarantees that we read the last value written in modification
order.  Avoid the sequential consistent thread fence and instead use the
inter-processor interrupt to set the thread dispatch necessary
indicator.
2015-09-28 13:56:57 +02:00
Sebastian Huber
1f7c5c88ca score: Fix atomic compare exchange 2015-09-25 21:48:24 +02:00
Martin Galvan
f52885b6bc ARMv7M: Improve exception handler routine and add comments on SP selection
This patch adds a brief description of how context state is saved into the
SP on exception entry, and makes a few changes to _ARMV7M_Exception_default
in order to make it a bit more efficient. I also removed the unused 'v7mfsz'
input parameter.

This should apply over Sudarshan's patch.
2015-09-23 14:53:25 +02:00
Sudarshan Rajagopalan
7263a50d6c Fix exception handler for supporting FPU 2015-09-23 14:52:55 +02:00
Sebastian Huber
95b43d0dde arm: Replace __sync_synchronize() implementation 2015-09-01 09:59:26 +02:00
Sebastian Huber
39e3e20140 arm: Use compiler memory barrier by default 2015-09-01 09:59:18 +02:00
Jan Sommer
7e798b4758 Add __synch_synchronize function for arm
Fixes link failure when linking Ada programs on the raspberry pi
2015-08-01 10:19:40 -07:00
Sebastian Huber
f7d95581c8 m68k: Include proper header file 2015-07-24 10:47:25 +02:00
Sebastian Huber
98a41f419c arm: Include proper header file 2015-07-23 20:34:19 +02:00
Joel Sherrill
db01d0cc61 sparc64/rtems/score/cpu.h: Delete dead declaration 2015-07-16 11:15:53 -07:00
Sebastian Huber
93f5adb644 powerpc: Do not use the ATB for e500 multilib
The e500v1 has no support for the ATB.

Update #2369.
2015-07-15 10:52:40 +02:00
Nick Withers
e2fcb7dc64 powerpc: Fix _CPU_Counter_read()
The mftb is not available on Book E processors.  Use SPR 268 instead.

Close #2369.
2015-07-15 09:02:32 +02:00
Sebastian Huber
4c6843168d powerpc: Add BUCSR register defines 2015-07-08 10:07:59 +02:00
Sebastian Huber
48fed9a56e score: Simplify <rtems/system.h>
Drop the <rtems/score/percpu.h> include since this file exposes a lot of
implementation details.
2015-06-26 09:16:25 +02:00
Sebastian Huber
9d8389021c arm: Implement _CPU_ISR_Get_level() for ARMv7-M 2015-06-15 20:45:56 +02:00
Sebastian Huber
a51b3526ea sparc: Add SPARC_USE_SAFE_FP_SUPPORT
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-06-09 09:05:50 +02:00
Sebastian Huber
335e5caa9a score: Add Thread_Control::is_fp
Store the floating-point unit property in the thread control block
regardless of the CPU_HARDWARE_FP and CPU_SOFTWARE_FP settings.  Make
sure the floating-point unit is only enabled for the corresponding
multilibs.  This helps targets which have a volatile only floating point
context like SPARC for example.
2015-06-09 09:05:50 +02:00
Alexander Krutwig
2764bd43d0 sparc: Disable FPU in interrupt context
Update #2270.
2015-05-30 16:46:36 +02:00
Sebastian Huber
1f6cdba6e1 sparc: Remove superfluous FP enable
The FP context save/restore makes only sense in the context of FP
threads.

Update #2270.
2015-05-30 16:46:36 +02:00
Sebastian Huber
8a1dc71b8e sparc: Avoid new window for FP save/restore
Update #2270.
2015-05-30 16:46:34 +02:00
Alexander Krutwig
4a5a45045a sparc: Improve _CPU_Context_validate()
Write the pattern only once to the entry register window and the
floating point registers.

Update #2270.
2015-05-29 15:36:40 +02:00
Sebastian Huber
76030c703b sparc: Add static assertion 2015-05-26 14:13:44 +02:00
Sebastian Huber
422de7f77d sparc: Delete unused CONTEXT_CONTROL_SIZE 2015-05-26 14:09:11 +02:00
Sebastian Huber
139c0dce69 sparc: Delete unused ISF_STACK_FRAME_OFFSET 2015-05-26 14:08:11 +02:00
Sebastian Huber
fedc682870 sparc: Add static offset assertions 2015-05-26 14:05:57 +02:00
Hesham ALMatary
66a5000d78 cpukit: Add Epiphany architecture port v4 2015-05-21 16:03:34 -04:00
Alexander Krutwig
1c59cad4aa sparc: Add support for sptests/spcontext01
Implement _CPU_Context_validate() and _CPU_Context_volatile_clobber().

Update #2270.
2015-05-21 09:37:36 +02:00
Joel Sherrill
c5d86ec0c9 or1k-utility.h: Add missing end of C++ header pattern
closes 2326.
2015-04-17 09:45:05 -05:00
Daniel Krueger
a6c5a7e0b6 arm: Align ARM exception frame to 8 bytes
The stack pointer must be aligned on 8 byte boundary on ARM, so the size of
the exception frame must be a multiple of 8 bytes. Otherwise we might/will
get an alignment fault, when executing code in the data abort handler for
example.

Close #2318.

Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
2015-04-10 08:12:14 +02:00
Hesham ALMatary
1c8466165c or1k: Send halt signal to or1k simulators when rtems terminates 2015-04-02 10:01:50 -05:00
Sebastian Huber
cb4dd48e06 sparc: Ensure interrupt service after ISR enable 2015-03-25 13:17:54 +01:00
Sebastian Huber
d4edbdbcbf Replace www.rtems.com with www.rtems.org 2015-03-20 15:42:34 +01:00
Gedare Bloom
46d3c6d833 cpukit: add and use CPU_Uint32ptr type 2015-03-16 16:24:18 -04:00
Hesham ALMatary
a764d67387 score/or1k: Fix warnings. Add missing prototypes
Closes #2304
2015-03-13 15:49:30 -04:00
Joel Sherrill
bdf23b6cd4 cpukit: Remove old DESCRIPTION: in comments
These were remnants of pre-Doxygen comment style.
2015-03-11 16:18:29 -05:00
Joel Sherrill
ef598c37cf or1k/rtems/score/cpu.h: Add no_return attribute to _CPU_Context_restore 2015-03-09 16:14:17 -05:00
Joel Sherrill
4f4e7bb683 cpukit/score/cpu/sh/context.c: Correct name of _CPU_Context_switch 2015-03-09 16:14:16 -05:00
Joel Sherrill
2a11a46fd1 or1k: Correct _CPU_Thread_Idle_body prototype 2015-03-09 16:14:16 -05:00
Sebastian Huber
8ac3549db3 score: Delete unused CPU_UNROLL_ENQUEUE_PRIORITY 2015-03-05 08:12:24 +01:00
Hesham ALMatary
3358d62fe7 score/cpu/or1k: Add cpuatomic.h to fix broken build.
4e3d9a4d6c broke or1k, cpuatomic.h has to
be added to all architectures.
2015-03-04 17:24:21 -06:00
Hesham ALMatary
262a0d7bbd or1k/or1k-exception-default.c: Eliminate dependency on BSP provided .h file 2015-03-03 15:31:04 -05:00
Martin Galvan
63e91fe689 ARM: Fix _ARMV4_Exception_fiq_default
In _ARMV4_Exception_fiq_default, set the F bit of the SPSR so that when
it gets loaded back to the CPSR in save_more_context it won't re-enable
the FIQs.

Tested on a TMS570LS3137.
2015-02-27 11:56:51 +01:00
Gedare Bloom
9d090fb70a sparc64: fix copyright notices.
The sparc64 port had some incorrect copyright notices affixed to
source code files.
2015-02-23 15:42:59 -05:00