GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LRA / V5-2-0 > lra / rad750


Interface   Data Structures   File List   Data Fields   Globals  

LRA_control.c File Reference

Control routines for register access. More...

#include "LRA_p.h"
#include "LRA/LRA_telem.h"
#include "LRA/LRA_msgs.h"
#include "LRA/LRA_cmdxtrn.h"
#include "MSG/MSG_pubdefs.h"
#include "LEM/list.h"
#include "PBS/MBA.h"
#include "PBS/FPA.h"
#include "PBS/TASK.h"
#include "PBS/MTX.h"
#include "PBS/SEM.h"
#include "PBS/TOV.h"
#include "PBS/WCT.h"
#include "PBS/WUT.h"
#include "CPU_DB/CPU_DB_pubdefs.h"
#include "ITC/ITC_pubdefs.h"
#include "IMM/RBM_pubdefs.h"
#include <string.h>

Functions

static WUT_cb_status procUpdTimer (void *parm, WUT_tmr *timer)
 Process update timer expiration.
static void rqstDone (ITC_QueueItem *qItem, unsigned status, void *prm0, void *prm1, void *prm2, unsigned tx)
 Local routine called after a request has been completed.
static unsigned procUpdate (void *parm, const ITC_QueueItem *qItem, void *pay, unsigned len)
 Process statistics update request.
unsigned LRA_clearStats (void)
 Clear the register statistics.
unsigned LRA_getCtrl (LRA_control **ctrl)
 Get the control structure address.
unsigned LRA_getEbmEventStats (LRA_ebmEventStats *stats)
 Get a copy of the EBM event statistics.
unsigned LRA_getGemCntrStats (LRA_gemCntrStats *stats)
 Get a copy of the GEM counters.
unsigned LRA_getStats (LRA_stats *stats)
 Get a copy of the register statistics.
unsigned LRA_initialize (unsigned period, unsigned short tems)
 Initialize the register access system.
unsigned LRA_setStatsPeriod (unsigned period)
 Set the statistics update period.
unsigned LRA_setTemMask (unsigned short tems)
 Set the mask of sampled TEMs.
unsigned LRA_sizeofEbmEventStats (void)
 Get the size of the EBM event statistics block.
unsigned LRA_sizeofGemCntrStats (void)
 Get the size of the GEM counters block.
unsigned LRA_sizeofStats (void)
 Get the size of the LRA statistics block.
unsigned LRA_start ()
 Start the register access task.
unsigned LRA_startStats (void)
 Start register statistics acquisition.
unsigned LRA_stop (void)
 Stop the register access task.
unsigned LRA_stopStats (void)
 Stop register statistics acquisition.
unsigned LRA_terminate (void)
 Terminate register access.

Variables

static LRA_controllra = NULL
LRA_whiteBox LRA_wb


Detailed Description

Control routines for register access.

Author:
Owen H Saxton
$Id: LRA_control.c,v 1.16 2009/07/31 22:06:51 saxton Exp $

Function Documentation

unsigned LRA_clearStats ( void   ) 

Clear the register statistics.

The register statistics are cleared, with controlled access.

Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_getCtrl ( LRA_control **  ctrl  ) 

Get the control structure address.

This routine returns the address of the internal control structure. It is internal to the LRA system.

Parameters:
ctrl The address of a pointer to receive the address of the control structure.
Return values:
LRA_SUCCESS Address obtained successfully
LRA_NOTINIT LRA not initialized

unsigned LRA_getEbmEventStats ( LRA_ebmEventStats stats  ) 

Get a copy of the EBM event statistics.

The EBM event statistics are copied, with controlled access. Only the operation counts are copied.

Parameters:
stats The address of the area to which the statistics are to be copied
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_getGemCntrStats ( LRA_gemCntrStats stats  ) 

Get a copy of the GEM counters.

The GEM extended counters are copied, with controlled access. Only the counter values are copied.

Parameters:
stats The address of the area to which the counters are to be copied
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_getStats ( LRA_stats stats  ) 

Get a copy of the register statistics.

The register statistics are copied, with controlled access.

Parameters:
stats The address of the area to which the statistics are to be copied
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_initialize ( unsigned  period,
unsigned short  tems 
)

Initialize the register access system.

This routine sets up the apparatus needed by the register access system.

Parameters:
period The time, in 1/100 seconds, to be used between successive updates of the register statistics. If zero, the default value is used.
tems The mask of TEMs whose event receive stats are to be sampled. If zero, the default of all TEMs is used.
Return values:
LRA_SUCCESS Initialization was successful
LRA_ALRDINIT Already initialized
LRA_INSFMEM Insufficient memory for initialization
LRA_FPAFAIL FPA initialization failed
LRA_NOSEMS Unable to create semaphores
LRA_NOMUTEX Unable to create a mutex
LRA_NOTIMER Unable to create a timer
RBM_ALOCFAIL Memory allocation failure
RBM_FPAINIT FPA initialization failure
RBM_NOTINIT RBM system not initialized
ITC_ALOCFAIL Cannot allocate memory
ITC_NOTINIT ITC control block does not exist
ITC_TASKQUEU Cannot create task queues
ITC_CTLSTAT ITC control block not in state initialized
ITC_QUEUINIT Queue initialization failed
ITC_VARRNG Out of range variable detected
ITC_APIDDBL Table entry for this APID already in use

unsigned LRA_setStatsPeriod ( unsigned  period  ) 

Set the statistics update period.

This routine sets the statistics update period to a new value.

Parameters:
period The time, in 1/100 seconds, to be used between successive updates of the register statistics. If zero, the default value is used.
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_setTemMask ( unsigned short  tems  ) 

Set the mask of sampled TEMs.

This routine sets the mask of TEMs whose events received statistics are to be sampled.

Parameters:
tems The bit mask of TEMs to be sampled.
Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_sizeofEbmEventStats ( void   ) 

Get the size of the EBM event statistics block.

The size of the EBM event statistics block is returned.

Returns:
The size of the EBM event statistics block.

unsigned LRA_sizeofGemCntrStats ( void   ) 

Get the size of the GEM counters block.

The size of the GEM extended counters block is returned.

Returns:
The size of the GEM counters block.

unsigned LRA_sizeofStats ( void   ) 

Get the size of the LRA statistics block.

The size of the whole LRA statistics block is returned.

Returns:
The size of the LRA statistics block.

unsigned LRA_start ( void   ) 

Start the register access task.

This routine starts the register access task after checking that initialization has been successful.

Return values:
LRA_SUCCESS The task was started successfully
LRA_NOTINIT LRA not initialized
ITC_ALOCFAIL Cannot allocate for fork control block
ITC_CTLSTAT ITC control block not in state initialized
ITC_FORKINIT Fork initialization failed
ITC_FORKQHND Cannot recover all fork queue handles (obscure)
ITC_NOTINIT ITC control block does not exist

unsigned LRA_startStats ( void   ) 

Start register statistics acquisition.

The periodic updating of the register statistics block is started after the registers and statistics are cleared.

Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_stop ( void   ) 

Stop the register access task.

This routine stops the register access task.

Return values:
LRA_SUCCESS The task was stopped successfully
LRA_NOTINIT LRA not initialized
ITC_CTLSTAT ITC control block not in state initialized
ITC_NOTINIT ITC control block does not exist
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Invalid task state for this operation

unsigned LRA_stopStats ( void   ) 

Stop register statistics acquisition.

The periodic updating of the register statistics block is stopped.

Return values:
LRA_SUCCESS Success
LRA_NOTINIT LRA not initialized

unsigned LRA_terminate ( void   ) 

Terminate register access.

This routine frees all resources used by the register access system.

Return values:
LRA_SUCCESS Termination was successful
LRA_NOTINIT LRA not initialized

unsigned procUpdate ( void *  parm,
const ITC_QueueItem *  qItem,
void *  pay,
unsigned  len 
) [static]

Process statistics update request.

This routine is called by ITC in response to a statistics update request. It simply updates the statistics.

Parameters:
parm The user parameter (not used)
qItem The queue item making the request (not used)
pay The request payload address (not used)
len The length of the request payload (not used)
Return values:
LRA_SUCCESS Always success

WUT_cb_status procUpdTimer ( void *  parm,
WUT_tmr *  timer 
) [static]

Process update timer expiration.

When the statistics update timer expires, a request for an update is queued to the LRA task.

Parameters:
parm The user parameter (not used)
timer The handle for the expired timer
Return values:
LRA_SUCCESS Success always

void rqstDone ( ITC_QueueItem *  qItem,
unsigned  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned  tx 
) [static]

Local routine called after a request has been completed.

This routine is called by ITC after a request has been completed. It frees the queue item.


Variable Documentation

LRA_whiteBox LRA_wb

Initial value:


Generated on Fri Jul 31 15:37:09 2009 by  doxygen 1.5.3