Files
tp/libs/dolphin/os/OSSync.c
T
TakaRikka f070ee948f dolphin lib work (#237)
* getLayerNo_common_common finally matched

* dolphin ai / ar / card work from prime decomp

* work on dolphin dvd / dsp / db

* more dolphin os work

* si work

* remove asm

* build fix
2023-01-02 12:20:10 -07:00

36 lines
905 B
C

#include "dolphin/os/OSSync.h"
#include "dolphin/base/PPCArch.h"
#include "dolphin/os/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);
}