\hypertarget{memload_8c}{
\section{memload.c File Reference}
\label{memload_8c}\index{memload.c@{memload.c}}
}
Memory Load functions.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$CCSDS/CCSDS\_\-pkt.h$>$}\par
{\tt \#include $<$MEM/MEM\_\-cmddefs.h$>$}\par
{\tt \#include $<$MEM/MEM\_\-load.h$>$}\par
{\tt \#include $<$MEM/MEM\_\-msgs.h$>$}\par
{\tt \#include $<$MSG/MSG\_\-pubdefs.h$>$}\par
{\tt \#include $<$mempriv.h$>$}\par
{\tt \#include $<$PBS/MBA.h$>$}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__mem__LoadContext}{\_\-mem\_\-LoadContext}
\begin{CompactList}\small\item\em Memory Load context. \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{memload_8c_c3ae3bc8cda1951c8110fa710be0f49a}{
\#define \hyperlink{memload_8c_c3ae3bc8cda1951c8110fa710be0f49a}{MEM\_\-LOAD\_\-KEY\_\-VALID}~(0x124578ab)}
\label{memload_8c_c3ae3bc8cda1951c8110fa710be0f49a}

\begin{CompactList}\small\item\em Load info 'valid' key value. \item\end{CompactList}\item 
\hypertarget{memload_8c_d29baca19d1d5eb7486f3ef50cec3c8d}{
\#define \hyperlink{memload_8c_d29baca19d1d5eb7486f3ef50cec3c8d}{MEM\_\-LOAD\_\-MEM\_\-WRITE\_\-MAX\_\-WORDS}~(4096 / 4)}
\label{memload_8c_d29baca19d1d5eb7486f3ef50cec3c8d}

\begin{CompactList}\small\item\em Maximum number of words that can be loaded with a Memory Write telecommand. \item\end{CompactList}\item 
\hypertarget{memload_8c_607f81faad01d97363750235773b78bb}{
\#define \hyperlink{memload_8c_607f81faad01d97363750235773b78bb}{MEM\_\-LOAD\_\-MAX\_\-STALL}~(1000)}
\label{memload_8c_607f81faad01d97363750235773b78bb}

\begin{CompactList}\small\item\em Maximum number of times that a load operation can make no progress before declaring a timeout failure. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef struct \hyperlink{struct__mem__LoadContext}{\_\-mem\_\-LoadContext} \hyperlink{memload_8c_6f54b750e1d1027e2b88d9636ce3c61f}{mem\_\-LoadContext}
\begin{CompactList}\small\item\em Typedef for \hyperlink{struct__mem__LoadContext}{\_\-mem\_\-LoadContext}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{memload_8c_438dbbc23eba138e734f8076b56ae702}{mem\_\-LoadState} \{ \par
\hyperlink{memload_8c_438dbbc23eba138e734f8076b56ae702ffb9b105e80470d95efdf9a03e1af45c}{MEM\_\-LOAD\_\-IDLE}, 
\par
\hyperlink{memload_8c_438dbbc23eba138e734f8076b56ae702c65dbe90f4557d17d609cde434428724}{MEM\_\-LOAD\_\-ACTIVE}
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned int \hyperlink{memload_8c_a5042da18db258fb0ac5f2ae9654f5c0}{mem\_\-loadCheckHandle} (const \hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle, \hyperlink{struct__mem__LoadContext}{mem\_\-LoadContext} $\ast$$\ast$context\_\-pp, int check\_\-state, \hyperlink{memload_8c_438dbbc23eba138e734f8076b56ae702}{mem\_\-LoadState} exp\_\-state)
\begin{CompactList}\small\item\em Validate a Memory Load context handle. \item\end{CompactList}\item 
static unsigned int \hyperlink{memload_8c_afe0b45773828f6267cfcd00e479b0f9}{mem\_\-loadUpdateStatus} (\hyperlink{struct__mem__LoadContext}{mem\_\-LoadContext} $\ast$context\_\-p, const unsigned int status)
\begin{CompactList}\small\item\em Update load context status. \item\end{CompactList}\item 
static unsigned int \hyperlink{memload_8c_4d5dbb3c7b97cf3d4c9f012fdbeb20eb}{mem\_\-loadResetContext} (\hyperlink{struct__mem__LoadContext}{mem\_\-LoadContext} $\ast$context\_\-p)
\begin{CompactList}\small\item\em Reset the state of a load context. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_865d3a874529b2fec1699322096427bd}{MEM\_\-loadInit} (void)
\begin{CompactList}\small\item\em Start the Memory Load system. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_b5112e7af845af1dd91f944a34f934a3}{MEM\_\-loadGetContext} (\hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} $\ast$handle\_\-p)
\begin{CompactList}\small\item\em Allocate a Memory Load context. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_6353ab252a37f11b6722f104a82471e4}{MEM\_\-loadReleaseContext} (\hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle)
\begin{CompactList}\small\item\em Release a Memory Load context. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_f62c38b3308c0f3d9da8f5dfab0a9d76}{MEM\_\-loadGetInfo} (const \hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle, \hyperlink{struct__MEM__LoadInfo}{MEM\_\-LoadInfo} $\ast$info\_\-p)
\begin{CompactList}\small\item\em Get detailed information about a Memory Load context. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_e4d6d6de0cfdd8b7fad7c7689c759ddd}{mem\_\-loadStart} (\hyperlink{struct__mem__LoadContext}{mem\_\-LoadContext} $\ast$context\_\-p, const \hyperlink{struct__MEM__Descriptor}{MEM\_\-Descriptor} $\ast$md\_\-p, const unsigned char $\ast$data\_\-p)
\item 
unsigned int \hyperlink{memload_8c_ae81bf0b1de9339bc1474b26788f83c9}{MEM\_\-loadPktMemory} (\hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle, const void $\ast$pkt\_\-p, const unsigned int len)
\begin{CompactList}\small\item\em Handle Memory Write telecommand packets. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_6b9c975ef4ad8d224880f9b56cd1a85e}{MEM\_\-loadPktPci} (\hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle, const void $\ast$pkt\_\-p, const unsigned int len)
\begin{CompactList}\small\item\em Handle Memory PCI Device Header Write telecommand packets. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_c53d162201737af30ff0c9bbc7510445}{MEM\_\-loadPktReg} (\hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle, const void $\ast$pkt\_\-p, const unsigned int len)
\begin{CompactList}\small\item\em Handle Memory Processor Register Write telecommand packets. \item\end{CompactList}\item 
unsigned int \hyperlink{memload_8c_a7e7004d6ac18b1c5f40ac3c803b756a}{MEM\_\-loadWrite} (\hyperlink{MEM__load_8h_8d0a2c8705983911425ee48dbea70560}{MEM\_\-LoadHandle} handle)
\begin{CompactList}\small\item\em Write data for a Memory Load context. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Memory Load functions. 

These functions handle Memory Write telecommands and the resulting load operations.



\footnotesize\begin{verbatim}
  CVS $Id: memload.c,v 1.17 2011/03/29 01:58:53 apw Exp $
  \end{verbatim}
\normalsize
 

\subsection{Typedef Documentation}
\hypertarget{memload_8c_6f54b750e1d1027e2b88d9636ce3c61f}{
\index{memload.c@{memload.c}!mem\_\-LoadContext@{mem\_\-LoadContext}}
\index{mem\_\-LoadContext@{mem\_\-LoadContext}!memload.c@{memload.c}}
\subsubsection[{mem\_\-LoadContext}]{\setlength{\rightskip}{0pt plus 5cm}{\bf mem\_\-LoadContext}}}
\label{memload_8c_6f54b750e1d1027e2b88d9636ce3c61f}


Typedef for \hyperlink{struct__mem__LoadContext}{\_\-mem\_\-LoadContext}. 

The typedef for \hyperlink{struct__mem__LoadContext}{\_\-mem\_\-LoadContext}. 

\subsection{Enumeration Type Documentation}
\hypertarget{memload_8c_438dbbc23eba138e734f8076b56ae702}{
\index{memload.c@{memload.c}!mem\_\-LoadState@{mem\_\-LoadState}}
\index{mem\_\-LoadState@{mem\_\-LoadState}!memload.c@{memload.c}}
\subsubsection[{mem\_\-LoadState}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf mem\_\-LoadState}}}
\label{memload_8c_438dbbc23eba138e734f8076b56ae702}


The typedef for the load state enum, which is a list of all possible states for a load. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{MEM\_\-LOAD\_\-IDLE@{MEM\_\-LOAD\_\-IDLE}!memload.c@{memload.c}}\index{memload.c@{memload.c}!MEM\_\-LOAD\_\-IDLE@{MEM\_\-LOAD\_\-IDLE}}\item[{\em 
\hypertarget{memload_8c_438dbbc23eba138e734f8076b56ae702ffb9b105e80470d95efdf9a03e1af45c}{
MEM\_\-LOAD\_\-IDLE}
\label{memload_8c_438dbbc23eba138e734f8076b56ae702ffb9b105e80470d95efdf9a03e1af45c}
}]Load is idle, i.e. not active. \index{MEM\_\-LOAD\_\-ACTIVE@{MEM\_\-LOAD\_\-ACTIVE}!memload.c@{memload.c}}\index{memload.c@{memload.c}!MEM\_\-LOAD\_\-ACTIVE@{MEM\_\-LOAD\_\-ACTIVE}}\item[{\em 
\hypertarget{memload_8c_438dbbc23eba138e734f8076b56ae702c65dbe90f4557d17d609cde434428724}{
MEM\_\-LOAD\_\-ACTIVE}
\label{memload_8c_438dbbc23eba138e734f8076b56ae702c65dbe90f4557d17d609cde434428724}
}]Load is active, i.e. in progress. \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{memload_8c_a5042da18db258fb0ac5f2ae9654f5c0}{
\index{memload.c@{memload.c}!mem\_\-loadCheckHandle@{mem\_\-loadCheckHandle}}
\index{mem\_\-loadCheckHandle@{mem\_\-loadCheckHandle}!memload.c@{memload.c}}
\subsubsection[{mem\_\-loadCheckHandle}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-loadCheckHandle (const {\bf MEM\_\-LoadHandle} {\em handle}, \/  {\bf mem\_\-LoadContext} $\ast$$\ast$ {\em context\_\-pp}, \/  int {\em check\_\-state}, \/  {\bf mem\_\-LoadState} {\em exp\_\-state})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{memload_8c_a5042da18db258fb0ac5f2ae9654f5c0}


Validate a Memory Load context handle. 

Validate a Memory Load 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. \item[{\em check\_\-state}]Check context state? nonzero =$>$ yes, 0 =$>$ no. \item[{\em exp\_\-state}]Expected context state.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


References MEM\_\-LOAD\_\-KEY\_\-VALID, \_\-mem\_\-LoadContext::state, and \_\-mem\_\-LoadContext::valid\_\-key.

Referenced by MEM\_\-loadGetInfo(), MEM\_\-loadPktMemory(), MEM\_\-loadPktPci(), MEM\_\-loadPktReg(), MEM\_\-loadReleaseContext(), and MEM\_\-loadWrite().\hypertarget{memload_8c_b5112e7af845af1dd91f944a34f934a3}{
\index{memload.c@{memload.c}!MEM\_\-loadGetContext@{MEM\_\-loadGetContext}}
\index{MEM\_\-loadGetContext@{MEM\_\-loadGetContext}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadGetContext}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadGetContext ({\bf MEM\_\-LoadHandle} $\ast$ {\em handle\_\-p})}}
\label{memload_8c_b5112e7af845af1dd91f944a34f934a3}


Allocate a Memory Load context. 

Allocate a Memory Load 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__load_8h_f62c38b3308c0f3d9da8f5dfab0a9d76}{MEM\_\-loadGetInfo()} 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}
Allocate a Memory Load 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__load_8h_f62c38b3308c0f3d9da8f5dfab0a9d76}{MEM\_\-loadGetInfo()} 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}


References MEM\_\-LOAD\_\-KEY\_\-VALID, mem\_\-loadResetContext(), mem\_\-loadUpdateStatus(), and MEM\_\-MSG.\hypertarget{memload_8c_f62c38b3308c0f3d9da8f5dfab0a9d76}{
\index{memload.c@{memload.c}!MEM\_\-loadGetInfo@{MEM\_\-loadGetInfo}}
\index{MEM\_\-loadGetInfo@{MEM\_\-loadGetInfo}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadGetInfo}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadGetInfo (const {\bf MEM\_\-LoadHandle} {\em handle}, \/  {\bf MEM\_\-LoadInfo} $\ast$ {\em info\_\-p})}}
\label{memload_8c_f62c38b3308c0f3d9da8f5dfab0a9d76}


Get detailed information about a Memory Load context. 

Get information about a Memory Load 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}
Get information about a Memory Load 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}


References \_\-MEM\_\-Descriptor::addr, \_\-MEM\_\-Descriptor::bytes, \_\-MEM\_\-LoadInfo::is\_\-active, \_\-MEM\_\-LoadInfo::map, \_\-mem\_\-LoadContext::md, MEM\_\-LOAD\_\-ACTIVE, mem\_\-loadCheckHandle(), MEM\_\-MSG, \_\-MEM\_\-Descriptor::memmap, \_\-mem\_\-LoadContext::offset, \_\-MEM\_\-LoadInfo::offset, \_\-MEM\_\-LoadInfo::start\_\-addr, \_\-mem\_\-LoadContext::state, \_\-mem\_\-LoadContext::status, \_\-MEM\_\-LoadInfo::status, and \_\-MEM\_\-LoadInfo::total\_\-bytes.\hypertarget{memload_8c_865d3a874529b2fec1699322096427bd}{
\index{memload.c@{memload.c}!MEM\_\-loadInit@{MEM\_\-loadInit}}
\index{MEM\_\-loadInit@{MEM\_\-loadInit}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadInit}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadInit (void)}}
\label{memload_8c_865d3a874529b2fec1699322096427bd}


Start the Memory Load system. 

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

\begin{Desc}
\item[Returns:]A MEM MSG code.\end{Desc}
Start the Memory Load system. This function should be called once to initialize the internal state associated with the Memory Load telecommand handler.

\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}
\hypertarget{memload_8c_ae81bf0b1de9339bc1474b26788f83c9}{
\index{memload.c@{memload.c}!MEM\_\-loadPktMemory@{MEM\_\-loadPktMemory}}
\index{MEM\_\-loadPktMemory@{MEM\_\-loadPktMemory}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadPktMemory}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadPktMemory ({\bf MEM\_\-LoadHandle} {\em handle}, \/  const void $\ast$ {\em pkt\_\-p}, \/  const unsigned int {\em len})}}
\label{memload_8c_ae81bf0b1de9339bc1474b26788f83c9}


Handle Memory Write telecommand packets. 

Announces the arrival of a new Memory Write telecommand CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for load context. \item[{\em pkt\_\-p}]Pointer to packet. \item[{\em len}]Length of packet, in bytes.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code.\end{Desc}
Announces the arrival of a new Memory Write telecommand CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for load context. \item[{\em pkt\_\-p}]Pointer to packet. \item[{\em len}]Length of packet, in bytes.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code. \end{Desc}


References MEM\_\-CreateDescriptor(), MEM\_\-LOAD\_\-IDLE, mem\_\-loadCheckHandle(), mem\_\-loadResetContext(), mem\_\-loadStart(), mem\_\-loadUpdateStatus(), and MEM\_\-MSG.\hypertarget{memload_8c_6b9c975ef4ad8d224880f9b56cd1a85e}{
\index{memload.c@{memload.c}!MEM\_\-loadPktPci@{MEM\_\-loadPktPci}}
\index{MEM\_\-loadPktPci@{MEM\_\-loadPktPci}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadPktPci}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadPktPci ({\bf MEM\_\-LoadHandle} {\em handle}, \/  const void $\ast$ {\em pkt\_\-p}, \/  const unsigned int {\em len})}}
\label{memload_8c_6b9c975ef4ad8d224880f9b56cd1a85e}


Handle Memory PCI Device Header Write telecommand packets. 

Announces the arrival of a new Memory PCI Device Header Write telecommand CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for load context. \item[{\em pkt\_\-p}]Pointer to packet. \item[{\em len}]Length of packet, in bytes.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code.\end{Desc}
Announces the arrival of a new Memory PCI Device Header Write telecommand CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for load context. \item[{\em pkt\_\-p}]Pointer to packet. \item[{\em len}]Length of packet, in bytes.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code. \end{Desc}


References MEM\_\-CreateDescriptor(), MEM\_\-LOAD\_\-IDLE, mem\_\-loadCheckHandle(), mem\_\-loadResetContext(), mem\_\-loadStart(), mem\_\-loadUpdateStatus(), and MEM\_\-MSG.\hypertarget{memload_8c_c53d162201737af30ff0c9bbc7510445}{
\index{memload.c@{memload.c}!MEM\_\-loadPktReg@{MEM\_\-loadPktReg}}
\index{MEM\_\-loadPktReg@{MEM\_\-loadPktReg}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadPktReg}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadPktReg ({\bf MEM\_\-LoadHandle} {\em handle}, \/  const void $\ast$ {\em pkt\_\-p}, \/  const unsigned int {\em len})}}
\label{memload_8c_c53d162201737af30ff0c9bbc7510445}


Handle Memory Processor Register Write telecommand packets. 

Announces the arrival of a new Memory Processor Register Write telecommand CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for load context. \item[{\em pkt\_\-p}]Pointer to packet. \item[{\em len}]Length of packet, in bytes.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code.\end{Desc}
Announces the arrival of a new Memory Processor Register Write telecommand CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for load context. \item[{\em pkt\_\-p}]Pointer to packet. \item[{\em len}]Length of packet, in bytes.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code. \end{Desc}


References MEM\_\-CreateDescriptor(), MEM\_\-LOAD\_\-IDLE, mem\_\-loadCheckHandle(), mem\_\-loadResetContext(), mem\_\-loadStart(), mem\_\-loadUpdateStatus(), and MEM\_\-MSG.\hypertarget{memload_8c_6353ab252a37f11b6722f104a82471e4}{
\index{memload.c@{memload.c}!MEM\_\-loadReleaseContext@{MEM\_\-loadReleaseContext}}
\index{MEM\_\-loadReleaseContext@{MEM\_\-loadReleaseContext}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadReleaseContext}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadReleaseContext ({\bf MEM\_\-LoadHandle} {\em handle})}}
\label{memload_8c_6353ab252a37f11b6722f104a82471e4}


Release a Memory Load context. 

Release a Memory Load 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}
Release a Memory Load 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}


References mem\_\-loadCheckHandle(), and MEM\_\-MSG.\hypertarget{memload_8c_4d5dbb3c7b97cf3d4c9f012fdbeb20eb}{
\index{memload.c@{memload.c}!mem\_\-loadResetContext@{mem\_\-loadResetContext}}
\index{mem\_\-loadResetContext@{mem\_\-loadResetContext}!memload.c@{memload.c}}
\subsubsection[{mem\_\-loadResetContext}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-loadResetContext ({\bf mem\_\-LoadContext} $\ast$ {\em context\_\-p})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{memload_8c_4d5dbb3c7b97cf3d4c9f012fdbeb20eb}


Reset the state of a load context. 

Reset the state of a load context.

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


References MEM\_\-LOAD\_\-IDLE, MEM\_\-LOAD\_\-KEY\_\-VALID, \_\-mem\_\-LoadContext::state, and \_\-mem\_\-LoadContext::valid\_\-key.

Referenced by MEM\_\-loadGetContext(), MEM\_\-loadPktMemory(), MEM\_\-loadPktPci(), and MEM\_\-loadPktReg().\hypertarget{memload_8c_e4d6d6de0cfdd8b7fad7c7689c759ddd}{
\index{memload.c@{memload.c}!mem\_\-loadStart@{mem\_\-loadStart}}
\index{mem\_\-loadStart@{mem\_\-loadStart}!memload.c@{memload.c}}
\subsubsection[{mem\_\-loadStart}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-loadStart ({\bf mem\_\-LoadContext} $\ast$ {\em context\_\-p}, \/  const {\bf MEM\_\-Descriptor} $\ast$ {\em md\_\-p}, \/  const unsigned char $\ast$ {\em data\_\-p})}}
\label{memload_8c_e4d6d6de0cfdd8b7fad7c7689c759ddd}


Start a Memory Write operation. Updates the Memory Load context to reflect the start of a load operation.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em context\_\-p}]Pointer to load context. \item[{\em md\_\-p}]Pointer to target memory descriptor. \item[{\em data\_\-p}]Pointer to buffer containing the data to write.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MSG code. \end{Desc}


References \_\-MEM\_\-Descriptor::bytes, \_\-mem\_\-LoadContext::cb\_\-ptr, \_\-mem\_\-mapEntry::context\_\-p, \_\-mem\_\-LoadContext::map\_\-entry, \_\-mem\_\-LoadContext::md, MEM\_\-LOAD\_\-ACTIVE, MEM\_\-MAP\_\-ACCESS\_\-WRITE\_\-ANY, MEM\_\-MSG, Mem\_\-ValidateMemoryRange(), \_\-mem\_\-LoadContext::num\_\-stall, \_\-mem\_\-LoadContext::source, and \_\-mem\_\-LoadContext::state.

Referenced by MEM\_\-loadPktMemory(), MEM\_\-loadPktPci(), and MEM\_\-loadPktReg().\hypertarget{memload_8c_afe0b45773828f6267cfcd00e479b0f9}{
\index{memload.c@{memload.c}!mem\_\-loadUpdateStatus@{mem\_\-loadUpdateStatus}}
\index{mem\_\-loadUpdateStatus@{mem\_\-loadUpdateStatus}!memload.c@{memload.c}}
\subsubsection[{mem\_\-loadUpdateStatus}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mem\_\-loadUpdateStatus ({\bf mem\_\-LoadContext} $\ast$ {\em context\_\-p}, \/  const unsigned int {\em status})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{memload_8c_afe0b45773828f6267cfcd00e479b0f9}


Update load context status. 

Update a load context with the specified status.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em context\_\-p}]Pointer to load context. \item[{\em status}]Most recent function status.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code. \end{Desc}


References \_\-mem\_\-LoadContext::status.

Referenced by MEM\_\-loadGetContext(), MEM\_\-loadPktMemory(), MEM\_\-loadPktPci(), MEM\_\-loadPktReg(), and MEM\_\-loadWrite().\hypertarget{memload_8c_a7e7004d6ac18b1c5f40ac3c803b756a}{
\index{memload.c@{memload.c}!MEM\_\-loadWrite@{MEM\_\-loadWrite}}
\index{MEM\_\-loadWrite@{MEM\_\-loadWrite}!memload.c@{memload.c}}
\subsubsection[{MEM\_\-loadWrite}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int MEM\_\-loadWrite ({\bf MEM\_\-LoadHandle} {\em handle})}}
\label{memload_8c_a7e7004d6ac18b1c5f40ac3c803b756a}


Write data for a Memory Load context. 

Write another chunk of data for the specified Memory Load context. This function should be called repeatedly until all the data associated with the context has been written to memory. The status of the Memory Load operation can be obtained with the \hyperlink{MEM__load_8h_f62c38b3308c0f3d9da8f5dfab0a9d76}{MEM\_\-loadGetInfo()} function.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em handle}]Handle for context in which to write the data.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A MEM MSG code.\end{Desc}
Write another chunk of data for the specified Memory Load context. This function should be called repeatedly until all the data associated with the context has been written to memory. The status of the Memory Load operation can be obtained with the \hyperlink{MEM__load_8h_f62c38b3308c0f3d9da8f5dfab0a9d76}{MEM\_\-loadGetInfo()} function.

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


References \_\-MEM\_\-Descriptor::addr, \_\-MEM\_\-Descriptor::bytes, \_\-mem\_\-LoadContext::cb\_\-ptr, \_\-mem\_\-LoadContext::map\_\-entry, \_\-mem\_\-LoadContext::md, MEM\_\-LOAD\_\-ACTIVE, MEM\_\-LOAD\_\-IDLE, mem\_\-loadCheckHandle(), mem\_\-loadUpdateStatus(), MEM\_\-MSG, \_\-mem\_\-LoadContext::num\_\-stall, \_\-mem\_\-LoadContext::offset, \_\-mem\_\-LoadContext::source, \_\-mem\_\-LoadContext::state, and \_\-mem\_\-mapEntry::write\_\-cb.