From 1d8e02859be502647b52a71623f543712c869b2f Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 12 Dec 2014 16:07:46 -0800 Subject: [PATCH] Use user stack in supervisor mode This fixes a race condition, as there was only one kernel stack. --- benchmarks/common/crt.S | 15 +-------------- 1 file changed, 1 insertion(+), 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: -- 2.30.2