\hypertarget{rim_8c}{
\section{rim.c File Reference}
\label{rim_8c}\index{rim.c@{rim.c}}
}
Provides the RIM functionatlity. 

{\tt \#include \char`\"{}RIM/rim.h\char`\"{}}\par
{\tt \#include \char`\"{}data\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}descriptions.ic\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-init\-RIM\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-reg\-Enums\_\-s.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Endianness.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par


Include dependency graph for rim.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=345pt]{rim_8c__incl}
\end{center}
\end{figure}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \{ \par
{\bf TRC\_\-CSR\_\-ZERO\_\-H} =  0x00000003, 
\par
{\bf TRC\_\-CSR\_\-ZERO\_\-L} =  0xa0000000
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
size\_\-t \hyperlink{rim_8c_a2}{sizeof\-Store} (void)
\begin{CompactList}\small\item\em Calculate the \char`\"{}payload\char`\"{} of RIM. \item\end{CompactList}\item 
size\_\-t \hyperlink{rim_8c_a3}{round\-Up} (size\_\-t size)
\begin{CompactList}\small\item\em Round up a buffer size to be 64 bit aligned. \item\end{CompactList}\item 
char $\ast$ \hyperlink{rim_8c_a4}{align} (char $\ast$next)
\begin{CompactList}\small\item\em Align a pointer to the next 64-bit aligned block. \item\end{CompactList}\item 
size\_\-t \hyperlink{rim_8c_a5}{RIM\_\-sizeof} (void)
\begin{CompactList}\small\item\em Calculate the footprint of the RIM structure. \item\end{CompactList}\item 
\hyperlink{rim_8h_a0}{RIM} $\ast$ \hyperlink{rim_8c_a6}{RIM\_\-construct} (void $\ast$buffer)
\begin{CompactList}\small\item\em Initialised a block of memory as a RIM object. \item\end{CompactList}\item 
void \hyperlink{rim_8c_a7}{RIM\_\-clear} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim)
\begin{CompactList}\small\item\em Clear out the map and data portions of the RIM structure. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Provides the RIM functionatlity. 

\begin{Desc}
\item[Author:]James Swain -- \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{rim_8c_a4}{
\index{rim.c@{rim.c}!align@{align}}
\index{align@{align}!rim.c@{rim.c}}
\subsubsection[align]{\setlength{\rightskip}{0pt plus 5cm}char $\ast$ align (char $\ast$ {\em next})}}
\label{rim_8c_a4}


Align a pointer to the next 64-bit aligned block. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em next}]Ptr to the next data block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next 64-bit aligned block\end{Desc}
\hypertarget{rim_8c_a7}{
\index{rim.c@{rim.c}!RIM_clear@{RIM\_\-clear}}
\index{RIM_clear@{RIM\_\-clear}!rim.c@{rim.c}}
\subsubsection[RIM\_\-clear]{\setlength{\rightskip}{0pt plus 5cm}void RIM\_\-clear (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim})}}
\label{rim_8c_a7}


Clear out the map and data portions of the RIM structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM object to clear\end{description}
\end{Desc}
\hypertarget{rim_8c_a6}{
\index{rim.c@{rim.c}!RIM_construct@{RIM\_\-construct}}
\index{RIM_construct@{RIM\_\-construct}!rim.c@{rim.c}}
\subsubsection[RIM\_\-construct]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{rim_8h_a0}{RIM}$\ast$ RIM\_\-construct (void $\ast$ {\em buffer})}}
\label{rim_8c_a6}


Initialised a block of memory as a RIM object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buffer}]Pointer to uninitialised memory to use for the RIM structure \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]NULL if the buffer is misaligned, or an initialised RIM structure\end{Desc}
\hypertarget{rim_8c_a5}{
\index{rim.c@{rim.c}!RIM_sizeof@{RIM\_\-sizeof}}
\index{RIM_sizeof@{RIM\_\-sizeof}!rim.c@{rim.c}}
\subsubsection[RIM\_\-sizeof]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t RIM\_\-sizeof (void)}}
\label{rim_8c_a5}


Calculate the footprint of the RIM structure. 

\begin{Desc}
\item[Returns:]Amount of memory required to hold the RIM structure\end{Desc}
\hypertarget{rim_8c_a3}{
\index{rim.c@{rim.c}!roundUp@{roundUp}}
\index{roundUp@{roundUp}!rim.c@{rim.c}}
\subsubsection[roundUp]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t round\-Up (size\_\-t {\em size})}}
\label{rim_8c_a3}


Round up a buffer size to be 64 bit aligned. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em size}]Unrounded size \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Rounded size\end{Desc}
\hypertarget{rim_8c_a2}{
\index{rim.c@{rim.c}!sizeofStore@{sizeofStore}}
\index{sizeofStore@{sizeofStore}!rim.c@{rim.c}}
\subsubsection[sizeofStore]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t sizeof\-Store (void)}}
\label{rim_8c_a2}


Calculate the \char`\"{}payload\char`\"{} of RIM. 

\begin{Desc}
\item[Returns:]Amount of memory required to hold the RIM storage\end{Desc}
