PSPSDK 2024-10-31
Loading...
Searching...
No Matches
pspkernel.h File Reference
#include <pspuser.h>
#include <pspiofilemgr_kernel.h>
#include <psploadcore.h>
#include <pspstdio_kernel.h>
#include <pspsysreg.h>
#include <pspkdebug.h>
#include <pspintrman_kernel.h>
#include <pspmodulemgr_kernel.h>
Include dependency graph for pspkernel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define pspKernelSetKernelPC()
 Set the $pc register to a kernel memory address.
 
#define pspKernelSetUserPC()
 Set the $pc register to a user memory address.
 

Macro Definition Documentation

◆ pspKernelSetKernelPC

#define pspKernelSetKernelPC ( )
Value:
{ \
__asm__ volatile ( \
"la $8, 1f\n\t" \
"lui $9, 0x8000\n\t" \
"or $8, $9\n\t" \
"jr $8\n\t" \
" nop\n\t" \
"1:\n\t" \
: : : "$8", "$9"); \
}
float x
Definition psptypes.h:0

Set the $pc register to a kernel memory address.

When the PSP's kernel library stubs are called, they expect to be accessed from the kernel's address space. Use this function to set $pc to the kernel address space, before calling a kernel library stub.

◆ pspKernelSetUserPC

#define pspKernelSetUserPC ( )
Value:
{ \
__asm__ volatile ( \
"la $8, 1f\n\t" \
"li $9, 0x7FFFFFFF\n\t" \
"and $8, $9\n\t" \
"jr $8\n\t" \
" nop\n\t" \
"1:\n\t" \
: : : "$8", "$9"); \
}

Set the $pc register to a user memory address.