From 6f8e5772d17d277842be3f6162ddd665a17e5be9 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 20 Dec 2021 14:53:44 +0200 Subject: More sensible init + Who knew some reservations were a good thing? (at least relativelyy speaking) --- include/apos/attrs.h | 1 + include/apos/vmem.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include/apos') diff --git a/include/apos/attrs.h b/include/apos/attrs.h index 469b7bd..64ec27d 100644 --- a/include/apos/attrs.h +++ b/include/apos/attrs.h @@ -8,5 +8,6 @@ #define __weak __attribute__((weak)) #define __main __section(".kernel.start") __noinline +#define __init __section(".init.start") __noinline #endif /* APOS_COMPILER_ATTRIBUTES_H */ diff --git a/include/apos/vmem.h b/include/apos/vmem.h index daa9d10..38432ee 100644 --- a/include/apos/vmem.h +++ b/include/apos/vmem.h @@ -26,7 +26,8 @@ struct sp_mem { #define mem_container(ptr)\ container_of(ptr, struct sp_mem, sp_n) - +#define __va(x) (((char *)(x)) + VM_DMAP - RAM_BASE) +#define __pa(x) (((char *)(x)) + RAM_BASE - VM_DMAP) /* general overview of the different functions: * (un)map_vmem: map one known page of physical memory to one known page of -- cgit v1.3