\doxysubsection{SVM process notifications}
\hypertarget{group__notifyprocesses}{}\label{group__notifyprocesses}\index{SVM process notifications@{SVM process notifications}}


This module contains API functions to handle SVM process interruption notifications.  


\doxysubsubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void \mbox{\hyperlink{group__notifyprocesses_gafb5d1ede49e7f496cd9cc3b2ee867506}{svm\+\_\+process\+\_\+interruptionnotification\+\_\+enable}} (const void \texorpdfstring{$\ast$}{*}svm, const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}} process)
\begin{DoxyCompactList}\small\item\em This function changes the process behavior on interruption event. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void \mbox{\hyperlink{group__notifyprocesses_ga4bde833dfb788986e7fa8efc09d6308f}{svm\+\_\+process\+\_\+interruptionnotification\+\_\+disable}} (const void \texorpdfstring{$\ast$}{*}svm, const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}} process)
\begin{DoxyCompactList}\small\item\em This function changes the process behavior on interruption event. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void \mbox{\hyperlink{group__notifyprocesses_ga5dd9da9e466b35e72eeaa4174f931488}{svm\+\_\+process\+\_\+interruptionnotification\+\_\+wait}} (const void \texorpdfstring{$\ast$}{*}svm)
\begin{DoxyCompactList}\small\item\em This function waits until the current process receives an interruption notification. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void \mbox{\hyperlink{group__notifyprocesses_gaa10ec3b1bb041b5e576245654c80c82a}{svm\+\_\+process\+\_\+interruptionnotification\+\_\+send}} (const void \texorpdfstring{$\ast$}{*}svm, const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}} process)
\begin{DoxyCompactList}\small\item\em This function sends an interruption notification to a process. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
This module contains API functions to handle SVM process interruption notifications. 



\doxysubsubsection{Function Documentation}
\Hypertarget{group__notifyprocesses_ga4bde833dfb788986e7fa8efc09d6308f}\label{group__notifyprocesses_ga4bde833dfb788986e7fa8efc09d6308f} 
\index{SVM process notifications@{SVM process notifications}!svm\_process\_interruptionnotification\_disable@{svm\_process\_interruptionnotification\_disable}}
\index{svm\_process\_interruptionnotification\_disable@{svm\_process\_interruptionnotification\_disable}!SVM process notifications@{SVM process notifications}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_interruptionnotification\_disable()}{svm\_process\_interruptionnotification\_disable()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void svm\+\_\+process\+\_\+interruptionnotification\+\_\+disable (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}}}]{process }\end{DoxyParamCaption})}



This function changes the process behavior on interruption event. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em process} & The process allowing to be notified about interruption events.\\
\hline
\end{DoxyParams}
The process will ignore interruption event notifications. On interruption event reception, any blocking syscall will continue its execution.

\begin{DoxyWarning}{Warning}
This feature needs to be activated at SVM compilation time (Please refer to the configure --enable-\/linux-\/extensions option) and may not work.
\end{DoxyWarning}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when the process is not ours or is not a process locked by ours. \\
\hline
{\em FAILURE} & interruption when this API function is called outside a waiting instruction.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}{svm\+\_\+process\+\_\+ownership\+\_\+lock} 

\doxylink{group__getprocesses_gab65c1662923bb41bd23071ef15422f68}{svm\+\_\+process\+\_\+get\+\_\+current} 
\end{DoxySeeAlso}
\Hypertarget{group__notifyprocesses_gafb5d1ede49e7f496cd9cc3b2ee867506}\label{group__notifyprocesses_gafb5d1ede49e7f496cd9cc3b2ee867506} 
\index{SVM process notifications@{SVM process notifications}!svm\_process\_interruptionnotification\_enable@{svm\_process\_interruptionnotification\_enable}}
\index{svm\_process\_interruptionnotification\_enable@{svm\_process\_interruptionnotification\_enable}!SVM process notifications@{SVM process notifications}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_interruptionnotification\_enable()}{svm\_process\_interruptionnotification\_enable()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void svm\+\_\+process\+\_\+interruptionnotification\+\_\+enable (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}}}]{process }\end{DoxyParamCaption})}



This function changes the process behavior on interruption event. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em process} & The process allowing to be notified about interruption events.\\
\hline
\end{DoxyParams}
The process will accept notification on hardware interruptions and scheduling events like suspension, termination and lock. On interruption event, the process will receive a technical signal associated to an empty handler to unlock execution from blocking syscalls. This signal is not related to the eventual hardware interruption signal triggering this notification.

\begin{DoxyNote}{Note}
The interruption notifications are received even if no hardware interruption handlers are defined for the received hardware interruptions.
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
This feature needs to be activated at SVM compilation time (Please refer to the configure --enable-\/linux-\/extensions option) and may not work.
\end{DoxyWarning}
Usage example\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{char}\ buffer[1024];}
\DoxyCodeLine{\mbox{\hyperlink{group__notifyprocesses_gafb5d1ede49e7f496cd9cc3b2ee867506}{svm\_process\_interruptionnotification\_enable}}(svm,\mbox{\hyperlink{group__getprocesses_gab65c1662923bb41bd23071ef15422f68}{svm\_process\_get\_current}}(svm));}
\DoxyCodeLine{ssize\_t\ s\ =\ read(fd,buffer,1024);}
\DoxyCodeLine{\mbox{\hyperlink{group__notifyprocesses_ga4bde833dfb788986e7fa8efc09d6308f}{svm\_process\_interruptionnotification\_disable}}(svm,\mbox{\hyperlink{group__getprocesses_gab65c1662923bb41bd23071ef15422f68}{svm\_process\_get\_current}}(svm));}
\DoxyCodeLine{\textcolor{keywordflow}{if}(s<0)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}(errno==EINTR)}
\DoxyCodeLine{\ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ an\ interruption\ event\ has\ been\ received\ by\ the\ SVM.}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__stringvalues_gadb4dbc96d874c8e5c9157217d0158db2}{svm\_value\_string\_new\_null}}(svm);}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{\ \textcolor{comment}{//\ other\ error\ handling\ here}}
\DoxyCodeLine{\}}
\DoxyCodeLine{\textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__stringvalues_ga07d8c55d0197a17761af6852433def44}{svm\_value\_string\_new\_\_buffer}}(svm,buffer,s);}

\end{DoxyCode}



\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when the process is not ours or is not a process locked by ours. \\
\hline
{\em FAILURE} & interruption when this API function is called outside a waiting instruction.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}{svm\+\_\+process\+\_\+ownership\+\_\+lock} 

\doxylink{group__getprocesses_gab65c1662923bb41bd23071ef15422f68}{svm\+\_\+process\+\_\+get\+\_\+current} 
\end{DoxySeeAlso}
\Hypertarget{group__notifyprocesses_gaa10ec3b1bb041b5e576245654c80c82a}\label{group__notifyprocesses_gaa10ec3b1bb041b5e576245654c80c82a} 
\index{SVM process notifications@{SVM process notifications}!svm\_process\_interruptionnotification\_send@{svm\_process\_interruptionnotification\_send}}
\index{svm\_process\_interruptionnotification\_send@{svm\_process\_interruptionnotification\_send}!SVM process notifications@{SVM process notifications}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_interruptionnotification\_send()}{svm\_process\_interruptionnotification\_send()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void svm\+\_\+process\+\_\+interruptionnotification\+\_\+send (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}}}]{process }\end{DoxyParamCaption})}



This function sends an interruption notification to a process. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em process} & The process to notify.\\
\hline
\end{DoxyParams}
The process will be notified only if it accepts interruption notifications.

\begin{DoxyWarning}{Warning}
This feature needs to be activated at SVM compilation time (Please refer to the configure --enable-\/linux-\/extensions option) and may not work.
\end{DoxyWarning}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.)\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__notifyprocesses_gafb5d1ede49e7f496cd9cc3b2ee867506}{svm\+\_\+process\+\_\+interruptionnotification\+\_\+enable} 

\doxylink{group__notifyprocesses_ga5dd9da9e466b35e72eeaa4174f931488}{svm\+\_\+process\+\_\+interruptionnotification\+\_\+wait} 
\end{DoxySeeAlso}
\Hypertarget{group__notifyprocesses_ga5dd9da9e466b35e72eeaa4174f931488}\label{group__notifyprocesses_ga5dd9da9e466b35e72eeaa4174f931488} 
\index{SVM process notifications@{SVM process notifications}!svm\_process\_interruptionnotification\_wait@{svm\_process\_interruptionnotification\_wait}}
\index{svm\_process\_interruptionnotification\_wait@{svm\_process\_interruptionnotification\_wait}!SVM process notifications@{SVM process notifications}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_interruptionnotification\_wait()}{svm\_process\_interruptionnotification\_wait()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} void svm\+\_\+process\+\_\+interruptionnotification\+\_\+wait (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm }\end{DoxyParamCaption})}



This function waits until the current process receives an interruption notification. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function.\\
\hline
\end{DoxyParams}
To distinguish between an interruption from the scheduler or an hardware interruption, use the svm\+\_\+processor\+\_\+is\+\_\+hardwareinterrupted API function.

\begin{DoxyNote}{Note}
The API function temporarly enables the interruption notifications.
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
This feature needs to be activated at SVM compilation time (Please refer to the configure --enable-\/linux-\/extensions option) and may not work.
\end{DoxyWarning}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when called outside a process. \\
\hline
{\em FAILURE} & interruption when this API function is called outside a waiting instruction.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__interruptionprocessors_ga3ba9c434473ec2f6bbb79f09276c62f9}{svm\+\_\+processor\+\_\+is\+\_\+hardwareinterrupted} 
\end{DoxySeeAlso}
