Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added alarm-management function patch.
- Loading branch information
Showing
15 changed files
with
541 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void InitAlarm(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
*/ | ||
|
||
#include <kernel.h> | ||
#include <stdio.h> | ||
|
||
struct SyscallData{ | ||
int syscall; | ||
void *function; | ||
}; | ||
|
||
static const struct SyscallData SysEntry[]={ | ||
{0x5A, &kCopy}, | ||
{0x5B, (void*)0x80076000}, | ||
{0xFC, NULL}, //SetAlarm | ||
{0xFD, NULL}, //iSetAlarm | ||
{0xFE, NULL}, //ReleaseAlarm | ||
{0xFF, NULL}, //iReleaseAlarm | ||
{0x12C, NULL}, //Intc12Handler (overwrites INTC 12 handler entry) | ||
{0x08, NULL}, //ResumeIntrDispatch (Syscall #8) | ||
}; | ||
|
||
extern unsigned char srcfile[]; | ||
extern unsigned int size_srcfile; | ||
|
||
extern unsigned char eenull[]; | ||
extern unsigned int size_eenull; | ||
|
||
void InitAlarm(void) | ||
{ | ||
int i; | ||
|
||
setup(SysEntry[0].syscall, SysEntry[0].function); | ||
Copy((void*)0x80076000, srcfile, size_srcfile); | ||
Copy((void*)0x00082000, eenull, size_eenull); | ||
FlushCache(0); | ||
FlushCache(2); | ||
setup(SysEntry[1].syscall, SysEntry[1].function); | ||
|
||
for(i=2; i<8; i++) | ||
setup(SysEntry[i].syscall, GetEntryAddress(SysEntry[i].syscall)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
|
||
EE_BIN_DIR = bin/ | ||
EE_OBJS_DIR = obj/ | ||
|
||
EE_EENULL_BIN = eenull.bin | ||
EE_EENULL_BIN := $(EE_EENULL_BIN:%=$(EE_BIN_DIR)%) | ||
EE_EENULL_ELF = eenull.elf | ||
EE_EENULL_ELF := $(EE_EENULL_ELF:%=$(EE_BIN_DIR)%) | ||
EE_OBJS = eenull.o | ||
|
||
EE_CFLAGS += -mno-gpopt | ||
|
||
$(EE_EENULL_BIN): $(EE_EENULL_ELF) | ||
$(EE_OBJCOPY) -Obinary $< $@ | ||
|
||
clean: | ||
rm -f -r $(EE_OBJS_DIR) $(EE_BIN_DIR) | ||
|
||
include $(PS2SDKSRC)/Defs.make | ||
include $(PS2SDKSRC)/ee/Rules.make | ||
|
||
$(EE_EENULL_ELF): $(EE_OBJS) | $(EE_BIN_DIR) | ||
$(EE_CC) $(EE_CFLAGS) -o $@ $^ -nostartfiles -Tlinkfile -s $(EE_LIBS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
*/ | ||
|
||
ENTRY(UModeCallbackDispatcher); | ||
|
||
SECTIONS { | ||
.text 0x00082000: { | ||
_ftext = . ; | ||
*(.text) | ||
*(.text.*) | ||
*(.gnu.linkonce.t*) | ||
QUAD(0) | ||
} | ||
|
||
/* Static data. */ | ||
.rodata ALIGN(128): { | ||
*(.rodata) | ||
*(.rodata.*) | ||
*(.gnu.linkonce.r*) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
|
||
.set noreorder | ||
|
||
#Will be executed in user mode, but with interrupts disabled. | ||
#Set stack address to 0x00081fc0 | ||
.globl UModeCallbackDispatcher | ||
.ent UModeCallbackDispatcher | ||
UModeCallbackDispatcher: | ||
lui $sp, 0x0008 | ||
jalr $v1 | ||
addiu $sp, $sp, 0x1fc0 | ||
addiu $v1, $zero, -8 | ||
syscall | ||
.end UModeCallbackDispatcher | ||
.p2align 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
|
||
EE_BIN_DIR = bin/ | ||
EE_OBJS_DIR = obj/ | ||
|
||
EE_SRCFILE_BIN = srcfile.bin | ||
EE_SRCFILE_BIN := $(EE_SRCFILE_BIN:%=$(EE_BIN_DIR)%) | ||
EE_SRCFILE_ELF = srcfile.elf | ||
EE_SRCFILE_ELF := $(EE_SRCFILE_ELF:%=$(EE_BIN_DIR)%) | ||
EE_OBJS = srcfile.o alarm.o dispatch.o | ||
|
||
EE_CFLAGS += -mno-gpopt | ||
|
||
$(EE_SRCFILE_BIN): $(EE_SRCFILE_ELF) | ||
$(EE_OBJCOPY) -Obinary $< $@ | ||
|
||
clean: | ||
rm -f -r $(EE_OBJS_DIR) $(EE_BIN_DIR) | ||
|
||
include $(PS2SDKSRC)/Defs.make | ||
include $(PS2SDKSRC)/ee/Rules.make | ||
|
||
$(EE_SRCFILE_ELF): $(EE_OBJS) | $(EE_BIN_DIR) | ||
$(EE_CC) $(EE_CFLAGS) -o $@ $^ -nostartfiles -Tlinkfile -s $(EE_LIBS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
*/ | ||
|
||
ENTRY(_start); | ||
|
||
SECTIONS { | ||
.text 0x80076000: { | ||
_ftext = . ; | ||
*(.text) | ||
*(.text.*) | ||
*(.gnu.linkonce.t*) | ||
QUAD(0) | ||
} | ||
|
||
/* Static data. */ | ||
.rodata ALIGN(128): { | ||
*(.rodata) | ||
*(.rodata.*) | ||
*(.gnu.linkonce.r*) | ||
} | ||
} |
Oops, something went wrong.