diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-01 18:45:02 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-01 18:50:25 -0400 |
commit | 9fa0a7f1da1b70bee995f53c6c96c43189018772 (patch) | |
tree | 114548896790eaff23cdca84a025281de86bbb51 /src/Dolphin/os/OSSync.c | |
parent | 2ba3289286bbfcf9fcc13fd135d976058d8b6c2e (diff) |
global: Import Dolphin SDK
This version comes from the Metroid Prime decompilation project.
https://github.com/PrimeDecomp/prime
Diffstat (limited to 'src/Dolphin/os/OSSync.c')
-rw-r--r-- | src/Dolphin/os/OSSync.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Dolphin/os/OSSync.c b/src/Dolphin/os/OSSync.c new file mode 100644 index 0000000..b5aeccf --- /dev/null +++ b/src/Dolphin/os/OSSync.c @@ -0,0 +1,29 @@ +#include "string.h" +#include "dolphin/PPCArch.h" +#include "dolphin/os.h" + +void __OSSystemCallVectorStart(); +void __OSSystemCallVectorEnd(); +static asm void SystemCallVector() { + nofralloc +entry __OSSystemCallVectorStart + mfspr r9, HID0 + ori r10, r9, 8 + mtspr HID0, r10 + isync + sync + mtspr HID0, r9 + + rfi + +entry __OSSystemCallVectorEnd + nop +} + +void __OSInitSystemCall() { + void* addr = OSPhysicalToCached(0x00C00); + memcpy(addr, __OSSystemCallVectorStart, (size_t)__OSSystemCallVectorEnd - (size_t)__OSSystemCallVectorStart); + DCFlushRangeNoSync(addr, 0x100); + __sync(); + ICInvalidateRange(addr, 0x100); +} |