Imported most of dolphin/os

This commit is contained in:
dbalatoni13 2024-11-12 19:16:59 +01:00
parent 023cd90675
commit 970da00ce2
35 changed files with 6591 additions and 131 deletions

29
src/dolphin/os/OSSync.c Normal file
View file

@ -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);
}