mirror of https://github.com/PrimeDecomp/prime.git
parent
f3ef565768
commit
387f4a4019
|
@ -815,7 +815,7 @@ LIBS = [
|
||||||
"Dolphin/os/OSReset",
|
"Dolphin/os/OSReset",
|
||||||
"Dolphin/os/OSResetSW",
|
"Dolphin/os/OSResetSW",
|
||||||
"Dolphin/os/OSRtc",
|
"Dolphin/os/OSRtc",
|
||||||
"Dolphin/os/OSSync",
|
["Dolphin/os/OSSync", True],
|
||||||
"Dolphin/os/OSThread",
|
"Dolphin/os/OSThread",
|
||||||
"Dolphin/os/OSTime",
|
"Dolphin/os/OSTime",
|
||||||
["Dolphin/os/__ppc_eabi_init", True],
|
["Dolphin/os/__ppc_eabi_init", True],
|
||||||
|
|
|
@ -7,9 +7,11 @@ extern "C" {
|
||||||
|
|
||||||
#define offsetof(type, member) ((size_t) & (((type*)0)->member))
|
#define offsetof(type, member) ((size_t) & (((type*)0)->member))
|
||||||
|
|
||||||
typedef __typeof__(sizeof(0)) size_t;
|
/* These break 1.2.5 */
|
||||||
typedef __typeof__((char*)0 - (char*)0) ptrdiff_t;
|
//typedef __typeof__(sizeof(0)) size_t;
|
||||||
|
//typedef __typeof__((char*)0 - (char*)0) ptrdiff_t;
|
||||||
|
typedef unsigned long size_t;
|
||||||
|
typedef long ptrdiff_t;
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0L
|
#define NULL 0L
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -703,7 +703,7 @@ OS_FILES :=\
|
||||||
$(BUILD_DIR)/asm/Dolphin/os/OSReset.o\
|
$(BUILD_DIR)/asm/Dolphin/os/OSReset.o\
|
||||||
$(BUILD_DIR)/asm/Dolphin/os/OSResetSW.o\
|
$(BUILD_DIR)/asm/Dolphin/os/OSResetSW.o\
|
||||||
$(BUILD_DIR)/asm/Dolphin/os/OSRtc.o\
|
$(BUILD_DIR)/asm/Dolphin/os/OSRtc.o\
|
||||||
$(BUILD_DIR)/asm/Dolphin/os/OSSync.o\
|
$(BUILD_DIR)/src/Dolphin/os/OSSync.o\
|
||||||
$(BUILD_DIR)/asm/Dolphin/os/OSThread.o\
|
$(BUILD_DIR)/asm/Dolphin/os/OSThread.o\
|
||||||
$(BUILD_DIR)/asm/Dolphin/os/OSTime.o\
|
$(BUILD_DIR)/asm/Dolphin/os/OSTime.o\
|
||||||
$(BUILD_DIR)/src/Dolphin/os/__ppc_eabi_init.ep.o\
|
$(BUILD_DIR)/src/Dolphin/os/__ppc_eabi_init.ep.o\
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
Loading…
Reference in New Issue