GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FBS / V0-3-1 > fbs_rtos / linux-gcc
#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 <PBI/PTR.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 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. |
CVS $Id: FBS_load.c.ux-xxx-xxx,v 1.6 2011/03/24 21:24:42 apw Exp $
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()).
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 |
FBS_LOADFAIL | Load module failed | |
FBS_OPENTEMP | Open of temporary file failed | |
FBS_SUCCESS | Success |
References FBS_mtx__create(), FBS_mtx__destroy(), FBS_mtx__lock(), FBS_mtx__unlock(), FILE_close(), FILE_getKey(), FILE_open(), and FILE_S_NOHED.
Referenced by FILE_loadModuleByName().
unsigned int FILE_loadModuleByID | ( | unsigned int | id, | |
int | sym, | |||
void ** | mod | |||
) |
Load a FSW code module by file ID.
id | (in) File ID | |
sym | (in) Symbol loading flag (conventional VxWorks definition) | |
mod | (out) Module handle (note 1) |
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.
nam | (in) File name | |
sym | (in) Symbol loading flag (note 1) | |
mod | (out) Module handle (note 2) |
mode
flag to a dlopen()
call.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).
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) |
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 |