PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
thpool.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 __THPOOL_H__
17#define __THPOOL_H__
18
19#include <types.h>
20#include <irx.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26// Fixed-length pool attributes
27#define FA_THFIFO 0x000
28#define FA_THPRI 0x001
29#define FA_MEMBTM 0x200
30
31/*
32 * Fixed length memory pool
33 */
34
35typedef struct _iop_fpl_param
36{
37 unsigned int attr;
38 unsigned int option;
39 int block_size;
40 int blocks;
42
43typedef struct _iop_fpl_info
44{
45 unsigned int attr;
46 unsigned int option;
47 int blockSize;
48 int numBlocks;
49 int freeBlocks;
50 int numWaitThreads;
51 int reserved[4];
53
54int CreateFpl(iop_fpl_param *param);
55int DeleteFpl(int fplId);
56void *AllocateFpl(int fplId);
57void *pAllocateFpl(int fplId);
58void *ipAllocateFpl(int fplId);
59int FreeFpl(int fplId, void *memory);
60int ReferFplStatus(int fplId, iop_fpl_info_t *info);
61int iReferFplStatus(int fplId, iop_fpl_info_t *info);
62
63#define thfpool_IMPORTS_start DECLARE_IMPORT_TABLE(thfpool, 1, 1)
64#define thfpool_IMPORTS_end END_IMPORT_TABLE
65
66#define I_CreateFpl DECLARE_IMPORT(4, CreateFpl)
67#define I_DeleteFpl DECLARE_IMPORT(5, DeleteFpl)
68#define I_AllocateFpl DECLARE_IMPORT(6, AllocateFpl)
69#define I_pAllocateFpl DECLARE_IMPORT(7, pAllocateFpl)
70#define I_ipAllocateFpl DECLARE_IMPORT(8, ipAllocateFpl)
71#define I_FreeFpl DECLARE_IMPORT(9, FreeFpl)
72#define I_ReferFplStatus DECLARE_IMPORT(11, ReferFplStatus)
73#define I_iReferFplStatus DECLARE_IMPORT(12, iReferFplStatus)
74
75/*
76 * Variable length memory pool
77 */
78
79// Variable-length pool attributes
80#define VA_THFIFO 0x000
81#define VA_THPRI 0x001
82#define VA_MEMBTM 0x200
83
84typedef struct _iop_vpl_param
85{
86 unsigned int attr;
87 unsigned int option;
88 int size;
90
91typedef struct _iop_vpl_info
92{
93 unsigned int attr;
94 unsigned int option;
95 int size;
96 int freeSize;
97 int numWaitThreads;
98 int reserved[3];
100
101int CreateVpl(iop_vpl_param *param);
102int DeleteVpl(int vplId);
103void *AllocateVpl(int vplId, int size);
104void *pAllocateVpl(int vplId, int size);
105void *ipAllocateVpl(int vplId, int size);
106int FreeVpl(int vplId, void *memory);
107int ReferVplStatus(int vplId, iop_vpl_info_t *info);
108int iReferVplStatus(int vplId, iop_vpl_info_t *info);
109
110#define thvpool_IMPORTS_start DECLARE_IMPORT_TABLE(thvpool, 1, 1)
111#define thvpool_IMPORTS_end END_IMPORT_TABLE
112
113#define I_CreateVpl DECLARE_IMPORT(4, CreateVpl)
114#define I_DeleteVpl DECLARE_IMPORT(5, DeleteVpl)
115#define I_AllocateVpl DECLARE_IMPORT(6, AllocateVpl)
116#define I_pAllocateVpl DECLARE_IMPORT(7, pAllocateVpl)
117#define I_ipAllocateVpl DECLARE_IMPORT(8, ipAllocateVpl)
118#define I_FreeVpl DECLARE_IMPORT(9, FreeVpl)
119#define I_ReferVplStatus DECLARE_IMPORT(11, ReferVplStatus)
120#define I_iReferVplStatus DECLARE_IMPORT(12, iReferVplStatus)
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* __THPOOL_H__ */