GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCM / dev > lcm_epu / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LCM_scrub.c File Reference

LCM memory scrubbing/exception handling functions (all architectures). More...

#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <MDB/MDB_pubdefs.h>
#include <PBS/FPA.h>
#include <PBS/MBA.h>
#include <PBS/WUT.h>
#include <LCM/LCM_msgs.h>
#include <LCM/LCM_tlmdefs.h>
#include <LCM_prvdefs.h>

Typedefs

typedef enum _LCM_PacketCount LCM_PacketCount
 Typedef for enum _LCM_PacketCount.

Enumerations

enum  _LCM_PacketCount {
  LCM_L_MEMERR_PKT = 128,
  LCM_L_PCIERR_PKT = 128
}
 Enumeration of telemetry packet allocation counts. More...

Functions

static void memPacketInit (void *prm, void *pkt, int siz, int off)
 Initialize memory error reporting packets.
static void pciPacketInit (void *prm, void *pkt, int siz, int off)
 Initialize PCI error reporting packets.
static void packetFree (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx)
 An ITC completion routine to free a queue item after use.
static void packetInitialize (LCM_Control *ctl, void *pkt, FPA_fcb *fcb, unsigned int qilen, unsigned int apid)
 Initialize error reporting packets (both memory and PCI).
unsigned int LCM_ErrorCfg (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLCMERRORCFG command.
unsigned int LCM_ScrubCfg (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLCMSCRUBCFG command.
unsigned int LCM_scrubInitialize (LCM_Control *ctl)
 Initialize the LCM memory scrubbing subsystem.
unsigned int LCM_ScrubRun (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LLCMSCRUBRUN command.
WUT_cb_status LCM_scrubTimer (LCM_Control *ctl, WUT_tmr *timer)
 Callback for the memory scrub timer.


Detailed Description

LCM memory scrubbing/exception handling functions (all architectures).

CVS $Id: LCM_scrub.c,v 1.5 2011/03/29 21:59:34 apw Exp $
Author:
A.P.Waite
LCM_scrub.c provides the memory scrubbing and PCI/memory error exception handling common to all architectures. Given that only the rad750 architecture has the concept of memory scrubbing, this file contains very little. It does however include most of the initialization functions, so that targets other than rad750 do actually have the same memory and resource layout.

Enumeration Type Documentation

Enumeration of telemetry packet allocation counts.

Enumerator:
LCM_L_MEMERR_PKT  Memory error packets
LCM_L_PCIERR_PKT  PCI error packets


Function Documentation

unsigned int LCM_ErrorCfg ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LLCMERRORCFG command.

Parameters:
prm (in) User context parameter
qitem (in) Queue item
pay (in) Payload pointer
len (in) Payload length
Return values:
ITC_FORWARD If command is forwarded to another node
LCM_ECMDPARM Error in command parameters
LCM_SUCCESS Success

References _LCM_NODEPAD::bf, _LCM_Control::cmd_hdr_size, _LCM_ErrorCfg_Prm::errClass, _LCM_ErrorCfg_Prm::errLevel, _LCM_ErrorCfg_Prm::flag, LCM_LCMERRCLASS_LCMECLMEC, LCM_LCMERRCLASS_LCMECLMEU, LCM_LCMERRCLASS_LCMECLPCI, LCM_LCMERRLEVEL_LCMLEVCRI, _LCM_Control::node_id, and _LCM_Control::pci_err_level.

unsigned int LCM_ScrubCfg ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LLCMSCRUBCFG command.

Parameters:
prm (in) User context parameter
qitem (in) Queue item
pay (in) Payload pointer
len (in) Payload length
Return values:
ITC_FORWARD If command is forwarded to another node
LCM_SUCCESS Success

References _LCM_NODEPAD::bf, _LCM_Control::cmd_hdr_size, _LCM_ScrubCfg_Prm::flag, LCM_scrubTimer(), _LCM_Control::node_id, _LCM_ScrubCfg_Prm::period, _LCM_Control::scrub_period, and _LCM_Control::scrub_timer.

unsigned int LCM_scrubInitialize ( LCM_Control ctl  ) 

Initialize the LCM memory scrubbing subsystem.

Parameters:
ctl (in) LCM control block
Return values:
LCM_ALOCFAIL Memory allocation failed
LCM_FPAINIT FPA initialization failed
LCM_SCRTIMFL Timer allocation failed
LCM_SUCCESS Success
LCM_scrubInitialize() builds up the CPU common facilities to run the memory scrubber and handle memory/PCI exceptions.

References LCM_L_MEMERR_PKT, LCM_L_PCIERR_PKT, LCM_LCMERRLEVEL_LCMLEVDIA, _LCM_Control::mem, _LCM_Control::memc_err_count, memPacketInit(), _LCM_Control::memu_err_count, _LCM_Control::pci, _LCM_Control::pci_err_count, _LCM_Control::pci_err_level, pciPacketInit(), and _LCM_Control::scrub_timer.

Referenced by LCM_initialize().

unsigned int LCM_ScrubRun ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LLCMSCRUBRUN command.

Parameters:
prm (in) User context parameter
qitem (in) Queue item
pay (in) Payload pointer
len (in) Payload length
Return values:
ITC_FORWARD If command is forwarded to another node
LCM_SUCCESS Success

References _LCM_NODEPAD::bf, _LCM_Control::cmd_hdr_size, _LCM_ScrubRun_Prm::flag, LCM_scrubMemAuto(), and _LCM_Control::node_id.

WUT_cb_status LCM_scrubTimer ( LCM_Control ctl,
WUT_tmr *  timer 
)

Callback for the memory scrub timer.

Parameters:
ctl (in) LCM control block
timer (in) WUT timer
Returns:
WUT_K_STATE_CHANGE_YES

References LCM_scrubMemAuto(), and _LCM_Control::scrub_period.

Referenced by LCM_ScrubCfg(), and LCM_scrubTaskInitialize().

static void memPacketInit ( void *  prm,
void *  pkt,
int  siz,
int  off 
) [static]

Initialize memory error reporting packets.

Parameters:
prm (in) User parameter (the memory error FPA control block)
pkt (in) Packet pointer
siz (in) Packet size (unused)
off (in) Offset to packet control structure (unused)

References LCM_MEMORYERROR_TLM_APID, _LCM_Control::mem, and packetInitialize().

Referenced by LCM_scrubInitialize().

static void packetFree ( ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned int  tx 
) [static]

An ITC completion routine to free a queue item after use.

Parameters:
qitem (in) Queue item
status (in) Status from ITC
prm0 (in) User param 0 (the FPA control block)
prm1 (in) User param 1 (unused)
prm2 (in) User param 2 (unused)
tx (in) Failure during send phase of ITC_send() (unused)
freePacket() is the callback routine that's called once a packet has been delivered to the spacecraft (a standard ITC completion routine).

Referenced by packetInitialize().

static void packetInitialize ( LCM_Control ctl,
void *  pkt,
FPA_fcb *  fcb,
unsigned int  qilen,
unsigned int  apid 
) [static]

Initialize error reporting packets (both memory and PCI).

Parameters:
ctl (in) LCM control block
pkt (in) Packet pointer
fcb (in) FPA control block
qilen (in) Packet length
apid (in) Packet APID

References packetFree(), and _LCM_Control::telem_hdr_size.

Referenced by memPacketInit(), and pciPacketInit().

static void pciPacketInit ( void *  prm,
void *  pkt,
int  siz,
int  off 
) [static]

Initialize PCI error reporting packets.

Parameters:
prm (in) User parameter (the PCI error FPA control block)
pkt (in) Packet pointer
siz (in) Packet size (unused)
off (in) Offset to packet control structure (unused)

References LCM_PCIERROR_TLM_APID, packetInitialize(), and _LCM_Control::pci.

Referenced by LCM_scrubInitialize().


Generated on Wed Mar 30 16:02:50 2011 by  doxygen 1.5.8