\hypertarget{memdump_8c}{
\section{memdump.c File Reference}
\label{memdump_8c}\index{memdump.c@{memdump.c}}
}
Memory Dump functions.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}MEM/MEMCMD.h\char`\"{}}\par
{\tt \#include \char`\"{}MEM/MEM\_\-dump.h\char`\"{}}\par
{\tt \#include \char`\"{}MEM/MEM\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}mempriv.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par


Include dependency graph for memdump.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=387pt]{memdump_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__mem__DumpContext}{\_\-mem\_\-Dump\-Context}
\begin{CompactList}\small\item\em Memory Dump context. \item\end{CompactList}\item 
union \hyperlink{union__mem__DumpSnap}{\_\-mem\_\-Dump\-Snap}
\begin{CompactList}\small\item\em Memory Dump snapshot. \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{memdump_8c_a0}{
\#define \hyperlink{memdump_8c_a0}{MEM\_\-DUMP\_\-KEY\_\-VALID}\ (0x235689ab)}
\label{memdump_8c_a0}

\begin{CompactList}\small\item\em Dump info 'valid' key value. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{union__mem__DumpSnap}{\_\-mem\_\-Dump\-Snap} \hyperlink{memdump_8c_a1}{mem\_\-Dump\-Snap}
\begin{CompactList}\small\item\em Typedef for \hyperlink{union__mem__DumpSnap}{\_\-mem\_\-Dump\-Snap}. \item\end{CompactList}\item 
typedef \hyperlink{struct__mem__DumpContext}{\_\-mem\_\-Dump\-Context} \hyperlink{memdump_8c_a2}{mem\_\-Dump\-Context}
\begin{CompactList}\small\item\em Typedef for \hyperlink{struct__mem__DumpContext}{\_\-mem\_\-Dump\-Context}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{memdump_8c_a3}{mem\_\-dump\-Check\-Handle} (const \hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} handle, \hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context} $\ast$$\ast$context\_\-pp)
\begin{CompactList}\small\item\em Validate a Memory Dump context handle. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a4}{mem\_\-dump\-Update\-Status} (\hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context} $\ast$context\_\-p, const unsigned int status)
\begin{CompactList}\small\item\em Update dump context status. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a5}{mem\_\-dump\-Reset\-Context} (\hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context} $\ast$context\_\-p)
\begin{CompactList}\small\item\em Reset the state of a dump context. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a6}{MEM\_\-dump\-Init} (void)
\begin{CompactList}\small\item\em Start the Memory Dump system. \item\end{CompactList}\item 
\hyperlink{MEM_8h_a3}{MEM\_\-Status} \hyperlink{memdump_8c_a7}{mem\_\-Validate\-Dump\-Descriptor} (const \hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$md, const \hyperlink{struct__mem__mapEntry}{mem\_\-map\-Entry} $\ast$$\ast$map\-Entry)
\begin{CompactList}\small\item\em Validate arguments for memory dump. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a8}{MEM\_\-dump\-Get\-Context} (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} $\ast$handle\_\-p)
\begin{CompactList}\small\item\em Allocate a Memory Dump context. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a9}{MEM\_\-dump\-Release\-Context} (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} handle)
\begin{CompactList}\small\item\em Release a Memory Dump context. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a10}{MEM\_\-dump\-Start} (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} handle, const \hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$md\_\-p)
\item 
\hypertarget{memdump_8c_a11}{
\hyperlink{MEM_8h_a3}{MEM\_\-Status} \hyperlink{memdump_8c_a11}{MEM\_\-Cancel\-Dump} (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} opaque\-Context)}
\label{memdump_8c_a11}

\begin{CompactList}\small\item\em Cancel an active memory dump. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a12}{MEM\_\-dump\-Get\-Info} (const \hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} handle, \hyperlink{struct__MEM__DumpInfo}{MEM\_\-Dump\-Info} $\ast$info\_\-p)
\begin{CompactList}\small\item\em Get detailed information about a Memory Dump context. \item\end{CompactList}\item 
unsigned int \hyperlink{memdump_8c_a13}{MEM\_\-dump\-Get\-Data} (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} handle, size\_\-t req\_\-bytes, caddr\_\-t $\ast$addr\_\-p, size\_\-t $\ast$act\_\-bytes\_\-p, void $\ast$dest\_\-p)
\begin{CompactList}\small\item\em Read data for a Memory Dump operation. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Memory Dump functions. 

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



\footnotesize\begin{verbatim}
  CVS $Id: memdump.c,v 1.13 2004/11/19 22:01:04 dmay Exp $
  \end{verbatim}\normalsize


\subsection{Typedef Documentation}
\hypertarget{memdump_8c_a2}{
\index{memdump.c@{memdump.c}!mem_DumpContext@{mem\_\-DumpContext}}
\index{mem_DumpContext@{mem\_\-DumpContext}!memdump.c@{memdump.c}}
\subsubsection[mem\_\-DumpContext]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context}}}
\label{memdump_8c_a2}


Typedef for \hyperlink{struct__mem__DumpContext}{\_\-mem\_\-Dump\-Context}. 

The typedef for \hyperlink{struct__mem__DumpContext}{\_\-mem\_\-Dump\-Context}. \hypertarget{memdump_8c_a1}{
\index{memdump.c@{memdump.c}!mem_DumpSnap@{mem\_\-DumpSnap}}
\index{mem_DumpSnap@{mem\_\-DumpSnap}!memdump.c@{memdump.c}}
\subsubsection[mem\_\-DumpSnap]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__mem__DumpSnap}{mem\_\-Dump\-Snap}}}
\label{memdump_8c_a1}


Typedef for \hyperlink{union__mem__DumpSnap}{\_\-mem\_\-Dump\-Snap}. 

The typedef for \hyperlink{union__mem__DumpSnap}{\_\-mem\_\-Dump\-Snap}. 

\subsection{Function Documentation}
\hypertarget{memdump_8c_a3}{
\index{memdump.c@{memdump.c}!mem_dumpCheckHandle@{mem\_\-dumpCheckHandle}}
\index{mem_dumpCheckHandle@{mem\_\-dumpCheckHandle}!memdump.c@{memdump.c}}
\subsubsection[mem\_\-dumpCheckHandle]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-dump\-Check\-Handle (const \hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} {\em handle}, \hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context} $\ast$$\ast$ {\em context\_\-pp})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{memdump_8c_a3}


Validate a Memory Dump context handle. 

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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for the context. \item[{\em context\_\-pp}]Pointer to location to return context pointer.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}
\hypertarget{memdump_8c_a8}{
\index{memdump.c@{memdump.c}!MEM_dumpGetContext@{MEM\_\-dumpGetContext}}
\index{MEM_dumpGetContext@{MEM\_\-dumpGetContext}!memdump.c@{memdump.c}}
\subsubsection[MEM\_\-dumpGetContext]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-dump\-Get\-Context (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} $\ast$ {\em handle\_\-p})}}
\label{memdump_8c_a8}


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 \hyperlink{MEM__dump_8h_a5}{MEM\_\-dump\-Get\-Info()} function can be used to get detailed information about the context.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle\_\-p}]Pointer to location to return context handle.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=180pt]{memdump_8c_a8_cgraph}
\end{center}
\end{figure}
\hypertarget{memdump_8c_a13}{
\index{memdump.c@{memdump.c}!MEM_dumpGetData@{MEM\_\-dumpGetData}}
\index{MEM_dumpGetData@{MEM\_\-dumpGetData}!memdump.c@{memdump.c}}
\subsubsection[MEM\_\-dumpGetData]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-dump\-Get\-Data (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} {\em handle}, size\_\-t {\em req\_\-bytes}, caddr\_\-t $\ast$ {\em addr\_\-p}, size\_\-t $\ast$ {\em act\_\-bytes\_\-p}, void $\ast$ {\em dest\_\-p})}}
\label{memdump_8c_a13}


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).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for dump context. \item[{\em req\_\-bytes}]Amount of data to dump, in bytes. \item[{\em addr\_\-p}]Pointer to location to return address of dumped data. \item[{\em act\_\-bytes\_\-p}]Pointer to location to return num bytes dumped. \item[{\em dest\_\-p}]Pointer to location to store dumped data.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=173pt]{memdump_8c_a13_cgraph}
\end{center}
\end{figure}
\hypertarget{memdump_8c_a12}{
\index{memdump.c@{memdump.c}!MEM_dumpGetInfo@{MEM\_\-dumpGetInfo}}
\index{MEM_dumpGetInfo@{MEM\_\-dumpGetInfo}!memdump.c@{memdump.c}}
\subsubsection[MEM\_\-dumpGetInfo]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-dump\-Get\-Info (const \hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} {\em handle}, \hyperlink{struct__MEM__DumpInfo}{MEM\_\-Dump\-Info} $\ast$ {\em info\_\-p})}}
\label{memdump_8c_a12}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for context. \item[{\em info\_\-p}]Pointer to location to return context info.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=172pt]{memdump_8c_a12_cgraph}
\end{center}
\end{figure}
\hypertarget{memdump_8c_a6}{
\index{memdump.c@{memdump.c}!MEM_dumpInit@{MEM\_\-dumpInit}}
\index{MEM_dumpInit@{MEM\_\-dumpInit}!memdump.c@{memdump.c}}
\subsubsection[MEM\_\-dumpInit]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-dump\-Init (void)}}
\label{memdump_8c_a6}


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.

\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}
\hypertarget{memdump_8c_a9}{
\index{memdump.c@{memdump.c}!MEM_dumpReleaseContext@{MEM\_\-dumpReleaseContext}}
\index{MEM_dumpReleaseContext@{MEM\_\-dumpReleaseContext}!memdump.c@{memdump.c}}
\subsubsection[MEM\_\-dumpReleaseContext]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-dump\-Release\-Context (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} {\em handle})}}
\label{memdump_8c_a9}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for context to release.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=190pt]{memdump_8c_a9_cgraph}
\end{center}
\end{figure}
\hypertarget{memdump_8c_a5}{
\index{memdump.c@{memdump.c}!mem_dumpResetContext@{mem\_\-dumpResetContext}}
\index{mem_dumpResetContext@{mem\_\-dumpResetContext}!memdump.c@{memdump.c}}
\subsubsection[mem\_\-dumpResetContext]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-dump\-Reset\-Context (\hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context} $\ast$ {\em context\_\-p})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{memdump_8c_a5}


Reset the state of a dump context. 

Reset the state of a dump context.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em context\_\-p}]Pointer to dump context.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}
\hypertarget{memdump_8c_a10}{
\index{memdump.c@{memdump.c}!MEM_dumpStart@{MEM\_\-dumpStart}}
\index{MEM_dumpStart@{MEM\_\-dumpStart}!memdump.c@{memdump.c}}
\subsubsection[MEM\_\-dumpStart]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-dump\-Start (\hyperlink{MEM__dump_8h_a0}{MEM\_\-Dump\-Handle} {\em handle}, const \hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$ {\em md\_\-p})}}
\label{memdump_8c_a10}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for dump context. \item[{\em md\_\-p}]Pointer to dump memory descriptor.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=275pt]{memdump_8c_a10_cgraph}
\end{center}
\end{figure}
\hypertarget{memdump_8c_a4}{
\index{memdump.c@{memdump.c}!mem_dumpUpdateStatus@{mem\_\-dumpUpdateStatus}}
\index{mem_dumpUpdateStatus@{mem\_\-dumpUpdateStatus}!memdump.c@{memdump.c}}
\subsubsection[mem\_\-dumpUpdateStatus]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-dump\-Update\-Status (\hyperlink{struct__mem__DumpContext}{mem\_\-Dump\-Context} $\ast$ {\em context\_\-p}, const unsigned int {\em status})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{memdump_8c_a4}


Update dump context status. 

Update a dump context with the specified status.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em context\_\-p}]Pointer to dump context. \item[{\em status}]Most recent function status.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}
\hypertarget{memdump_8c_a7}{
\index{memdump.c@{memdump.c}!mem_ValidateDumpDescriptor@{mem\_\-ValidateDumpDescriptor}}
\index{mem_ValidateDumpDescriptor@{mem\_\-ValidateDumpDescriptor}!memdump.c@{memdump.c}}
\subsubsection[mem\_\-ValidateDumpDescriptor]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{MEM_8h_a3}{MEM\_\-Status} mem\_\-Validate\-Dump\-Descriptor (const \hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$ {\em md}, const \hyperlink{struct__mem__mapEntry}{mem\_\-map\-Entry} $\ast$$\ast$ {\em map\-Entry})}}
\label{memdump_8c_a7}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em md}]Memory descriptor to validate. \item[{\em map\-Entry}]Pointer to location to store matching memory map entry pointer. Only valid as a return value if MEM\_\-SUCESS is returned. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em MEM\_\-SUCESS}]Memory descriptor valid for dump and map\-Entry valid. \item[{\em MEM\_\-BADMAP}]Memory map in descriptor not valid for memory dump. \item[{\em MEM\_\-OUTOFRNG}]Address and/or size out of range for dump. \item[{\em MEM\_\-BADACC}]Memory descriptor not readable or not properly 32-bit aligned. \item[{\em MEM\_\-UNKNOWN}]Coding error encountered. \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=207pt]{memdump_8c_a7_cgraph}
\end{center}
\end{figure}
