diff options
author | Robert Morris <[email protected]> | 2019-06-01 05:33:38 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-06-01 05:33:38 -0400 |
commit | 50cbc7510250a64674d619d13f5912edf08b767d (patch) | |
tree | 874895d11adb72fed959619d85596b062260276f /riscv.h | |
parent | 7fd1f1eb0aab4d52852fc4f5e83eafc991f9a627 (diff) | |
download | xv6-labs-50cbc7510250a64674d619d13f5912edf08b767d.tar.gz xv6-labs-50cbc7510250a64674d619d13f5912edf08b767d.tar.bz2 xv6-labs-50cbc7510250a64674d619d13f5912edf08b767d.zip |
first shell prints $ prompt, though no console input yet
Diffstat (limited to 'riscv.h')
-rw-r--r-- | riscv.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -129,7 +129,7 @@ w_sscratch(uint64 x) asm("csrw sscratch, %0" : : "r" (x)); } -// Supervisor trap cause +// Supervisor Trap Cause static inline uint64 r_scause() { @@ -138,6 +138,15 @@ r_scause() return x; } +// Supervisor Trap Value +static inline uint64 +r_stval() +{ + uint64 x; + asm("csrr %0, stval" : "=r" (x) ); + return x; +} + #define PGSIZE 4096 // bytes per page #define PGSHIFT 12 // bits of offset within a page |