[ed11bb26] | 1 | /** |
---|
| 2 | * @file itronsys/vmempool.h |
---|
| 3 | */ |
---|
| 4 | |
---|
[352c9b2] | 5 | /* |
---|
[9d9a3dd] | 6 | * COPYRIGHT (c) 1989-1999. |
---|
| 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * |
---|
[352c9b2] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[e49f9e6b] | 11 | * http://www.rtems.com/license/LICENSE. |
---|
[352c9b2] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
[6df1f64] | 16 | #ifndef _ITRONSYS_VMEMPOOL_H |
---|
| 17 | #define _ITRONSYS_VMEMPOOL_H |
---|
[352c9b2] | 18 | |
---|
| 19 | #ifdef __cplusplus |
---|
| 20 | extern "C" { |
---|
| 21 | #endif |
---|
| 22 | |
---|
| 23 | /* |
---|
| 24 | * Create Variable Memory Pool (cre_mpl) Structure |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | typedef struct t_cmpl { |
---|
| 28 | VP exinf; /* extended information */ |
---|
| 29 | ATR mplatr; /* memorypool attributes */ |
---|
| 30 | INT mplsz; /* memorypool size */ |
---|
| 31 | /* additional information may be included depending on the implementation */ |
---|
| 32 | } T_CMPL; |
---|
| 33 | |
---|
| 34 | /* |
---|
| 35 | * mplatr |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #define TA_TFIFO 0x00 /* waiting tasks are handled by FIFO */ |
---|
| 39 | #define TA_TPRI 0x01 /* waiting tasks are handled by priority */ |
---|
| 40 | |
---|
| 41 | /* |
---|
| 42 | * mplid |
---|
| 43 | */ |
---|
| 44 | |
---|
| 45 | #define TMPL_OS (-4) /* memorypool used by OS */ |
---|
| 46 | |
---|
| 47 | /* |
---|
| 48 | * Reference Variable Memory Pool (ref_mpl) Structure |
---|
| 49 | */ |
---|
| 50 | |
---|
| 51 | typedef struct t_rmpl { |
---|
| 52 | VP exinf; /* extended information */ |
---|
| 53 | BOOL_ID wtsk; /* indicates whether or not there are waiting tasks */ |
---|
| 54 | INT frsz; /* total size of free memory */ |
---|
| 55 | INT maxsz; /* size of largest contiguous memory */ |
---|
| 56 | /* additional information may be included depending on the implementation */ |
---|
| 57 | } T_RMPL; |
---|
| 58 | |
---|
| 59 | /* |
---|
| 60 | * Variable Memory Pool Functions |
---|
| 61 | */ |
---|
| 62 | |
---|
| 63 | /* |
---|
| 64 | * cre_mpl - Create Variable-Size Memorypool |
---|
| 65 | */ |
---|
| 66 | |
---|
| 67 | ER cre_mpl( |
---|
| 68 | ID mplid, |
---|
| 69 | T_CMPL *pk_cmpl |
---|
| 70 | ); |
---|
| 71 | |
---|
| 72 | /* |
---|
| 73 | * del_mpl - Delete Variable-Size Memorypool |
---|
| 74 | */ |
---|
| 75 | |
---|
| 76 | ER del_mpl( |
---|
| 77 | ID mplid |
---|
| 78 | ); |
---|
| 79 | |
---|
| 80 | /* |
---|
| 81 | * get_blk - Get Variable-Size Memory Block |
---|
| 82 | */ |
---|
| 83 | |
---|
| 84 | ER get_blk( |
---|
| 85 | VP *p_blk, |
---|
| 86 | ID mplid, |
---|
| 87 | INT blksz |
---|
| 88 | ); |
---|
| 89 | |
---|
| 90 | /* |
---|
| 91 | * pget_blk - Poll and Get Variable-Size Memory Block |
---|
| 92 | */ |
---|
| 93 | |
---|
| 94 | ER pget_blk( |
---|
| 95 | VP *p_blk, |
---|
| 96 | ID mplid, |
---|
| 97 | INT blksz |
---|
| 98 | ); |
---|
| 99 | |
---|
| 100 | /* |
---|
| 101 | * tget_blk - Get Variable-Size Memory Block with Timeout |
---|
| 102 | */ |
---|
| 103 | |
---|
| 104 | ER tget_blk( |
---|
| 105 | VP *p_blk, |
---|
| 106 | ID mplid, |
---|
| 107 | INT blksz, |
---|
| 108 | TMO tmout |
---|
| 109 | ); |
---|
| 110 | |
---|
| 111 | /* |
---|
| 112 | * rel_blk - Release Variable-Size Memory Block |
---|
| 113 | */ |
---|
| 114 | |
---|
| 115 | ER rel_blk( |
---|
| 116 | ID mplid, |
---|
| 117 | VP blk |
---|
| 118 | ); |
---|
| 119 | |
---|
| 120 | /* |
---|
| 121 | * ref_mpl - Reference Variable-Size Memorypool Status |
---|
| 122 | */ |
---|
| 123 | |
---|
| 124 | ER ref_mpl( |
---|
| 125 | T_RMPL *pk_rmpl, |
---|
| 126 | ID mplid |
---|
| 127 | ); |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | #ifdef __cplusplus |
---|
| 131 | } |
---|
| 132 | #endif |
---|
| 133 | |
---|
| 134 | #endif |
---|
| 135 | /* end of include file */ |
---|