diff --git a/ee_core/Makefile b/ee_core/Makefile index a4210c206..a5fbd4126 100644 --- a/ee_core/Makefile +++ b/ee_core/Makefile @@ -16,10 +16,9 @@ EE_OBJS_DIR = obj/ GSMCORE_EE_OBJS = gsm_engine.o gsm_api.o IGSCORE_EE_OBJS = igs_api.o CHEATCORE_EE_OBJS = cheat_engine.o cheat_api.o -KERNEL_OBJS = iWakeupThread.o #iWakeupThread is used by SIFRPC. This prevents the thread patch from libkernel from being linked to. EE_OBJS = main.o syshook.o iopmgr.o modmgr.o util.o patches.o patches_asm.o \ - padhook.o spu.o tlb.o asm.o crt0.o $(KERNEL_OBJS) + padhook.o spu.o tlb.o asm.o crt0.o MAPFILE = ee_core.map EE_INCS := -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -Iinclude -I. @@ -77,7 +76,7 @@ ifeq ($(EESIO_DEBUG),1) EE_LIBS += -lc endif -EE_LIBS += -lkernel +EE_LIBS += -lkernel-nopatch $(EE_OBJS_DIR)%.o : $(EE_SRC_DIR)%.c @mkdir -p $(EE_OBJS_DIR) @@ -103,8 +102,4 @@ clean: clean_all: rm -f -r $(EE_OBJS_DIR) $(EE_BIN) $(MAPFILE) -$(KERNEL_OBJS:%=$(EE_OBJS_DIR)%): $(EE_SRC_DIR)kernel_custom.S - @mkdir -p $(EE_OBJS_DIR) - $(EE_CC) $(EE_CFLAGS) -DF_$(*:$(EE_OBJS_DIR)%=%) $< -c -o $@ - include $(PS2SDK)/samples/Makefile.pref diff --git a/ee_core/include/syscallnr_custom.h b/ee_core/include/syscallnr_custom.h deleted file mode 100644 index b136950df..000000000 --- a/ee_core/include/syscallnr_custom.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _SYSCALLNR_H_ -#define _SYSCALLNR_H_ - -/* - * This file contains the system call numbers, similar to asm/unistd.h on Linux. - */ -#define __NR_iWakeupThread (-0x34) - -#endif /* _SYSCALLNR_H_ */ diff --git a/ee_core/src/kernel_custom.S b/ee_core/src/kernel_custom.S deleted file mode 100644 index 00c7a9294..000000000 --- a/ee_core/src/kernel_custom.S +++ /dev/null @@ -1,91 +0,0 @@ -/* -# _____ ___ ____ ___ ____ -# ____| | ____| | | |____| -# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. -#----------------------------------------------------------------------- -# (C)2001, Gustavo Scotti (gustavo@scotti.com) -# (c) 2003 Marcus R. Brown (mrbrown@0xd6.org) -# Licenced under Academic Free License version 2.0 -# Review ps2sdk README & LICENSE files for further details. -*/ - -/** - * @file - * EE Kernel functions - */ - -#include "syscallnr_custom.h" - - .text - .p2align 3 - -#ifdef USE_KMODE -#define SYSCALL(name) \ - .set push; \ - .set noreorder; \ - .text; \ - .align 4; \ - .globl name; \ - .type name,@function; \ - .ent name,0; \ -name: j __syscall; \ - li $3, __NR_##name;\ - nop; \ - .end name; \ - .size name,.-name; \ - .set pop; -#else -#define SYSCALL(name) \ - .set push; \ - .set noreorder; \ - .text; \ - .align 4; \ - .globl name; \ - .type name,@function; \ - .ent name,0; \ -name: li $3, __NR_##name;\ - syscall; \ - jr $31; \ - nop; \ - .end name; \ - .size name,.-name; \ - .set pop; -#endif - -#ifdef F___syscall -.set push -.set noreorder -.text -.align 4 -.globl __syscall -.type __syscall,@function -.ent __syscall,0 -__syscall: - mfc0 $2, $12 - andi $2, $2, 0x18 - beqz $2, _kMode - slt $2, $3, $0 - syscall - jr $31 - nop -_kMode: - subu $26, $0, $3 - movn $3, $26, $2 - sll $3, $3, 2 - lui $26, 0x8000 - lhu $2, 0x02F0($26) - sll $2, $2, 16 - lh $26, 0x02F8($26) - add $2, $26 - addu $3, $2 - lw $26, 0x00($3) - jr $26 - nop -.end __syscall -.size __syscall,.-__syscall -.set pop -#endif - -#ifdef F_iWakeupThread -SYSCALL(iWakeupThread) -#endif diff --git a/ee_core/src/main.c b/ee_core/src/main.c index faa036d40..fb508520b 100644 --- a/ee_core/src/main.c +++ b/ee_core/src/main.c @@ -154,9 +154,9 @@ int main(int argc, char **argv) char *argvs[1]; argvs[0] = ElfPath; argvs[1] = NULL; - _LoadExecPS2("rom0:PS2LOGO", 1, argvs); + LoadExecPS2("rom0:PS2LOGO", 1, argvs); } else { - _LoadExecPS2(ElfPath, 0, NULL); + LoadExecPS2(ElfPath, 0, NULL); } if (!DisableDebug) diff --git a/ee_core/src/padhook.c b/ee_core/src/padhook.c index 59ad264c7..15f83387f 100644 --- a/ee_core/src/padhook.c +++ b/ee_core/src/padhook.c @@ -134,7 +134,7 @@ static void t_loadElf(void) GS_BGCOLOUR = 0x0080FF; // Orange // Execute BOOT.ELF - _ExecPS2((void *)elf.epc, (void *)elf.gp, 1, argv); + ExecPS2((void *)elf.epc, (void *)elf.gp, 1, argv); } if (!DisableDebug) { @@ -143,7 +143,7 @@ static void t_loadElf(void) } // Return to PS2 Browser - _Exit(0); + Exit(0); } // Poweroff PlayStation 2 @@ -273,10 +273,10 @@ static void IGR_Thread(void *arg) // Execute home loader if (ExitPath[0] != '\0') - _ExecPS2(t_loadElf, &_gp, 0, NULL); + ExecPS2(t_loadElf, &_gp, 0, NULL); // Return to PS2 Browser - _Exit(0); + Exit(0); } // If combo is R3 + L3 or Reset failed, Poweroff PS2 @@ -370,7 +370,7 @@ static int IGR_Intc_Handler(int cause) for (i = 1; i < 256; i++) { if (i != IGR_Thread_ID) { // Suspend all threads - _iSuspendThread(i); + iSuspendThread(i); iChangeThreadPriority(i, 127); } } @@ -378,7 +378,7 @@ static int IGR_Intc_Handler(int cause) DPRINTF("IGR: trying to wake IGR thread...\n"); iChangeThreadPriority(IGR_Thread_ID, 0); // WakeUp IGR thread - _iWakeupThread(IGR_Thread_ID); + iWakeupThread(IGR_Thread_ID); } ExitHandler(); diff --git a/ee_core/src/syshook.c b/ee_core/src/syshook.c index 650df5e1a..26ec0e1ca 100644 --- a/ee_core/src/syshook.c +++ b/ee_core/src/syshook.c @@ -133,7 +133,7 @@ void t_loadElf(void) disable_padOpen_hook = 0; DPRINTF("t_loadElf: executing...\n"); - _ExecPS2((void *)elf.epc, (void *)elf.gp, g_argc, g_argv); + ExecPS2((void *)elf.epc, (void *)elf.gp, g_argc, g_argv); } DPRINTF(" failed\n"); diff --git a/elfldr/Makefile b/elfldr/Makefile index 342320a48..c1f2c00d4 100644 --- a/elfldr/Makefile +++ b/elfldr/Makefile @@ -1,12 +1,11 @@ EE_BIN = elfldr.elf -KERNEL_OBJS = iWakeupThread.o #iWakeupThread is used by SIFRPC. This prevents the thread patch from libkernel from being linked to. -EE_OBJS = elfldr.o crt0.o $(KERNEL_OBJS) +EE_OBJS = elfldr.o crt0.o EE_INCS := -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -I. EE_CFLAGS := -D_EE -O2 -mgpopt -G8192 -Wall $(EE_INCS) EE_LDFLAGS = -nostartfiles -Tlinkfile -L$(PS2SDK)/ee/lib -s -EE_LIBS += -lkernel +EE_LIBS += -lkernel-nopatch %.o : %.c $(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@ @@ -22,7 +21,4 @@ all: $(EE_BIN) clean: rm -f $(EE_BIN) $(EE_OBJS) elfldr.map -$(KERNEL_OBJS:%=$(EE_OBJS_DIR)%): $(EE_SRC_DIR)kernel_custom.S - $(EE_CC) $(EE_CFLAGS) -DF_$(*:$(EE_OBJS_DIR)%=%) $< -c -o $@ - include $(PS2SDK)/samples/Makefile.pref diff --git a/elfldr/elfldr.c b/elfldr/elfldr.c index 332753853..95c7c6334 100644 --- a/elfldr/elfldr.c +++ b/elfldr/elfldr.c @@ -46,7 +46,7 @@ static inline void BootError(char *filename) argv[0] = "BootError"; argv[1] = filename; - _ExecOSD(2, argv); + ExecOSD(2, argv); } static inline void InitializeUserMemory(unsigned int start, unsigned int end) @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) argv[0] = _argv; } - _ExecPS2((void *)exd.epc, (void *)exd.gp, argc, argv); + ExecPS2((void *)exd.epc, (void *)exd.gp, argc, argv); } else { SifExitRpc(); } diff --git a/elfldr/kernel_custom.S b/elfldr/kernel_custom.S deleted file mode 100644 index 00c7a9294..000000000 --- a/elfldr/kernel_custom.S +++ /dev/null @@ -1,91 +0,0 @@ -/* -# _____ ___ ____ ___ ____ -# ____| | ____| | | |____| -# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. -#----------------------------------------------------------------------- -# (C)2001, Gustavo Scotti (gustavo@scotti.com) -# (c) 2003 Marcus R. Brown (mrbrown@0xd6.org) -# Licenced under Academic Free License version 2.0 -# Review ps2sdk README & LICENSE files for further details. -*/ - -/** - * @file - * EE Kernel functions - */ - -#include "syscallnr_custom.h" - - .text - .p2align 3 - -#ifdef USE_KMODE -#define SYSCALL(name) \ - .set push; \ - .set noreorder; \ - .text; \ - .align 4; \ - .globl name; \ - .type name,@function; \ - .ent name,0; \ -name: j __syscall; \ - li $3, __NR_##name;\ - nop; \ - .end name; \ - .size name,.-name; \ - .set pop; -#else -#define SYSCALL(name) \ - .set push; \ - .set noreorder; \ - .text; \ - .align 4; \ - .globl name; \ - .type name,@function; \ - .ent name,0; \ -name: li $3, __NR_##name;\ - syscall; \ - jr $31; \ - nop; \ - .end name; \ - .size name,.-name; \ - .set pop; -#endif - -#ifdef F___syscall -.set push -.set noreorder -.text -.align 4 -.globl __syscall -.type __syscall,@function -.ent __syscall,0 -__syscall: - mfc0 $2, $12 - andi $2, $2, 0x18 - beqz $2, _kMode - slt $2, $3, $0 - syscall - jr $31 - nop -_kMode: - subu $26, $0, $3 - movn $3, $26, $2 - sll $3, $3, 2 - lui $26, 0x8000 - lhu $2, 0x02F0($26) - sll $2, $2, 16 - lh $26, 0x02F8($26) - add $2, $26 - addu $3, $2 - lw $26, 0x00($3) - jr $26 - nop -.end __syscall -.size __syscall,.-__syscall -.set pop -#endif - -#ifdef F_iWakeupThread -SYSCALL(iWakeupThread) -#endif diff --git a/elfldr/syscallnr_custom.h b/elfldr/syscallnr_custom.h deleted file mode 100644 index b136950df..000000000 --- a/elfldr/syscallnr_custom.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _SYSCALLNR_H_ -#define _SYSCALLNR_H_ - -/* - * This file contains the system call numbers, similar to asm/unistd.h on Linux. - */ -#define __NR_iWakeupThread (-0x34) - -#endif /* _SYSCALLNR_H_ */