Match and link OSSync

This commit is contained in:
Phillip Stephens 2022-10-10 10:03:39 -07:00
parent f14ca94607
commit 9203a4e0bc
4 changed files with 36 additions and 5 deletions

View File

@ -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],

View File

@ -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

View File

@ -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\

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