PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
xmodload.h
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7
# Licenced under Academic Free License version 2.0
8
# Review ps2sdk README & LICENSE files for further details.
9
*/
10
16
#ifndef __XMODLOAD_H__
17
#define __XMODLOAD_H__
18
19
#include <
modload.h
>
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
int
GetModuleIdList(
int
*readbuf,
int
readbufsize,
int
*modulecount);
26
27
typedef
struct
{
28
char
name[56];
29
u16
version
;
30
u16 flags;
31
int
id;
32
u32 entry_addr;
33
u32 gp_value;
34
u32 text_addr;
35
u32 text_size;
36
u32 data_size;
37
u32 bss_size;
38
u32 lreserve[2];
39
}
ModuleStatus
;
40
41
int
ReferModuleStatus(
int
modid,
ModuleStatus
*status);
42
int
GetModuleIdListByName(
const
char
*name,
int
*readbuf,
int
readbufsize,
int
*modulecount);
43
44
typedef
struct
{
45
int (*beforeOpen)(
void
*opt,
const
char
*filename,
int
flag);
46
int (*afterOpen)(
void
*opt,
int
fd);
47
int (*close)(
void
*opt,
int
fd);
48
int (*setBufSize)(
void
*opt,
int
fd,
size_t
nbyte);
49
int (*beforeRead)(
void
*opt,
int
fd,
size_t
nbyte);
50
int (*read)(
void
*opt,
int
fd,
void
*buf,
size_t
nbyte);
51
int (*lseek)(
void
*opt,
int
fd,
long
offset,
int
whence);
52
int (*getfsize)(
void
*opt,
int
fd);
53
}
LDfilefunc
;
54
55
typedef
struct
{
56
char
position;
57
char
access;
58
char
creserved[2];
59
void
*distaddr;
60
int
distoffset;
61
LDfilefunc
*functable;
62
void
*funcopt;
63
int
ireserved[3];
64
}
LMWOoption
;
65
66
int
LoadModuleWithOption(
const
char
*filename,
const
LMWOoption
*option);
67
int
StopModule(
int
modid,
int
arglen,
const
char
*args,
int
*result);
68
int
UnloadModule(
int
modid);
69
int
SearchModuleByName(
const
char
*name);
70
int
SearchModuleByAddress(
const
void
*addr);
71
int
SelfStopModule(
int
arglen,
const
char
*args,
int
*result);
72
void
SelfUnloadModule(
void
);
73
void
*AllocLoadMemory(
int
type,
unsigned
int
size,
void
*addr);
74
int
FreeLoadMemory(
void
*area);
75
int
SetModuleFlags(
int
modid,
int
flag);
76
77
#define xmodload_IMPORTS_start DECLARE_IMPORT_TABLE(modload, 1, 7)
78
#define xmodload_IMPORTS_end END_IMPORT_TABLE
79
80
#define I_GetModuleIdList DECLARE_IMPORT(16, GetModuleIdList)
81
#define I_ReferModuleStatus DECLARE_IMPORT(17, ReferModuleStatus)
82
#define I_GetModuleIdListByName DECLARE_IMPORT(18, GetModuleIdListByName)
83
#define I_LoadModuleWithOption DECLARE_IMPORT(19, LoadModuleWithOption)
84
#define I_StopModule DECLARE_IMPORT(20, StopModule)
85
#define I_UnloadModule DECLARE_IMPORT(21, UnloadModule)
86
#define I_SearchModuleByName DECLARE_IMPORT(22, SearchModuleByName)
87
#define I_SearchModuleByAddress DECLARE_IMPORT(23, SearchModuleByAddress)
88
#define I_SelfStopModule DECLARE_IMPORT(26, SelfStopModule)
89
#define I_SelfUnloadModule DECLARE_IMPORT(27, SelfUnloadModule)
90
#define I_AllocLoadMemory DECLARE_IMPORT(28, AllocLoadMemory)
91
#define I_FreeLoadMemory DECLARE_IMPORT(29, FreeLoadMemory)
92
#define I_SetModuleFlags DECLARE_IMPORT(30, SetModuleFlags)
93
94
#ifdef __cplusplus
95
}
96
#endif
97
98
#endif
/* __XMODLOAD_H__ */
version
unsigned int version
Definition
fileXio.h:3
modload.h
LDfilefunc
Definition
xmodload.h:44
LMWOoption
Definition
xmodload.h:55
ModuleStatus
Definition
xmodload.h:27
iop
kernel
include
xmodload.h
Generated on Thu Nov 14 2024 05:25:27 for PS2SDK by
1.9.8