sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
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
17#ifndef __THVPOOL_H__
18#define __THVPOOL_H__
19
20#include <types.h>
21#include <irx.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*
28 * Variable length memory pool
29 */
30
31// Variable-length pool attributes
32#define VA_THFIFO 0x000
33#define VA_THPRI 0x001
34#define VA_MEMBTM 0x200
35
36typedef struct _iop_vpl_param
37{
38 unsigned int attr;
39 unsigned int option;
40 int size;
41} iop_vpl_param;
42
43typedef struct _iop_vpl_info
44{
45 unsigned int attr;
46 unsigned int option;
47 int size;
48 int freeSize;
49 int numWaitThreads;
50 int reserved[3];
51} iop_vpl_info_t;
52
53extern int CreateVpl(iop_vpl_param *param);
54extern int DeleteVpl(int vplId);
55extern void *AllocateVpl(int vplId, int size);
56extern void *pAllocateVpl(int vplId, int size);
57extern void *ipAllocateVpl(int vplId, int size);
58extern int FreeVpl(int vplId, void *memory);
59extern int ReferVplStatus(int vplId, iop_vpl_info_t *info);
60extern int iReferVplStatus(int vplId, iop_vpl_info_t *info);
61
62#define thvpool_IMPORTS_start DECLARE_IMPORT_TABLE(thvpool, 1, 1)
63#define thvpool_IMPORTS_end END_IMPORT_TABLE
64
65#define I_CreateVpl DECLARE_IMPORT(4, CreateVpl)
66#define I_DeleteVpl DECLARE_IMPORT(5, DeleteVpl)
67#define I_AllocateVpl DECLARE_IMPORT(6, AllocateVpl)
68#define I_pAllocateVpl DECLARE_IMPORT(7, pAllocateVpl)
69#define I_ipAllocateVpl DECLARE_IMPORT(8, ipAllocateVpl)
70#define I_FreeVpl DECLARE_IMPORT(9, FreeVpl)
71#define I_ReferVplStatus DECLARE_IMPORT(11, ReferVplStatus)
72#define I_iReferVplStatus DECLARE_IMPORT(12, iReferVplStatus)
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif /* __THVPOOL_H__ */