From a717296a2036cede5fccfff544513043a984d614 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 15 Sep 2022 19:21:14 +0300 Subject: change syscalls to take 5 params and return 6 + In total, a syscall is built up of 6 values, with the first being the syscall number. Symmetrically, the first value is now a status and the following five values return "values". This allows us to cram in more info into the ipc_* functions. The performance difference is absolutely minimal, at least from my testing in qemu. --- arch/riscv64/asm/asm-offsets.c | 9 +++++++++ arch/riscv64/asm/source.mk | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'arch/riscv64/asm') diff --git a/arch/riscv64/asm/asm-offsets.c b/arch/riscv64/asm/asm-offsets.c index 8852d8f..3619765 100644 --- a/arch/riscv64/asm/asm-offsets.c +++ b/arch/riscv64/asm/asm-offsets.c @@ -8,6 +8,7 @@ */ #include +#include #include "../kernel/regs.h" /** @@ -74,4 +75,12 @@ void asm_offsets() OFFSETOF(t5, struct riscv_regs); OFFSETOF(t6, struct riscv_regs); SIZEOF(registers, struct riscv_regs); + + OFFSETOF(s, struct sys_ret); + OFFSETOF(ar0, struct sys_ret); + OFFSETOF(ar1, struct sys_ret); + OFFSETOF(ar2, struct sys_ret); + OFFSETOF(ar3, struct sys_ret); + OFFSETOF(ar4, struct sys_ret); + SIZEOF(sys_ret, struct sys_ret); } diff --git a/arch/riscv64/asm/source.mk b/arch/riscv64/asm/source.mk index 9b463b7..87bcf24 100644 --- a/arch/riscv64/asm/source.mk +++ b/arch/riscv64/asm/source.mk @@ -9,7 +9,7 @@ $(OFFSET_HEADER): $(OFFSET_SOURCE) echo " * @file asm-offsets.h" >> $(OFFSET_HEADER) echo " * This comment is to shut up warnings." >> $(OFFSET_HEADER) echo " */" >> $(OFFSET_HEADER) - $(COMPILER) $(INCLUDE_FLAGS) -S $(OFFSET_SOURCE) -o - |\ + $(COMPILER) $(CFLAGS) $(INCLUDE_FLAGS) -S $(OFFSET_SOURCE) -o - |\ awk '($$1 == "#->") { print "#define " $$2 " " $$3 }' >> $(OFFSET_HEADER) echo "#endif /* APOS_ASM_OFFSETS_H */" >> $(OFFSET_HEADER) -- cgit v1.3