Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Partial roll back & rework of c1470b2 for maintainability: removed ol…
…d hack for preventing the thread patch from being included, in favour of the new libkernel-nopatch library.
  • Loading branch information
sp193 committed Sep 2, 2017
1 parent 61b6981 commit 2f5c0a6
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 224 deletions.
9 changes: 2 additions & 7 deletions ee_core/Makefile
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -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
9 changes: 0 additions & 9 deletions ee_core/include/syscallnr_custom.h

This file was deleted.

91 changes: 0 additions & 91 deletions ee_core/src/kernel_custom.S

This file was deleted.

4 changes: 2 additions & 2 deletions ee_core/src/main.c
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions ee_core/src/padhook.c
Expand Up @@ -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) {
Expand All @@ -143,7 +143,7 @@ static void t_loadElf(void)
}

// Return to PS2 Browser
_Exit(0);
Exit(0);
}

// Poweroff PlayStation 2
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -370,15 +370,15 @@ 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);
}
}

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();
Expand Down
2 changes: 1 addition & 1 deletion ee_core/src/syshook.c
Expand Up @@ -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");
Expand Down
8 changes: 2 additions & 6 deletions 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 $@
Expand All @@ -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
4 changes: 2 additions & 2 deletions elfldr/elfldr.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}
Expand Down
91 changes: 0 additions & 91 deletions elfldr/kernel_custom.S

This file was deleted.

9 changes: 0 additions & 9 deletions elfldr/syscallnr_custom.h

This file was deleted.

0 comments on commit 2f5c0a6

Please sign in to comment.