GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MEM / V5-6-0

Constituent: mem_base     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

memdump.c File Reference

Memory Dump functions. More...

#include <string.h>
#include "MEM/MEM_cmddefs.h"
#include "MEM/MEM_dump.h"
#include "MEM/MEM_msgs.h"
#include "MSG/MSG_pubdefs.h"
#include "mempriv.h"
#include "PBS/MBA.h"

Include dependency graph for memdump.c:


Data Structures

union  _mem_DumpSnap
 Memory Dump snapshot. More...
struct  _mem_DumpContext
 Memory Dump context. More...

Defines

#define MEM_DUMP_KEY_VALID   (0x235689ab)
 Dump info 'valid' key value.

Typedefs

typedef _mem_DumpSnap mem_DumpSnap
 Typedef for _mem_DumpSnap.
typedef _mem_DumpContext mem_DumpContext
 Typedef for _mem_DumpContext.

Functions

static void * Mem_GatherRegisterSet (void *ptr)
 Gather CPU register info.
static void * Mem_GatherPciHeader (unsigned char *dest_p, MEM_Descriptor *md_p)
 Gather PCI device header info.
static unsigned int mem_dumpCheckHandle (const MEM_DumpHandle handle, mem_DumpContext **context_pp)
 Validate a Memory Dump context handle.
static unsigned int mem_dumpUpdateStatus (mem_DumpContext *context_p, const unsigned int status)
 Update dump context status.
static unsigned int mem_dumpResetContext (mem_DumpContext *context_p)
 Reset the state of a dump context.
unsigned int MEM_dumpInit (void)
 Start the Memory Dump system.
MEM_Status mem_ValidateDumpDescriptor (const MEM_Descriptor *md, const mem_mapEntry **mapEntry)
 Validate arguments for memory dump.
unsigned int MEM_dumpGetContext (MEM_DumpHandle *handle_p)
 Allocate a Memory Dump context.
unsigned int MEM_dumpReleaseContext (MEM_DumpHandle handle)
 Release a Memory Dump context.
unsigned int MEM_dumpStart (MEM_DumpHandle handle, const MEM_Descriptor *md_p)
unsigned int MEM_CancelDump (MEM_DumpHandle handle)
 Cancel a Memory Dump operation.
unsigned int MEM_dumpGetInfo (const MEM_DumpHandle handle, MEM_DumpInfo *info_p)
 Get detailed information about a Memory Dump context.
unsigned int MEM_dumpGetData (MEM_DumpHandle handle, size_t req_bytes, caddr_t *addr_p, size_t *act_bytes_p, void *dest_p)
 Read data for a Memory Dump operation.

Detailed Description

Memory Dump functions.

These functions handle Memory Dump telecommands and the resulting dump operations.

  CVS $Id: memdump.c,v 1.20 2005/08/12 15:55:19 dmay Exp $
  

Typedef Documentation

mem_DumpContext
 

Typedef for _mem_DumpContext.

The typedef for _mem_DumpContext.

mem_DumpSnap
 

Typedef for _mem_DumpSnap.

The typedef for _mem_DumpSnap.


Function Documentation

unsigned int MEM_CancelDump MEM_DumpHandle  handle  ) 
 

Cancel a Memory Dump operation.

Parameters:
handle Handle for dump context.
Returns:
A MEM MSG code.

unsigned int mem_dumpCheckHandle const MEM_DumpHandle  handle,
mem_DumpContext **  context_pp
[static]
 

Validate a Memory Dump context handle.

Validate a Memory Dump context handle and return a pointer to the corresponding context.

Parameters:
handle Handle for the context.
context_pp Pointer to location to return context pointer.
Returns:
A MEM MSG code.

unsigned int MEM_dumpGetContext MEM_DumpHandle handle_p  ) 
 

Allocate a Memory Dump context.

Allocate a Memory Dump context. This is analogous to a constructor for a context. This function returns only a handle to a context. The details of the context are hidden from the user. The MEM_dumpGetInfo() function can be used to get detailed information about the context.

Parameters:
handle_p Pointer to location to return context handle.
Returns:
A MEM MSG code.

unsigned int MEM_dumpGetData MEM_DumpHandle  handle,
size_t  req_bytes,
caddr_t *  addr_p,
size_t *  act_bytes_p,
void *  dest_p
 

Read data for a Memory Dump operation.

Read a chunk of data for the specified Memory Dump context. This function should be called repeatedly until all the data associated with the context has been dumped. It returns the address from which the dumped data was read and the actual number of bytes dumped (which may be less than the number of bytes requested).

Parameters:
handle Handle for dump context.
req_bytes Amount of data to dump, in bytes.
addr_p Pointer to location to return address of dumped data.
act_bytes_p Pointer to location to return num bytes dumped.
dest_p Pointer to location to store dumped data.
Returns:
A MEM MSG code.

unsigned int MEM_dumpGetInfo const MEM_DumpHandle  handle,
MEM_DumpInfo info_p
 

Get detailed information about a Memory Dump context.

Get information about a Memory Dump context. The information returned is a subset of the context details that are normally hidden from the user.

Parameters:
handle Handle for context.
info_p Pointer to location to return context info.
Returns:
A MEM MSG code.

unsigned int MEM_dumpInit void   ) 
 

Start the Memory Dump system.

Start the Memory Dump system. This function should be called once to initialize the internal state associated with the Memory Dump telecommand handler.

Returns:
A MEM MSG code.

unsigned int MEM_dumpReleaseContext MEM_DumpHandle  handle  ) 
 

Release a Memory Dump context.

Release a Memory Dump context so that the memory associated to it can be re-allocated. This is analogous to a destructor for a context.

Parameters:
handle Handle for context to release.
Returns:
A MEM MSG code.

unsigned int mem_dumpResetContext mem_DumpContext context_p  )  [static]
 

Reset the state of a dump context.

Reset the state of a dump context.

Parameters:
context_p Pointer to dump context.
Returns:
A MEM MSG code.

unsigned int MEM_dumpStart MEM_DumpHandle  handle,
const MEM_Descriptor md_p
 

Start a Memory Dump operation. Updates the Memory Dump context to reflect the start of a dump operation.

Parameters:
handle Handle for dump context.
md_p Pointer to dump memory descriptor.
Returns:
A MEM MSG code.

unsigned int mem_dumpUpdateStatus mem_DumpContext context_p,
const unsigned int  status
[static]
 

Update dump context status.

Update a dump context with the specified status.

Parameters:
context_p Pointer to dump context.
status Most recent function status.
Returns:
A MEM MSG code.

void * Mem_GatherPciHeader unsigned char *  dest_p,
MEM_Descriptor md_p
[static]
 

Gather PCI device header info.

Get a PCI Device Header dump and store it at the location defined by dest_p. Returns the sum of dest_p and the number of bytes used to dump the PCI device header.

Parameters:
dest_p Pointer to location to store PCI device header dump.
md_p Pointer to memory descriptor containing PCI address.
Returns:
Sum of dest_p and number of bytes used by PCI device header dump.

void * Mem_GatherRegisterSet void *  ptr  )  [static]
 

Gather CPU register info.

Get a CPU register dump and store it at the location defined by ptr. Returns the sum of ptr and the number of bytes used to dump the register set.

Parameters:
ptr Pointer to location to store register dump.
Returns:
Sum of ptr and number of bytes used by register dump.

MEM_Status mem_ValidateDumpDescriptor const MEM_Descriptor md,
const mem_mapEntry **  mapEntry
 

Validate arguments for memory dump.

The code determines if a memory descriptor is valid and appropriate for a memory dump (a valid memory descriptor does not infer that it is valid for a dump operation). The address and range of the memory descriptor are checked against the memory map to ensure that the operation is valid.

This function also returns a pointer to the matching memory map entry when MEM_SUCCESS is returned.

Parameters:
md Memory descriptor to validate.
mapEntry Pointer to location to store matching memory map entry pointer. Only valid as a return value if MEM_SUCESS is returned.
Return values:
MEM_SUCESS Memory descriptor valid for dump and mapEntry valid.
MEM_BADMAP Memory map in descriptor not valid for memory dump.
MEM_OUTOFRNG Address and/or size out of range for dump.
MEM_BADACC Memory descriptor not readable or not properly 32-bit aligned.
MEM_UNKNOWN Coding error encountered.


Generated on Tue Nov 8 22:36:26 2005 by  doxygen 1.4.4