Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/SALP4Q/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ Revolution/FS/fs.c:
.sdata start:0x805F3878 end:0x805F3888
.sbss start:0x805F5F10 end:0x805F5F28

Revolution/IPC/ipcMain.c:
.text start:0x803B2C50 end:0x803B2D38
.sbss start:0x805F5F28 end:0x805F5F3C

Revolution/IPC/ipcclt.c:
.text start:0x803B2D40 end:0x803B472C
.bss start:0x805A4800 end:0x805A48C0
.sdata start:0x805F3888 end:0x805F3890
.sbss start:0x805F5F40 end:0x805F5F50

Revolution/NAND/NANDOpenClose.c:
.text start:0x803B5EF0 end:0x803B63FC

Expand Down
34 changes: 17 additions & 17 deletions config/SALP4Q/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36643,7 +36643,7 @@ fn_80373A40 = .text:0x80373A40; // type:function size:0x144
fn_80373B90 = .text:0x80373B90; // type:function size:0x29C
fn_80373E30 = .text:0x80373E30; // type:function size:0x18C
OSSleepThread = .text:0x80373FC0; // type:function size:0xF0 scope:global
fn_803740B0 = .text:0x803740B0; // type:function size:0xF8
OSWakeupThread = .text:0x803740B0; // type:function size:0xF8
fn_803741B0 = .text:0x803741B0; // type:function size:0xEC
fn_803742A0 = .text:0x803742A0; // type:function size:0x30
fn_803742D0 = .text:0x803742D0; // type:function size:0x38
Expand Down Expand Up @@ -37746,17 +37746,17 @@ ISFS_Close = .text:0x803B2B20; // type:function size:0x4
ISFS_CloseAsync = .text:0x803B2B30; // type:function size:0x84
fn_803B2BC0 = .text:0x803B2BC0; // type:function size:0x90
IPCInit = .text:0x803B2C50; // type:function size:0x4C scope:global
fn_803B2CA0 = .text:0x803B2CA0; // type:function size:0x48
IPCReInit = .text:0x803B2CA0; // type:function size:0x48
IPCReadReg = .text:0x803B2CF0; // type:function size:0x10 scope:global
IPCWriteReg = .text:0x803B2D00; // type:function size:0x10 scope:global
IPCGetBufferHi = .text:0x803B2D10; // type:function size:0x8 scope:global
IPCGetBufferLo = .text:0x803B2D20; // type:function size:0x8 scope:global
IPCSetBufferLo = .text:0x803B2D30; // type:function size:0x8 scope:global
strnlen = .text:0x803B2D40; // type:function size:0x2C scope:global
fn_803B2D70 = .text:0x803B2D70; // type:function size:0x258
IpcReplyHandler = .text:0x803B2D70; // type:function size:0x258
IPCInterruptHandler = .text:0x803B2FD0; // type:function size:0x1AC scope:local
IPCCltInit = .text:0x803B3180; // type:function size:0xC0 scope:global
fn_803B3240 = .text:0x803B3240; // type:function size:0x74
IPCCltReInit = .text:0x803B3240; // type:function size:0x74
__ios_Ipc2 = .text:0x803B32C0; // type:function size:0x240 scope:local
IOS_OpenAsync = .text:0x803B3500; // type:function size:0x11C scope:global
IOS_Open = .text:0x803B3620; // type:function size:0x124 scope:global
Expand All @@ -37770,18 +37770,18 @@ IOS_SeekAsync = .text:0x803B3CE0; // type:function size:0xE0
IOS_Seek = .text:0x803B3DC0; // type:function size:0xE8
IOS_IoctlAsync = .text:0x803B3EB0; // type:function size:0x138 scope:global
IOS_Ioctl = .text:0x803B3FF0; // type:function size:0x130
fn_803B4120 = .text:0x803B4120; // type:function size:0x13C
__ios_Ioctlv = .text:0x803B4120; // type:function size:0x13C
IOS_IoctlvAsync = .text:0x803B4260; // type:function size:0xE4
IOS_Ioctlv = .text:0x803B4350; // type:function size:0xDC scope:global
fn_803B4430 = .text:0x803B4430; // type:function size:0x2FC
IOS_IoctlvReboot = .text:0x803B4430; // type:function size:0x2FC
iosCreateHeap = .text:0x803B4730; // type:function size:0x130 scope:global
fn_803B4860 = .text:0x803B4860; // type:function size:0x1FC
iosAllocAligned = .text:0x803B4A60; // type:function size:0x4 scope:global
iosFree = .text:0x803B4A70; // type:function size:0x1E8 scope:global
IPCiProfInit = .text:0x803B4C60; // type:function size:0xB8 scope:global
IPCiProfQueueReq = .text:0x803B4D20; // type:function size:0x84 scope:global
fn_803B4DB0 = .text:0x803B4DB0; // type:function size:0x10
fn_803B4DC0 = .text:0x803B4DC0; // type:function size:0x7C
IPCiProfAck = .text:0x803B4DB0; // type:function size:0x10
IPCiProfReply = .text:0x803B4DC0; // type:function size:0x7C
fn_803B4E40 = .text:0x803B4E40; // type:function size:0x108
fn_803B4F50 = .text:0x803B4F50; // type:function size:0xF0
fn_803B5040 = .text:0x803B5040; // type:function size:0x118
Expand Down Expand Up @@ -48272,7 +48272,7 @@ lbl_805A47C0 = .bss:0x805A47C0; // type:object size:0x10
lbl_805A47D0 = .bss:0x805A47D0; // type:object size:0x30
__responses = .bss:0x805A4800; // type:object size:0x50 scope:local data:4byte
__timeout_alarm = .bss:0x805A4850; // type:object size:0x30 scope:local
lbl_805A4880 = .bss:0x805A4880; // type:object size:0x40
__rpcBuf = .bss:0x805A4880; // type:object size:0x40
lbl_805A48C0 = .bss:0x805A48C0; // type:object size:0x80 data:4byte
IpcFdArray = .bss:0x805A4940; // type:object size:0x80 scope:local data:4byte
IpcReqPtrArray = .bss:0x805A49C0; // type:object size:0x80 scope:local data:4byte
Expand Down Expand Up @@ -51297,14 +51297,14 @@ _asynCnt = .sbss:0x805F5F18; // type:object size:0x4 scope:local data:4byte
@LOCAL@ISFS_OpenLib__Fv@lo = .sbss:0x805F5F1C; // type:object size:0x4 scope:weak data:4byte
@LOCAL@ISFS_OpenLib__Fv@hi@0 = .sbss:0x805F5F20; // type:object size:0x4 scope:weak data:4byte
hId = .sbss:0x805F5F24; // type:object size:0x4 scope:global data:4byte
lbl_805F5F28 = .sbss:0x805F5F28; // type:object size:0x1 data:byte
lbl_805F5F2C = .sbss:0x805F5F2C; // type:object size:0x4 data:4byte
lbl_805F5F30 = .sbss:0x805F5F30; // type:object size:0x4 data:4byte
lbl_805F5F34 = .sbss:0x805F5F34; // type:object size:0x4 data:4byte
lbl_805F5F38 = .sbss:0x805F5F38; // type:object size:0x8 data:4byte
lbl_805F5F40 = .sbss:0x805F5F40; // type:object size:0x4 data:4byte
lbl_805F5F44 = .sbss:0x805F5F44; // type:object size:0x4 data:4byte
lbl_805F5F48 = .sbss:0x805F5F48; // type:object size:0x4 data:4byte
Initialized = .sbss:0x805F5F28; // type:object size:0x1 scope:local data:byte
IPCCurrentBufferLo = .sbss:0x805F5F2C; // type:object size:0x4 scope:local data:4byte
IPCCurrentBufferHi = .sbss:0x805F5F30; // type:object size:0x4 scope:local data:4byte
IPCBufferLo = .sbss:0x805F5F34; // type:object size:0x4 scope:local data:4byte
IPCBufferHi = .sbss:0x805F5F38; // type:object size:0x4 scope:local data:4byte
__relnchFl = .sbss:0x805F5F40; // type:object size:0x4 scope:local data:4byte
__relnchRpc = .sbss:0x805F5F44; // type:object size:0x4 scope:local data:4byte
__relnchRpcSave = .sbss:0x805F5F48; // type:object size:0x4 scope:local data:4byte
@LOCAL@IPCCltInit__Fv@initialized = .sbss:0x805F5F4C; // type:object size:0x4 scope:weak data:4byte
IpcNumPendingReqs = .sbss:0x805F5F50; // type:object size:0x4 scope:local data:4byte
IpcNumUnIssuedReqs = .sbss:0x805F5F54; // type:object size:0x4 scope:local data:4byte
Expand Down
19 changes: 8 additions & 11 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,18 @@
'-pragma "cats off"',
'-pragma "warning off (10184)"',
'-pragma "warn_notinlined off"',
'-pragma "warn_filenamecaps on"',
'-pragma "warn_filenamecaps_system on"',

"-RTTI on",
"-Cpp_exceptions off",
"-str noreuse",
"-str noreuse,noreadonly",

"-i src",
f"-i build/{config.version}/include",
f"-DBUILD_VERSION={version_num}",
f"-DVERSION_{config.version}"
f"-DVERSION_{config.version}",

"-O4,p",
"-inline auto",
]

# Debug flags
Expand Down Expand Up @@ -258,9 +259,7 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": [
*cflags_base,
"-O4,p",
"-lang=c99",
"-inline auto",
"-func_align 4",
"-rostr"
],
Expand All @@ -281,9 +280,7 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": [
*cflags_base,
"-O4,p",
"-lang=c99",
"-d NDEBUG",
"-str reuse",
],
"host": False,
Expand All @@ -297,6 +294,9 @@ def MatchingFor(*versions):
Object(MatchingFor("SALP4Q"), "Revolution/FS/fs.c"),
# GX
Object(MatchingFor("SALP4Q"), "Revolution/GX/GXBump.c"),
# IPC
Object(MatchingFor("SALP4Q"), "Revolution/IPC/ipcMain.c"),
Object(MatchingFor(), "Revolution/IPC/ipcclt.c"),
# NAND
Object(MatchingFor("SALP4Q"), "Revolution/NAND/NANDLogging.c"),
Object(MatchingFor("SALP4Q"), "Revolution/NAND/NANDOpenClose.c"),
Expand All @@ -316,7 +316,6 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": [
*cflags_base,
"-O4,p",
"-lang=c99",
"-use_lmw_stmw on",
"-func_align 4"
Expand Down Expand Up @@ -345,7 +344,6 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": [
*cflags_base,
"-O4,p",
"-func_align 4",
"-inline all",
"-fp_contract on",
Expand All @@ -364,7 +362,6 @@ def MatchingFor(*versions):
"mw_version": config.linker_version,
"cflags": [
*cflags_base,
"-O4,p",
"-func_align 4",
"-inline all",
"-fp_contract on",
Expand Down
40 changes: 40 additions & 0 deletions src/Revolution/IPC/ipcMain.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "Revolution/IPC.h" // IWYU pragma: keep
#include "Revolution/OS.h" // IWYU pragma: keep

static u8 Initialized = FALSE;
static void* IPCCurrentBufferLo = NULL;
static void* IPCCurrentBufferHi = NULL;
static void* IPCBufferLo = NULL;
static void* IPCBufferHi = NULL;

void IPCInit(void) {
if (!Initialized) {
IPCBufferHi = __OSGetIPCBufferHi();
IPCBufferLo = __OSGetIPCBufferLo();
IPCCurrentBufferHi = IPCBufferHi;
IPCCurrentBufferLo = IPCBufferLo;
Initialized = TRUE;
}
}

void IPCReInit(void) {
Initialized = FALSE;
IPCBufferHi = __OSGetIPCBufferHi();
IPCBufferLo = __OSGetIPCBufferLo();
IPCCurrentBufferHi = IPCBufferHi;
IPCCurrentBufferLo = IPCBufferLo;
Initialized = TRUE;
}

u32 IPCReadReg(s32 index) { return IPC_HW_REGS[index]; }

void IPCWriteReg(s32 index, u32 value) { IPC_HW_REGS[index] = value; }

void* IPCGetBufferHi(void) { return IPCCurrentBufferHi; }

void* IPCGetBufferLo(void) { return IPCCurrentBufferLo; }

//unused
void IPCSetBufferHi(void* hi) { IPCCurrentBufferHi = hi; }

void IPCSetBufferLo(void* lo) { IPCCurrentBufferLo = lo; }
Loading
Loading