From 0c6ba17b2f08d05195cdbaeba4607fdd8d000775 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 9 Jul 2024 22:25:07 +0300 Subject: fix make clean --- Makefile | 1 + arch/riscv64/asm/asm-offsets.c | 19 +++++++------------ src/uapi/mem.c | 1 - tests/Makefile | 6 ++++++ tests/hello-world/source.mk | 4 ++-- tests/noop/source.mk | 4 ++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 6358e29..0eae957 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,7 @@ RM = rm .PHONY: clean clean: + $(MAKE) -C tests clean $(RM) -rf $(CLEANUP) .PHONY: clean_run diff --git a/arch/riscv64/asm/asm-offsets.c b/arch/riscv64/asm/asm-offsets.c index 80a48f2..05ac51a 100644 --- a/arch/riscv64/asm/asm-offsets.c +++ b/arch/riscv64/asm/asm-offsets.c @@ -7,6 +7,7 @@ * _save_context. */ +#include #include #include #include "../kernel/regs.h" @@ -59,12 +60,6 @@ void asm_offsets() OFFSETOF(t2, struct riscv_regs); OFFSETOF(s0, struct riscv_regs); OFFSETOF(s1, struct riscv_regs); - OFFSETOF(a0, struct riscv_regs); - OFFSETOF(a1, struct riscv_regs); - OFFSETOF(a2, struct riscv_regs); - OFFSETOF(a3, struct riscv_regs); - OFFSETOF(a4, struct riscv_regs); - OFFSETOF(a5, struct riscv_regs); OFFSETOF(a6, struct riscv_regs); OFFSETOF(a7, struct riscv_regs); OFFSETOF(s2, struct riscv_regs); @@ -81,14 +76,14 @@ void asm_offsets() OFFSETOF(t4, struct riscv_regs); OFFSETOF(t5, struct riscv_regs); OFFSETOF(t6, struct riscv_regs); + OFFSETOF(a0, struct riscv_regs); + OFFSETOF(a1, struct riscv_regs); + OFFSETOF(a2, struct riscv_regs); + OFFSETOF(a3, struct riscv_regs); + OFFSETOF(a4, struct riscv_regs); + OFFSETOF(a5, 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); OFFSETOF(exec, struct tcb); diff --git a/src/uapi/mem.c b/src/uapi/mem.c index aeff7c5..f7237d7 100644 --- a/src/uapi/mem.c +++ b/src/uapi/mem.c @@ -179,7 +179,6 @@ SYSCALL_DEFINE3(ref_sharedmem)(struct tcb *t, sys_arg_t tid, sys_arg_t addr, if (!r || zombie(r)) return_args1(t, ERR_INVAL); - size_t size = 0; flags = sanitize_uvflags(flags); vm_t start = ref_shared_uvmem(r, c, addr, flags); if (ERR_CODE(start)) diff --git a/tests/Makefile b/tests/Makefile index 2012107..00b523e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -32,3 +32,9 @@ check: $(TESTS) build/printf.o: common/printf.c mkdir -p build $(COMPILE) -c common/printf.c -o build/printf.o + +RM ?= rm + +.PHONY: clean +clean: + $(RM) -rf build diff --git a/tests/hello-world/source.mk b/tests/hello-world/source.mk index 203a42e..52d642d 100644 --- a/tests/hello-world/source.mk +++ b/tests/hello-world/source.mk @@ -4,5 +4,5 @@ TESTS := $(TESTS) hello-world hello-world: hello-world/init.c $(COMMON) mkdir -p build/hello-world $(COMPILE) hello-world/init.c build/printf.o -o build/hello-world/init - echo build/hello-world/init | $(GEN_INITRD) hello-world/initrd - $(QEMU) hello-world/initrd | grep 'Hello, world!' + echo build/hello-world/init | $(GEN_INITRD) build/hello-world/initrd + $(QEMU) build/hello-world/initrd | grep 'Hello, world!' diff --git a/tests/noop/source.mk b/tests/noop/source.mk index 087ce9b..3745e37 100644 --- a/tests/noop/source.mk +++ b/tests/noop/source.mk @@ -4,5 +4,5 @@ TESTS := $(TESTS) noop noop: noop/init.c $(COMMON) mkdir -p build/noop $(COMPILE) noop/init.c build/printf.o -o build/noop/init - echo build/noop/init | $(GEN_INITRD) noop/initrd - $(QEMU) noop/initrd | grep 'OK' + echo build/noop/init | $(GEN_INITRD) build/noop/initrd + $(QEMU) build/noop/initrd | grep 'OK' -- cgit v1.3