blob: 5c3e296d5fc6c09ee0f7464e1b2d57f0874fb885 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#include <revolution/ipc.h>
#include <revolution/os/OSIpc.h>
#include <revolution/os.h>
static void* IPCBufferHi;
static void* IPCBufferLo;
static void* IPCCurrentBufferHi;
static void* IPCCurrentBufferLo;
static u8 Initialized;
void IPCInit(void) {
if (Initialized) {
return;
}
IPCBufferHi = __OSGetIPCBufferHi();
IPCBufferLo = __OSGetIPCBufferLo();
IPCCurrentBufferHi = IPCBufferHi;
IPCCurrentBufferLo = IPCBufferLo;
Initialized = TRUE;
}
#if SDK_AUG2010
void IPCReInit(void) {
Initialized = FALSE;
IPCInit();
}
#endif
u32 IPCReadReg(u32 regIdx) {
u32 reg = __IPCRegs[regIdx];
return reg;
}
void IPCWriteReg(u32 regIdx, u32 data) {
__IPCRegs[regIdx] = data;
}
void* IPCGetBufferHi(void) {
return IPCCurrentBufferHi;
}
void* IPCGetBufferLo(void) {
return IPCCurrentBufferLo;
}
void IPCSetBufferLo(void* newLo) {
ASSERTLINE(296, IPCBufferLo <= newLo);
IPCCurrentBufferLo = newLo;
}
|