summaryrefslogtreecommitdiff
path: root/v/vm.c
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-05-02 14:29:14 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-05-02 14:29:14 -0700
commitb54a6f8e11f43ac6df310016723ef6eb2f7d3a33 (patch)
tree21edb00b64ec0c356d0055036f77885eeecab4e8 /v/vm.c
parent3d45ca302dbf5ac22cfac8fb025c05c735c35e26 (diff)
downloadenv-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.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/v/vm.c b/v/vm.c
index ef1f733..5fd1b11 100644
--- a/v/vm.c
+++ b/v/vm.c
@@ -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 { \