GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MEM / V5-8-1 > mem_base / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

memcommon.c File Reference

Code common to MEM functions. More...

#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <MEM/MEM.h>
#include <MEM/MEM_cmddefs.h>
#include <MEM/MEM_msgs.h>
#include <MSG/MSG_pubdefs.h>
#include <mempriv.h>

Functions

void MEM_CreateDescriptor (MEM_Descriptor *md, const MEM_Memmap map, const caddr_t addr, const size_t bytes)
 Create a generic memory descriptor.
unsigned int MEM_CreateDescriptorFromDumpCommand (MEM_Descriptor *md_p, const void *pkt_p)
 Create a memory descriptor from a dump command.


Detailed Description

Code common to MEM functions.

  CVS $Id: memcommon.c,v 1.12 2011/03/29 01:58:53 apw Exp $
  

Function Documentation

void MEM_CreateDescriptor ( MEM_Descriptor md,
const MEM_Memmap  map,
const caddr_t  addr,
const size_t  bytes 
)

Create a generic memory descriptor.

Create a generic memory descriptor. This can be used to create any type of memory descriptor, but for those with extended data (such as a PCI configuration space descriptor), the extended data must be added by the caller. This function simply copies its arguments to the corresponding members of the memory descriptor.

There is no argument checking, a user can create a completely bogus memory descriptor with this call. It is up to the routines that use the memory descriptor to validate it.

Parameters:
md Pointer to location to build the descriptor.
map Type of memory.
addr Starting memory address.
bytes Size of memory, in bytes.
Create a generic memory descriptor. This can be used to create any type of memory descriptor, but for those with extended data (such as a PCI configuration space descriptor), the extended data must be added by the caller. This function simply copies its arguments to the corresponding members of the memory descriptor.

There is no argument checking, a user can create a completely bogus memory descriptor with this call. It is up to the routines that use the memory descriptor to validate it.

Parameters:
md Pointer to location to build the descriptor.
map Type of memory.
addr Starting memory address.
bytes Size of memory, in bytes.

References _MEM_Descriptor::addr, _MEM_Descriptor::bytes, _MEM_Descriptor::memmap, and _MEM_Descriptor::words.

Referenced by MEM_CreateDescriptorFromDumpCommand(), MEM_loadPktMemory(), MEM_loadPktPci(), and MEM_loadPktReg().

unsigned int MEM_CreateDescriptorFromDumpCommand ( MEM_Descriptor md_p,
const void *  pkt_p 
)

Create a memory descriptor from a dump command.

This function creates a memory descriptor for use during a memory dump. It converts a valid memory dump command packet to a memory descriptor that describes the memory specified in the memory dump command.

It is assumed that the memory dump command packet has been validated.

Parameters:
md_p Pointer to location to build the descriptor.
pkt_p Pointer to valid memory dump command packet.
This function creates a memory descriptor for use during a memory dump. It converts a valid memory dump command packet to a memory descriptor that describes the memory specified in the memory dump command.

It is assumed that the memory dump command packet has been validated.

Parameters:
md_p Pointer to location to build the descriptor.
pkt_p Pointer to valid memory dump command packet.

References MEM_CreateDescriptor(), MEM_MSG, MEM_PCI_CONFIG_BYTES, and MEM_REGISTER_SET_BYTES.


Generated on Sat Apr 9 19:26:01 2011 by  doxygen 1.5.8