aboutsummaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-08-30 19:20:21 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-08-30 19:20:21 +0300
commit314bca3dc19a864c76153bfcd5a58be8c40000f9 (patch)
tree9aba30284fce66e149a7472adea1cb4037e49463 /tests/common
parent1a2e1fff7ce4b8fd8db46549d81e71e76b842da3 (diff)
downloadkmi-314bca3dc19a864c76153bfcd5a58be8c40000f9.tar.gz
kmi-314bca3dc19a864c76153bfcd5a58be8c40000f9.zip
improvements to shared memory handling
+ Now each shared region is reference counter (technically each region is refernce counted, private regions just have a count of 1). Also, syscalls that touch the TLB get flushed, but should probably look into where else this flushing might be needed.
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/arch/riscv64/source.mk5
-rw-r--r--tests/common/sys.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/common/arch/riscv64/source.mk b/tests/common/arch/riscv64/source.mk
index 517c1c7..e3c0e55 100644
--- a/tests/common/arch/riscv64/source.mk
+++ b/tests/common/arch/riscv64/source.mk
@@ -1 +1,4 @@
-ARCH_FLAGS += -march=rv64imac -mabi=lp64
+# -mno-relax to disable the compiler from using the gp register as a shorthand
+# for __global_pointer$, which I currently don't do anything with. Should
+# probably fix at some point
+ARCH_FLAGS += -march=rv64imac -mabi=lp64 -mno-relax
diff --git a/tests/common/sys.h b/tests/common/sys.h
index 6d5e493..3e98abf 100644
--- a/tests/common/sys.h
+++ b/tests/common/sys.h
@@ -86,9 +86,10 @@ static inline void *sys_ref_sharedmem(id_t tid, uintptr_t addr, vmflags_t flags)
return (void *)r.a0;
}
-static inline void sys_free_mem(uintptr_t start)
+static inline enum sys_status sys_free_mem(uintptr_t start)
{
- syscall1(SYS_FREE_MEM, start);
+ struct sys_ret r = syscall1(SYS_FREE_MEM, start);
+ return r.s;
}
static inline uint64_t sys_timebase()