zephyr/arch/sparc/core
Martin Åberg a1d1a5f547 SPARC: Keep interrupts disabled during kernel init
This commit avoids enabling interrupts during Zephyr init.

Details:
Interrupts will be enabled only when the first thread starts or if
arch_irq_unlock() is called before that.

The logic is now:
1. Enable traps, disable interrupts globally
2. Initialize bss
3. Call _PrepC

Use in-place memset() to avoid register window overflow and underflow
traps. That is perhaps not the common scenario, but could happen with
memset() implementation which contains SAVE instructions on a system
with few register windows.

The second, and more important, item this commit addresses is that it
increases the processor interrupt level (priority) to highest. That
is, it enters _PrepC with all maskable interrupts levels disabled.

This fixes some cases where interrupts could be taken after
z_clock_driver_init() while the system was still initializing. That
seem to have occurred when clearing large thread stacks.

The third thing is that we now start out with current window pointer
0 (PSR.CWP=0) instead of 1. It has no practical implication except
for preparing for possible future support for systems with only
two windows.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-07-22 10:25:53 -04:00
..
offsets SPARC: improve fatal log 2021-03-25 17:48:23 +01:00
CMakeLists.txt
fatal.c arch: sparc: Fix 10.4 violations 2021-04-10 09:59:37 -04:00
fault_trap.S SPARC: improve fatal log 2021-03-25 17:48:23 +01:00
interrupt_trap.S SPARC: add FPU support 2020-12-04 14:33:43 +02:00
irq_manage.c arch: sparc: Fix 10.4 violations 2021-04-10 09:59:37 -04:00
irq_offload.c
prep_c.c
reset_trap.S SPARC: Keep interrupts disabled during kernel init 2021-07-22 10:25:53 -04:00
stack_offsets.h SPARC: optimized interrupt stack frame size 2020-12-04 14:33:43 +02:00
sw_trap_set_pil.S
switch.S sparc: write through switched_from in arch_switch() 2021-02-17 06:35:03 -05:00
thread.c kernel: arch: use ENOTSUP instead of ENOSYS in k_float_disable() 2021-03-25 14:13:23 +01:00
tls.c
trap_table_mvt.S SPARC: add the Flush windows software trap 2021-05-28 06:32:36 -05:00
window_trap.S SPARC: add the Flush windows software trap 2021-05-28 06:32:36 -05:00