GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / dev > pbs / mv2304
#include <stdio.h>
#include <vxWorks.h>
#include <sysLib.h>
#include <memPartLib.h>
#include <PBI/impl/ASM.h.xx-ppc-gcc>
Functions | |
static PART_ID | mba_create (const MBA_badBlock *list) |
Creates the memory partition, taking into account a list of bad blocks. | |
static PART_ID | mba_add (PART_ID part_id, unsigned char *beg, unsigned char *end) |
Creates (if part_id is NULL) or adds to the specified memory partition. | |
int | MBA_initialize (MBA_create_cb create, void *prm) |
One time initialization of the MBA facility. | |
void * | MBA_align (unsigned int alignment, unsigned int nBytes) |
Allocates nBytes of aligned memory. | |
void * | MBA_alloc (unsigned int nBytes) |
Allocates nBytes of at least word aligned memory. | |
int | MBA_free (void *pBlock) |
Frees a piece of memory allocated with either MBA_align() or MBA_alloc(). | |
int | MBA_statsGet (MBA_stats *stats) |
Gets the memory stats for the MBA partition. | |
Variables | |
static PART_ID | MemPartId = NULL |
The memory partition id used to allocate user memory requests. |
CVS $Id: MBA.c.vx-ppc-gcc,v 1.6 2011/03/24 23:05:47 apw Exp $
static PART_ID mba_add | ( | PART_ID | part_id, | |
unsigned char * | beg, | |||
unsigned char * | end | |||
) | [static] |
Creates (if part_id is NULL) or adds to the specified memory partition.
part_id | The partition id to add to. If NULL, a new partition is created | |
beg | Pointer to the beginning of the memory | |
end | Pointer to the end of the memory (actually, in the usual C sense, one byte past the last byte) |
Referenced by mba_create().
void* MBA_align | ( | unsigned int | alignment, | |
unsigned int | nBytes | |||
) |
Allocates nBytes of aligned memory.
alignment | The alignment factor. This must be a power of 2 | |
nBytes | The number of bytes to allocate |
void* MBA_alloc | ( | unsigned int | nBytes | ) |
Allocates nBytes of at least word aligned memory.
nBytes | The number of bytes to allocate |
Referenced by TASK_create(), TASK_cvt(), and WUT_sys_init().
static PART_ID mba_create | ( | const MBA_badBlock * | list | ) | [static] |
Creates the memory partition, taking into account a list of bad blocks.
list | A list of bad blocks. This may be specified as NULL. |
References _MBA_badBlock::beg, _MBA_badBlock::len, and mba_add().
Referenced by MBA_initialize().
int MBA_free | ( | void * | pBlock | ) |
Frees a piece of memory allocated with either MBA_align() or MBA_alloc().
pBlock | Pointer to the block of memory to be freed. |
0,if | successful | |
-1,if | error |
Referenced by TASK_cvt(), TASK_join(), TASK_rvt(), and WUT_sys_shutdown().
int MBA_initialize | ( | MBA_create_cb | create, | |
void * | prm | |||
) |
One time initialization of the MBA facility.
create | User callback partition creation meant to usurp the default creation routine in an extreme emergency | |
prm | Arbitrary user parameter passed to partition creation routine. If the partition creation routine is specified as NULL, then, if this parameter is treated as a pointer to a list of bad blocks, MBA_badBlock. |
References mba_create(), and MemPartId.
Referenced by PBS_initialize2().
int MBA_statsGet | ( | MBA_stats * | stats | ) |
Gets the memory stats for the MBA partition.
stats | Pointer to the statistics block to fill |
0,if | successful | |
-1,if | error |