PSPSDK Utility Library


Functions

int pspSdkQueryModuleInfoV1 (SceUID uid, SceKernelModuleInfo *modinfo)
 Query a modules information from its uid.
int pspSdkGetModuleIdList (SceUID *readbuf, int readbufsize, int *idcount)
 Get the list of module IDs.
int pspSdkInstallNoDeviceCheckPatch (void)
 Patch the sceModuleManager module to nullify LoadDeviceCheck() calls.
int pspSdkInstallNoPlainModuleCheckPatch (void)
 Patch sceLoadCore module to remove loading plain module checks.
int pspSdkInstallKernelLoadModulePatch (void)
 Patch sceLoadModuleWithApiType to remove the kernel check in loadmodule allowing all modules to load.
SceUID pspSdkLoadStartModule (const char *filename, int mpid)
 Load a module and start it.
SceUID pspSdkLoadStartModuleWithArgs (const char *filename, int mpid, int argc, char *const argv[])
 Load a module and start it with arguments.
void pspSdkFixupImports (int moduleId)
 Manually fixup library imports for late binding modules.
int pspSdkLoadInetModules ()
 Load Inet related modules.
int pspSdkInetInit ()
 Initialize Inet related modules.
void pspSdkInetTerm ()
 Terminate Inet related modules.
int pspSdkReferThreadStatusByName (const char *name, SceUID *pUID, SceKernelThreadInfo *pInfo)
 Search for a thread with the given name and retrieve it's SceKernelThreadInfo struct.
int pspSdkReferSemaStatusByName (const char *name, SceUID *pUID, SceKernelSemaInfo *pInfo)
 Search for a semaphore with the given name and retrieve it's SceKernelSemaInfo struct.
int pspSdkReferEventFlagStatusByName (const char *name, SceUID *pUID, SceKernelEventFlagInfo *pInfo)
 Search for an event flag with the given name and retrieve it's SceKernelEventFlagInfo struct.
int pspSdkReferMboxStatusByName (const char *name, SceUID *pUID, SceKernelMbxInfo *pInfo)
 Search for a message box with the given name and retrieve it's SceKernelMbxInfo struct.
int pspSdkReferVplStatusByName (const char *name, SceUID *pUID, SceKernelVplInfo *pInfo)
 Search for a VPL with the given name and retrieve it's SceKernelVplInfo struct.
int pspSdkReferFplStatusByName (const char *name, SceUID *pUID, SceKernelFplInfo *pInfo)
 Search for a FPL with the given name and retrieve it's SceKernelFplInfo struct.
int pspSdkReferMppStatusByName (const char *name, SceUID *pUID, SceKernelMppInfo *pInfo)
 Search for a message pipe with the given name and retrieve it's SceKernelMppInfo struct.
int pspSdkReferCallbackStatusByName (const char *name, SceUID *pUID, SceKernelCallbackInfo *pInfo)
 Search for a callback with the given name and retrieve it's SceKernelCallbackInfo struct.
int pspSdkReferVTimerStatusByName (const char *name, SceUID *pUID, SceKernelVTimerInfo *pInfo)
 Search for a vtimer with the given name and retrieve it's SceKernelVTimerInfo struct.
int pspSdkReferThreadEventHandlerStatusByName (const char *name, SceUID *pUID, SceKernelThreadEventHandlerInfo *pInfo)
 Search for a thread event handler with the given name and retrieve it's SceKernelThreadEventHandlerInfo struct.
unsigned int pspSdkDisableInterrupts (void)
 Disable interrupts.
void pspSdkEnableInterrupts (unsigned int istate)
 Enable interrupts.
unsigned int pspSdkSetK1 (unsigned int k1)
 Set the processors K1 register to a known value.
unsigned int pspSdkGetK1 (void)
 Get the current value of the processors K1 register.
void pspSdkDisableFPUExceptions (void)
 Disable the CPUs FPU exceptions.


Function Documentation

void pspSdkDisableFPUExceptions ( void   ) 

Disable the CPUs FPU exceptions.

unsigned int pspSdkDisableInterrupts ( void   ) 

Disable interrupts.

Note:
Do not disable interrupts for too long otherwise the watchdog will get you.
Returns:
The previous state of the interrupt enable bit (should be passed back to pspSdkEnableInterrupts)

void pspSdkEnableInterrupts ( unsigned int  istate  ) 

Enable interrupts.

Parameters:
istate - The interrupt state as returned from pspSdkDisableInterrupts

void pspSdkFixupImports ( int  moduleId  ) 

Manually fixup library imports for late binding modules.

Parameters:
moduleId - Id of the module to fixup

unsigned int pspSdkGetK1 ( void   ) 

Get the current value of the processors K1 register.

Returns:
The current value of K1

int pspSdkGetModuleIdList ( SceUID readbuf,
int  readbufsize,
int *  idcount 
)

Get the list of module IDs.

Note:
This is a replacement function for the missing v1.5 sceKernelGetModuleIdList on v1.0 firmware. DO NOT use on anything above that version.
Parameters:
readbuf - Buffer to store the module list.
readbufsize - Number of elements in the readbuffer.
idcount - Returns the number of module ids
Returns:
>= 0 on success

int pspSdkInetInit (  ) 

Initialize Inet related modules.

Returns:
- 0 on success, otherwise one of PspKernelErrorCodes.

void pspSdkInetTerm (  ) 

Terminate Inet related modules.

int pspSdkInstallKernelLoadModulePatch ( void   ) 

Patch sceLoadModuleWithApiType to remove the kernel check in loadmodule allowing all modules to load.

Note:
This function must be called while running in kernel mode
Returns:
0 on success

int pspSdkInstallNoDeviceCheckPatch ( void   ) 

Patch the sceModuleManager module to nullify LoadDeviceCheck() calls.

Returns:
0 on success, otherwise one of PspKernelErrorCodes.
Note:
This function must be called while running in kernel mode. The program must also be linked against the pspkernel library.

int pspSdkInstallNoPlainModuleCheckPatch ( void   ) 

Patch sceLoadCore module to remove loading plain module checks.

Note:
This function must be called while running in kernel mode.
Returns:
0 on success, otherwise one of PspKernelErrorCodes.

int pspSdkLoadInetModules (  ) 

Load Inet related modules.

Note:
You must be in kernel mode to execute this function.
Returns:
- 0 on success, otherwise one of PspKernelErrorCodes.

SceUID pspSdkLoadStartModule ( const char *  filename,
int  mpid 
)

Load a module and start it.

Parameters:
filename - Path to the module.
mpid - Memory parition ID to use to load the module int.
Returns:
- The UID of the module on success, otherwise one of PspKernelErrorCodes.

SceUID pspSdkLoadStartModuleWithArgs ( const char *  filename,
int  mpid,
int  argc,
char *const   argv[] 
)

Load a module and start it with arguments.

Parameters:
filename - Path to the module.
mpid - Memory parition ID to use to load the module int.
argc - Number of arguments to pass to start module
argv - Array of arguments
Returns:
- The UID of the module on success, otherwise one of PspKernelErrorCodes.

int pspSdkQueryModuleInfoV1 ( SceUID  uid,
SceKernelModuleInfo modinfo 
)

Query a modules information from its uid.

Note:
this is a replacement function for the broken kernel sceKernelQueryModuleInfo in v1.0 firmware DO NOT use on a anything above that version. This also needs kernel mode access where the normal one has a user mode stub.
Parameters:
uid - The UID of the module to query.
modinfo - Pointer a module SceKernelModuleInfo structure.
Returns:
< 0 on error.

int pspSdkReferCallbackStatusByName ( const char *  name,
SceUID pUID,
SceKernelCallbackInfo pInfo 
)

Search for a callback with the given name and retrieve it's SceKernelCallbackInfo struct.

Parameters:
name - The name of to search for.
pUID - If the given name is found, it's SceUID is stored here.
pInfo - If the given name is found, it's SceKernelMppInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferEventFlagStatusByName ( const char *  name,
SceUID pUID,
SceKernelEventFlagInfo pInfo 
)

Search for an event flag with the given name and retrieve it's SceKernelEventFlagInfo struct.

Parameters:
name - The name of the event flag to search for.
pUID - If the event flag with the given name is found, it's SceUID is stored here.
pInfo - If the event flag with the given name is found, it's SceKernelEventFlagInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferFplStatusByName ( const char *  name,
SceUID pUID,
SceKernelFplInfo pInfo 
)

Search for a FPL with the given name and retrieve it's SceKernelFplInfo struct.

Parameters:
name - The name of to search for.
pUID - If the given name is found, it's SceUID is stored here.
pInfo - If the given name is found, it's SceKernelFplInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferMboxStatusByName ( const char *  name,
SceUID pUID,
SceKernelMbxInfo pInfo 
)

Search for a message box with the given name and retrieve it's SceKernelMbxInfo struct.

Parameters:
name - The name of the message box to search for.
pUID - If the message box with the given name is found, it's SceUID is stored here.
pInfo - If the message box with the given name is found, it's SceKernelMbxInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferMppStatusByName ( const char *  name,
SceUID pUID,
SceKernelMppInfo pInfo 
)

Search for a message pipe with the given name and retrieve it's SceKernelMppInfo struct.

Parameters:
name - The name of to search for.
pUID - If the given name is found, it's SceUID is stored here.
pInfo - If the given name is found, it's SceKernelMppInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferSemaStatusByName ( const char *  name,
SceUID pUID,
SceKernelSemaInfo pInfo 
)

Search for a semaphore with the given name and retrieve it's SceKernelSemaInfo struct.

Parameters:
name - The name of the sema to search for.
pUID - If the sema with the given name is found, it's SceUID is stored here.
pInfo - If the sema with the given name is found, it's SceKernelSemaInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferThreadEventHandlerStatusByName ( const char *  name,
SceUID pUID,
SceKernelThreadEventHandlerInfo pInfo 
)

Search for a thread event handler with the given name and retrieve it's SceKernelThreadEventHandlerInfo struct.

Parameters:
name - The name of to search for.
pUID - If the given name is found, it's SceUID is stored here.
pInfo - If the given name is found, it's SceKernelThreadEventHandlerInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferThreadStatusByName ( const char *  name,
SceUID pUID,
SceKernelThreadInfo pInfo 
)

Search for a thread with the given name and retrieve it's SceKernelThreadInfo struct.

Parameters:
name - The name of the thread to search for.
pUID - If the thread with the given name is found, it's SceUID is stored here.
pInfo - If the thread with the given name is found, it's SceKernelThreadInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferVplStatusByName ( const char *  name,
SceUID pUID,
SceKernelVplInfo pInfo 
)

Search for a VPL with the given name and retrieve it's SceKernelVplInfo struct.

Parameters:
name - The name of to search for.
pUID - If the given name is found, it's SceUID is stored here.
pInfo - If the given name is found, it's SceKernelVplInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

int pspSdkReferVTimerStatusByName ( const char *  name,
SceUID pUID,
SceKernelVTimerInfo pInfo 
)

Search for a vtimer with the given name and retrieve it's SceKernelVTimerInfo struct.

Parameters:
name - The name of to search for.
pUID - If the given name is found, it's SceUID is stored here.
pInfo - If the given name is found, it's SceKernelVTimerInfo data is stored here.
Returns:
0 if successful, otherwise one of PspKernelErrorCodes.

unsigned int pspSdkSetK1 ( unsigned int  k1  ) 

Set the processors K1 register to a known value.

Note:
This function is for use in kernel mode syscall exports. The kernel sets the k1 register to indicate what mode called the function, i.e. whether it was directly called, was called via a syscall from a kernel thread or called via a syscall from a user thread. By setting k1 to 0 before doing anything in your code you can make the other functions think you are calling from a kernel thread and therefore disable numerous protections.
Parameters:
k1 - The k1 value to set
Returns:
The previous value of k1


Generated on Tue Jul 24 15:21:26 2007 for PSPSDK-Rev2272 by  doxygen 1.5.2