\hypertarget{PBS_8h}{
\section{PBS.h File Reference}
\label{PBS_8h}\index{PBS.h@{PBS.h}}
}
PBS library, contains the interface to initialization routines for PBS. 

{\tt \#include \char`\"{}IPBS/MBA.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/impl/PBS.h.px-xxx-xxx\char`\"{}}\par


Include dependency graph for PBS.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=237pt]{PBS_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=82pt]{PBS_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__PBS__crashCtx}{\_\-PBS\_\-crash\-Ctx}
\begin{CompactList}\small\item\em Defines the application context parameters of a crash. \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{PBS_8h_a0}{
\#define \hyperlink{PBS_8h_a0}{PBS\_\-CRASH\_\-HANDLER\_\-DEFAULT}~(\hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler})(-1)}
\label{PBS_8h_a0}

\begin{CompactList}\small\item\em Specifies to PBS\_\-crash\-Handler\-Set that the default crash handler is requested. \item\end{CompactList}\item 
\hypertarget{PBS_8h_a1}{
\#define \hyperlink{PBS_8h_a1}{PBS\_\-V\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT}~28}
\label{PBS_8h_a1}

\begin{CompactList}\small\item\em Starting bit of the Vx\-Works reboot field in the options. This is a 3 bit wide field passed directly to 'reboot'. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{struct__PBS__crashCtx}{\_\-PBS\_\-crash\-Ctx} \hyperlink{PBS_8h_a2}{PBS\_\-crash\-Ctx}
\begin{CompactList}\small\item\em Typedef for struct {\em \hyperlink{struct__PBS__crashCtx}{\_\-PBS\_\-crash\-Ctx}\/}. \item\end{CompactList}\item 
typedef int($\ast$ \hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler} )(\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} type, const \hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx} $\ast$ctx, unsigned int options, const char $\ast$string)
\begin{CompactList}\small\item\em User callback routine to handle a crash. \item\end{CompactList}\item 
typedef enum \hyperlink{PBS_8h_a19}{\_\-PBS\_\-crash\-Options} \hyperlink{PBS_8h_a4}{PBS\_\-crash\-Options}
\begin{CompactList}\small\item\em Typedef for. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{PBS_8h_a19}{\_\-PBS\_\-crash\-Options} \{ \par
\hyperlink{PBS_8h_a19a5}{PBS\_\-M\_\-CRASH\_\-OPTION\_\-CRASH\_\-NO} =  (1$<$$<$31), 
\par
\hyperlink{PBS_8h_a19a6}{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-QUICK} =  (1$<$$<$ 30), 
\par
\hyperlink{PBS_8h_a19a7}{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-CLEAR} =  (1$<$$<$ 29), 
\par
\hyperlink{PBS_8h_a19a8}{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-NOAUTO} =  (1$<$$<$ 28)
 \}
\begin{CompactList}\small\item\em Enumerates those bits of the options argument that PBS uses. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{PBS_8h_a9}{PBS\_\-fast\_\-clear} (void $\ast$ptr, unsigned int nbytes)
\begin{CompactList}\small\item\em Clears (Zeroes) the specified memory. \item\end{CompactList}\item 
\hypertarget{PBS_8h_a10}{
int {\bf PBS\_\-configure} (void)}
\label{PBS_8h_a10}

\item 
int \hyperlink{PBS_8h_a11}{PBS\_\-initialize} (int wut\_\-tmr\_\-cnt, int keepalive\_\-period)
\begin{CompactList}\small\item\em One-time PBS library initialization routine. \item\end{CompactList}\item 
int \hyperlink{PBS_8h_a12}{PBS\_\-initialize2} (int wut\_\-tmr\_\-cnt, int keepalive\_\-period, \hyperlink{MBA_8h_a1}{MBA\_\-create\_\-cb} mba\_\-create, void $\ast$mba\_\-prm)
\begin{CompactList}\small\item\em One-time PBS library initialization routine. \item\end{CompactList}\item 
int \hyperlink{PBS_8h_a13}{PBS\_\-shutdown} (void)
\begin{CompactList}\small\item\em Shuts down the PBS facility. \item\end{CompactList}\item 
void \hyperlink{PBS_8h_a14}{PBS\_\-crash} (\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} type, const \hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx} $\ast$ctx, unsigned int options, const char $\ast$string)
\begin{CompactList}\small\item\em General purposes reboot routine. \item\end{CompactList}\item 
void \hyperlink{PBS_8h_a15}{PBS\_\-panic} (unsigned int reason, unsigned int parameter, void $\ast$pc, unsigned int options, const char $\ast$string)
\begin{CompactList}\small\item\em Routine to initiate a panic reboot. \item\end{CompactList}\item 
void \hyperlink{PBS_8h_a16}{PBS\_\-reboot} (unsigned int reason, unsigned int parameter, void $\ast$pc, unsigned int options, const char $\ast$string)
\begin{CompactList}\small\item\em Routine to initiate a commanded reboot. \item\end{CompactList}\item 
\hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler} \hyperlink{PBS_8h_a17}{PBS\_\-crash\-Handler\-Set} (\hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler} crash\-Handler)
\begin{CompactList}\small\item\em Installs a new user crash handler. \item\end{CompactList}\item 
int \hyperlink{PBS_8h_a18}{PBS\_\-crash\-Print} (\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} type, const \hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx} $\ast$ctx, unsigned int options, const char $\ast$string)
\begin{CompactList}\small\item\em Very simple default PBS crash handler. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
PBS library, contains the interface to initialization routines for PBS. 

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


\footnotesize\begin{verbatim}   CVS $Id: PBS.h,v 1.1.1.1 2006/02/10 21:45:35 saxton Exp $
\end{verbatim}
\normalsize


\subsection{Typedef Documentation}
\hypertarget{PBS_8h_a2}{
\index{PBS.h@{PBS.h}!PBS_crashCtx@{PBS\_\-crashCtx}}
\index{PBS_crashCtx@{PBS\_\-crashCtx}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-crashCtx]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx}}}
\label{PBS_8h_a2}


Typedef for struct {\em \hyperlink{struct__PBS__crashCtx}{\_\-PBS\_\-crash\-Ctx}\/}. 

This data structure contains the application specific context parameters of the crash. The intent is to provide enough information that the reason of the crash can be diagnosed.

This block is limited to 8 32-bit values and, if the OS supports it, is committed to the area of memory saved across boots.\hypertarget{PBS_8h_a3}{
\index{PBS.h@{PBS.h}!PBS_crashHandler@{PBS\_\-crashHandler}}
\index{PBS_crashHandler@{PBS\_\-crashHandler}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-crashHandler]{\setlength{\rightskip}{0pt plus 5cm}unsigned int($\ast$ \hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler})(\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} type, const \hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx} ctx, unsigned int options, const char $\ast$string)}}
\label{PBS_8h_a3}


User callback routine to handle a crash. 

\begin{Desc}
\item[Returns:]The new options value\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The crash type, {\em i.e\/}. one of\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} 's. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]The crash context block \item[{\em options}]The crash options (OS dependent) \item[{\em string}]An arbitrary user string\end{description}
\end{Desc}
This routine is meant to provide a formatted dump of the crash. It is user provided by calling\begin{Desc}
\item[See also:]\hyperlink{PBS_8c_a8}{PBS\_\-crash\-Handler\-Set} (). A default version 

\hyperlink{PBS_8c_a7}{PBS\_\-crash\-Print} () has been provided.\end{Desc}
\hypertarget{PBS_8h_a4}{
\index{PBS.h@{PBS.h}!PBS_crashOptions@{PBS\_\-crashOptions}}
\index{PBS_crashOptions@{PBS\_\-crashOptions}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-crashOptions]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{PBS_8h_a4}{PBS\_\-crash\-Options}}}
\label{PBS_8h_a4}


Typedef for. 

\begin{Desc}
\item[See also:]enum \hyperlink{PBS_8h_a19}{\_\-PBS\_\-crash\-Options}\end{Desc}
The options word present in many of the PBS crash routines, {\em e.g\/}. \begin{Desc}
\item[See also:]\hyperlink{PBS_8c_a9}{PBS\_\-crash},

\hyperlink{PBS_8c_a11}{PBS\_\-panic} and

\hyperlink{PBS_8c_a10}{PBS\_\-reboot}, is a series of bit flags shared between the PBS layer and the underlying OS reboot layer.\end{Desc}
The tenative agreement is that PBS gets the upper 16 and the OS reboot layer gets the lower 16. PBS will begin allocating these bits from the top down.

Some of the PBS options are generic, {\em i.e\/}. they have the same meaning on all platforms, while others only have meaning on certain platforms.

In the former category is\begin{Desc}
\item[See also:]PBS\_\-M\_\-CRASH\_\-OPTION\_\-REBOOT\_\-NO. This option inhibits the calling of the underlying OS reboot function, essentially reducing the call to \hyperlink{PBS_8c_a9}{PBS\_\-crash}, \hyperlink{PBS_8c_a11}{PBS\_\-panic} and \hyperlink{PBS_8c_a10}{PBS\_\-reboot} to only filling out the context block and calling back the user defined handler. This feature may prove useful in testing.\end{Desc}
In the latter category is\begin{Desc}
\item[See also:]PBS\_\-M\_\-CRASH\_\-OPTION\_\-REBOOT\_\-NOAUTO. This option is relevant only to those platforms calling the VXWORKs {\em reboot\/} function. These platforms are {\em mv2304\/} and the {\em mcp750\/}. This option effectively translates in the the BOOT\_\-NORMAL (option cleared) and BOOT\_\-NOAUTOBOOT.\end{Desc}


\subsection{Enumeration Type Documentation}
\hypertarget{PBS_8h_a19}{
\index{PBS.h@{PBS.h}!_PBS_crashOptions@{\_\-PBS\_\-crashOptions}}
\index{_PBS_crashOptions@{\_\-PBS\_\-crashOptions}!PBS.h@{PBS.h}}
\subsubsection[\_\-PBS\_\-crashOptions]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{PBS_8h_a19}{\_\-PBS\_\-crash\-Options}}}
\label{PBS_8h_a19}


Enumerates those bits of the options argument that PBS uses. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{PBS_M_CRASH_OPTION_CRASH_NO@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-CRASH\_\-NO}!PBS.h@{PBS.h}}\index{PBS.h@{PBS.h}!PBS_M_CRASH_OPTION_CRASH_NO@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-CRASH\_\-NO}}\item[{\em 
\hypertarget{PBS_8h_a19a5}{
PBS\_\-M\_\-CRASH\_\-OPTION\_\-CRASH\_\-NO}
\label{PBS_8h_a19a5}
}]Only call the user level handler,do no call the underlying OS crash/reboot function. \index{PBS_M_CRASH_OPTION_VX_REBOOT_QUICK@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-QUICK}!PBS.h@{PBS.h}}\index{PBS.h@{PBS.h}!PBS_M_CRASH_OPTION_VX_REBOOT_QUICK@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-QUICK}}\item[{\em 
\hypertarget{PBS_8h_a19a6}{
PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-QUICK}
\label{PBS_8h_a19a6}
}]Meaningful only MV23xx and MCP750 platforms, this translates into BOOT\_\-QUICK\_\-AUTOBOOT (4) \index{PBS_M_CRASH_OPTION_VX_REBOOT_CLEAR@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-CLEAR}!PBS.h@{PBS.h}}\index{PBS.h@{PBS.h}!PBS_M_CRASH_OPTION_VX_REBOOT_CLEAR@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-CLEAR}}\item[{\em 
\hypertarget{PBS_8h_a19a7}{
PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-CLEAR}
\label{PBS_8h_a19a7}
}]Meaningful only MV23xx and MCP750 platforms, this translates into BOOT\_\-CLEAR (2), clearing memory on the reboot \index{PBS_M_CRASH_OPTION_VX_REBOOT_NOAUTO@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-NOAUTO}!PBS.h@{PBS.h}}\index{PBS.h@{PBS.h}!PBS_M_CRASH_OPTION_VX_REBOOT_NOAUTO@{PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-NOAUTO}}\item[{\em 
\hypertarget{PBS_8h_a19a8}{
PBS\_\-M\_\-CRASH\_\-OPTION\_\-VX\_\-REBOOT\_\-NOAUTO}
\label{PBS_8h_a19a8}
}]Meaningful only MV23xx and MCP750 platforms, this translates into BOOT\_\-NO\_\-AUTOBOOT (1) \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{PBS_8h_a14}{
\index{PBS.h@{PBS.h}!PBS_crash@{PBS\_\-crash}}
\index{PBS_crash@{PBS\_\-crash}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-crash]{\setlength{\rightskip}{0pt plus 5cm}void PBS\_\-crash (\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} {\em type}, const \hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx} $\ast$ {\em ctx}, unsigned int {\em options}, const char $\ast$ {\em string})}}
\label{PBS_8h_a14}


General purposes reboot routine. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of reboot being requested, {\em i.e\/}. one of \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type}. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]A filled in\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a2}{PBS\_\-crash\-Ctx} block. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em options}]A set options. See\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a4}{PBS\_\-crash\-Options} for further details. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]An arbitrary user string. This is used iff there is an active PBS crash handler, in which case it is merely passed through to it.\end{description}
\end{Desc}
\hypertarget{PBS_8h_a17}{
\index{PBS.h@{PBS.h}!PBS_crashHandlerSet@{PBS\_\-crashHandlerSet}}
\index{PBS_crashHandlerSet@{PBS\_\-crashHandlerSet}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-crashHandlerSet]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler} PBS\_\-crash\-Handler\-Set (\hyperlink{PBS_8h_a3}{PBS\_\-crash\-Handler} {\em crash\-Handler})}}
\label{PBS_8h_a17}


Installs a new user crash handler. 

\begin{Desc}
\item[Returns:]The old crash handler\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em crash\-Handler}]The new crash handler routine. If this may be NULL or PBS\_\-CRASH\_\-HANDLER\_\-DEFAULT\end{description}
\end{Desc}
This routine may be specified as NULL, in which case no user crash handler callback routine is executed.

\begin{Desc}
\item[Note:]While one can currently get the same effect using either of the two example pieces of code below. If one uses the former, then the PBS crash handler is always\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a18}{PBS\_\-crash\-Print()}, while if one uses the later, the crash handler tracks the current runtime default.\end{Desc}


\footnotesize\begin{verbatim}   PBS_crashHandlerSet (PBS_crashPrint);
\end{verbatim}
\normalsize




\footnotesize\begin{verbatim}   PBS_crashHandlerSet (PBS_CRASH_HANDLER_DEFAULT);
\end{verbatim}
\normalsize
\hypertarget{PBS_8h_a18}{
\index{PBS.h@{PBS.h}!PBS_crashPrint@{PBS\_\-crashPrint}}
\index{PBS_crashPrint@{PBS\_\-crashPrint}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-crashPrint]{\setlength{\rightskip}{0pt plus 5cm}int PBS\_\-crash\-Print (\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type} {\em type}, const \hyperlink{struct__PBS__crashCtx}{PBS\_\-crash\-Ctx} $\ast$ {\em ctx}, unsigned int {\em options}, const char $\ast$ {\em string})}}
\label{PBS_8h_a18}


Very simple default PBS crash handler. 

\begin{Desc}
\item[Returns:]{\em options\/} \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of reboot being requested, {\em i.e\/}. one of\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_8vx-xxx-xxx_a2}{PBS\_\-crash\-Type}. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ctx}]Pointer to a completed PBS\_\-crash\-Ctx block. \item[{\em options}]A set options. See\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a4}{PBS\_\-crash\-Options} for further details. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]An arbitrary user string. It is just printed as the first line of the output.\end{description}
\end{Desc}
This is the current default user handler, {\em i\/}..e the one gets if PBS\_\-CRASH\_\-HANDLER\_\-DEFAULT is specified as the argument to \begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a17}{PBS\_\-crash\-Handler\-Set()}.\end{Desc}
\hypertarget{PBS_8h_a9}{
\index{PBS.h@{PBS.h}!PBS_fast_clear@{PBS\_\-fast\_\-clear}}
\index{PBS_fast_clear@{PBS\_\-fast\_\-clear}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-fast\_\-clear]{\setlength{\rightskip}{0pt plus 5cm}void PBS\_\-fast\_\-clear (void $\ast$ {\em ptr}, unsigned int {\em nbytes})}}
\label{PBS_8h_a9}


Clears (Zeroes) the specified memory. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr}]Pointer to the memory to zero \item[{\em nbytes}]The number of bytes to zero\end{description}
\end{Desc}
\begin{Desc}
\item[]This provides a fast way of zeroing large chunks of memory on PPC platforms using the {\em dcbz\/} instruction. This instruction zeroes a cache line at a time. The savings in speed varies by processor, but factors of 5 or more are in the ballpark, saturating out at a factor of 2 once the data cache size is exceeded (32Kbytes).\end{Desc}
\begin{Desc}
\item[]On other platforms, the library supplied routine is used.\end{Desc}
\begin{Desc}
\item[Warning:]On PPC platforms, this will work if and only if the memory being cleared is cache enabled. For the most part this is not a problem since usually all memory but memory mapped to IO space and set aside for driver use is marked cacheable. This routine does check to make sure the data cache is globally enabled. If not, the generic clear routine is called. The routine is protected if the data cache is globally disabled, in this case, dropping make and using the generic routine.\end{Desc}
\hypertarget{PBS_8h_a11}{
\index{PBS.h@{PBS.h}!PBS_initialize@{PBS\_\-initialize}}
\index{PBS_initialize@{PBS\_\-initialize}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-initialize]{\setlength{\rightskip}{0pt plus 5cm}int PBS\_\-initialize (int {\em wut\_\-tmr\_\-cnt}, int {\em keepalive\_\-period})}}
\label{PBS_8h_a11}


One-time PBS library initialization routine. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut\_\-tmr\_\-cnt}]The number of WUT timers to keep in the system pool. If specified as 0, a default value of 256 will be used. \item[{\em keepalive\_\-period}]The period (in nanoseconds) of the periodic keepalive timer. If specified as 0, a default value of 20,000,000, corresponding to 50Hz will be used.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status, 1 indicates PBS was already initialized\end{Desc}
This is a one-time initialization of the PBS library. This call not only initializes static resources, but also replaces the Vx\-Works decrement counter interrupt routine (the 'timer') with the high resolution WUT timers.\hypertarget{PBS_8h_a12}{
\index{PBS.h@{PBS.h}!PBS_initialize2@{PBS\_\-initialize2}}
\index{PBS_initialize2@{PBS\_\-initialize2}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-initialize2]{\setlength{\rightskip}{0pt plus 5cm}int PBS\_\-initialize2 (int {\em wut\_\-tmr\_\-cnt}, int {\em keepalive\_\-period}, \hyperlink{MBA_8h_a1}{MBA\_\-create\_\-cb} {\em mba\_\-create}, void $\ast$ {\em mba\_\-prm})}}
\label{PBS_8h_a12}


One-time PBS library initialization routine. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut\_\-tmr\_\-cnt}]The number of WUT timers to keep in the system pool. If specified as 0, a default value of 256 will be used. \item[{\em keepalive\_\-period}]The period (in nanoseconds) of the periodic keepalive timer. If specified as 0, a default value of 20,000,000, corresponding to 50Hz will be used.\item[{\em mba\_\-create}]Alternate MBA partition creation routine. If specified as NULL, a default creation routine will be used and {\em prm\/} will be interpretted as a list of bad blocks, {\em i.e\/}. of type MBA\_\-bad\-Block\-List.\item[{\em mba\_\-prm}]Arbitrary parameter passed to the MBA partition creation routine.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status, 1 indicates PBS was already initialized\end{Desc}
This is a one-time initialization of the PBS library.\hypertarget{PBS_8h_a15}{
\index{PBS.h@{PBS.h}!PBS_panic@{PBS\_\-panic}}
\index{PBS_panic@{PBS\_\-panic}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-panic]{\setlength{\rightskip}{0pt plus 5cm}void PBS\_\-panic (unsigned int {\em reason}, unsigned int {\em parameter}, void $\ast$ {\em pc}, unsigned int {\em options}, const char $\ast$ {\em string})}}
\label{PBS_8h_a15}


Routine to initiate a panic reboot. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em reason}]An application specific reason for the reboot. For example, this may identify the reason why the software is in a panic. \item[{\em parameter}]An additional opaque user application parameter \item[{\em pc}]The PC of where the reboot panic originated. Typically one would use PBS\_\-PC() to get fill this value. \item[{\em options}]A set options. Set\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a4}{PBS\_\-crash\-Options} for further details. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]An arbitrary user string. This is used iff there is an active PBS crash handler, in which case it is merely passed through to it.\end{description}
\end{Desc}
This routine is typically called when a piece of application code finds itself confronted with a software or hardware error which it cannot handle.

This routine will\begin{enumerate}
\item fill out the remaining fields of the PCB\_\-crash\-Ctx block\item callback any user supplied PBS\_\-crash\-Handler, see\begin{Desc}
\item[See also:]\hyperlink{PBS_8c_a8}{PBS\_\-crash\-Handler\-Set} ().\end{Desc}
\item call the underlying OS dependent reboot or abort routine.\end{enumerate}
\hypertarget{PBS_8h_a16}{
\index{PBS.h@{PBS.h}!PBS_reboot@{PBS\_\-reboot}}
\index{PBS_reboot@{PBS\_\-reboot}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-reboot]{\setlength{\rightskip}{0pt plus 5cm}void PBS\_\-reboot (unsigned int {\em reason}, unsigned int {\em parameter}, void $\ast$ {\em pc}, unsigned int {\em options}, const char $\ast$ {\em string})}}
\label{PBS_8h_a16}


Routine to initiate a commanded reboot. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]An arbitrary user string. This is used iff there is an active PBS crash handler, in which case it is merely passed through to it. \item[{\em reason}]An command specific reason for the reboot. For example this may identify the source of the reboot command \item[{\em parameter}]An additional opaque user parameter \item[{\em pc}]The PC of where the reboot command originated. Typically one would use PBS\_\-PC() to get fill this value. \item[{\em options}]A set options. See\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{PBS_8h_a4}{PBS\_\-crash\-Options} for further details.\end{Desc}
This routine is called when a command instructing the OS to reboot has been received.

This routine will\begin{enumerate}
\item fill out the remaining fields of the PCB\_\-crash\-Ctx block\item callback any user supplied PBS\_\-crash\-Handler, see\begin{Desc}
\item[See also:]\hyperlink{PBS_8c_a8}{PBS\_\-crash\-Handler\-Set} ().\end{Desc}
\item call the underlying OS dependent reboot or abort routine.\end{enumerate}
\hypertarget{PBS_8h_a13}{
\index{PBS.h@{PBS.h}!PBS_shutdown@{PBS\_\-shutdown}}
\index{PBS_shutdown@{PBS\_\-shutdown}!PBS.h@{PBS.h}}
\subsubsection[PBS\_\-shutdown]{\setlength{\rightskip}{0pt plus 5cm}int PBS\_\-shutdown (void)}}
\label{PBS_8h_a13}


Shuts down the PBS facility. 

\begin{Desc}
\item[Warning:]This function is only meant to be used during development. Its main use is to allow the semi-graceful reloading of PBS in the Vx\-Works environment.\end{Desc}
