PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
thvpool.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __THVPOOL_H__
17#define __THVPOOL_H__
18
19#include <types.h>
20#include <irx.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/*
27 * Variable length memory pool
28 */
29
30// Variable-length pool attributes
31#define VA_THFIFO 0x000
32#define VA_THPRI 0x001
33#define VA_MEMBTM 0x200
34
35typedef struct _iop_vpl_param
36{
37 unsigned int attr;
38 unsigned int option;
39 int size;
41
42typedef struct _iop_vpl_info
43{
44 unsigned int attr;
45 unsigned int option;
46 int size;
47 int freeSize;
48 int numWaitThreads;
49 int reserved[3];
51
52extern int CreateVpl(iop_vpl_param *param);
53extern int DeleteVpl(int vplId);
54extern void *AllocateVpl(int vplId, int size);
55extern void *pAllocateVpl(int vplId, int size);
56extern void *ipAllocateVpl(int vplId, int size);
57extern int FreeVpl(int vplId, void *memory);
58extern int ReferVplStatus(int vplId, iop_vpl_info_t *info);
59extern int iReferVplStatus(int vplId, iop_vpl_info_t *info);
60
61#define thvpool_IMPORTS_start DECLARE_IMPORT_TABLE(thvpool, 1, 1)
62#define thvpool_IMPORTS_end END_IMPORT_TABLE
63
64#define I_CreateVpl DECLARE_IMPORT(4, CreateVpl)
65#define I_DeleteVpl DECLARE_IMPORT(5, DeleteVpl)
66#define I_AllocateVpl DECLARE_IMPORT(6, AllocateVpl)
67#define I_pAllocateVpl DECLARE_IMPORT(7, pAllocateVpl)
68#define I_ipAllocateVpl DECLARE_IMPORT(8, ipAllocateVpl)
69#define I_FreeVpl DECLARE_IMPORT(9, FreeVpl)
70#define I_ReferVplStatus DECLARE_IMPORT(11, ReferVplStatus)
71#define I_iReferVplStatus DECLARE_IMPORT(12, iReferVplStatus)
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif /* __THVPOOL_H__ */