summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Aberg <maberg@gaisler.com>2018-11-06 12:56:38 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2020-09-02 10:53:07 +0200
commit37ba65035d3b51eedd64d6675ca42f1f3d5859f0 (patch)
treecc8c4b0c164de5ab3619afef9622a6a3a91827a8
parent8baf93d771cd07ea12eb968e40d1606e481139e2 (diff)
bsps/leon3: Do not invalidate the entry point
This commit fixes an issue when booting SMP application: entry point can become invalid for secondary processors. The first CPU does the following in the boot_card(): 1. Release other CPUs from power-down (but does not wait here) 2. Some other stuff 3. Overwrite trap entry 0 with spurious interrupt handler. 4. The rest It means that the entry point is guaranteed to be valid for the first CPU entering the RTEMS kernel. But 1. and 3. above gives a race. CPU1.. will either enter the kernel properly or end up in the spurious interrupt handler depending on how soon it reaches the entry point it is. One example where this has been an issue is when secondary processors run self-tests in a ROM boot loader before entering the RTEMS entry point. "start" is trap entry 0 in the trap table and directly jumps to "hard_reset".
-rw-r--r--bsps/sparc/leon3/start/spurious.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bsps/sparc/leon3/start/spurious.c b/bsps/sparc/leon3/start/spurious.c
index 23ac4bf4cf..4555ff4ad1 100644
--- a/bsps/sparc/leon3/start/spurious.c
+++ b/bsps/sparc/leon3/start/spurious.c
@@ -148,7 +148,7 @@ void bsp_spurious_initialize()
level = sparc_disable_interrupts();
/* mask = LEON3_IrqCtrl_Regs->mask_p0; */
- for ( trap=0 ; trap<256 ; trap++ ) {
+ for ( trap=1 ; trap<256 ; trap++ ) {
/*
* Skip window overflow, underflow, and flush as well as software