blob: b8c3f64c3f740b0a4e324eb02ab075c7b192636c (
plain)
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
|
#include <revolution.h>
#include <revolution/os.h>
#include "__os.h"
static void* SaveEnd;
static void* SaveStart;
void __OSReboot(u32 resetCode, u32 bootDol) {
OSContext exceptionContext;
char* argvToPass;
OSDisableInterrupts();
OSSetArenaLo((void*)0x81280000);
OSSetArenaHi((void*)0x812f0000);
argvToPass = NULL;
__OSNextPartitionType = *(u32*)0x80003194;
__OSBootDol(bootDol, resetCode | 0x80000000, (const char**)&argvToPass);
}
void OSSetSaveRegion(void* start, void* end) {
ASSERTMSGLINE(134, (u32)start >= 0x80700000 || start == NULL, "OSSetSaveRegion(): start address should be NULL or higher than 0x80700000\n");
ASSERTMSGLINE(135, 0x81200000 >= (u32)end || end == NULL, "OSSetSaveRegion(): end address should be NULL or lower than 0x81200000\n");
ASSERTMSGLINE(136, ((start == NULL) ^ (end == NULL)) == 0, "OSSetSaveRegion(): if either start or end is NULL, both should be NULL\n");
SaveStart = start;
SaveEnd = end;
}
void OSGetSaveRegion(void** start, void** end) {
*start = SaveStart;
*end = SaveEnd;
}
void OSGetSavedRegion(void** start, void** end) {
*start = __OSRebootParams.regionStart;
*end = __OSRebootParams.regionEnd;
}
|