vitasdk
Documentation of the vitasdk
modulemgr.h
Go to the documentation of this file.
1 
6 #ifndef _PSP2COMMON_KERNEL_MODULEMGR_H_
7 #define _PSP2COMMON_KERNEL_MODULEMGR_H_
8 
9 #include <vitasdk/build_utils.h>
10 #include <psp2common/types.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
20 #define SCE_KERNEL_START_SUCCESS (0)
21 #define SCE_KERNEL_START_RESIDENT SCE_KERNEL_START_SUCCESS
22 #define SCE_KERNEL_START_NO_RESIDENT (1)
23 #define SCE_KERNEL_START_FAILED (2)
24 
25 #define SCE_KERNEL_STOP_SUCCESS (0)
26 #define SCE_KERNEL_STOP_FAIL (1)
27 #define SCE_KERNEL_STOP_CANCEL SCE_KERNEL_STOP_FAIL
30 typedef enum SceKernelModuleState {
35 
36 /*
37  * Assigning the following macro to the variable sceKernelPreloadModuleInhibit with the OR operator inhibit preloading that module.
38  *
39  * Example
40  * <code>
41  * // Inhibit preload SceLibc and SceShellSvc.
42  * int sceKernelPreloadModuleInhibit = SCE_KERNEL_PRELOAD_INHIBIT_LIBC | SCE_KERNEL_PRELOAD_INHIBIT_LIBSHELLSVC;
43  * </code>
44  *
45  * And these are only valid for modules in the process image, preload is not inhibited even if specified for modules to be loaded later.
46  *
47  * WARNING
48  * If SceLibNet etc. is loaded without SceShellSvc etc. loaded, an unintended system crash will occur.
49  */
63 
64 
65 typedef struct SceKernelSegmentInfo {
68  void *vaddr;
74 
75 typedef struct SceKernelModuleInfo {
78  uint16_t modattr;
79  uint8_t modver[2];
80  char module_name[28];
82  void *start_entry;
83  void *stop_entry;
84  void *exit_entry;
85  void *exidx_top;
86  void *exidx_btm;
87  void *extab_top;
88  void *extab_btm;
89  void *tlsInit;
92  char path[256];
97 
98 typedef struct {
102 
103 typedef struct {
107 
108 typedef struct SceKernelSystemSwVersion {
110  char versionString[0x1C];
115 
116 /* For backward compatibility */
118 
122  uint32_t libnid;
123  uint16_t version;
124  uint16_t flags;
127  uint16_t unk_0x14;
128  uint16_t unk_0x16;
129  char library_name[0x100];
134 
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif /* _PSP2COMMON_KERNEL_MODULEMGR_H_ */
SceKernelSystemSwVersion SceKernelFwInfo
Definition: modulemgr.h:117
uint32_t libnid
Definition: modulemgr.h:122
SceSize size
sizeof(SceKernelModuleLibraryInfo) : 0x120
Definition: modulemgr.h:120
uint16_t modattr
Definition: modulemgr.h:78
SceUInt unk_24
Definition: modulemgr.h:112
uint8_t modver[2]
Definition: modulemgr.h:79
char library_name[0x100]
Definition: modulemgr.h:129
char module_name[28]
Definition: modulemgr.h:80
SceSize tlsAreaSize
Definition: modulemgr.h:91
SceSize number_of_imported
Definition: modulemgr.h:130
SceUInt res
unused
Definition: modulemgr.h:71
void * extab_btm
Definition: modulemgr.h:88
uint16_t entry_num_variable
Definition: modulemgr.h:126
void * start_entry
Definition: modulemgr.h:82
char path[256]
Definition: modulemgr.h:92
SceSize size
Definition: modulemgr.h:99
void * exit_entry
Definition: modulemgr.h:84
void * stop_entry
Definition: modulemgr.h:83
SceSize size
this structure size (0x18)
Definition: modulemgr.h:66
void * exidx_top
Definition: modulemgr.h:85
SceUID library_id
Definition: modulemgr.h:121
SceSize size
0x1B8 for Vita 1.x
Definition: modulemgr.h:76
SceSize memsz
size in memory
Definition: modulemgr.h:69
SceUInt unk28
Definition: modulemgr.h:81
uint16_t unk_0x16
Definition: modulemgr.h:128
VITASDK_BUILD_ASSERT_EQ(4, SceKernelPreloadInhibit)
SceUID modid
Definition: modulemgr.h:77
uint16_t unk_0x14
Definition: modulemgr.h:127
SceKernelModuleState
Definition: modulemgr.h:30
SceSize size
Definition: modulemgr.h:109
void * exidx_btm
Definition: modulemgr.h:86
SceUInt perms
probably rwx in low bits
Definition: modulemgr.h:67
char versionString[0x1C]
Definition: modulemgr.h:110
SceUID modid2
Definition: modulemgr.h:131
SceSize size
Definition: modulemgr.h:104
void * vaddr
address in memory
Definition: modulemgr.h:68
SceSize filesz
original size of memsz
Definition: modulemgr.h:70
SceUInt version
Definition: modulemgr.h:111
SceKernelSegmentInfo segments[4]
Definition: modulemgr.h:93
uint16_t entry_num_function
Definition: modulemgr.h:125
uint16_t flags
Definition: modulemgr.h:124
uint16_t version
Definition: modulemgr.h:123
SceUInt state
see:SceKernelModuleState
Definition: modulemgr.h:94
void * tlsInit
Definition: modulemgr.h:89
SceSize tlsInitSize
Definition: modulemgr.h:90
void * extab_top
Definition: modulemgr.h:87
SceKernelPreloadInhibit
Definition: modulemgr.h:50
@ SCE_KERNEL_MODULE_STATE_READY
Definition: modulemgr.h:31
@ SCE_KERNEL_MODULE_STATE_STARTED
Definition: modulemgr.h:32
@ SCE_KERNEL_MODULE_STATE_ENDED
Definition: modulemgr.h:33
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBPERF
Definition: modulemgr.h:60
@ SCE_KERNEL_PRELOAD_INHIBIT_APPUTIL
Definition: modulemgr.h:57
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBSHELLSVC
Definition: modulemgr.h:54
@ SCE_KERNEL_PRELOAD_INHIBIT_NONE
Definition: modulemgr.h:51
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBC
Definition: modulemgr.h:52
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBFIOS2
Definition: modulemgr.h:56
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBDBG
Definition: modulemgr.h:53
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBSCEFT2
Definition: modulemgr.h:58
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBPVF
Definition: modulemgr.h:59
@ SCE_KERNEL_PRELOAD_INHIBIT_LIBCDLG
Definition: modulemgr.h:55
Definition: modulemgr.h:98
Definition: modulemgr.h:75
Definition: modulemgr.h:119
Definition: modulemgr.h:65
Definition: modulemgr.h:108
Definition: modulemgr.h:103
unsigned int SceSize
Definition: types.h:56
uint32_t SceUInt
Definition: types.h:48
int SceUID
UIDs are used to describe many different kernel objects.
Definition: types.h:90