mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[bootloader] Added custom trampolines
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <ion/src/device/n0110/drivers/power.h>
|
||||
|
||||
#include <bootloader/trampoline.h>
|
||||
#include <bootloader/boot.h>
|
||||
|
||||
namespace Bootloader {
|
||||
|
||||
@@ -30,4 +31,12 @@ void* Trampolines[TRAMPOLINES_COUNT]
|
||||
(void*) strncmp
|
||||
};
|
||||
|
||||
}
|
||||
void* CustomTrampolines[CUSTOM_TRAMPOLINES_COUNT]
|
||||
__attribute__((section(".custom_trampolines_table")))
|
||||
__attribute__((used))
|
||||
= {
|
||||
(void*) Bootloader::Boot::mode,
|
||||
(void*) Bootloader::Boot::setMode
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
namespace Bootloader {
|
||||
|
||||
#define TRAMPOLINES_COUNT 13
|
||||
|
||||
extern void* Trampolines[TRAMPOLINES_COUNT];
|
||||
|
||||
#define CUSTOM_TRAMPOLINES_COUNT 2
|
||||
extern void* CustomTrampolines[CUSTOM_TRAMPOLINES_COUNT];
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -7,6 +7,7 @@ MEMORY {
|
||||
|
||||
STACK_SIZE = 32K;
|
||||
TRAMPOLINES_OFFSET = 0xE000;
|
||||
CUSTOM_TRAMPOLINES_OFFSET = 64K - 64;
|
||||
FLASH_SECOND_SECTOR_OFFSET = 16K;
|
||||
FLASH_SECOND_SECTOR_SIZE = 16K;
|
||||
|
||||
@@ -85,6 +86,11 @@ SECTIONS {
|
||||
KEEP(*(.trampolines_table));
|
||||
} > INTERNAL_FLASH
|
||||
|
||||
.custom_trampolines_table : {
|
||||
. = ORIGIN(INTERNAL_FLASH) + CUSTOM_TRAMPOLINES_OFFSET;
|
||||
KEEP(*(.custom_trampolines_table));
|
||||
} > INTERNAL_FLASH
|
||||
|
||||
.bss : {
|
||||
/* The bss section contains data for all uninitialized variables
|
||||
* So like the .data section, it will go in RAM, but unlike the data section
|
||||
|
||||
Reference in New Issue
Block a user