PSP2SDK  dirty-f9e4f2d
The free SDK for PSP2
include/psp2/kernel/sysmem.h
Go to the documentation of this file.
00001 
00012 #ifndef _PSP2_KERNEL_SYSMEM_H_
00013 #define _PSP2_KERNEL_SYSMEM_H_
00014 
00015 #include <psp2/types.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 typedef int SceKernelMemBlockType;
00022 
00023 enum {
00024     SCE_KERNEL_MEMBLOCK_TYPE_USER_RW    = 0x0c20d060,
00025     SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE    = 0x0c208060,
00026     SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_RW   = 0x0c80d060,
00027     SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW    = 0x0d808060,
00028     SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW  = 0x09408060
00029 };
00030 
00031 /***
00032  * Allocates a new memoy block
00033  *
00034  * @param[in] name - Name for the memory block
00035  * @param[in] type - Type of the memory to allocate
00036  * @param[in] size - Size of the memory to allocate
00037  * @param[in] optp - Memory block options?
00038  *
00039  * @return SceUID of the memory block on success, < 0 on error.
00040 */
00041 SceUID sceKernelAllocMemBlock(const char *name, SceKernelMemBlockType type, int size, void *optp);
00042 
00043 SceUID sceKernelAllocMemBlockForVM(const char *, SceSize);
00044 
00045 /***
00046  * Frees new memoy block
00047  *
00048  * @param[in] uid - SceUID of the memory block to free
00049  *
00050  * @return 0 on success, < 0 on error.
00051 */
00052 int sceKernelFreeMemBlock(SceUID uid);
00053 
00054 /***
00055  * Gets the base address of a memoy block
00056  *
00057  * @param[in] uid - SceUID of the memory block to free
00058  * @param[out] basep - Base address of the memory block identified by SceUID
00059  *
00060  * @return 0 on success, < 0 on error.
00061 */
00062 int sceKernelGetMemBlockBase(SceUID uid, void **basep);
00063 
00064 SceUID sceKernelFindMemBlockByAddr(const void *, int);
00065 
00066 void sceKernelSyncVMDomain(SceUID, void *, SceSize);
00067 void sceKernelOpenVMDomain();
00068 void sceKernelCloseVMDomain();
00069 
00070 #ifdef __cplusplus
00071 }
00072 #endif
00073 
00074 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines