sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
thfpool.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 __THFPOOL_H__
18#define __THFPOOL_H__
19
20#include <types.h>
21#include <irx.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27// Fixed-length pool attributes
28#define FA_THFIFO 0x000
29#define FA_THPRI 0x001
30#define FA_MEMBTM 0x200
31
32/*
33 * Fixed length memory pool
34 */
35
36typedef struct _iop_fpl_param
37{
38 unsigned int attr;
39 unsigned int option;
40 int block_size;
41 int blocks;
42} iop_fpl_param;
43
44typedef struct _iop_fpl_info
45{
46 unsigned int attr;
47 unsigned int option;
48 int blockSize;
49 int numBlocks;
50 int freeBlocks;
51 int numWaitThreads;
52 int reserved[4];
53} iop_fpl_info_t;
54
55extern int CreateFpl(iop_fpl_param *param);
56extern int DeleteFpl(int fplId);
57extern void *AllocateFpl(int fplId);
58extern void *pAllocateFpl(int fplId);
59extern void *ipAllocateFpl(int fplId);
60extern int FreeFpl(int fplId, void *memory);
61extern int ReferFplStatus(int fplId, iop_fpl_info_t *info);
62extern int iReferFplStatus(int fplId, iop_fpl_info_t *info);
63
64#define thfpool_IMPORTS_start DECLARE_IMPORT_TABLE(thfpool, 1, 1)
65#define thfpool_IMPORTS_end END_IMPORT_TABLE
66
67#define I_CreateFpl DECLARE_IMPORT(4, CreateFpl)
68#define I_DeleteFpl DECLARE_IMPORT(5, DeleteFpl)
69#define I_AllocateFpl DECLARE_IMPORT(6, AllocateFpl)
70#define I_pAllocateFpl DECLARE_IMPORT(7, pAllocateFpl)
71#define I_ipAllocateFpl DECLARE_IMPORT(8, ipAllocateFpl)
72#define I_FreeFpl DECLARE_IMPORT(9, FreeFpl)
73#define I_ReferFplStatus DECLARE_IMPORT(11, ReferFplStatus)
74#define I_iReferFplStatus DECLARE_IMPORT(12, iReferFplStatus)
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* __THFPOOL_H__ */