vitasdk
Documentation of the vitasdk
sysmem.h File Reference

Go to the source code of this file.

Data Structures

struct  SceKernelAllocMemBlockKernelOpt
 
struct  SceKernelHeapMemoryOpt
 Options and mapping results for heap allocation. More...
 
struct  SceKernelAllocMemBlockInfo
 
struct  SceKernelMemBlockInfoCore
 
struct  SceKernelMemBlockInfoEx
 

Macros

#define ksceKernelFindMemBlockByAddrForPid(pid, addr, size)   ksceKernelFindProcMemBlockByAddr(pid, addr, size)
 
#define ksceKernelMapBlockUserVisible(uid)   ksceKernelMapMemBlock(uid)
 
#define ksceKernelRemapBlock(uid, type)   ksceKernelRemapMemBlock(uid, type)
 
#define ksceKernelMapUserBlock(name, permission, flags, user_buf, size, kernel_page, kernel_size, kernel_offset)   ksceKernelUserMapWithFlags(name, permission, flags, user_buf, size, kernel_page, kernel_size, kernel_offset)
 
#define ksceKernelMapUserBlockDefaultType(name, permission, user_buf, size, kernel_page, kernel_size, kernel_offset)   ksceKernelUserMap(name, permission, user_buf, size, kernel_page, kernel_size, kernel_offset)
 
#define ksceKernelMapUserBlockDefaultTypeForPid(pid, name, permission, user_buf, size, kernel_page, kernel_size, kernel_offset)   ksceKernelProcUserMap(pid, name, permission, user_buf, size, kernel_page, kernel_size, kernel_offset)
 
#define ksceKernelMemBlockRelease(uid)   ksceKernelUserUnmap(uid)
 
#define ksceKernelMemRangeRetain(addr, size)   ksceKernelLockRange(addr, size)
 
#define ksceKernelMemRangeRetainForPid(pid, addr, size)   ksceKernelLockRangeProc(pid, addr, size)
 
#define ksceKernelMemRangeRetainWithPerm(perm, addr, size)   ksceKernelLockRangeWithMode(perm, addr, size)
 
#define ksceKernelMemRangeRelease(addr, size)   ksceKernelUnlockRange(addr, size)
 
#define ksceKernelMemRangeReleaseForPid(pid, addr, size)   ksceKernelUnlockRangeProc(pid, addr, size)
 
#define ksceKernelMemRangeReleaseWithPerm(perm, addr, size)   ksceKernelUnlockRangeWithMode(perm, addr, size)
 

Typedefs

typedef SceKernelAllocMemBlockKernelOpt SceKernelAllocMemBlockOptKernel
 
typedef struct SceUIDPhyMemPartObject SceUIDPhyMemPartObject
 Opaque class-specific data for a physical-memory-partition UID object.
 
typedef struct SceKernelObject SceKernelObject
 Opaque class-specific data returned by the GUID and PUID object APIs.
 

Enumerations

enum  SceKernelMemoryRefPerm {
  SCE_KERNEL_MEMORY_REF_PERM_ANY = 0 , SCE_KERNEL_MEMORY_REF_PERM_USER_R = 0x01 , SCE_KERNEL_MEMORY_REF_PERM_USER_W = 0x02 , SCE_KERNEL_MEMORY_REF_PERM_USER_X = 0x04 ,
  SCE_KERNEL_MEMORY_REF_PERM_KERN_R = 0x10 , SCE_KERNEL_MEMORY_REF_PERM_KERN_W = 0x20 , SCE_KERNEL_MEMORY_REF_PERM_KERN_X = 0x40
}
 
enum  SceKernelHeapMemoryMappingAction { SCE_KERNEL_HEAP_MEMORY_MAPPING_ACTION_NONE = 0 , SCE_KERNEL_HEAP_MEMORY_MAPPING_ACTION_MAP = 1 , SCE_KERNEL_HEAP_MEMORY_MAPPING_ACTION_UNMAP = 2 }
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x58, SceKernelAllocMemBlockKernelOpt)
 
SceUID ksceKernelAllocMemBlock (const char *name, SceKernelMemBlockType type, SceSize size, SceKernelAllocMemBlockKernelOpt *opt)
 Allocates a new memory block.
 
int ksceKernelFreeMemBlock (SceUID uid)
 Frees new memory block.
 
int ksceKernelGetMemBlockBase (SceUID uid, void **base)
 Gets the base address of a memory block.
 
int ksceKernelGetMemBlockType (SceUID uid, unsigned int *type)
 Gets the memory block type of a memory block.
 
SceUID ksceKernelFindMemBlockByAddr (const void *addr, SceSize size)
 Find the SceUID of a memory block.
 
SceUID ksceKernelFindProcMemBlockByAddr (SceUID pid, const void *addr, SceSize size)
 Find the SceUID of a memory block in a process.
 
int ksceKernelGetMemBlockAllocMapSize (SceUID memid, SceSize *alloc_map_size)
 Get the AllocMapSize of a MemBlock.
 
int ksceKernelMapMemBlock (SceUID uid)
 Map a memblock.
 
int ksceKernelMapMemBlockWithFlag (SceUID uid, int flag)
 Map a memblock.
 
int ksceKernelRemapMemBlock (SceUID uid, SceKernelMemBlockType type)
 Changes the block type.
 
int ksceKernelUnmapMemBlock (SceUID uid)
 Unmap a memblock.
 
SceUID ksceKernelUserMap (const char *name, int permission, const void *user_buf, SceSize size, void **kernel_page, SceSize *kernel_size, SceUInt32 *kernel_offset)
 The mapping user address space to kernel.
 
SceUID ksceKernelProcUserMap (SceUID pid, const char *name, int permission, const void *user_buf, SceSize size, void **kernel_page, SceSize *kernel_size, SceUInt32 *kernel_offset)
 The mapping user address space to kernel with process.
 
SceUID ksceKernelUserMapWithFlags (const char *name, int permission, int flags, const void *user_buf, SceSize size, void **kernel_page, SceSize *kernel_size, unsigned int *kernel_offset)
 The mapping user address space to kernel with flags.
 
int ksceKernelUserUnmap (SceUID uid)
 Frees a memblock mapped with ksceKernelUserMap.
 
int ksceKernelLockRange (void *addr, SceSize size)
 Locks a memory range.
 
int ksceKernelLockRangeProc (ScePID pid, void *addr, SceSize size)
 Locks a memory range for a process (pid)
 
int ksceKernelLockRangeWithMode (SceKernelMemoryRefPerm perm, void *addr, SceSize size)
 Locks a memory range, checking for a given permission.
 
int ksceKernelUnlockRange (void *addr, SceSize size)
 Unlocks a memory range.
 
int ksceKernelUnlockRangeProc (ScePID pid, void *addr, SceSize size)
 Unlocks a memory range for a process (pid)
 
int ksceKernelUnlockRangeWithMode (SceKernelMemoryRefPerm perm, void *addr, SceSize size)
 Unlocks a memory range checking for a given permission.
 
SceUID ksceKernelAllocPartitionMemBlock (SceUID part, const char *name, SceKernelMemBlockType type, SceSize size, const SceKernelAllocMemBlockOptKernel *pOpt)
 
int ksceKernelFreeSimpleMemBlock (void *a1)
 
 VITASDK_BUILD_ASSERT_EQ (0x14, SceKernelHeapMemoryOpt)
 
 VITASDK_BUILD_ASSERT_EQ (0x14, SceKernelAllocMemBlockInfo)
 
 VITASDK_BUILD_ASSERT_EQ (0x2C, SceKernelMemBlockInfoCore)
 
 VITASDK_BUILD_ASSERT_EQ (0xB8, SceKernelMemBlockInfoEx)
 
SceUID ksceGUIDCreate (SceClass *object_class, const char *name, SceUID reference_guid, SceKernelObject **object)
 Creates a global UID object, optionally relative to reference_guid.
 
int ksceGUIDGetClass (SceUID guid, SceClass **object_class)
 Gets the class of a global UID object.
 
int ksceGUIDGetName (SceUID guid, const char **name)
 Gets the read-only name owned by a live global UID.
 
int ksceGUIDGetObject (SceUID guid, SceKernelObject **object)
 Gets the class-specific object data for a global UID without taking a reference.
 
SceUID ksceGUIDKernelCreate (SceClass *object_class, const char *name, SceKernelObject **object)
 Creates a kernel-owned global UID object with the default attributes.
 
const char * ksceGUIDName (SceUID guid)
 Returns the read-only name of a live global UID.
 
SceUID ksceGUIDOpenByName (const char *name)
 Opens a named global UID object.
 
int ksceGUIDReferObjectWithLevel (SceUID guid, SceUInt32 visibility_level, SceKernelObject **object)
 Takes a reference to a global UID at visibility level 0 through 7.
 
int ksceGUIDReferObjectWithSubclass (SceUID guid, SceClass *object_class, SceKernelObject **object)
 Takes a reference to a global UID object when its class derives from object_class.
 
int ksceGUIDSetName (SceUID guid, const char *name)
 Replaces the name of a global UID object.
 
void * ksceKernelAllocHeapMemoryWithOpt (SceUID heap_id, SceSize size, SceKernelHeapMemoryOpt *opt)
 Allocates from the heap identified by heap_id.
 
SceUID ksceKernelAllocMemBlockWithInfo (const char *name, SceKernelMemBlockType type, SceSize vsize, const SceKernelAllocMemBlockOptKernel *opt, SceKernelAllocMemBlockInfo *info)
 Allocates a memory block and returns its mapping information.
 
void * ksceKernelAllocUncacheHeapMemory (SceSize size)
 
void * ksceKernelAllocUncacheHeapMemoryWithOption (SceSize size, SceKernelHeapMemoryOpt *opt)
 
int ksceKernelCountFillValue64FromUser (const SceUInt64 *ptr, SceUInt64 value, SceSize byte_size)
 Counts the bytes at the start of a user-memory range in the calling process that match a repeated 64-bit value.
 
int ksceKernelCountFillValue64FromUserProc (ScePID pid, const SceUInt64 *ptr, SceUInt64 value, SceSize byte_size)
 Counts the bytes at the start of another process's user-memory range that match a repeated 64-bit value.
 
int ksceKernelCountFillValueFromUser (const SceUInt32 *ptr, SceUInt32 value, SceSize byte_size)
 Counts the bytes at the start of a user-memory range in the calling process that match a repeated 32-bit value.
 
int ksceKernelCountFillValueFromUserProc (ScePID pid, const SceUInt32 *ptr, SceUInt32 value, SceSize byte_size)
 Counts the bytes at the start of another process's user-memory range that match a repeated 32-bit value.
 
int ksceKernelDecRefCountMemBlock (SceUID uid)
 Decrements a memblock's internal range/reference counter.
 
int ksceKernelFreeUncacheHeapMemory (void *ptr)
 
int ksceKernelGetMemBlockInfo (SceUID uid, SceUInt32 visibility_level, SceKernelMemBlockInfoEx *info)
 Gets extended memblock information at visibility level 0 through 7.
 
int ksceKernelGetMemBlockMappedBase (SceUID uid, void **base)
 Gets the currently mapped base of a memblock.
 
int ksceKernelGetMemBlockMemtypeByAddr (const void *addr)
 Gets the internal memory type for an address.
 
int ksceKernelGetMemBlockPARange (SceUID uid, SceKernelPARange *pa_range)
 Gets the single physical range backing a memblock.
 
int ksceKernelGetMemBlockPAVector (SceUID uid, SceKernelPAVector *pa_vector)
 Gets the physical-range vector backing a memblock.
 
int ksceKernelGetMemBlockVBase (SceUID uid, void **base)
 Gets the virtual base reserved for a memblock.
 
int ksceKernelGetPhysicalMemoryType (const void *vaddr)
 Classifies the physical region containing a virtual address.
 
int ksceKernelIncRefCountMemBlock (SceUID uid)
 Increments a memblock's internal range/reference counter.
 
int ksceKernelIsAccessibleRange (SceUInt32 permission, const void *va, SceSize len)
 permission is a bitwise OR of SceKernelMemoryRefPerm values.
 
int ksceKernelIsAccessibleRangeProc (ScePID pid, SceUInt32 permission, const void *va, SceSize len)
 permission is a bitwise OR of SceKernelMemoryRefPerm values.
 
int ksceKernelIsEqualAccessibleRangeProcBySW (ScePID pid, SceUInt32 permission, const void *va, SceSize len)
 Checks whether a range has exactly the requested software permissions.
 
int ksceKernelMemBlockGetInfoEx (SceUID uid, SceKernelMemBlockInfoEx *info)
 Gets extended memblock information at visibility level 7.
 
int ksceKernelMemBlockType2Memtype (SceKernelMemBlockType type)
 Gets the internal memory-type class associated with a memblock type.
 
int ksceKernelMemBlockTypeGetPrivileges (SceKernelMemBlockType type)
 Gets the memory permissions associated with a memblock type.
 
int ksceKernelProcModeVAtoPA (ScePID pid, SceUInt32 permission, const void *va, void **pa)
 Translates an address in another process after applying an MMU access mode.
 
int ksceKernelVARangeToPARangeByHW (const SceKernelVARange *v_range, SceKernelPARange *pa_range)
 
int ksceKernelVARangeToPARangeBySW (const SceKernelVARange *v_range, SceKernelPARange *pa_range)
 
int ksceKernelVARangeToPAVectorByHW (const SceKernelVARange *v_range, SceKernelPAVector *pa_vector)
 
int ksceKernelVARangeToPAVectorBySW (const SceKernelVARange *v_range, SceKernelPAVector *pa_vector)
 
int ksceKernelVAtoPABySW (const void *va, void **pa)
 
int kscePUIDGetClass (ScePID pid, SceUID puid, SceClass **object_class)
 Gets the class of an object in a process-local UID namespace.
 
int kscePUIDGetName (ScePID pid, SceUID puid, const char **name)
 Gets the read-only name owned by a process-local UID entry.
 
int kscePUIDGetObject (ScePID pid, SceUID puid, SceKernelObject **object)
 Gets the class-specific object data for a process-local UID without taking a reference.
 
SceUID kscePUIDOpenByGUIDWithFlags (ScePID pid, SceUID guid, SceUInt32 flags)
 Opens a global UID in a process-local UID namespace.
 
SceUID kscePUIDOpenByName (ScePID pid, const char *name)
 Opens a named object in a process-local UID namespace.
 
SceUID kscePUIDOpenByNameWithClass (ScePID pid, const char *name, SceClass *object_class)
 Opens a named object of the required class in a process-local UID namespace.
 
int kscePUIDSetName (ScePID pid, SceUID puid, const char *name)
 Replaces the name of a process-local UID entry.
 
SceUID kscePUIDtoGUIDWithClass (ScePID pid, SceUID puid, SceClass *object_class)
 Resolves a process-local UID to its global UID, requiring object_class.