summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-07-19 16:50:02 -0700
committerGitHub <noreply@github.com>2024-07-19 16:50:02 -0700
commit1b6c90ae6bc1e09d6472c5b701b07ce233e7f424 (patch)
tree01f4698fe6a73b8999a6b60d4bcb40aa31e31fe9 /src/boot
parentfbc4e813e567a7cf8d8e87b10f2c2e7437b2d5ef (diff)
Bootclear cleanup (#201)
* bootclear is the start of the boot segment * Use the end of boot * stack top in main thread creation
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/boot_main.c6
-rw-r--r--src/boot/idle.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c
index 76da7f9..cebad08 100644
--- a/src/boot/boot_main.c
+++ b/src/boot/boot_main.c
@@ -15,15 +15,15 @@ STACK(sBootStack, 0x400);
// original name unknown
void bootclear(void) {
- s32 size = (uintptr_t)bootclear - BOOT_ADDRESS_ULTRA;
+ s32 size = (uintptr_t)SEGMENT_VRAM_START(boot) - BOOT_ADDRESS_ULTRA;
if (size > 0) {
bzero((void*)BOOT_ADDRESS_ULTRA, size);
}
- size = osMemSize - OS_K0_TO_PHYSICAL(SEGMENT_VRAM_START(dmadata));
+ size = osMemSize - OS_K0_TO_PHYSICAL(SEGMENT_VRAM_END(boot));
if (size > 0) {
- bzero(SEGMENT_VRAM_START(dmadata), size);
+ bzero(SEGMENT_VRAM_END(boot), size);
}
}
diff --git a/src/boot/idle.c b/src/boot/idle.c
index 6ca947a..003c44d 100644
--- a/src/boot/idle.c
+++ b/src/boot/idle.c
@@ -60,7 +60,7 @@ void Idle_ThreadEntry(void* arg) {
osViBlack(true);
osCreatePiManager(OS_PRIORITY_PIMGR, &sPiMgrCmdQueue, sPiMgrCmdBuff, ARRAY_COUNT(sPiMgrCmdBuff));
StackCheck_Init(&sMainStackInfo, sMainStack, STACK_TOP(sMainStack), 0, 0x400, "main");
- osCreateThread(&sMainThread, M_THREAD_ID_MAIN, Main_ThreadEntry, arg, &sMainStackInfo, M_PRIORITY_MAIN);
+ osCreateThread(&sMainThread, M_THREAD_ID_MAIN, Main_ThreadEntry, arg, STACK_TOP(sMainStack), M_PRIORITY_MAIN);
osStartThread(&sMainThread);
osSetThreadPri(NULL, OS_PRIORITY_IDLE);