PSPSDK 2025-05-14
Loading...
Searching...
No Matches
pspsysmem_kernel.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspsysmem_kernel.h - Interface to the system memory manager (kernel).
7 *
8 * Copyright (c) 2005 James F.
9 *
10 */
11
12/* Note: Some of the structures, types, and definitions in this file were
13 extrapolated from symbolic debugging information found in the Japanese
14 version of Puzzle Bobble. */
15
16#ifndef PSPSYSMEMKERNEL_H
17#define PSPSYSMEMKERNEL_H
18
19#include <pspkerneltypes.h>
20#include <psptypes.h>
21#include <pspsysmem.h>
22
30#ifdef __cplusplus
31extern "C" {
32#endif
33
35{
37 unsigned int startaddr;
38 unsigned int memsize;
39 unsigned int attr;
41
51
60
69
74
79
84
94int sceKernelSetDdrMemoryProtection(void *addr, int size, int prot);
95
106SceUID sceKernelCreateHeap(SceUID partitionid, SceSize size, int unk, const char *name);
107
117
126int sceKernelFreeHeapMemory(SceUID heapid, void *block);
127
136
145
150 struct _uidControlBlock *type; //(0x8)
151 u32 UID; //(0xC)
152 char *name; //(0x10)
153 unsigned char unk;
154 unsigned char size; // Size in words
157} __attribute__((packed));
159
169
180
187
196
203
211
218
219#ifdef __cplusplus
220}
221#endif
222
225#endif /* PSPSYSMEMKERNEL_H */
void sceKernelSysMemDumpTail(void)
Dump the tail blocks.
SceUID sceKernelCreateHeap(SceUID partitionid, SceSize size, int unk, const char *name)
Create a heap.
void * sceKernelAllocHeapMemory(SceUID heapid, SceSize size)
Allocate a memory block from a heap.
int sceKernelQueryMemoryPartitionInfo(int pid, PspSysmemPartitionInfo *info)
Query the parition information.
int sceKernelGetUIDcontrolBlockWithType(SceUID uid, uidControlBlock *type, uidControlBlock **block)
Get a UID control block on a particular type.
SceSize sceKernelPartitionTotalFreeMemSize(int pid)
Get the total amount of free memory.
int sceKernelGetModel(void)
Get the model of PSP.
void sceKernelSysMemDump(void)
Get the kernel to dump the internal memory table to Kprintf.
int sceKernelFreeHeapMemory(SceUID heapid, void *block)
Free a memory block allocated from a heap.
int sceKernelDeleteUID(SceUID uid)
Delete a UID.
int sceKernelDeleteHeap(SceUID heapid)
Delete a heap.
struct _PspSysmemPartitionInfo PspSysmemPartitionInfo
uidControlBlock * SysMemForKernel_536AD5E1(void)
Get the root of the UID tree (1.5+ only)
SceSize sceKernelPartitionMaxFreeMemSize(int pid)
Get the size of the largest free memory block.
int sceKernelSetDdrMemoryProtection(void *addr, int size, int prot)
Set the protection of a block of ddr memory.
void sceKernelSysMemDumpBlock(void)
Dump the list of memory blocks.
int sceKernelGetUIDcontrolBlock(SceUID uid, uidControlBlock **block)
Get a UID control block.
int sceKernelGetCompiledSdkVersion(void)
Get the SDK version set with sceKernelSetCompiledSdkVersion().
SceSize sceKernelHeapTotalFreeSize(SceUID heapid)
Get the amount of free size of a heap, in bytes.
int sceKernelSetCompiledSdkVersion(int version)
Set the version of the SDK with which the caller was compiled.
int SceUID
UIDs are used to describe many different kernel objects.
Definition pspkerneltypes.h:24
unsigned int SceSize
Definition psptypes.h:103
uint32_t u32
Definition psptypes.h:41
Definition pspsysmem_kernel.h:35
SceSize size
Definition pspsysmem_kernel.h:36
unsigned int attr
Definition pspsysmem_kernel.h:39
unsigned int memsize
Definition pspsysmem_kernel.h:38
unsigned int startaddr
Definition pspsysmem_kernel.h:37
Structure of a UID control block.
Definition pspsysmem_kernel.h:147
struct _uidControlBlock * nextChild
Definition pspsysmem_kernel.h:149
short attribute
Definition pspsysmem_kernel.h:155
struct _uidControlBlock * type
Definition pspsysmem_kernel.h:150
unsigned char size
Definition pspsysmem_kernel.h:154
struct _uidControlBlock * parent
Definition pspsysmem_kernel.h:148
char * name
Definition pspsysmem_kernel.h:152
u32 UID
Definition pspsysmem_kernel.h:151
struct _uidControlBlock * nextEntry
Definition pspsysmem_kernel.h:156
unsigned char unk
Definition pspsysmem_kernel.h:153