aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-12-09 15:20:40 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-12-09 15:20:40 -0700
commitac25063e15d7aa645f7567b9bdb0726e5c332fd6 (patch)
tree1a18f6d80cbcc25ce50ebb23c3a81f2d802130e9 /include
parent2aaf2180aa352c71c43efd548893fffe506397e5 (diff)
downloadstm32l4-broken_linker.tar.gz
stm32l4-broken_linker.tar.bz2
stm32l4-broken_linker.zip
Refactor the linker script to make more sense.broken_linker
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.
Diffstat (limited to 'include')
-rw-r--r--include/kern/init.h7
1 files changed, 7 insertions, 0 deletions
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,