pspsdk-1.0+beta2
pspmodulemgr.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * pspmodulemgr.h - Prototypes to manage modules.
7  *
8  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11  *
12  * $Id: pspmodulemgr.h 2494 2010-06-01 18:45:10Z jim $
13  */
14 
15 /* Note: Some of the structures, types, and definitions in this file were
16  extrapolated from symbolic debugging information found in the Japanese
17  version of Puzzle Bobble. */
18 
19 #ifndef __MODLOAD_H__
20 #define __MODLOAD_H__
21 
22 #include <pspkerneltypes.h>
23 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
34 
35 #define PSP_MEMORY_PARTITION_KERNEL 1
36 #define PSP_MEMORY_PARTITION_USER 2
37 
38 typedef struct SceKernelLMOption {
42  unsigned int flags;
43  char position;
44  char access;
45  char creserved[2];
47 
48 typedef struct SceKernelSMOption {
52  int priority;
53  unsigned int attribute;
55 
56 
69 
81 
92 
107 
119 int sceKernelStartModule(SceUID modid, SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
120 
132 int sceKernelStopModule(SceUID modid, SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
133 
141 int sceKernelUnloadModule(SceUID modid);
142 
152 int sceKernelSelfStopUnloadModule(int unknown, SceSize argsize, void *argp);
153 
164 int sceKernelStopUnloadSelfModule(SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
165 
166 
167 typedef struct SceKernelModuleInfo {
169  char nsegment;
170  char reserved[3];
171  int segmentaddr[4];
172  int segmentsize[4];
173  unsigned int entry_addr;
174  unsigned int gp_value;
175  unsigned int text_addr;
176  unsigned int text_size;
177  unsigned int data_size;
178  unsigned int bss_size;
179  /* The following is only available in the v1.5 firmware and above,
180  but as sceKernelQueryModuleInfo is broken in v1.0 is doesn't matter ;) */
181  unsigned short attribute;
182  unsigned char version[2];
183  char name[28];
185 
199 
210 int sceKernelGetModuleIdList(SceUID *readbuf, int readbufsize, int *idcount);
211 
217 int sceKernelGetModuleId(void);
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif