GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FBS / V0-3-1 > fbs_rtos / rad750


Interface   Data Structures   File List   Data Fields   Globals  

FBS_load.c.vx-xxx-xxx File Reference

Universal file loader for FSW files (VxWorks implementation). More...

#include <loadLib.h>
#include <ioLib.h>
#include <memDrv.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <CMX/CMX_asBuiltPub.h>
#include <PBS/INT.ih>
#include <MDB/MDB_pubdefs.h>
#include <FBS/FBS_pubrtos.h>
#include <FBS/FBS_msgs.h>
#include <ZLIB/zlib.h>
#include <FBS_mtx.ih>

Functions

static unsigned int FILE_loadModule (unsigned int id, const char *nam, int sym, void **mod, unsigned int *dat)
 Load a code module (wrapper for VxWorks loadModule()).
unsigned int FILE_loadModuleByID (unsigned int id, int sym, void **mod)
 Load a FSW code module by file ID.
unsigned int FILE_loadModuleByName (const char *nam, int sym, void **mod)
 Load a FSW code module by file name.
unsigned int FILE_loadModuleSecondary (unsigned int id, int sym, void **mod, unsigned int *dat)
 Load a FSW code module by file ID (special for secondary boot).

Variables

char memDevice [] = { "/mem/loadModule" }
 Name for a memory device.
static FBS_mti mti
 Instance of (storage for) mutex (only used in Unix).
static volatile FBS_mtx mtx
 Mutex to enforce serial load operations with FILE_loadModulexxx.


Detailed Description

Universal file loader for FSW files (VxWorks implementation).

CVS $Id: FBS_load.c.vx-xxx-xxx,v 1.6 2011/03/24 21:24:42 apw Exp $
Author:
A.P.Waite

Function Documentation

static unsigned int FILE_loadModule ( unsigned int  id,
const char *  nam,
int  sym,
void **  mod,
unsigned int *  dat 
) [static]

Load a code module (wrapper for VxWorks loadModule()).

Parameters:
id (in) File ID
nam (in) File name
sym (in) Symbol loading flag (conventional VxWorks definition)
mod (out) Module handle
dat (out) Pointer to location to return additional error information
Return values:
FBS_CSBODY Body checksum mismatch
FBS_IMEMALOC Cannot allocate memory to read module
FBS_LOADFAIL Load module failed
FBS_MEMDVCRE Memory device create failed
FBS_MEMDVOPN Memory device open failed
FBS_NOOPEN Cannot open module
FBS_OMEMALOC Cannot allocate memory to inflate module
FBS_SLURP File length mismatch
FBS_SUCCESS Success
FBS_ZLIBFAIL Inflation failed
FBS_ZLIBINIT Inflation initialization failed

References FBS_mtx__create(), FBS_mtx__destroy(), FBS_mtx__lock(), FBS_mtx__unlock(), and FILE_decodePrimary().

Referenced by FILE_loadModuleByID(), FILE_loadModuleByName(), and FILE_loadModuleSecondary().

unsigned int FILE_loadModuleByID ( unsigned int  id,
int  sym,
void **  mod 
)

Load a FSW code module by file ID.

Parameters:
id (in) File ID
sym (in) Symbol loading flag (conventional VxWorks definition)
mod (out) Module handle (note 1)
Warning:
I can find no rationale for providing this functionality in the unix world, so the unix implementation simply (reports) and returns an error.
Note:
  1. Can be specified as a NULL pointer, in which case nothing is returned. If specified, it is set to the handle returned by VxWorks loadModule().
Return values:
FBS_CSBODY Body checksum mismatch
FBS_IMEMALOC Cannot allocate memory to read module
FBS_LOADFAIL Load module failed
FBS_MEMDVCRE Memory device create failed
FBS_MEMDVOPN Memory device open failed
FBS_NOOPEN Cannot open module
FBS_NOTIMPL Function not implemented (unix only)
FBS_OMEMALOC Cannot allocate memory to inflate module
FBS_SLURP File length mismatch
FBS_SUCCESS Success
FBS_ZLIBFAIL Inflation failed
FBS_ZLIBINIT Inflation initialization failed

References FILE_loadModule(), FILE_PATH_STR_SIZE_USR, and FILE_pathIdToPath().

unsigned int FILE_loadModuleByName ( const char *  nam,
int  sym,
void **  mod 
)

Load a FSW code module by file name.

Parameters:
nam (in) File name
sym (in) Symbol loading flag (note 1)
mod (out) Module handle (note 2)
Note:
  1. For VxWorks, this is the symbol loading control flag in the call to loadModule(). For unix, this is the mode flag to a dlopen() call.
  2. Can be specified as a NULL pointer, in which case nothing is returned. If specified, it is set to the handle returned by VxWorks loadModule().
Return values:
FBS_CSBODY Body checksum mismatch
FBS_IMEMALOC Cannot allocate memory to read module
FBS_LOADFAIL Load module failed
FBS_MEMDVCRE Memory device create failed
FBS_MEMDVOPN Memory device open failed
FBS_NAMENULL Module name is NULL
FBS_NOOPEN Cannot open module
FBS_NOTIMPL Function not implemented (unix only)
FBS_OMEMALOC Cannot allocate memory to inflate module
FBS_SLURP File length mismatch
FBS_SUCCESS Success
FBS_ZLIBFAIL Inflation failed
FBS_ZLIBINIT Inflation initialization failed

References FILE_loadModule(), and FILE_pathPathToId().

unsigned int FILE_loadModuleSecondary ( unsigned int  id,
int  sym,
void **  mod,
unsigned int *  dat 
)

Load a FSW code module by file ID (special for secondary boot).

Parameters:
id (in) File ID
sym (in) Symbol loading flag (conventional VxWorks definition)
mod (out) Module handle (note 1)
dat (out) Return extra information on error (note 2)
Warning:
I can find no rationale for providing this functionality in the unix world, so the unix implementation simply (reports) and returns an error.
Note:
  1. Can be specified as a NULL pointer, in which case nothing is returned. If specified, it is set to the handle returned by VxWorks loadModule().
  2. Can be specified as a NULL pointer, in which case nothing is returned. If specified, a more detailed error code is provided.
Return values:
FBS_CSBODY Body checksum mismatch
FBS_IMEMALOC Cannot allocate memory to read module
FBS_LOADFAIL Load module failed
FBS_MEMDVCRE Memory device create failed
FBS_MEMDVOPN Memory device open failed
FBS_NOOPEN Cannot open module
FBS_NOTIMPL Function not implemented (unix only)
FBS_OMEMALOC Cannot allocate memory to inflate module
FBS_SLURP File length mismatch
FBS_SUCCESS Success
FBS_ZLIBFAIL Inflation failed
FBS_ZLIBINIT Inflation initialization failed
FILE_loadModuleSecondary() is a courtesy entry point for use during a fully automated secondary boot. During this period, errors cannot be reported through standard communications channels (because they haven't been brought up yet), so errors are recorded in the boot diagnostics area for later retrieval by primary boot. To refine the error reporting the boot diagnostics allow an extra parameter to be saved. That is what is brought out through this interface.

References FILE_loadModule(), FILE_PATH_STR_SIZE_USR, and FILE_pathIdToPath().


Generated on Wed Nov 21 17:55:20 2012 by  doxygen 1.5.8