From: Andrew Waterman Date: Sat, 13 Dec 2014 00:07:46 +0000 (-0800) Subject: Use user stack in supervisor mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d8e02859be502647b52a71623f543712c869b2f;p=riscv-tests.git Use user stack in supervisor mode This fixes a race condition, as there was only one kernel stack. --- 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: