GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> TRD / V0-0-1 > trd / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

TRD_database.c File Reference

Facilities to save/restore a TRD (turbo-reset database) database. More...

#include <string.h>
#include <CAB/CAB_lookupPub.h>
#include <MDB/MDB_pubdefs.h>
#include <PBI/PTR.h>
#include <PBS/FFS.ih>
#include <PBS/MTX.h>
#include <TRD/TRD_msgs.h>
#include <ZLIB/zlib.h>
#include <TRD_prvdefs.h>

Defines

#define MEMMAP_BHDR_BASE_OFFSET   (0x00000000)
#define MEMMAP_BHDR_SIZE   (256)
#define MEMMAP_BHDR_RESET_PTR_OFFSET   (0x00000024)
#define MEMMAP_BHDR_RESET_SIZE_OFFSET   (0x00000028)
#define TFFS_PHYSICAL_READ   (0)
#define TFFS_PHYSICAL_WRITE   (0)
#define OK   (0)

Functions

unsigned int TRD_databaseRead (unsigned int vol)
 Read the TRD database from non-volatile memory and execute.
unsigned int TRD_databaseWrite (unsigned int vol)
 Write the TRD database to non-volatile memory.
int TRD_fakeTffsRawio (int tffsDriveNo, int functionNo, int arg0, int arg1, int arg2)
 TFFS raw IO routine (pure fakery for use on unix hosts).
unsigned int TRD_databaseSpace (TRD_Control *tcb, unsigned int vol, unsigned int *off, unsigned int *siz)
 Identify save/restore space in EEPROM.


Detailed Description

Facilities to save/restore a TRD (turbo-reset database) database.

CVS $Id: TRD_database.c,v 1.2 2011/03/28 21:41:07 apw Exp $
Author:
A.P.Waite
TRD_database.c provides facilities to save and restore a TRD (turbo-reset database). For environments lacking a SIB, this code will go through the motions, but it will not attempt to actually save/restore a database via non-volatile (EEPROM) memory.

Function Documentation

unsigned int TRD_databaseRead ( unsigned int  vol  ) 

Read the TRD database from non-volatile memory and execute.

Parameters:
vol (in) TFFS volume. Must be either 2 (/mm0) or 3 (/mm1)
TRD_databaseRead() reads back and executes a TRD database.

References _TRD_BufferHeader::acs, _TRD_Row::buf, _TRD_Control::buf, _TRD_RowHeader::fmt, _TRD_BufferHeader::frm, _TRD_Row::hdr, _TRD_RowHeader::len, _TRD_BufferHeader::len, _TRD_Control::mtx, _TRD_RowHeader::off, _TRD_Control::sib, _TRD_Control::state, TRD_CTL_INITIALIZED, TRD_databaseSpace(), and TRD_tcb.

unsigned int TRD_databaseSpace ( TRD_Control tcb,
unsigned int  vol,
unsigned int *  off,
unsigned int *  siz 
)

Identify save/restore space in EEPROM.

Parameters:
tcb (in) TRD control block
vol (in) EEPROM bank (/mm0, /mm1 convention)
off (out) Offset to database in EEPROM
siz (out) Maximum allowed size of database in EEPROM
TRD_databaseSpace() identifies save/restore space in EEPROM.
Parameters:
vol TRD control block
off EEPROM bank (/mm0, /mm1 convention)
siz Offset to database in EEPROM Maximum size of database in EEPROM

References _TRD_Control::sib, and TRD_fakeTffsRawio().

Referenced by TRD_databaseRead(), and TRD_databaseWrite().

unsigned int TRD_databaseWrite ( unsigned int  vol  ) 

int TRD_fakeTffsRawio ( int  tffsDriveNo,
int  functionNo,
int  arg0,
int  arg1,
int  arg2 
)

TFFS raw IO routine (pure fakery for use on unix hosts).

Parameters:
tffsDriveNo (in) (Fake) Drive number
functionNo (in) (Fake) Function number
arg0 (in) (Fake) Argument 0
arg1 (in) (Fake) Argument 1
arg2 (in) (Fake) Argument 2
Parameters:
functionNo TrueFFS drive number
arg0 TrueFFS function code
arg1 Argument 0
arg2 Argument 1 Argument 2

Referenced by TRD_databaseSpace(), and TRD_initialize().


Generated on Tue Nov 29 17:10:11 2011 by  doxygen 1.5.8