forked from numworks/epsilon
-
Notifications
You must be signed in to change notification settings - Fork 92
/
trampoline.cpp
42 lines (35 loc) · 1006 Bytes
/
trampoline.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <string.h>
#include <ion/src/device/shared/drivers/external_flash.h>
#include <ion/src/device/n0110/drivers/power.h>
#include <bootloader/trampoline.h>
#include <bootloader/boot.h>
namespace Bootloader {
void __attribute__((noinline)) suspend() {
Ion::Device::Power::internalFlashSuspend(true);
}
void* Trampolines[TRAMPOLINES_COUNT]
__attribute__((section(".trampolines_table")))
__attribute__((used))
= {
(void*) Bootloader::suspend, // Suspend
(void*) Ion::Device::ExternalFlash::EraseSector, // External erase
(void*) Ion::Device::ExternalFlash::WriteMemory, // External write
(void*) memcmp,
(void*) memcpy,
(void*) memmove,
(void*) memset,
(void*) strchr,
(void*) strcmp,
(void*) strlcat,
(void*) strlcpy,
(void*) strlen,
(void*) strncmp
};
void* CustomTrampolines[CUSTOM_TRAMPOLINES_COUNT]
__attribute__((section(".custom_trampolines_table")))
__attribute__((used))
= {
(void*) Bootloader::Boot::mode,
(void*) Bootloader::Boot::setMode
};
}