PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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_element_
 
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_element_ sysmem_alloc_element_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_tGetSysmemInternalData (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_element_

struct sysmem_alloc_element_

Definition at line 36 of file sysmem.h.

+ Collaboration diagram for sysmem_alloc_element_:
Data Fields
struct sysmem_alloc_element_ * next
unsigned int info

◆ sysmem_alloc_table_

struct sysmem_alloc_table_

Definition at line 42 of file sysmem.h.

+ Collaboration diagram for sysmem_alloc_table_:
Data Fields
struct sysmem_alloc_table_ * next
sysmem_alloc_element_t list[31]
int padding

◆ sysmem_internals_

struct sysmem_internals_

Sysmem internal data structure.

Definition at line 50 of file sysmem.h.

+ Collaboration diagram for sysmem_internals_:
Data Fields
int memsize
sysmem_alloc_table_t * alloclist
void * intr_suspend_tbl
int allocation_count
sysmem_alloc_table_t * smemupdate_cur

Macro Definition Documentation

◆ ALLOC_FIRST

#define ALLOC_FIRST   0

Definition at line 28 of file sysmem.h.

◆ ALLOC_LAST

#define ALLOC_LAST   1

Definition at line 29 of file sysmem.h.

◆ ALLOC_ADDRESS

#define ALLOC_ADDRESS   2

Definition at line 30 of file sysmem.h.

◆ USED

#define USED   0x00000000

Definition at line 33 of file sysmem.h.

◆ FREE

#define FREE   0x80000000

Definition at line 34 of file sysmem.h.

◆ sysmem_IMPORTS_start

#define sysmem_IMPORTS_start   DECLARE_IMPORT_TABLE(sysmem, 1, 1)

Definition at line 79 of file sysmem.h.

◆ sysmem_IMPORTS_end

#define sysmem_IMPORTS_end   END_IMPORT_TABLE

Definition at line 80 of file sysmem.h.

◆ I_GetSysmemInternalData

#define I_GetSysmemInternalData   DECLARE_IMPORT(3, GetSysmemInternalData)

Definition at line 82 of file sysmem.h.

◆ I_AllocSysMemory

#define I_AllocSysMemory   DECLARE_IMPORT(4, AllocSysMemory)

Definition at line 83 of file sysmem.h.

◆ I_FreeSysMemory

#define I_FreeSysMemory   DECLARE_IMPORT(5, FreeSysMemory)

Definition at line 84 of file sysmem.h.

◆ I_QueryMemSize

#define I_QueryMemSize   DECLARE_IMPORT(6, QueryMemSize)

Definition at line 85 of file sysmem.h.

◆ I_QueryMaxFreeMemSize

#define I_QueryMaxFreeMemSize   DECLARE_IMPORT(7, QueryMaxFreeMemSize)

Definition at line 86 of file sysmem.h.

◆ I_QueryTotalFreeMemSize

#define I_QueryTotalFreeMemSize   DECLARE_IMPORT(8, QueryTotalFreeMemSize)

Definition at line 87 of file sysmem.h.

◆ I_QueryBlockTopAddress

#define I_QueryBlockTopAddress   DECLARE_IMPORT(9, QueryBlockTopAddress)

Definition at line 88 of file sysmem.h.

◆ I_QueryBlockSize

#define I_QueryBlockSize   DECLARE_IMPORT(10, QueryBlockSize)

Definition at line 89 of file sysmem.h.

◆ I_Kprintf

#define I_Kprintf   DECLARE_IMPORT(14, Kprintf)

Definition at line 90 of file sysmem.h.

◆ I_KprintfSet

#define I_KprintfSet   DECLARE_IMPORT(15, KprintfSet)

Definition at line 91 of file sysmem.h.

Typedef Documentation

◆ sysmem_internals_t

Sysmem internal data structure.

◆ KprintfHandler_t

typedef int() KprintfHandler_t(void *context, const char *format, va_list ap)

Definition at line 74 of file sysmem.h.

Function Documentation

◆ GetSysmemInternalData()

sysmem_internals_t * GetSysmemInternalData ( void  )

Definition at line 323 of file sysmem.c.

◆ AllocSysMemory()

void * AllocSysMemory ( int  mode,
int  size,
void *  ptr 
)

Definition at line 177 of file sysmem.c.

◆ FreeSysMemory()

int FreeSysMemory ( void *  ptr)

Definition at line 191 of file sysmem.c.

◆ QueryMemSize()

u32 QueryMemSize ( )

Definition at line 118 of file sysmem.c.

◆ QueryMaxFreeMemSize()

u32 QueryMaxFreeMemSize ( )

Definition at line 126 of file sysmem.c.

◆ QueryTotalFreeMemSize()

u32 QueryTotalFreeMemSize ( )

Definition at line 150 of file sysmem.c.

◆ QueryBlockTopAddress()

void * QueryBlockTopAddress ( void *  address)

Definition at line 214 of file sysmem.c.

◆ QueryBlockSize()

int QueryBlockSize ( void *  address)

Definition at line 237 of file sysmem.c.

◆ Kprintf()

int Kprintf ( const char *  format,
  ... 
)

Definition at line 737 of file sysmem.c.

◆ KprintfSet()

void KprintfSet ( KprintfHandler_t *  new_cb,
void *  context 
)

Definition at line 752 of file sysmem.c.