diff options
author | Glenn Anderson | 2015-08-14 23:27:02 -0400 |
---|---|---|
committer | Glenn Anderson | 2015-08-14 23:27:02 -0400 |
commit | 1f6cb4f3cbf7ae615d12c1dd66136347247ab7a6 (patch) | |
tree | ca88156373140a2081e64ae091d05555adadad69 /include/user/kernel/sysmem.h | |
download | vds-libraries-1f6cb4f3cbf7ae615d12c1dd66136347247ab7a6.tar.gz |
Initial commit. Added headers from psp2sdk.
Diffstat (limited to 'include/user/kernel/sysmem.h')
-rw-r--r-- | include/user/kernel/sysmem.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/include/user/kernel/sysmem.h b/include/user/kernel/sysmem.h new file mode 100644 index 0000000..5c258f0 --- /dev/null +++ b/include/user/kernel/sysmem.h @@ -0,0 +1,63 @@ +#ifndef _PSP2_KERNEL_SYSMEM_H_ +#define _PSP2_KERNEL_SYSMEM_H_ + +#include <psp2/types.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int SceKernelMemBlockType; + +enum { + SCE_KERNEL_MEMBLOCK_TYPE_USER_RW = 0x0c20d060, + SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE = 0x0c208060, + SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW = 0x0c80d060, + SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW = 0x0d808060, + SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW = 0x09408060 +}; + +/*** + * Allocates a new memoy block + * + * @param[in] name - Name for the memory block + * @param[in] type - Type of the memory to allocate + * @param[in] size - Size of the memory to allocate + * @param[in] optp - Memory block options? + * + * @return SceUID of the memory block on success, < 0 on error. +*/ +SceUID sceKernelAllocMemBlock(const char *name, SceKernelMemBlockType type, int size, void *optp); + +SceUID sceKernelAllocMemBlockForVM(const char *, SceSize); + +/*** + * Frees new memoy block + * + * @param[in] uid - SceUID of the memory block to free + * + * @return 0 on success, < 0 on error. +*/ +int sceKernelFreeMemBlock(SceUID uid); + +/*** + * Gets the base address of a memoy block + * + * @param[in] uid - SceUID of the memory block to free + * @param[out] basep - Base address of the memory block identified by SceUID + * + * @return 0 on success, < 0 on error. +*/ +int sceKernelGetMemBlockBase(SceUID uid, void **basep); + +SceUID sceKernelFindMemBlockByAddr(const void *, int); + +void sceKernelSyncVMDomain(SceUID, void *, SceSize); +void sceKernelOpenVMDomain(); +void sceKernelCloseVMDomain(); + +#ifdef __cplusplus +} +#endif + +#endif |