\hypertarget{mi_8h}{
\section{libbroadway/include/broadway/mi.h File Reference}
\label{mi_8h}\index{libbroadway/include/broadway/mi.h@{libbroadway/include/broadway/mi.h}}
}
{\ttfamily \#include $<$types.h$>$}\par
{\ttfamily \#include $<$broadway.h$>$}\par
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{mi_8h_a774b0631e3b58fc676dae2b74c6fa175}{mi\_\-initialize} (void)
\begin{DoxyCompactList}\small\item\em Initialize the MI subsystem. \item\end{DoxyCompactList}\item 
int \hyperlink{mi_8h_aab536bbb920d8954d9d2725d6a4eae4c}{mi\_\-shutdown} (void)
\begin{DoxyCompactList}\small\item\em Shut down the MI subsystem. \item\end{DoxyCompactList}\item 
int \hyperlink{mi_8h_a81ab8af6703e151a54f96476c40fda6d}{mi\_\-protect\_\-region} (void $\ast$addr, int size, BOOL r, BOOL w, int($\ast$exec)(u32 irq, void $\ast$data), void $\ast$data)
\begin{DoxyCompactList}\small\item\em Protects a region of memory. \item\end{DoxyCompactList}\item 
int \hyperlink{mi_8h_a6189bd8864075da48cd1174fcc1f0b70}{mi\_\-unprotect\_\-region} (int rgn)
\begin{DoxyCompactList}\small\item\em Unprotects a region of memory. \item\end{DoxyCompactList}\item 
void \hyperlink{mi_8h_a6a282b9db8d07bc36254f0341f75f1a9}{irq\_\-mi\_\-enable} (u32 irq)
\begin{DoxyCompactList}\small\item\em Enables a specific MI IRQ. \item\end{DoxyCompactList}\item 
void \hyperlink{mi_8h_a8d77a91ea307e6cb8817223153138505}{irq\_\-mi\_\-disable} (u32 irq)
\begin{DoxyCompactList}\small\item\em Disables a specific MI IRQ. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
An abstraction of the Memory Interface (MI). Has 4 protection zones that can be used to detect when writes, reads, or both happen upon specified regions of memory. Buggy. 

\subsection{Function Documentation}
\hypertarget{mi_8h_a8d77a91ea307e6cb8817223153138505}{
\index{mi.h@{mi.h}!irq\_\-mi\_\-disable@{irq\_\-mi\_\-disable}}
\index{irq\_\-mi\_\-disable@{irq\_\-mi\_\-disable}!mi.h@{mi.h}}
\subsubsection[{irq\_\-mi\_\-disable}]{\setlength{\rightskip}{0pt plus 5cm}void irq\_\-mi\_\-disable (u32 {\em irq})}}
\label{mi_8h_a8d77a91ea307e6cb8817223153138505}


Disables a specific MI IRQ. 


\begin{DoxyParams}{Parameters}
\item[{\em irq}]the IRQ to disable \end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{mi_8h_a6a282b9db8d07bc36254f0341f75f1a9}{irq\_\-mi\_\-enable()} 
\end{DoxySeeAlso}
\hypertarget{mi_8h_a6a282b9db8d07bc36254f0341f75f1a9}{
\index{mi.h@{mi.h}!irq\_\-mi\_\-enable@{irq\_\-mi\_\-enable}}
\index{irq\_\-mi\_\-enable@{irq\_\-mi\_\-enable}!mi.h@{mi.h}}
\subsubsection[{irq\_\-mi\_\-enable}]{\setlength{\rightskip}{0pt plus 5cm}void irq\_\-mi\_\-enable (u32 {\em irq})}}
\label{mi_8h_a6a282b9db8d07bc36254f0341f75f1a9}


Enables a specific MI IRQ. 


\begin{DoxyParams}{Parameters}
\item[{\em irq}]the IRQ to enable \end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{mi_8h_a8d77a91ea307e6cb8817223153138505}{irq\_\-mi\_\-disable()} 
\end{DoxySeeAlso}
\hypertarget{mi_8h_a774b0631e3b58fc676dae2b74c6fa175}{
\index{mi.h@{mi.h}!mi\_\-initialize@{mi\_\-initialize}}
\index{mi\_\-initialize@{mi\_\-initialize}!mi.h@{mi.h}}
\subsubsection[{mi\_\-initialize}]{\setlength{\rightskip}{0pt plus 5cm}int mi\_\-initialize (void)}}
\label{mi_8h_a774b0631e3b58fc676dae2b74c6fa175}


Initialize the MI subsystem. 

Initializes the MI subsystem, registers the handler for the MI interrupt and performs all other required initialization tasks. \begin{DoxyReturn}{Returns}
If initialization was successful, returns 1. Otherwise 0. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mi_8h_aab536bbb920d8954d9d2725d6a4eae4c}{mi\_\-shutdown()} 
\end{DoxySeeAlso}
\hypertarget{mi_8h_a81ab8af6703e151a54f96476c40fda6d}{
\index{mi.h@{mi.h}!mi\_\-protect\_\-region@{mi\_\-protect\_\-region}}
\index{mi\_\-protect\_\-region@{mi\_\-protect\_\-region}!mi.h@{mi.h}}
\subsubsection[{mi\_\-protect\_\-region}]{\setlength{\rightskip}{0pt plus 5cm}int mi\_\-protect\_\-region (void $\ast$ {\em addr}, \/  int {\em size}, \/  BOOL {\em r}, \/  BOOL {\em w}, \/  int($\ast$)(u32 irq, void $\ast$data) {\em exec}, \/  void $\ast$ {\em data})}}
\label{mi_8h_a81ab8af6703e151a54f96476c40fda6d}


Protects a region of memory. 


\begin{DoxyParams}{Parameters}
\item[{\em addr}]the start address of the protected region. \item[{\em size}]how large the protected region is in bytes. \item[{\em r}]whether the memory region can be read from \item[{\em w}]whether the memory region can be written to \item[{\em exec}]the callback that is called when the region is accessed in a way that is not allowed. \item[{\em data}]data provided to the callback when it fires. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The region number used to protect the memory. This number is also which IRQ is fired when it is accessed badly. If -\/1, an error occurred trying to protect the region. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mi_8h_a6a282b9db8d07bc36254f0341f75f1a9}{irq\_\-mi\_\-enable()}, \hyperlink{mi_8h_a8d77a91ea307e6cb8817223153138505}{irq\_\-mi\_\-disable()}, and \hyperlink{mi_8h_a6189bd8864075da48cd1174fcc1f0b70}{mi\_\-unprotect\_\-region()} 
\end{DoxySeeAlso}
\hypertarget{mi_8h_aab536bbb920d8954d9d2725d6a4eae4c}{
\index{mi.h@{mi.h}!mi\_\-shutdown@{mi\_\-shutdown}}
\index{mi\_\-shutdown@{mi\_\-shutdown}!mi.h@{mi.h}}
\subsubsection[{mi\_\-shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int mi\_\-shutdown (void)}}
\label{mi_8h_aab536bbb920d8954d9d2725d6a4eae4c}


Shut down the MI subsystem. 

Shuts down the MI subsystem, unregisters the handler for the MI interrupt and performs all other required shut down tasks. \begin{DoxyReturn}{Returns}
If shut down was successful, returns 1. Otherwise 0. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{mi_8h_a774b0631e3b58fc676dae2b74c6fa175}{mi\_\-initialize()} 
\end{DoxySeeAlso}
\hypertarget{mi_8h_a6189bd8864075da48cd1174fcc1f0b70}{
\index{mi.h@{mi.h}!mi\_\-unprotect\_\-region@{mi\_\-unprotect\_\-region}}
\index{mi\_\-unprotect\_\-region@{mi\_\-unprotect\_\-region}!mi.h@{mi.h}}
\subsubsection[{mi\_\-unprotect\_\-region}]{\setlength{\rightskip}{0pt plus 5cm}int mi\_\-unprotect\_\-region (int {\em rgn})}}
\label{mi_8h_a6189bd8864075da48cd1174fcc1f0b70}


Unprotects a region of memory. 


\begin{DoxyParams}{Parameters}
\item[{\em rgn}]the region number to unprotect. This is given when you protected the region. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
Whether the unprotection worked. 
\end{DoxyReturn}
