From ac25063e15d7aa645f7567b9bdb0726e5c332fd6 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 9 Dec 2022 15:20:40 -0700 Subject: Refactor the linker script to make more sense. Specifically this moves the inits into the .text section. This also move the data and bss segments into sram2 to give the heap and stack more space to work with in sram1. --- include/kern/init.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/kern/init.h') diff --git a/include/kern/init.h b/include/kern/init.h index 0ebbeac..7c40d19 100644 --- a/include/kern/init.h +++ b/include/kern/init.h @@ -64,6 +64,13 @@ void(*init7_ptr)() = init7fn; \ static void init7fn +#define entry_point(fn) \ + static __attribute((__section__(".entry_point"))) __attribute((__used__)) \ + struct { \ + uint32_t _unused; \ + uint32_t entry_point; \ + } c = { 0x2000c000, (uint32_t) &fn } + typedef enum { INIT_LEVEL_0, INIT_LEVEL_1, -- cgit