sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
main.c
1
#include <
stdio.h
>
2
#include <
string.h
>
3
#include <
kernel.h
>
4
5
#include <
kernel.h
>
6
#include <
loadfile.h
>
7
#include <
sbv_patches.h
>
8
#include <sifrpc.h>
9
10
extern
int
kputs(
char
*s);
11
12
/* A program must never return from main on the rig: that reboots the console. */
13
static
int
rig_failed;
14
static
int
rig_kputs(
char
*s) {
15
if
(strstr(s,
": FAIL"
)) rig_failed = 1;
16
return
kputs(s);
17
}
18
#define kputs rig_kputs
19
extern
unsigned
char
probe_irx[];
20
extern
unsigned
int
size_probe_irx;
21
22
static
int
test_main(
void
) {
23
int
result = -1;
24
SifInitRpc(0);
25
sbv_patch_enable_lmb
();
26
int
id
=
SifExecModuleBuffer
(probe_irx, size_probe_irx, 0, NULL, &result);
27
/* The module returns 100 + b + c: 113 when the shared-lui style code is relocated right. */
28
kputs(
id
> 0 && result == 113 ?
"iop-module: PASS\n"
:
"iop-module: FAIL\n"
);
29
return
0;
30
}
31
32
int
main(
void
) {
33
int
result = test_main();
34
printf(
"[ps2rig] exit=%d\n"
, (result || rig_failed) ? 1 : 0);
35
SleepThread();
36
return
0;
37
}
SifExecModuleBuffer
int SifExecModuleBuffer(void *ptr, u32 size, u32 arg_len, const char *args, int *mod_res)
Definition
loadfile.c:314
kernel.h
loadfile.h
sbv_patches.h
sbv_patch_enable_lmb
int sbv_patch_enable_lmb(void)
Definition
patch_enable_lmb.c:68
stdio.h
string.h
tests
iop-module
src
ee
main.c
Generated by
1.18.0