aboutsummaryrefslogtreecommitdiff
path: root/pk/frontend.c
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-02-28 20:42:42 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-02-28 20:42:42 -0800
commitd2d2e0a55c08b15a08892d5b89ee939a5986e69e (patch)
tree610c4abb4f618b7d6946dd48d8e0d5ad0d752a43 /pk/frontend.c
parent75471727f834ba6e227804a2b7330658a65f700a (diff)
downloadpk-d2d2e0a55c08b15a08892d5b89ee939a5986e69e.zip
pk-d2d2e0a55c08b15a08892d5b89ee939a5986e69e.tar.gz
pk-d2d2e0a55c08b15a08892d5b89ee939a5986e69e.tar.bz2
Remove SBI HTIF support; add console_getchar
Diffstat (limited to 'pk/frontend.c')
-rw-r--r--pk/frontend.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/pk/frontend.c b/pk/frontend.c
index b2d26ce..5055a28 100644
--- a/pk/frontend.c
+++ b/pk/frontend.c
@@ -8,20 +8,6 @@
#include "syscall.h"
#include <stdint.h>
-uint64_t tohost_sync(unsigned dev, unsigned cmd, uint64_t payload)
-{
- uint64_t fromhost;
- __sync_synchronize();
-
- sbi_device_message m = {dev, cmd, payload}, *p;
- do_mcall(MCALL_SEND_DEVICE_REQUEST, &m);
- while ((p = (void*)do_mcall(MCALL_RECEIVE_DEVICE_RESPONSE)) == 0);
- kassert(p == &m);
-
- __sync_synchronize();
- return m.data;
-}
-
long frontend_syscall(long n, long a0, long a1, long a2, long a3, long a4, long a5, long a6)
{
static volatile uint64_t magic_mem[8];
@@ -38,7 +24,7 @@ long frontend_syscall(long n, long a0, long a1, long a2, long a3, long a4, long
magic_mem[6] = a5;
magic_mem[7] = a6;
- tohost_sync(0, 0, (uintptr_t)magic_mem);
+ do_mcall(MCALL_HTIF_SYSCALL, magic_mem);
long ret = magic_mem[0];