GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > FBS / V0-2-0

Constituent: fbs_rtos     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

FBS_load.c.ux-xxx-xxx File Reference

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

#include <dlfcn.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include "CMX/CMX_asBuiltPub.h"
#include "PBS/INT.ih"
#include "FBS/FBS_pubrtos.h"
#include "FBS/FBS_msgs.h"
#include "MDB/MDB_pubdefs.h"
#include "FBS_mtx.ih"

Include dependency graph for FBS_load.c.ux-xxx-xxx:

This graph shows which files directly or indirectly include this file:


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 Unix dlopen()).
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

const char mksname [] = { "/tmp/loadModuleXXXXXX" }
 Template of a name to pass to mkstemp().
static FBS_mti mti
 Instance of (storage for) mutex (only used in Unix).
static volatile FBS_mtx mtx
 Mutex to enforce serial open/close/delete operations on a single file.

Detailed Description

Universal file loader for FSW files (unix implementation).

CVS $Id: FBS_load.c.ux-xxx-xxx,v 1.4 2005/11/17 01:27:19 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 Unix dlopen()).

Parameters:
id (in) File ID
nam (in) File name
sym (in) dlopen() mode flag
mod (out) Module handle
dat (out) Pointer to location to return additional error information
Return values:
FBS_LOADFAIL Load module failed
FBS_OPENTEMP Open of temporary file failed
FBS_SUCCESS Success

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

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

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.


Generated on Wed Nov 16 20:49:41 2005 by  doxygen 1.4.4