GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EMP / V1-2-0
Constituent: asc     Tag: mv2304
#include "EMP/LSD_sdi.h"
#include "EMP/ASC.h"
#include "EMP/ASC_ids.h"
#include "EMP/ASC_ascCtb.h"
#include "EMP/ASC_ascBdy.h"
#include "EMP/EMP_hdrdefs.h"
#include "EMP/EMP_tlmdefs.h"
#include "EMP/EMP_write.h"
#include "EMP_hdr.h"
#include "EMP/ASC_statsdefs.h"
#include "EMP/EMP_msgs.h"
#include "EMP_DB/ASC_DB_schema.h"
#include "EDS_DB/EDS_DB_schema.h"
#include "EDS/EDS_fw.h"
#include "EDS/EBF_evt.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_gem.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_gemLocate.h"
#include "EDS/EDR_acdUnpack.h"
#include "EDS/FFS.h"
#include "LSF/LSF.h"
#include "LSF/LSF_ids.h"
#include "LSF/LSF_reason.h"
#include "ITC/ITC_pubdefs.h"
#include "ZLIB/zlib.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/TMR.h"
#include "PBS/MBA.h"
#include "PBS/FPA.h"
#include "PBS/WUT.h"
#include "PBS/WUT_tmr.h"
#include "PBS/FORK.h"
#include "PBS/PTS.h"
#include <string.h>
Include dependency graph for ASC_eds.c:
Data Structures | |
struct | _OutputMessage |
This is a buffer with a header large enough to hold the control information to both store this on the FPA free que and post it to an output FORK que. The body of the message is the buffer for the output datagram. More... | |
struct | _Prescaler |
Prescaler control structure. More... | |
struct | _LastEvent |
Information about the last event in the previous packet. This used to seed the begin information of the next packet. More... | |
struct | _FlushMessage |
Flush fork message structure. More... | |
struct | _Flush |
Flush control structure. More... | |
struct | _ASC |
The control structure for an ASC process. More... | |
Defines | |
#define | TRACE_PUT(xx, yy) |
#define | ASC_VER_K_DATAGRAM 0 |
The version of the ASC datagram that is being produced. | |
#define | NUM_COUNTER_BUFFS 3 |
Number of messages to accumulate histograms in. | |
#define | RND_TO(_v, _r) (((_v) + (_r) - 1) & ~((_r) - 1)) |
Rounds the specified value up to the _r. _r must be a binary power of 2. | |
Typedefs | |
typedef _OutputMessage | OutputMessage |
Typedef for struct _OutputMessage. | |
typedef _Prescaler | Prescaler |
Typedef for struct _Prescaler. | |
typedef _LastEvent | LastEvent |
Typedef for struct _LastEvent. | |
typedef _FlushMessage | FlushMessage |
Typedef for struct _FlushMessage. | |
typedef int(* | FlushDeliverRtn )(void *ctx, FORK_cb_rtn rtn, FORK_msg_hdr *msg) |
Signature of routine to deliver a flush message. | |
typedef _Flush | Flush |
Typedef for struct _Flush. | |
typedef _ASC | ASC |
Typedef for struct _ASC. | |
Functions | |
static unsigned int | AscEdsSizeof (const void *db, void *prm) |
This is the EDS service to return the size of the context structure. | |
static const EDS_fwHandlerServices * | AscEdsConstruct (ASC *asc, const ASC_DB_Schema *db, ASC_handlerConstructCfg *cfg, EDS_fw *edsFw) |
This is the EDS constructor for ASC. It's name is supplied to the caller via the ASC_constructServicesGet routine. | |
static int | AscEdsDestruct (ASC *asc) |
The EDS destructor service. | |
static unsigned int | AscEdsObjectsGet (ASC *asc) |
The EDS Objects Get service. This returns a bit mask of the objects managed EDS that ASC requires. | |
static unsigned int | AscEdsNeedsGet (ASC *asc) |
The EDS Needs Get service. | |
static int | AscEdsFlush (ASC *asc, int reason) |
The EDS flush service. | |
static unsigned int | AscEdsProcess (ASC *asc, unsigned int pktBytes, EBF_pkt *pkt, EBF_siv siv, EDS_fwIxb *ixb, int id) |
The EDS Event Processing Service. | |
static int | CompressIt (z_stream *zstream, void *dst, int dstLen, void *src, int srcLen) |
Utility function to call the ZLIB deflate routine. | |
static unsigned int | output (ASC *asc, OutputMessage *msg) |
The datagram output routine. This is a FORK service callback routine. | |
static unsigned int | forkExit (ASC *asc, OutputMessage *msg) |
Forces the FORK task to exit. | |
static void | initMsg (void *unused, OutputMessage *msg, int msg_size, int pcb_offset) |
This is the FPA initialization callback routine used to initialize each packet in the FPA pool. | |
const EDS_DB_HandlerConstructServices * | ASC_constructServicesGet (ASC_handlerConstructCfg *cfg) |
Routine called by LPA (via EMP_DB) to get constructionr info for ASC. | |
static __inline FPA_fcb * | createFpaPool (int cnt) |
Creates the FPA pool used to hold the input message packets. | |
static __inline unsigned int | createOutputTask (ASC *asc) |
static __inline ASC_ascBdy_Raw0 * | get_packet (ASC *asc) |
Returns a pointer to the packet to be filled in. | |
static __inline void | set_aem (EBF_dir *dir, EBF_pkt *pkt, unsigned int pktBytes) |
Locates the AEM data without doing a full directory. The pointer to the AEM contribution is stashed away in the EBF directory structure. This is a little sleazy, but that's where EDR_acdUnpack expects to find it. | |
static void * | zlibMalloc (void *arg, unsigned int nitems, unsigned int size) |
Callback function used by ZLIB to allocate memory. | |
static void | zlibFree (void *arg, void *address) |
Callback function used by ZLIB to free memory. | |
static unsigned int | zlibInitStream (z_stream *stream, int level) |
Does the one time initialization of the compression stream. | |
int | flush_forward (void *lcb, FlushMessage *msg) |
Executes in the context of the event handling task. | |
WUT_cb_status | flush_tmr (ASC *asc, WUT_tmr *tmr) |
This is the timer ISR flush routine. | |
static __inline void | dgmComplete (LSF_datagram *dgm, ASC *asc, unsigned int payloadSize, unsigned int bridge) |
Completes the datagram header information. | |
Variables | |
static const unsigned char | OpenReasons [16] |
Maps a closing reason into its complimentary open reason. |
JJRussell- russell@slac.stanford.edu
CVS $Id: ASC_eds.c,v 1.5 2006/03/01 01:44:42 russell Exp $
|
Number of messages to accumulate histograms in. Processing in fork takes about 300mSec for compress,clear, and output Since buffers will be switched after maybe 10sec, double buffer would probably work but 3 are specified for safety |
|
Rounds the specified value up to the _r. _r must be a binary power of 2.
|
|
Signature of routine to deliver a flush message.
|
|
Routine called by LPA (via EMP_DB) to get constructionr info for ASC.
|
|
This is the EDS constructor for ASC. It's name is supplied to the caller via the ASC_constructServicesGet routine.
|
|
The EDS destructor service.
|
|
The EDS flush service.
|
|
The EDS Needs Get service.
|
|
The EDS Objects Get service. This returns a bit mask of the objects managed EDS that ASC requires.
|
|
The EDS Event Processing Service.
|
|
This is the EDS service to return the size of the context structure.
|
|
Utility function to call the ZLIB deflate routine.
|
|
Creates the FPA pool used to hold the input message packets.
|
|
|
|
Completes the datagram header information.
|
|
Executes in the context of the event handling task.
|
|
This is the timer ISR flush routine.
|
|
Forces the FORK task to exit.
|
|
Returns a pointer to the packet to be filled in.
|
|
This is the FPA initialization callback routine used to initialize each packet in the FPA pool.
|
|
The datagram output routine. This is a FORK service callback routine.
|
|
Locates the AEM data without doing a full directory. The pointer to the AEM contribution is stashed away in the EBF directory structure. This is a little sleazy, but that's where EDR_acdUnpack expects to find it.
|
|
Callback function used by ZLIB to free memory.
|
|
Does the one time initialization of the compression stream.
|
|
Callback function used by ZLIB to allocate memory.
|
|
Initial value: { LSF_REASON_OPEN_K_START, LSF_REASON_OPEN_K_START_OP, LSF_REASON_OPEN_K_AUTO_TIME, LSF_REASON_OPEN_K_AUTO_COUNT, LSF_REASON_OPEN_K_START, LSF_REASON_OPEN_K_START_OP, LSF_REASON_OPEN_K_START_AUTO, LSF_REASON_OPEN_K_START, LSF_REASON_OPEN_K_RESUME, LSF_REASON_OPEN_K_RESUME_OP, LSF_REASON_OPEN_K_RESUME_AUTO, LSF_REASON_OPEN_K_AUTO, LSF_REASON_OPEN_K_AUTO_MODE, LSF_REASON_OPEN_K_AUTO_TIME, LSF_REASON_OPEN_K_AUTO_COUNT, LSF_REASON_OPEN_K_AUTO_FULL }
|