GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FBS / dev > fbs_swap / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

FBS_pubrtos.h File Reference

Public definitions for FBS facilities built into the RTOS. More...

#include <stdio.h>
#include <sys/types.h>

Classes

struct  _SIB_Info
 Contains address and size information about the various SIB board memory and register regions. More...

Defines

#define FILE_HDR_NAME_SIZE   (8)
 The size in bytes of the file name contained in a file header.
#define FILE_M_MODULE   ( 0x02000000 )
 Module number in the errno sense.
#define FILE_S_SUCCESS   ( FILE_M_MODULE | 0x0000 )
 File opened successfully (not a read-only request).
#define FILE_S_NOHED   ( FILE_M_MODULE | 0x0004 )
 File opened successfully (no FSW header found).
#define FILE_S_HEDNOCMP   ( FILE_M_MODULE | 0x0008 )
 File opened successfully (FSW header found, file not compressed).
#define FILE_S_HEDCMP   ( FILE_M_MODULE | 0x000c )
 File opened successfully (FSW header found, file compressed).
#define FILE_E_CORRUPT   ( FILE_M_MODULE | 0x0003 )
 File open failed (the adler32 checksum of the body failed).
#define FILE_E_NOMKDIR   ( FILE_M_MODULE | 0x0007 )
 File open failed (could not create directory for temporary file).
#define FILE_E_NOSLOT   ( FILE_M_MODULE | 0x000b )
 File open failed (no more slots to store temporary file info).
#define FILE_E_NOTMPOPN   ( FILE_M_MODULE | 0x000f )
 File open failed (could not open temporary file).
#define FILE_E_NOINFLAT   ( FILE_M_MODULE | 0x0013 )
 File open failed (inflation step failed).
#define FILE_E_NOREOPEN   ( FILE_M_MODULE | 0x0017 )
 File open failed (could not reopen temporary file read-only).
#define FILE_E_MMAPMODE   ( FILE_M_MODULE | 0x001b )
 Open mode read/write not supported for memory mapped files.
#define FILE_E_MMAPNAME   ( FILE_M_MODULE | 0x001f )
 Not a recognized memory mapped file name.
#define FILE_E_MMAPNOT   ( FILE_M_MODULE | 0x0023 )
 Requested memory mapped file not available on this system.
#define FILE_E_MMAPOPEN   ( FILE_M_MODULE | 0x0027 )
 Requested memory mapped file already open.
#define FILE_E_MMAPLOST   ( FILE_M_MODULE | 0x002b )
 Cannot locate memory mapped file through SIB directory.
#define FILE_E_MMAPHEAD   ( FILE_M_MODULE | 0x002f )
 Memory mapped file does not start with a valid header.
#define FILE_E_MMAPNOOP   ( FILE_M_MODULE | 0x0033 )
 Create and delete operations not supported.
File Device Definitions


#define FILE_L_MEM_DEVICES   (3)
#define FILE_L_MEM_FILES   (3)
#define FILE_DEV_NAME_BOOT   "/boot"
#define FILE_DEV_NAME_RAM   "/ram"
#define FILE_DEV_NAME_EE0   "/ee0"
#define FILE_DEV_NAME_EE1   "/ee1"
#define FILE_DEV_NAME_MEM   "/mem"
#define FILE_DEV_NAME_MM0   "/mm0"
#define FILE_DEV_NAME_MM1   "/mm1"
#define FILE_DEV_NUM_BOOT   (0)
#define FILE_DEV_NUM_RAM   (1)
#define FILE_DEV_NUM_EE0   (2)
#define FILE_DEV_NUM_EE1   (3)
#define FILE_DEV_NUM_MEM   (4)
#define FILE_DEV_NUM_MM0   (5)
#define FILE_DEV_NUM_MM1   (6)
#define FILE_DEV_NUM_USR   (7)
File Device Definitions (deprecated)


#define FILE_DEV_NAME_TMP   "/tmp"
#define FILE_DEV_NUM_TMP   (7)
File ID Utility Macros


#define FILE_ID_M_DEV   (0xe0000000)
#define FILE_ID_M_DIR   (0x1fc00000)
#define FILE_ID_M_FILE   (0x003fffff)
#define FILE_ID_S_DEV   (29)
#define FILE_ID_S_DIR   (22)
#define FILE_ID_S_FILE   (0)
#define FILE_ID_TO_NUM(_id, _dev, _dir, _file)
 Translates a file ID word into component numbers.
#define FILE_NUM_TO_ID(_id, _dev, _dir, _file)
 Translates file component numbers to an ID word.
File Path Utility Macros


#define FILE_PATH_STR_SIZE   (24)
 The number of bytes needed to hold a system file path string.
#define FILE_PATH_STR_SIZE_USR   (256)
 The number of bytes needed to hold a user-defined file path string.
#define FILE_ID_TO_PATH(_str, _dev, _dir, _file)
 Translates file component numbers to an ASCII path name.

Typedefs

typedef enum _FILE_Hdr_Version FILE_Hdr_Version
 Typedef for enum _FILE_Hdr_Version.
typedef enum
_FILE_Hdr_Compression_Flag 
FILE_Hdr_Compression_Flag
 Typedef for enum _FILE_Hdr_Compression_Flag.
typedef struct _SIB_Info SIB_Info
 Typedef for struct _SIB_Info.

Enumerations

enum  _FILE_Hdr_Version {
  FILE_HDR_VERSION_1 = 0x2000,
  FILE_HDR_VERSION_2 = 0x4000
}
 The file header version enumeration. Tracks format changes. More...
enum  _FILE_Hdr_Compression_Flag {
  FILE_HDR_UNCOMPRESSED = 0x0000,
  FILE_HDR_COMPRESSED = 0x1000
}
 The file header compression flag values. More...

Functions

File Manipulation Functions


unsigned int FILE_check (const char *fil, unsigned int *key, unsigned short *typ)
int FILE_close (int fd)
unsigned int FILE_decodePrimary (unsigned char *buf, unsigned int cnt, unsigned int *ver, unsigned int *cmp, unsigned short *typ, unsigned int *key, unsigned int *fcs, unsigned int *len)
unsigned int FILE_getCompression (int fd)
unsigned int FILE_getKey (int fd)
const char * FILE_getMemDeviceName (unsigned int ddx)
const char * FILE_getMemFileName (unsigned int fdx)
int FILE_getName (int fd, char *nam, unsigned int len)
unsigned int FILE_getSize (int fd)
unsigned short FILE_getType (int fd)
unsigned int FILE_getVersion (int fd)
unsigned int FILE_hdrCreate (void *buf, unsigned int length, unsigned int time, unsigned int chksum, unsigned short type, unsigned int key, FILE_Hdr_Compression_Flag compress, const char *name)
unsigned int FILE_hdrGetChksum (const void *buf, unsigned int *chksum)
unsigned int FILE_hdrGetCompression (const void *buf, unsigned short *compress)
unsigned int FILE_hdrGetKey (const void *buf, unsigned int *key)
unsigned int FILE_hdrGetLength (const void *buf, unsigned int *length)
unsigned int FILE_hdrGetName (const void *buf, char *name)
unsigned int FILE_hdrGetTime (const void *buf, unsigned int *time)
unsigned int FILE_hdrGetType (const void *buf, unsigned short *type)
unsigned int FILE_hdrSizeof (void)
unsigned int FILE_hdrVerify (const void *buf)
int FILE_open (const char *fil, int flg, mode_t mod)
Module Loading Functions


unsigned int FILE_loadModuleByID (unsigned int id, int sym, void **mod)
unsigned int FILE_loadModuleByName (const char *nam, int sym, void **mod)
unsigned int FILE_loadModuleSecondary (unsigned int id, int sym, void **mod, unsigned int *dat)
File ID, Name and Path Manipulation Functions


unsigned int FILE_pathInit (const char *usrName5, const char *usrName6)
unsigned int FILE_pathSizeof (void)
unsigned int FILE_pathIdToNum (unsigned int id, unsigned int *dev, unsigned int *dir, unsigned int *file)
unsigned int FILE_pathNumToId (unsigned int *id, unsigned int dev, unsigned int dir, unsigned int file)
unsigned int FILE_pathIdToPath (unsigned int id, char *str)
unsigned int FILE_pathPathToId (const char *nam)
TFFS and RAM Disk Functions


unsigned int FILE_sysMemMount (void)
unsigned int FILE_sysRamCreate (void *addr, int size)
unsigned int FILE_sysTffsMount (int drv)
unsigned int FILE_sysTffsFormat (int drv, unsigned int offset)
unsigned int FILE_sysTffsCheck (int drv)
unsigned int FILE_sysTffsRepair (int drv)


Detailed Description

Public definitions for FBS facilities built into the RTOS.

CVS $Id: FBS_pubrtos.h,v 1.5 2011/03/24 21:24:42 apw Exp $
Author:
A.P.Waite

Define Documentation

#define FILE_ID_TO_NUM ( _id,
_dev,
_dir,
_file   ) 

Value:

{                                                               \
    *(_dev)  = (((_id) & FILE_ID_M_DEV ) >> FILE_ID_S_DEV );    \
    *(_dir)  = (((_id) & FILE_ID_M_DIR ) >> FILE_ID_S_DIR );    \
    *(_file) = (((_id) & FILE_ID_M_FILE) >> FILE_ID_S_FILE);    \
}
Translates a file ID word into component numbers.

Parameters:
_id The file ID word
_dev Storage for the device number
_dir Storage for the directory number
_file Storage for the file number

#define FILE_ID_TO_PATH ( _str,
_dev,
_dir,
_file   ) 

Value:

snprintf((_str), FILE_PATH_STR_SIZE, "%s/d%03u/f%07u", \
                                 (_dev), (_dir), (_file));
Translates file component numbers to an ASCII path name.

Parameters:
_str Storage for the path string
_dev The device name
_dir The directory number
_file The file number

#define FILE_NUM_TO_ID ( _id,
_dev,
_dir,
_file   ) 

Value:

{                                                               \
    *(_id)  = (((_dev)  << FILE_ID_S_DEV ) & FILE_ID_M_DEV );   \
    *(_id) |= (((_dir)  << FILE_ID_S_DIR ) & FILE_ID_M_DIR );   \
    *(_id) |= (((_file) << FILE_ID_S_FILE) & FILE_ID_M_FILE);   \
}
Translates file component numbers to an ID word.

Parameters:
_id Storage for the file ID word
_dev The device number
_dir The directory number
_file The file number


Enumeration Type Documentation

The file header compression flag values.

Enumerator:
FILE_HDR_UNCOMPRESSED  File data is not ZLIB compressed.
FILE_HDR_COMPRESSED  File data is ZLIB compressed.

The file header version enumeration. Tracks format changes.

Enumerator:
FILE_HDR_VERSION_1  Original format. Obsolete
FILE_HDR_VERSION_2  Current format.


Generated on Thu Mar 24 15:03:31 2011 by  doxygen 1.5.8