map private mem in agent
This commit is contained in:
@@ -78,14 +78,28 @@ inline fn x25519(reg u64 shared_mem sync_mem private_mem) {
|
||||
jade_scalarmult_curve25519_amd64_mulx(outptr, keyptr, pkptr);
|
||||
}
|
||||
|
||||
export fn agent_start(reg u64 shared_mem sync_mem private_mem) {
|
||||
export fn agent_start(reg u64 shared_mem sync_mem private_mem_fd) {
|
||||
stack u64 key_id;
|
||||
reg u64 futex_op, val, timeout, uaddr2, val3, woken_up;
|
||||
reg u64 private_mem;
|
||||
// Futex varibles
|
||||
reg u64 futex_op val timeout uaddr2 val3 woken_up;
|
||||
// Mmap variables
|
||||
reg u64 addr len prot flag off;
|
||||
|
||||
() = #spill(shared_mem, sync_mem);
|
||||
|
||||
private_mem_fd = private_mem_fd;
|
||||
addr = 0;
|
||||
len = 3200;
|
||||
prot = 3; // PROT_READ | PROT_WRITE
|
||||
flag = 1; // MAP_SHARED;
|
||||
off = 0;
|
||||
private_mem = #mmap(addr, len, prot, flag, private_mem_fd, off);
|
||||
|
||||
() = #spill(private_mem);
|
||||
|
||||
key_id = 0;
|
||||
|
||||
() = #spill(shared_mem, sync_mem, private_mem);
|
||||
|
||||
while (true) {
|
||||
() = #unspill(sync_mem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user