GLAST/LAT >
DAQ and FSW >
FSW >
Doxygen Index >
IMM / V0-0-2
Constituent: imm     Tag: linux-gcc
Interface Data Structures File List Data Fields Globals
RBM_memory.c File Reference
Memory allocation/free routines for an managed ring buffer.
More...
#include "PBS/FFS.ih"
#include "PBS/FPA.h"
#include "PBS/RW.ih"
#include "MSG/MSG_pubdefs.h"
#include "IMM/RBM_pubdefs.h"
#include "IMM/RBM_msgs.h"
#include "RBM_prvdefs.h"
Include dependency graph for RBM_memory.c:
|
Functions |
void * | RBM_allocAny (unsigned int typ, RBM_Ring *rcb, unsigned int siz, const TOC *toc, unsigned int *status) |
| Allocate a packet from a managed ring buffer.
|
void | RBM_freeITC (void *pkt, unsigned int status, void *prm0, void *prm1, void *prm2) |
| Free memory packet (ITC courtesy entry point).
|
void * | RBM_alloc (RBM_Ring *rcb, unsigned int siz, unsigned int *status) |
| Allocate a packet from a managed ring buffer.
|
void * | RBM_allocITC (RBM_Ring *rcb, unsigned int siz, void **rtn, void **cb0, void **cb1, void **cb2) |
| Allocate memory packet without timeout (ITC courtesy entry point).
|
void * | RBM_allocW (RBM_Ring *rcb, unsigned int siz, unsigned int *status) |
| Allocate a packet from a managed ring buffer.
|
void * | RBM_allocW_toc (RBM_Ring *rcb, unsigned int siz, const TOC *toc, unsigned int *status) |
| Allocate a packet from a managed ring buffer.
|
unsigned int | RBM_free (RBM_Ring *rcb, void *pkt, unsigned int siz) |
| Free memory back to a managed ring buffer.
|
Detailed Description
Memory allocation/free routines for an managed ring buffer.
CVS $Id: RBM_memory.c,v 1.2 2005/03/25 01:01:41 apw Exp $
- Author:
- A.P.Waite
RBM_memory.c provides the memory allocation and free routines for RBM.
Function Documentation
void * RBM_alloc |
( |
RBM_Ring * |
rcb, |
|
|
unsigned int |
siz, |
|
|
unsigned int * |
status |
|
) |
|
|
|
Allocate a packet from a managed ring buffer.
- Parameters:
-
rcb | (in) Ring buffer manager control block |
siz | (in) Number of bytes to allocate |
status | (out) Completion status (pointer can be NULL) |
- Return values:
-
NULL | Memory allocation failed |
x | Pointer to allocated memory |
Values returned through status parameter
- Return values:
-
RBM_RINGDRY | No memory left in ring to satisfy allocation |
RBM_RINGPTR | Ring control block pointer invalid |
RBM_RINGSTAT | Ring control block not in state started |
RBM_RINGSIZE | Ring not big enough |
RBM_SUCCESS | Success |
RBM_alloc() allocates a memory packet from an RBM memory ring without pending. |
Here is the call graph for this function:
void * RBM_allocAny |
( |
unsigned int |
typ, |
|
|
RBM_Ring * |
rcb, |
|
|
unsigned int |
siz, |
|
|
const TOC * |
toc, |
|
|
unsigned int * |
status |
|
) |
|
|
|
Allocate a packet from a managed ring buffer.
- Parameters:
-
typ | (in) Type of allocation (what pending style) |
rcb | (in) Ring buffer manager control block |
siz | (in) Number of bytes to allocate |
toc | (in) Time-out control |
status | (out) Completion status (pointer can be NULL) |
- Return values:
-
NULL | Memory allocation failed |
x | Pointer to allocated memory |
Values returned through status parameter
- Return values:
-
RBM_RINGDRY | No memory left in ring to satisfy allocation |
RBM_RINGPTR | Ring control block pointer invalid |
RBM_RINGSTAT | Ring control block not in state started |
RBM_RINGSIZE | Ring not big enough |
RBM_SUCCESS | Success |
RBM_allocW_toc() allocates a memory from an RBM managed ring buffer. |
Here is the call graph for this function:
void * RBM_allocITC |
( |
RBM_Ring * |
rcb, |
|
|
unsigned int |
siz, |
|
|
void ** |
rtn, |
|
|
void ** |
cb0, |
|
|
void ** |
cb1, |
|
|
void ** |
cb2 |
|
) |
|
|
|
Allocate memory packet without timeout (ITC courtesy entry point).
- Parameters:
-
rcb | (in) Ring buffer manager control block |
siz | (in) Number of bytes to allocate |
rtn | (out) Processing completion callback routine |
cb0 | (out) Processing completion callback user parameter 0 |
cb1 | (out) Processing completion callback user parameter 1 |
cb2 | (out) Processing completion callback user parameter 2 |
- Return values:
-
NULL | Memory allocation failed |
x | Pointer to allocated memory |
RBM_allocITC() is a courtesy entry point, compatible with the signature for an ITC "abstract memory allocator". In keeping with ITC's planned usage, this is an allocation without wait. The callback is set up to simply free the memory. rtn is set to RBM_freeITC(), cb0 is set to the ring control block rcb, cb1 is set to the number of bytes allocated. cb2 is unused. |
Here is the call graph for this function:
void * RBM_allocW |
( |
RBM_Ring * |
rcb, |
|
|
unsigned int |
siz, |
|
|
unsigned int * |
status |
|
) |
|
|
|
Allocate a packet from a managed ring buffer.
- Parameters:
-
rcb | (in) Ring buffer manager control block |
siz | (in) Number of bytes to allocate |
status | (out) Completion status (pointer can be NULL) |
- Return values:
-
NULL | Memory allocation failed |
x | Pointer to allocated memory |
Values returned through status parameter
- Return values:
-
RBM_RINGDRY | No memory left in ring to satisfy allocation |
RBM_RINGPTR | Ring control block pointer invalid |
RBM_RINGSTAT | Ring control block not in state started |
RBM_RINGSIZE | Ring not big enough |
RBM_SUCCESS | Success |
RBM_alloc() allocates a memory packet from an RBM memory ring with infinite pending. |
Here is the call graph for this function:
void * RBM_allocW_toc |
( |
RBM_Ring * |
rcb, |
|
|
unsigned int |
siz, |
|
|
const TOC * |
toc, |
|
|
unsigned int * |
status |
|
) |
|
|
|
Allocate a packet from a managed ring buffer.
- Parameters:
-
rcb | (in) Ring buffer manager control block |
siz | (in) Number of bytes to allocate |
toc | (in) Time-out control |
status | (out) Completion status (pointer can be NULL) |
- Return values:
-
NULL | Memory allocation failed |
x | Pointer to allocated memory |
Values returned through status parameter
- Return values:
-
RBM_RINGDRY | No memory left in ring to satisfy allocation |
RBM_RINGPTR | Ring control block pointer invalid |
RBM_RINGSTAT | Ring control block not in state started |
RBM_RINGSIZE | Ring not big enough |
RBM_SUCCESS | Success |
RBM_allocW_toc() allocates a memory packet from an RBM memory pring. This is the most general entry point, providing both timeout control and an explanation in case of failure (via the status parameter). For simpler applications that don't require timeout control, the entry points RBM_alloc() and RBM_allocW() are more appropriate. |
Here is the call graph for this function:
unsigned int RBM_free |
( |
RBM_Ring * |
rcb, |
|
|
void * |
pkt, |
|
|
unsigned int |
siz |
|
) |
|
|
|
Free memory back to a managed ring buffer.
- Parameters:
-
rcb | (in) Ring buffer manager control block |
pkt | (in) Pointer to memory to free |
siz | (in) Length of memory to free |
- Return values:
-
RBM_RINGMISS | Packet pointer not valid in this ring |
RBM_RINGPTR | Ring control block pointer invalid |
RBM_SUCCESS | Success |
RBM_free() frees a packet back to a managed ring buffer. |
Here is the call graph for this function:
void RBM_freeITC |
( |
void * |
pkt, |
|
|
unsigned int |
status, |
|
|
void * |
prm0, |
|
|
void * |
prm1, |
|
|
void * |
prm2 |
|
) |
|
|
|
Free memory packet (ITC courtesy entry point).
- Parameters:
-
pkt | (in) Memory to free |
status | (in) Processing completion status (ignored) |
prm0 | (out) Processing completion callback user parameter 0 |
prm1 | (out) Processing completion callback user parameter 1 |
prm2 | (out) Processing completion callback user parameter 2 |
RBM_freeITC() is a courtesy entry point, compatible with the signature for an ITC "processing completion routine". In keeping with ITC's planned usage, this simply a memory free (processing completion status is ignored). |
Here is the call graph for this function:
Generated on Thu Mar 24 20:33:56 2005 by
1.3.3