blob: cbdb9da4da3f2899e3a755609afb867a2cdc7ccf (
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
|
#include "dolphin/os/OSSync.h"
#include "dolphin/os.h"
void __OSSystemCallVectorStart();
void __OSSystemCallVectorEnd();
/* 80340A20-80340A3C 33B360 001C+00 1/1 0/0 0/0 .text SystemCallVector */
static asm void SystemCallVector(void) {
// clang-format off
nofralloc
entry __OSSystemCallVectorStart
mfspr r9, HID0
ori r10, r9, 8
mtspr HID0, r10
isync
sync
mtspr HID0, r9
rfi
entry __OSSystemCallVectorEnd
nop
// clang-format on
}
/* 80340A40-80340AA4 33B380 0064+00 0/0 1/1 0/0 .text __OSInitSystemCall */
void __OSInitSystemCall(void) {
void* addr = OSPhysicalToCached(0x00C00);
memcpy(addr, __OSSystemCallVectorStart,
(size_t)__OSSystemCallVectorEnd - (size_t)__OSSystemCallVectorStart);
DCFlushRangeNoSync(addr, 0x100);
__sync();
ICInvalidateRange(addr, 0x100);
}
|