PS2SDK
PS2 Homebrew Libraries
sysmem.h File Reference
#include <types.h>
#include <irx.h>
#include <stdarg.h>
+ Include dependency graph for sysmem.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sysmem_alloc_block_info_
 
struct  sysmem_alloc_block_
 
struct  sysmem_alloc_table_
 
struct  sysmem_internals_
 

Macros

#define ALLOC_FIRST   0
 
#define ALLOC_LAST   1
 
#define ALLOC_ADDRESS   2
 
#define USED   0x00000000
 
#define FREE   0x80000000
 
#define sysmem_IMPORTS_start   DECLARE_IMPORT_TABLE(sysmem, 1, 1)
 
#define sysmem_IMPORTS_end   END_IMPORT_TABLE
 
#define I_GetSysmemInternalData   DECLARE_IMPORT(3, GetSysmemInternalData)
 
#define I_AllocSysMemory   DECLARE_IMPORT(4, AllocSysMemory)
 
#define I_FreeSysMemory   DECLARE_IMPORT(5, FreeSysMemory)
 
#define I_QueryMemSize   DECLARE_IMPORT(6, QueryMemSize)
 
#define I_QueryMaxFreeMemSize   DECLARE_IMPORT(7, QueryMaxFreeMemSize)
 
#define I_QueryTotalFreeMemSize   DECLARE_IMPORT(8, QueryTotalFreeMemSize)
 
#define I_QueryBlockTopAddress   DECLARE_IMPORT(9, QueryBlockTopAddress)
 
#define I_QueryBlockSize   DECLARE_IMPORT(10, QueryBlockSize)
 
#define I_Kprintf   DECLARE_IMPORT(14, Kprintf)
 
#define I_KprintfSet   DECLARE_IMPORT(15, KprintfSet)
 

Typedefs

typedef struct sysmem_alloc_block_info_ sysmem_alloc_block_info_t
 
typedef struct sysmem_alloc_block_ sysmem_alloc_block_t
 
typedef struct sysmem_alloc_table_ sysmem_alloc_table_t
 
typedef struct sysmem_internals_ sysmem_internals_t
 
typedef int() KprintfHandler_t(void *context, const char *format, va_list ap)
 

Functions

sysmem_internals_t * GetSysmemInternalData (void)
 
void * AllocSysMemory (int mode, int size, void *ptr)
 
int FreeSysMemory (void *ptr)
 
u32 QueryMemSize ()
 
u32 QueryMaxFreeMemSize ()
 
u32 QueryTotalFreeMemSize ()
 
void * QueryBlockTopAddress (void *address)
 
int QueryBlockSize (void *address)
 
int Kprintf (const char *format,...)
 
void KprintfSet (KprintfHandler_t *, void *context)
 

Detailed Description

System memory manager.

Definition in file sysmem.h.


Data Structure Documentation

◆ sysmem_alloc_block_info_

struct sysmem_alloc_block_info_

Definition at line 36 of file sysmem.h.

Data Fields
u32 m_allocated: 1
u32 m_address: 15
u32 m_pad: 1
u32 m_size: 15

◆ sysmem_alloc_block_

struct sysmem_alloc_block_

Definition at line 44 of file sysmem.h.

+ Collaboration diagram for sysmem_alloc_block_:
Data Fields
struct sysmem_alloc_block_ * m_next
sysmem_alloc_block_info_t m_info

◆ sysmem_alloc_table_

struct sysmem_alloc_table_

Definition at line 50 of file sysmem.h.

+ Collaboration diagram for sysmem_alloc_table_:
Data Fields
struct sysmem_alloc_table_ * m_next
sysmem_alloc_block_t m_blkarray[31]
int m_padding

◆ sysmem_internals_

struct sysmem_internals_

Sysmem internal data structure.

Definition at line 58 of file sysmem.h.

+ Collaboration diagram for sysmem_internals_:
Data Fields
int m_memsize
sysmem_alloc_table_t * m_alloclist
void * m_intr_suspend_tbl
int m_allocation_count
sysmem_alloc_table_t * m_smemupdate_cur

Typedef Documentation

◆ sysmem_internals_t

Sysmem internal data structure.