GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBS / V2-10-13

Constituent: test_clear     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

test_clear.c File Reference

Unit test for the PBS_fast_clear routine. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include "PBS/PBS.h"
#include "PBS/TMR.h"
#include "PBS/CACHE.h"

Include dependency graph for test_clear.c:


Defines

#define PBS_fast_clear   PBS_test_fast_clear
 Redefines the fast clear routine on non-PPC platforms.

Functions

unsigned int test_clear (void)
 Main driver for test program, entry point for VxWorks.

Detailed Description

Unit test for the PBS_fast_clear routine.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: test_clear.c,v 1.1 2004/12/07 16:18:03 russell Exp $

PBS_fast_clear is a PPC specific optimization to quickly clear memory using the DBCZ instruction. The memory being cleared must be cacheable. While the routine functions even with the data cache globally disabled, one reaps none of the speed benefits, since in this case the routine just resorts to a generic clear.
The test can be run from the command line by typing

   $ test_clear

Define Documentation

#define PBS_fast_clear   PBS_test_fast_clear
 

Redefines the fast clear routine on non-PPC platforms.

On non-PPC platforms this entry point is redefined to a test routine which emulates the same logic as the version of PBS_fast_clear found on the PPC platform. Without this redefinition, PBS_fast_clear on non-PPC platforms is defined as the usual library function
In this way, both the performance of the library function can be used in application code and the logic can tested in this specialized way.


Function Documentation

unsigned int test_clear void   ) 
 

Main driver for test program, entry point for VxWorks.

Return values:
0,Test succeeded
!=0,Test failed
This tests the fast clear function, both functional and performance aspects. The boundary cases are probed and along with making sure the memory is properly zeroed, guard regions around the test region are checked to make sure they are not zeroed.


Generated on Fri Feb 9 04:06:54 2007 by  doxygen 1.4.4