GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / dev > lcbd / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LCBR.c File Reference

Implements the LCB result list/item scanning parsing routines. More...

#include <LCBD/LCBR.h>
#include <LCBD/LATP.h>
#include <LCBD/LCB_cr.h>
#include <stdio.h>

Functions

unsigned int LCBR_process (const LCB_ri *ri, const LCB_ri *end, LCBR_processor rtn, void *prm)
 Executes the user specified handler for each result item in the range ri to end.
const LCB_riLCBR_check (const LCB_ri *ri, const LCB_ri *end)
 Checks the specified range of result items for errors.
unsigned int LCBR_error_get (const LCB_ri *ri)
 Returns the 16-bit error word of ri.
static unsigned int show (void *prm, const LCB_ri *ri)
 Shows (prints) a single result item.
void LCBR_show (unsigned int options, const LCB_ri *beg, const LCB_ri *end)
 Dumps the result items to stdout.


Detailed Description

Implements the LCB result list/item scanning parsing routines.

Author:
JJRussell -- russell@slac.stanford.edu
  CVS $Id

Function Documentation

const LCB_ri* LCBR_check ( const LCB_ri ri,
const LCB_ri end 
)

Checks the specified range of result items for errors.

Returns:
Pointer to the last item successfully checked. If successful, end should be returned. A convience method to quickly scan a result list for any errors. If any result item has an error, a pointer to that result item is returned.
If anything of than a pointer to end is returned, then an error in the result list has occurred. There are two offending conditions

  1. The error code in the result item is anything but successful
  2. A result item has an undefined OPCODE making it impossible to advance.

The low 2 bits of the returned pointer contain the error syndrome. Currently only these two cases are defined

  • low 2 bits 0, error is from the error field in the result item
  • low 2 bits 1, error is because of a bad opcode.

References _LCB_ri::hdr, LCBR_MAP_N8BYTES_BY_OPCODE, LCBR_N8BYTES_BY_OPCODE_FULL, and _LCB_ri_hdr_bf::opcode.

unsigned int LCBR_error_get ( const LCB_ri ri  ) 

Returns the 16-bit error word of ri.

Parameters:
ri Pointer to result item structure
Returns:
The error code. If the opcode is not recognized, the value LCB_RCV_ERR_UNDEFINED_7 is returned.

References _LCB_ri::hdr, LCB_RST_ERR_RCV_UNDEFINED_7, LCBR_N8BYTES_BY_OPCODE, and _LCB_ri_hdr_bf::opcode.

Referenced by show().

unsigned int LCBR_process ( const LCB_ri ri,
const LCB_ri end,
LCBR_processor  rtn,
void *  prm 
)

Executes the user specified handler for each result item in the range ri to end.

Returns:
The status of the last processing call
Parameters:
ri The first result item to process
end One past the last result item to process
rtn User provided callback routine to process one item
prm User provided parameter passed to rtn

References LCBR__next().

Referenced by LCBR_show().

void LCBR_show ( unsigned int  options,
const LCB_ri beg,
const LCB_ri end 
)

Dumps the result items to stdout.

Parameters:
options Show options
beg Pointer to the first result descriptor to show
end Pointer to one past the lst result descriptor to show
Returns:
void

References LCBR_process(), and show().

static unsigned int show ( void *  prm,
const LCB_ri ri 
) [static]

Shows (prints) a single result item.

Parameters:
prm Arbitrary user parameter, unused
ri Pointer to result item
Returns:
0 Useful when passed to LCBR_process () to print all result items.

References _LATP_cell_hdr::bf, _LATP_cell_hdr_bf::dst, _LCB_ri::hdr, LCB_RESULT_ADDR_MASK, LCBR_error_get(), LCBR_TYPE_BY_OPCODE, LCBR_TYPE_REGISTER, _LCB_ri_hdr_bf::opcode, _LATP_cell_hdr_bf::parity, _LATP_cell_hdr_bf::proto, _LATP_cell_hdr_bf::rsp, _LATP_cell_hdr_bf::src, _LCB_ri_hdr_bf::timestamp, and _LATP_cell_hdr::us.


Generated on Thu Mar 24 19:06:44 2011 by  doxygen 1.5.8