diff options
author | Andrew Waterman <waterman@eecs.berkeley.edu> | 2013-11-24 14:25:22 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@eecs.berkeley.edu> | 2013-11-24 14:25:22 -0800 |
commit | 9c4e0839779f302720173ad063fa25366cef21f7 (patch) | |
tree | 0fc4021f6287a68c1d1d033a4eaf0e6297029002 /pt/riscv_test.h | |
parent | f3545105d54ab746efac58b96e998a252cafd16b (diff) | |
download | env-9c4e0839779f302720173ad063fa25366cef21f7.zip env-9c4e0839779f302720173ad063fa25366cef21f7.tar.gz env-9c4e0839779f302720173ad063fa25366cef21f7.tar.bz2 |
Update to new privileged mode
Diffstat (limited to 'pt/riscv_test.h')
-rw-r--r-- | pt/riscv_test.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/pt/riscv_test.h b/pt/riscv_test.h index 66eb59c..5b48665 100644 --- a/pt/riscv_test.h +++ b/pt/riscv_test.h @@ -50,33 +50,33 @@ evac: \ //----------------------------------------------------------------------- #define ENABLE_TIMER_INTERRUPT \ - mtpcr x0,clear_ipi; \ - mfpcr a0,status; \ + csrw clear_ipi,x0; \ + csrr a0,status; \ li a1,SR_IM; \ or a0,a0,a1; \ - mtpcr a0,status; \ - setpcr status,SR_EI; \ + csrw status,a0; \ + csrs status,SR_EI; \ la a0,_handler; \ - mtpcr a0,evec; \ - mtpcr x0,count; \ + csrw evec,a0; \ + csrw count,x0; \ addi a0,x0,60; \ - mtpcr a0,compare; \ + csrw compare,a0; \ #define XCPT_HANDLER \ _handler: \ - mtpcr a0,sup0; \ - mtpcr a1,sup1; \ + csrw sup0,a0; \ + csrw sup1,a1; \ vxcptcause x0; \ la a0,evac; \ vxcptsave a0; \ vxcptrestore a0; \ - setpcr status,SR_PEI; \ - mfpcr a0,count; \ + csrs status,SR_PEI; \ + csrr a0,count; \ addi a0,a0,60; \ - mtpcr a0,compare; \ - mfpcr a0,sup0; \ - mfpcr a1,sup1; \ - eret; \ + csrr a0,compare; \ + csrr a0,sup0; \ + csrr a1,sup1; \ + sret; \ #if 0 #define XCPT_HANDLER \ |