ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
srcfile.c
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Licenced under Academic Free License version 2.0
7
# Review ps2sdk README & LICENSE files for further details.
8
*/
9
10
#include "
kernel.h
"
11
#include "
internal.h
"
12
13
struct
SyscallData
{
14
int
syscall
;
15
void
*
function
;
16
};
17
18
#define NUM_ENTRIES 6
19
static
struct
SyscallData
entries
[
NUM_ENTRIES
] = {
20
{0xfc, &
SetAlarm
},
21
{0xfd, &
SetAlarm
},
22
{0xfe, &
ReleaseAlarm
},
23
{0xff, &
ReleaseAlarm
},
24
{0x12c, &
Intc12Handler
},
//Overwrites INTC 12 handler without using SetINTCHandler
25
{0x08, &
ResumeIntrDispatch
}
26
};
27
28
void
*
_start
(
int
syscall
) __attribute__((section(
".start"
)));
29
30
void
*
_start
(
int
syscall
)
31
{
32
int
i;
33
34
for
(i = 0; i <
NUM_ENTRIES
; i++)
35
{
36
if
(
syscall
==
entries
[i].
syscall
)
37
return
entries
[i].
function
;
38
}
39
40
return
NULL
;
41
}
ResumeIntrDispatch
void ResumeIntrDispatch(void)
kernel.h
SetAlarm
s32 SetAlarm(u16 time, void(*callback)(s32 alarm_id, u16 time, void *common), void *common)
ReleaseAlarm
s32 ReleaseAlarm(s32 alarm_id)
Definition:
alarm.c:110
internal.h
Intc12Handler
void Intc12Handler(void)
Definition:
alarm.c:167
_start
void * _start(int syscall)
Definition:
srcfile.c:30
NUM_ENTRIES
#define NUM_ENTRIES
Definition:
srcfile.c:18
entries
static struct SyscallData entries[NUM_ENTRIES]
Definition:
srcfile.c:19
SyscallData
Definition:
alarm.c:21
SyscallData::syscall
int syscall
Definition:
alarm.c:22
SyscallData::function
void * function
Definition:
alarm.c:23
NULL
#define NULL
Definition:
tamtypes.h:91
ee
kernel
src
srcfile
src
srcfile.c
Generated on Thu Feb 11 2021 11:42:22 for ps2sdk by
1.9.2