\hypertarget{MEM_8h}{
\section{MEM.h File Reference}
\label{MEM_8h}\index{MEM.h@{MEM.h}}
}
public interface to memory dump/load  


\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__MEM__Descriptor}{\_\-MEM\_\-Descriptor}
\begin{CompactList}\small\item\em Memory descriptor. \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{MEM_8h_daaf4942ce2a4346e6fea6d8ea91dac4}{MEM\_\-MAP\_\-NAME}(\_\-\_\-e\_\-\_\-)
\begin{CompactList}\small\item\em Evaluate a memory map code to a text string. \item\end{CompactList}\item 
\hypertarget{MEM_8h_900f0c60d883704d5b26ee4c7bf4cb14}{
\#define \hyperlink{MEM_8h_900f0c60d883704d5b26ee4c7bf4cb14}{MEM\_\-PCI\_\-CONFIG\_\-BYTES}~(256)}
\label{MEM_8h_900f0c60d883704d5b26ee4c7bf4cb14}

\begin{CompactList}\small\item\em Size in bytes of the PCI configuration space. \item\end{CompactList}\item 
\#define \hyperlink{MEM_8h_d29bcc06d50426545ee4d12f80abb273}{MEM\_\-REGISTER\_\-SET\_\-BYTES}~(768)
\begin{CompactList}\small\item\em Size in bytes of a register dump. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef unsigned int \hyperlink{MEM_8h_2769b3c7b72f3c6e7562ee4b91bb17f1}{MEM\_\-Status}
\begin{CompactList}\small\item\em Typedef for return status of memory functions. \item\end{CompactList}\item 
typedef enum \hyperlink{MEM_8h_8d1f57239658578b0861df236c4b442d}{\_\-MEM\_\-Memmap} \hyperlink{MEM_8h_40cf7c187cca1c73f7fd0e931b3329b7}{MEM\_\-Memmap}
\begin{CompactList}\small\item\em Typedef for memory map selection. \item\end{CompactList}\item 
\hypertarget{MEM_8h_bd372247ae34823e403dc2e02be5aa91}{
typedef struct \hyperlink{struct__MEM__Descriptor}{\_\-MEM\_\-Descriptor} \hyperlink{MEM_8h_bd372247ae34823e403dc2e02be5aa91}{MEM\_\-Descriptor}}
\label{MEM_8h_bd372247ae34823e403dc2e02be5aa91}

\begin{CompactList}\small\item\em Typedef for \# \hyperlink{struct__MEM__Descriptor}{\_\-MEM\_\-Descriptor}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{MEM_8h_8d1f57239658578b0861df236c4b442d}{\_\-MEM\_\-Memmap} \{ \par
\textbf{MEM\_\-MEMMAP\_\-MEMORY}, 
\par
\textbf{MEM\_\-MEMMAP\_\-PCI\_\-CFG}, 
\par
\textbf{MEM\_\-MEMMAP\_\-REGISTER}
 \}
\begin{CompactList}\small\item\em Memory map selection. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{MEM_8h_fe36d7dbfeace5b11c0fb8273244e1a6}{MEM\_\-CreateDescriptor} (\hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$md, const \hyperlink{MEM_8h_40cf7c187cca1c73f7fd0e931b3329b7}{MEM\_\-Memmap} map, const caddr\_\-t addr, const size\_\-t bytes)
\begin{CompactList}\small\item\em Create a generic memory descriptor. \item\end{CompactList}\item 
unsigned int \hyperlink{MEM_8h_173c95bd213ed81601383e93246ee43d}{MEM\_\-CreateDescriptorFromDumpCommand} (\hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$md\_\-p, const void $\ast$pkt\_\-p)
\begin{CompactList}\small\item\em Create a memory descriptor from a dump command. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
public interface to memory dump/load 

Memory library. For use in boot and operation code.

\begin{Desc}
\item[Log]\hyperlink{MEM_8h}{MEM.h},v \end{Desc}
Revision 1.14 2011/03/29 01:58:51 apw Upgrade for RHEL 4/5/6 32/64

Revision 1.13 2005/10/06 21:13:22 dmay fix doxygen 1.4.4 warnings

Revision 1.12 2005/08/12 15:46:06 dmay add extern to function prototypes

Revision 1.11 2005/05/02 18:30:55 dmay add ifdef \_\-\_\-cplusplus change some comments

Revision 1.10 2005/02/28 21:08:35 dmay removed unused MEM\_\-CreateDescriptorFromLoadCommand

Revision 1.9 2005/02/23 19:52:41 dmay increase CPU register set size to 768 bytes

Revision 1.8 2004/12/08 17:25:27 dmay removed PCI fields from MEM\_\-Descriptor

Revision 1.7 2004/07/19 16:05:24 dmay no longer include MEMCMD.h

Revision 1.6 2004/06/29 14:09:38 dmay restructure MEM\_\-Descriptor move memory dump functions to \hyperlink{MEM__dump_8h}{MEM\_\-dump.h}

Revision 1.5 2004/06/17 20:00:31 dmay remove load data from memory descriptors

Revision 1.4 2004/05/03 20:09:33 dmay Added MemLoad data and PCI config data to memory descriptors Combined MEM\_\-CreateXxxDescriptor functions into single MEM\_\-CreateDescriptor function

Revision 1.3 2004/03/23 20:07:28 dmay increase MEM\_\-REGISTER\_\-SET\_\-BYTES from 512 to 640

Revision 1.2 2004/03/11 13:35:50 ray added wrapped indcator to dumps

Revision 1.1.1.1 2004/01/09 12:52:27 ray Create package MEM 

\subsection{Define Documentation}
\hypertarget{MEM_8h_daaf4942ce2a4346e6fea6d8ea91dac4}{
\index{MEM.h@{MEM.h}!MEM\_\-MAP\_\-NAME@{MEM\_\-MAP\_\-NAME}}
\index{MEM\_\-MAP\_\-NAME@{MEM\_\-MAP\_\-NAME}!MEM.h@{MEM.h}}
\subsubsection[{MEM\_\-MAP\_\-NAME}]{\setlength{\rightskip}{0pt plus 5cm}\#define MEM\_\-MAP\_\-NAME(\_\-\_\-e\_\-\_\-)}}
\label{MEM_8h_daaf4942ce2a4346e6fea6d8ea91dac4}


\textbf{Value:}

\begin{Code}\begin{verbatim}(((__e__)==MEM_MEMMAP_MEMORY)?"Memory": \
                            (((__e__)==MEM_MEMMAP_PCI_CFG)?"PCI Config": \
                            (((__e__)==MEM_MEMMAP_REGISTER)?"Register": \
                                                            "Unknown Map")))
\end{verbatim}
\end{Code}
Evaluate a memory map code to a text string. 

\hypertarget{MEM_8h_d29bcc06d50426545ee4d12f80abb273}{
\index{MEM.h@{MEM.h}!MEM\_\-REGISTER\_\-SET\_\-BYTES@{MEM\_\-REGISTER\_\-SET\_\-BYTES}}
\index{MEM\_\-REGISTER\_\-SET\_\-BYTES@{MEM\_\-REGISTER\_\-SET\_\-BYTES}!MEM.h@{MEM.h}}
\subsubsection[{MEM\_\-REGISTER\_\-SET\_\-BYTES}]{\setlength{\rightskip}{0pt plus 5cm}\#define MEM\_\-REGISTER\_\-SET\_\-BYTES~(768)}}
\label{MEM_8h_d29bcc06d50426545ee4d12f80abb273}


Size in bytes of a register dump. 

This is the size of a CPU register dump. There are 32 32-bit GPRs, 32 64-bit FPRs and 68 32-bit SPRs. That adds up to 656 bytes (164 words). A little extra space is allocated here (768 bytes, 192 words) in case a register or two was missed and needs to be added later.

For Memory Dump commands, a snapshot of the processor register values are gathered and stored in the dump context at the time the dump is started. The register values are then retrieved from the context as the dump progresses. 

Referenced by MEM\_\-CreateDescriptorFromDumpCommand().

\subsection{Typedef Documentation}
\hypertarget{MEM_8h_40cf7c187cca1c73f7fd0e931b3329b7}{
\index{MEM.h@{MEM.h}!MEM\_\-Memmap@{MEM\_\-Memmap}}
\index{MEM\_\-Memmap@{MEM\_\-Memmap}!MEM.h@{MEM.h}}
\subsubsection[{MEM\_\-Memmap}]{\setlength{\rightskip}{0pt plus 5cm}{\bf MEM\_\-Memmap}}}
\label{MEM_8h_40cf7c187cca1c73f7fd0e931b3329b7}


Typedef for memory map selection. 

Typedef for \_\-MEM\_\-Memmap enumeration. \hypertarget{MEM_8h_2769b3c7b72f3c6e7562ee4b91bb17f1}{
\index{MEM.h@{MEM.h}!MEM\_\-Status@{MEM\_\-Status}}
\index{MEM\_\-Status@{MEM\_\-Status}!MEM.h@{MEM.h}}
\subsubsection[{MEM\_\-Status}]{\setlength{\rightskip}{0pt plus 5cm}{\bf MEM\_\-Status}}}
\label{MEM_8h_2769b3c7b72f3c6e7562ee4b91bb17f1}


Typedef for return status of memory functions. 

Type for memory library return status codes. 

\subsection{Enumeration Type Documentation}
\hypertarget{MEM_8h_8d1f57239658578b0861df236c4b442d}{
\index{MEM.h@{MEM.h}!\_\-MEM\_\-Memmap@{\_\-MEM\_\-Memmap}}
\index{\_\-MEM\_\-Memmap@{\_\-MEM\_\-Memmap}!MEM.h@{MEM.h}}
\subsubsection[{\_\-MEM\_\-Memmap}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf \_\-MEM\_\-Memmap}}}
\label{MEM_8h_8d1f57239658578b0861df236c4b442d}


Memory map selection. 

Enumerated types to select a memory map. This is derived from the memory dump and load telecommands and describes three types of memory accesses made by the LAT memory system:

MEMORY - regular byte-accessable RAM-like memories with no alignment requirements.

PCI\_\-CFG - PCI configuration space.

REGISTER - PPCI memory-mapped registers. Memory map may contains \char`\"{}holes\char`\"{}, so generic non-aligned bytes access not always allowed. 

\subsection{Function Documentation}
\hypertarget{MEM_8h_fe36d7dbfeace5b11c0fb8273244e1a6}{
\index{MEM.h@{MEM.h}!MEM\_\-CreateDescriptor@{MEM\_\-CreateDescriptor}}
\index{MEM\_\-CreateDescriptor@{MEM\_\-CreateDescriptor}!MEM.h@{MEM.h}}
\subsubsection[{MEM\_\-CreateDescriptor}]{\setlength{\rightskip}{0pt plus 5cm}void MEM\_\-CreateDescriptor ({\bf MEM\_\-Descriptor} $\ast$ {\em md}, \/  const {\bf MEM\_\-Memmap} {\em map}, \/  const caddr\_\-t {\em addr}, \/  const size\_\-t {\em bytes})}}
\label{MEM_8h_fe36d7dbfeace5b11c0fb8273244e1a6}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em md}]Pointer to location to build the descriptor. \item[{\em map}]Type of memory. \item[{\em addr}]Starting memory address. \item[{\em bytes}]Size of memory, in bytes.\end{description}
\end{Desc}
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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em md}]Pointer to location to build the descriptor. \item[{\em map}]Type of memory. \item[{\em addr}]Starting memory address. \item[{\em bytes}]Size of memory, in bytes. \end{description}
\end{Desc}


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().\hypertarget{MEM_8h_173c95bd213ed81601383e93246ee43d}{
\index{MEM.h@{MEM.h}!MEM\_\-CreateDescriptorFromDumpCommand@{MEM\_\-CreateDescriptorFromDumpCommand}}
\index{MEM\_\-CreateDescriptorFromDumpCommand@{MEM\_\-CreateDescriptorFromDumpCommand}!MEM.h@{MEM.h}}
\subsubsection[{MEM\_\-CreateDescriptorFromDumpCommand}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-CreateDescriptorFromDumpCommand ({\bf MEM\_\-Descriptor} $\ast$ {\em md\_\-p}, \/  const void $\ast$ {\em pkt\_\-p})}}
\label{MEM_8h_173c95bd213ed81601383e93246ee43d}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em md\_\-p}]Pointer to location to build the descriptor. \item[{\em pkt\_\-p}]Pointer to valid memory dump command packet.\end{description}
\end{Desc}
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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em md\_\-p}]Pointer to location to build the descriptor. \item[{\em pkt\_\-p}]Pointer to valid memory dump command packet. \end{description}
\end{Desc}


References MEM\_\-CreateDescriptor(), MEM\_\-MSG, MEM\_\-PCI\_\-CONFIG\_\-BYTES, and MEM\_\-REGISTER\_\-SET\_\-BYTES.