diff options
author | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2010-08-18 18:24:55 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2010-08-18 18:24:55 -0700 |
commit | 29cc0dc9854c66f12bd65e12516f68ccd9a741da (patch) | |
tree | 23bd8147007d3d0fbb005f578f395e71f7d7d18d /pk/frontend.c | |
parent | e97220c9bf519b8e0f0b131a4f868331c4d526fb (diff) | |
download | pk-29cc0dc9854c66f12bd65e12516f68ccd9a741da.zip pk-29cc0dc9854c66f12bd65e12516f68ccd9a741da.tar.gz pk-29cc0dc9854c66f12bd65e12516f68ccd9a741da.tar.bz2 |
[pk,fesvr] improved proxykernel build system
Now uses a modified MCPPBS. Add --host=riscv to configure path.
Front-end server now just searches PATH for riscv-pk, so just install the pk
to somewhere in your path.
Diffstat (limited to 'pk/frontend.c')
-rw-r--r-- | pk/frontend.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/pk/frontend.c b/pk/frontend.c new file mode 100644 index 0000000..c4e799b --- /dev/null +++ b/pk/frontend.c @@ -0,0 +1,26 @@ +#include "pk.h" +#include "atomic.h" +#include "frontend.h" +#include "pcr.h" + +sysret_t frontend_syscall(long n, long a0, long a1, long a2, long a3) +{ + static volatile long magic_mem[8]; + + static spinlock_t lock = SPINLOCK_INIT; + spinlock_lock(&lock); + + magic_mem[0] = n; + magic_mem[1] = a0; + magic_mem[2] = a1; + magic_mem[3] = a2; + magic_mem[4] = a3; + + mtpcr(magic_mem,16); + while(mfpcr(17) == 0); + + sysret_t ret = {magic_mem[0],magic_mem[1]}; + + spinlock_unlock(&lock); + return ret; +} |