GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MEM / V5-8-2 > mem_unit_test / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

mem_util_pool.h File Reference

Interface to the functions found in mem_util_pool.c. More...

#include <ITC/ITC_pubdefs.h>
#include <mem_unit_test.h>

Functions

void * POOL_alloc (void *prm, unsigned int size, ITC_cb_Completion **free_cb, void **cb_parm_0, void **cb_parm_1, void **cb_parm_2)
 Allocate a packet from the memory pool.
int POOL_init (test_Test_Descriptor *td_p, unsigned int num_pkts, unsigned int pkt_bytes)
 Create the memory pool for packets.
int POOL_shutdown (test_Test_Descriptor *td_p)
 Shutdown the memory pool.


Detailed Description

Interface to the functions found in mem_util_pool.c.

**  CVS $Id: mem_util_pool.h,v 1.2 2011/03/29 01:58:52 apw Exp $
**  

Function Documentation

void* POOL_alloc ( void *  prm,
unsigned int  size,
ITC_cb_Completion **  free_cb,
void **  cb_parm_0,
void **  cb_parm_1,
void **  cb_parm_2 
)

Allocate a packet from the memory pool.

Parameters:
prm Context parm (pointer to test descriptor).
size Size of allocation request, in bytes.
free_cb Location to store pointer to 'free' callback function.
cb_parm_0 Location to store callback parameter 0.
cb_parm_1 Location to store callback parameter 1.
cb_parm_2 Location to store callback parameter 2.
Returns:
Pointer to allocated packet.

References _test_Test_Descriptor::pool_fcb_p, pool_free(), _test_Test_Descriptor::pool_in_use, and _test_Test_Descriptor::pool_pkt_bytes.

Referenced by cmd_send(), TASK_add_queue(), and TASK_init().

int POOL_init ( test_Test_Descriptor td_p,
unsigned int  num_pkts,
unsigned int  pkt_bytes 
)

Create the memory pool for packets.

Parameters:
td_p Pointer to test descriptor.
num_pkts Number of packets to include in the pool.
pkt_bytes Size of each packet in the pool, in bytes.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::pool_buf_p, _test_Test_Descriptor::pool_fcb_p, _test_Test_Descriptor::pool_in_use, _test_Test_Descriptor::pool_pkt_bytes, test_NULL_Compare(), test_Pop_State(), test_Push_State(), and test_Status_Success().

Referenced by mem_unit_test_func().

int POOL_shutdown ( test_Test_Descriptor td_p  ) 

Shutdown the memory pool.

Parameters:
td_p Pointer to test descriptor.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::pool_buf_p, _test_Test_Descriptor::pool_fcb_p, _test_Test_Descriptor::pool_in_use, test_Generic_Error(), test_Pop_State(), test_Push_State(), and test_Value32_Compare().

Referenced by mem_unit_test_func().


Generated on Wed Nov 21 21:09:16 2012 by  doxygen 1.5.8