diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-05-02 14:29:14 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-05-02 14:29:14 -0700 |
commit | b54a6f8e11f43ac6df310016723ef6eb2f7d3a33 (patch) | |
tree | 21edb00b64ec0c356d0055036f77885eeecab4e8 /v/vm.c | |
parent | 3d45ca302dbf5ac22cfac8fb025c05c735c35e26 (diff) | |
download | env-b54a6f8e11f43ac6df310016723ef6eb2f7d3a33.zip env-b54a6f8e11f43ac6df310016723ef6eb2f7d3a33.tar.gz env-b54a6f8e11f43ac6df310016723ef6eb2f7d3a33.tar.bz2 |
Stop using mtohost/mfromhost registers
Diffstat (limited to 'v/vm.c')
-rw-r--r-- | v/vm.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -8,7 +8,17 @@ void trap_entry(); void pop_tf(trapframe_t*); -void do_tohost(long tohost_value); + +volatile uint64_t tohost __attribute__((aligned(64))); +volatile uint64_t fromhost __attribute__((aligned(64))); + +static void do_tohost(uint64_t tohost_value) +{ + tohost = tohost_value; + while (fromhost == 0) + ; + fromhost = 0; +} #define pa2kva(pa) ((void*)(pa) - DRAM_BASE - MEGAPAGE_SIZE) #define uva2kva(pa) ((void*)(pa) - MEGAPAGE_SIZE) @@ -36,6 +46,11 @@ static void terminate(int code) while (1); } +void wtf() +{ + terminate(841); +} + #define stringify1(x) #x #define stringify(x) stringify1(x) #define assert(x) do { \ |