GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > test_mba / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

test_mba.c File Reference

Unit test for the Memory Block Allocator (MBA) facility. More...


Detailed Description

Unit test for the Memory Block Allocator (MBA) facility.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id

The MBA facility is FSW's interface to a basic random memory allocator, in the fashion of malloc() or memalign(). For host machines MBA_alloc() and MEM_align() map directly onto these routines. However, for embedded systems the native "C" runtime routines allocate memory from the VxWorks system partition. For technical reasons, only a portion of the total memory available on a typical single board computer (SBC) can be managed within the context of the system partition. The remaining memory must be managed as a separate partition. It is this partition that the MBA facility manages.

The test can be run from the command line by typing

   $ test_mba

A new test, applicable only on the embedded system, tests the bad block facility. There are 3 different test bad block lists, each testing a different boundary condition. Unfortunately, since VxWorks provides no way to destroy a partition, so one must reboot between each test

   # test_mba_badblock badBlockList size

   where badBlockList is an integer 0-2 inclusive
         size         is the size of the test block allocation

The test consists of initializing the MBA partition with a list of bad blocks, then allocating all the available memory in hunks of size. . Each allocated piece of memory is checked to see if any portion of it overlaps with and of the bad blocks.


Generated on Mon Aug 1 14:49:44 2011 by  doxygen 1.5.8