# pspmodulemgr.h

Go to the documentation of this file.

    00001 /*
    00002  * PSP Software Development Kit - http://www.pspdev.org
    00003  * -----------------------------------------------------------------------
    00004  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
    00005  *
    00006  * pspmodulemgr.h - Prototypes to manage modules.
    00007  *
    00008  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
    00009  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
    00010  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
    00011  *
    00012  * $Id: pspmodulemgr.h 792 2005-07-27 09:03:36Z warren $
    00013  */
    00014
    00015 /* Note: Some of the structures, types, and definitions in this file were
    00016    extrapolated from symbolic debugging information found in the Japanese
    00017    version of Puzzle Bobble. */
    00018
    00019 #ifndef __MODLOAD_H__
    00020 #define __MODLOAD_H__
    00021
    00022 #include <pspkerneltypes.h>
    00023
    00028 #ifdef __cplusplus
    00029 extern "C" {
    00030 #endif
    00031
    00034
    00035 #define PSP_MEMORY_PARTITION_KERNEL 1
    00036 #define PSP_MEMORY_PARTITION_USER 2
    00037
    00038 typedef struct SceKernelLMOption {
    00039         SceSize                 size;
    00040         SceUID                  mpidtext;
    00041         SceUID                  mpiddata;
    00042         unsigned int    flags;
    00043         char                    position;
    00044         char                    access;
    00045         char                    creserved[2];
    00046 } SceKernelLMOption;
    00047
    00048 typedef struct SceKernelSMOption {
    00049         SceSize                 size;
    00050         SceUID                  mpidstack;
    00051         SceSize                 stacksize;
    00052         int                     priority;
    00053         unsigned int    attribute;
    00054 } SceKernelSMOption;
    00055
    00056
    00068 SceUID sceKernelLoadModule(const char *path, int flags, SceKernelLMOption *option);
    00069
    00080 SceUID sceKernelLoadModuleMs(const char *path, int flags, SceKernelLMOption *option);
    00081
    00091 SceUID sceKernelLoadModuleByID(SceUID fid, int flags, SceKernelLMOption *option);
    00092
    00106 SceUID sceKernelLoadModuleBufferUsbWlan(SceSize bufsize, void *buf, int flags, SceKernelLMOption *option);
    00107
    00119 int sceKernelStartModule(SceUID modid, SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
    00120
    00132 int sceKernelStopModule(SceUID modid, SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
    00133
    00141 int sceKernelUnloadModule(SceUID modid);
    00142
    00152 int sceKernelSelfStopUnloadModule(int unknown, SceSize argsize, void *argp);
    00153
    00164 int sceKernelStopUnloadSelfModule(SceSize argsize, void *argp, int *status, SceKernelSMOption *option);
    00165
    00166
    00167 typedef struct SceKernelModuleInfo {
    00168         SceSize                 size;
    00169         char                    nsegment;
    00170         char                    reserved[3];
    00171         int                     segmentaddr[4];
    00172         int                     segmentsize[4];
    00173         unsigned int    entry_addr;
    00174         unsigned int    gp_value;
    00175         unsigned int    text_addr;
    00176         unsigned int    text_size;
    00177         unsigned int    data_size;
    00178         unsigned int    bss_size;
    00179         /* The following is only available in the v1.5 firmware and above,
    00180            but as sceKernelQueryModuleInfo is broken in v1.0 is doesn't matter ;) */
    00181         unsigned short  attribute;
    00182         unsigned char   version[2];
    00183         char            name[28];
    00184 } SceKernelModuleInfo;
    00185
    00198 int sceKernelQueryModuleInfo(SceUID modid, SceKernelModuleInfo *info);
    00199
    00202 #ifdef __cplusplus
    00203 }
    00204 #endif
    00205
    00206 #endif