projects
/
riscv-tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Put debug test stack in data instead of text
[riscv-tests.git]
/
debug
/
programs
/
entry.S
diff --git
a/debug/programs/entry.S
b/debug/programs/entry.S
index 866636b1b50b7e052faaf150ae62752623a9f68d..3acd786cc226d367ddc109cb03a53e11f2601b45 100755
(executable)
--- a/
debug/programs/entry.S
+++ b/
debug/programs/entry.S
@@
-1,9
+1,6
@@
-#ifndef ENTRY_S
-#define ENTRY_S
-
#include "encoding.h"
#include "encoding.h"
-#define STACK_SIZE
1024
+#define STACK_SIZE
(90 * XLEN / 8)
#if XLEN == 64
# define LREG ld
#if XLEN == 64
# define LREG ld
@@
-62,10
+59,11
@@
handle_reset:
.option pop
# Initialize stack pointer.
.option pop
# Initialize stack pointer.
- # Support up to 4 harts, with IDs 0--3.
+ # Give each hart STACK_SIZE of stack.
+ # Assume hart IDs are contiguous and start at 0.
csrr t0, CSR_MHARTID
addi t0, t0, 1
csrr t0, CSR_MHARTID
addi t0, t0, 1
- li t1, STACK_SIZE
/ 4
+ li t1, STACK_SIZE
mul t0, t0, t1
la sp, stack_bottom
add sp, sp, t0
mul t0, t0, t1
la sp, stack_bottom
add sp, sp, t0
@@
-108,6
+106,7
@@
wait_until_initialized: # Wait for hart 0 to perform initialization.
j _init
j _init
+.align 2
trap_entry:
addi sp, sp, -32*REGBYTES
trap_entry:
addi sp, sp, -32*REGBYTES
@@
-192,10
+191,10
@@
loop_forever:
j loop_forever
// Fill the stack with data so we can see if it was overrun.
j loop_forever
// Fill the stack with data so we can see if it was overrun.
+ .section .data
.align 4
stack_bottom:
.align 4
stack_bottom:
- .fill STACK_SIZE/4, 4, 0x22446688
+ .fill
NHARTS *
STACK_SIZE/4, 4, 0x22446688
stack_top:
initialized:
.word 0
stack_top:
initialized:
.word 0
-#endif