aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/common/crt.S
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2014-12-12 16:07:46 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2014-12-12 16:10:44 -0800
commit1d8e02859be502647b52a71623f543712c869b2f (patch)
treeb9b0bdde5cb9e7786e55ef8693e1e886e05db455 /benchmarks/common/crt.S
parent834cd6bd0b65360515ba205ace61c96f83f81867 (diff)
downloadriscv-tests-1d8e02859be502647b52a71623f543712c869b2f.zip
riscv-tests-1d8e02859be502647b52a71623f543712c869b2f.tar.gz
riscv-tests-1d8e02859be502647b52a71623f543712c869b2f.tar.bz2
Use user stack in supervisor mode
This fixes a race condition, as there was only one kernel stack.
Diffstat (limited to 'benchmarks/common/crt.S')
-rw-r--r--benchmarks/common/crt.S15
1 files changed, 1 insertions, 14 deletions
diff --git a/benchmarks/common/crt.S b/benchmarks/common/crt.S
index 24d22e8..2c004d1 100644
--- a/benchmarks/common/crt.S
+++ b/benchmarks/common/crt.S
@@ -126,15 +126,7 @@ _start:
sret
trap_entry:
- csrw sup0, sp
- csrw sup1, t0
- csrr t0, status
- andi t0, t0, SR_PS
- bnez t0, 1f
- la sp, kstacktop
-1:
addi sp, sp, -272
- csrr t0, sup1
SREG x1, 8(sp)
SREG x2, 16(sp)
@@ -216,13 +208,8 @@ trap_entry:
LREG x30, 240(sp)
LREG x31, 248(sp)
- csrr sp, sup0
+ addi sp, sp, 272
sret
-.bss
-.align 4
-.skip 4096
-kstacktop:
-
.section .tbss
tls_start: