diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-09-02 13:19:06 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-09-02 13:19:36 +0300 |
| commit | 9398194058eeb365bfc985b31b4049ccfd44ac45 (patch) | |
| tree | b1de80a7dd3b2528457505b46355ca9d21130ad9 /arch/riscv64/gen | |
| parent | 66eaaba9703bcb062d2078aede3b85c4a6f3a485 (diff) | |
| download | kmi-9398194058eeb365bfc985b31b4049ccfd44ac45.tar.gz kmi-9398194058eeb365bfc985b31b4049ccfd44ac45.zip | |
fix documentation warnings
Diffstat (limited to 'arch/riscv64/gen')
| -rw-r--r-- | arch/riscv64/gen/asm-offsets.c | 77 | ||||
| -rw-r--r-- | arch/riscv64/gen/source.mk | 15 |
2 files changed, 0 insertions, 92 deletions
diff --git a/arch/riscv64/gen/asm-offsets.c b/arch/riscv64/gen/asm-offsets.c deleted file mode 100644 index 8852d8f..0000000 --- a/arch/riscv64/gen/asm-offsets.c +++ /dev/null @@ -1,77 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ -/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */ - -/** - * @file asm-offsets.c - * riscv64 file used to generate offsets to register slots in stack. Used by - * _save_context. - */ - -#include <apos/utils.h> -#include "../kernel/regs.h" - -/** - * Insert assembly comment with calculated value. - * Largely based on linux - * - * @param sym Name of symbol. - * @param val Value of symbol. - */ -#define DEFINE(sym, val) \ - __asm__ volatile ("\n#-> " #sym " %0 " #val "\n" : : "i" (val)) - -/** - * Insert offset of member in structure. - * - * @param m Member. - * @param s Structure. - */ -#define OFFSETOF(m, s) DEFINE(offsetof_##m, offsetof(s, m)) - -/** - * Insert size of structure. - * - * @param n Name of structure. - * @param s Structure. - */ -#define SIZEOF(n, s) DEFINE(sizeof_##n, sizeof(s)) - -/** - * Generate assembly with calculated offsets and sizes. - * See arch/riscv64/gen/source.mk for how the assembly is used. - */ -void asm_offsets() -{ - OFFSETOF(ra, struct riscv_regs); - OFFSETOF(sp, struct riscv_regs); - OFFSETOF(tp, struct riscv_regs); - OFFSETOF(gp, struct riscv_regs); - OFFSETOF(t0, struct riscv_regs); - OFFSETOF(t1, struct riscv_regs); - 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); - OFFSETOF(s3, struct riscv_regs); - OFFSETOF(s4, struct riscv_regs); - OFFSETOF(s5, struct riscv_regs); - OFFSETOF(s6, struct riscv_regs); - OFFSETOF(s7, struct riscv_regs); - OFFSETOF(s8, struct riscv_regs); - OFFSETOF(s9, struct riscv_regs); - OFFSETOF(s10, struct riscv_regs); - OFFSETOF(s11, struct riscv_regs); - OFFSETOF(t3, struct riscv_regs); - OFFSETOF(t4, struct riscv_regs); - OFFSETOF(t5, struct riscv_regs); - OFFSETOF(t6, struct riscv_regs); - SIZEOF(registers, struct riscv_regs); -} diff --git a/arch/riscv64/gen/source.mk b/arch/riscv64/gen/source.mk deleted file mode 100644 index fda9651..0000000 --- a/arch/riscv64/gen/source.mk +++ /dev/null @@ -1,15 +0,0 @@ -OFFSET_HEADER := $(ARCH_SOURCE)/kernel/gen/asm-offsets.h -OFFSET_SOURCE := $(ARCH_SOURCE)/gen/asm-offsets.c - -$(OFFSET_HEADER): $(OFFSET_SOURCE) - echo "#ifndef APOS_ASM_OFFSETS_H" > $(OFFSET_HEADER) - echo "#define APOS_ASM_OFFSETS_H" >> $(OFFSET_HEADER) - echo "/**" >> $(OFFSET_HEADER) - 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 - |\ - awk '($$1 == "#->") { print "#define " $$2 " " $$3 }' >> $(OFFSET_HEADER) - echo "#endif /* APOS_ASM_OFFSETS_H */" >> $(OFFSET_HEADER) - -CLEANUP += $(ARCH_SOURCE)/kernel/gen/asm-offsets.h |
