GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LMC / V0-6-3

Constituent: lmc     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LMC_macro_p.h File Reference

Definition of the macros used in the multiplex counter functions. More...

#include "PBS/WCT.h"
#include "LMC_lem_p.h"
#include "LMC_prvdefs.h"
#include "ITC/ITC_pubdefs.h"

Include dependency graph for LMC_macro_p.h:

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


Defines

#define RESET_CL(LMC)
 Resets command and result control structures.
#define NEXT_CI(CR)   &CR.cl->ci[CR.nci++]
 Pointer to the next command item.
#define NEXT_RI(CR)   &CR.rl->ri[CR.nri++]
 Pointer to the next result item.
#define REQUEST_SIZE(NCI)   ( (sizeof(unsigned) + NCI * sizeof(LEM_ci)) / 8 )
 Size of a request list.
#define Q_ERR_CHECK(NCI, RL)
 Check for transfer or result item errors.
#define CALC_TIME(TS)
 Calculate a timestamp.
#define ALLOC_LISTS(CTL)
 Allocate storage for LCB lists.
#define CLEAR_LISTS(CTL)
 Clear storage for LCB lists.
#define BIND_LISTS(CTL)
 Bind LCB command and result lists.
#define QIOW(LCBD, SIZE, CMD_LIST, RESULT_LIST)
 No-op command for host calls.
#define QXCB(XCB)   (*XCB->sys.rtn) (XCB->sys.prm, XCB);
 Execute callback for host calls.
#define CHECK_CALL(FUNC)
 Call a function and check the return value (assumes a variable status exists).

Detailed Description

Definition of the macros used in the multiplex counter functions.

Author:
S.Maldonado - smaldona@slac.stanford.edu
Adopted (stolen) from work by J.Swain

Define Documentation

#define ALLOC_LISTS CTL   ) 
 

Value:

CTL->ld.cl  = (LMC_cl *)    LCBD_cl_alloc(sizeof(LMC_cl)); \
  CTL->ld.rl  = (LMC_cmd_rl *)LCBD_rl_alloc(sizeof(LMC_cmd_rl)); \
  CTL->cr.cl  = (LMC_cl *)    LCBD_cl_alloc(sizeof(LMC_cl)); \
  CTL->cr.rl  = (LMC_rsp_rl *)LCBD_rl_alloc(sizeof(LMC_rsp_rl)); \
  memset(CTL->ld.cl,0,sizeof(LMC_cl)); \
  memset(CTL->ld.rl,0,sizeof(LMC_cmd_rl)); \
  memset(CTL->cr.cl,0,sizeof(LMC_cl)); \
  memset(CTL->cr.rl,0,sizeof(LMC_rsp_rl)); \
  CTL->ld.nci = CTL->ld.nri = 0; \
  CTL->cr.nci = CTL->cr.nri = 0;
Allocate storage for LCB lists.

#define BIND_LISTS CTL   ) 
 

Value:

{ \
    unsigned cl_size,rl_size; \
    \
    cl_size = sizeof(LMC_cl) - (((N_LATP_CELLS - CTL->ld.nci)*sizeof(LEM_ci))); \
    rl_size = sizeof(LMC_cmd_rl) - (((N_LATP_CELLS - CTL->ld.nci)*sizeof(LEM_rsp_ri))); \
    \
    CTL->ld_xcb = LCBD_bind(LCBD_get(), \
                    cl_size >> 3,     \
                    (LCBD_cl *)CTL->ld.cl, \
                    rl_size >> 3, \
                    (LCBD_rl *)CTL->ld.rl, \
                    LMC_ld_cb,CTL, \
                    0,0,0,0); \
    \
    cl_size = sizeof(LMC_cl) - (((N_LATP_CELLS - CTL->cr.nci)*sizeof(LEM_ci))); \
    rl_size = sizeof(LMC_rsp_rl) - (((N_LATP_CELLS - CTL->cr.nci)*sizeof(LEM_cmd_ri))); \
    \
    CTL->rd_xcb = LCBD_bind(LCBD_get(), \
                    cl_size >> 3,     \
                    (LCBD_cl *)CTL->cr.cl, \
                    rl_size >> 3, \
                    (LCBD_rl *)CTL->cr.rl, \
                    LMC_rd_cb,CTL, \
                    0,0,0,0); \
  }
Bind LCB command and result lists.

#define CALC_TIME TS   ) 
 

Value:

{ \
    WCT_time_sat ts; \
    WCT_time_sat_s *ts_st; \
    ts = WCT_sat_get(); \
    ts_st = (WCT_time_sat_s *)&ts; \
    TS.s = (WCT_time_sat_s)(*ts_st); \
  }
Calculate a timestamp.

#define CHECK_CALL FUNC   ) 
 

Value:

{ \
  unsigned status = FUNC;\
  if(_msg_failure(status)) return status;\
}
Call a function and check the return value (assumes a variable status exists).

#define CLEAR_LISTS CTL   ) 
 

Value:

memset(CTL->ld.cl,0,sizeof(LMC_cl)); \
  memset(CTL->ld.rl,0,sizeof(LMC_cmd_rl)); \
  memset(CTL->cr.cl,0,sizeof(LMC_cl)); \
  memset(CTL->cr.rl,0,sizeof(LMC_rsp_rl));
Clear storage for LCB lists.

#define Q_ERR_CHECK NCI,
RL   ) 
 

Value:

if(0 != RL->xcb.usr.rd.bf.xstatus) \
    return _msg_report(LCBD_rst_xfr_err_map(RL->xcb.usr.rd.bf.xstatus), 0, 0);\
  { \
    unsigned li; \
    for(li = 0; li < NCI; ++li) \
      if(0 != RL->ri[li].err.ui) {\
        return _msg_report(LCBD_rst_rcv_err_map(RL->ri[li].err.ui), 0, 0); \
      }\
  }
Check for transfer or result item errors.

#define RESET_CL LMC   ) 
 

Value:

LMC->ld.nci = LMC->ld.nri = 0; \
    LMC->cr.nci = LMC->cr.nri = 0;
Resets command and result control structures.


Generated on Thu Mar 9 22:02:10 2006 by  doxygen 1.4.4