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  

FPM_memory.c File Reference

Memory allocation/free routines for an FPM memory pool. More...

#include "PBS/FFS.ih"
#include "PBS/FPA.h"
#include "PBS/RW.ih"
#include "MSG/MSG_pubdefs.h"
#include "IMM/FPM_pubdefs.h"
#include "IMM/FPM_msgs.h"
#include "FPM_prvdefs.h"

Include dependency graph for FPM_memory.c:

Include dependency graph

Functions

void * FPM_allocAny (unsigned int typ, FPM_Pool *pcb, unsigned int siz, const TOC *toc, unsigned int *status)
 Allocate a packet from an FPM memory pool.

void FPM_freeITC (void *pkt, unsigned int status, void *prm0, void *prm1, void *prm2)
 Free memory packet (ITC courtesy entry point).

void * FPM_alloc (FPM_Pool *pcb, unsigned int siz, unsigned int *status)
 Allocate a packet from an FPM memory pool.

void * FPM_allocITC (FPM_Pool *pcb, unsigned int siz, void **rtn, void **cb0, void **cb1, void **cb2)
 Allocate memory packet without timeout (ITC courtesy entry point).

void * FPM_allocW (FPM_Pool *pcb, unsigned int siz, unsigned int *status)
 Allocate a packet from an FPM memory pool.

void * FPM_allocW_toc (FPM_Pool *pcb, unsigned int siz, const TOC *toc, unsigned int *status)
 Allocate a packet from an FPM memory pool.

unsigned int FPM_free (FPM_Pool *pcb, void *pkt)
 Free a packet back to an FPM memory pool.


Detailed Description

Memory allocation/free routines for an FPM memory pool.

CVS $Id: FPM_memory.c,v 1.2 2005/03/25 01:01:41 apw Exp $
Author:
A.P.Waite
FPM_memory.c provides the memory allocation and free routines for FPM.

Function Documentation

void * FPM_alloc FPM_Pool pcb,
unsigned int  siz,
unsigned int *  status
 

Allocate a packet from an FPM memory pool.

Parameters:
pcb (in) Memory pool 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:
FPM_POOLDRY No packets left in pool to satisfy allocation
FPM_POOLPTR Pool control block pointer invalid
FPM_POOLSTAT Pool control block not in state started
FPM_POOLSIZE Pool has no allocator big enough
FPM_SUCCESS Success
FPM_alloc() allocates a memory packet from an FPM memory pool without pending.

Here is the call graph for this function:

void * FPM_allocAny unsigned int  typ,
FPM_Pool pcb,
unsigned int  siz,
const TOC *  toc,
unsigned int *  status
 

Allocate a packet from an FPM memory pool.

Parameters:
typ (in) Type of allocation (what pending style)
pcb (in) Memory pool 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:
FPM_POOLDRY No packets left in pool to satisfy allocation
FPM_POOLPTR Pool control block pointer invalid
FPM_POOLSTAT Pool control block not in state started
FPM_POOLSIZE Pool has no allocator big enough
FPM_SUCCESS Success
FPM_allocAny() is the general purpose routine underlying the different pending style calls (FPM_alloc(), FPM_allocW() and FPM_allocW_toc()).

Here is the call graph for this function:

void * FPM_allocITC FPM_Pool pcb,
unsigned int  siz,
void **  rtn,
void **  cb0,
void **  cb1,
void **  cb2
 

Allocate memory packet without timeout (ITC courtesy entry point).

Parameters:
pcb (in) Memory pool 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
FPM_alloc() 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 FPM_freeITC() and cb0 is set to the pool control block pcb. Other callback parameters are set to NULL.

Here is the call graph for this function:

void * FPM_allocW FPM_Pool pcb,
unsigned int  siz,
unsigned int *  status
 

Allocate a packet from an FPM memory pool.

Parameters:
pcb (in) Memory pool 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:
FPM_POOLDRY No packets left in pool to satisfy allocation
FPM_POOLPTR Pool control block pointer invalid
FPM_POOLSTAT Pool control block not in state started
FPM_POOLSIZE Pool has no allocator big enough
FPM_SUCCESS Success
FPM_allocW() allocates a memory packet from an FPM memory pool with infinite pending.

Here is the call graph for this function:

void * FPM_allocW_toc FPM_Pool pcb,
unsigned int  siz,
const TOC *  toc,
unsigned int *  status
 

Allocate a packet from an FPM memory pool.

Parameters:
pcb (in) Memory pool 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:
FPM_POOLDRY No packets left in pool to satisfy allocation
FPM_POOLPTR Pool control block pointer invalid
FPM_POOLSTAT Pool control block not in state started
FPM_POOLSIZE Pool has no allocator big enough
FPM_SUCCESS Success
FPM_allocW_toc() allocates a memory packet from an FPM memory pool. 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 FPM_alloc() and FPM_allocW() are more appropriate.

Here is the call graph for this function:

unsigned int FPM_free FPM_Pool pcb,
void *  pkt
 

Free a packet back to an FPM memory pool.

Parameters:
pcb (in) Memory pool control block
pkt (in) Packet to free
Return values:
FPM_POOLMISS Packet pointer not valid in this pool
FPM_POOLPTR Pool control block pointer invalid
FPM_SUCCESS Success
FPM_free() frees a packet back to an FPM memory pool. By a not so strange coincidence, it also has the correct signature for use as an ITC memory free routine.

Here is the call graph for this function:

void FPM_freeITC void *  pkt,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2
 

Free memory packet (ITC courtesy entry point).

Parameters:
pkt (in) Packet 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
FPM_free() 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:18 2005 by doxygen 1.3.3