\section{include/tm.h File Reference}
\label{tm_8h}\index{include/tm.h@{include/tm.h}}
Interface: task management. 

{\tt \#include $<$config.h$>$}\par
{\tt \#include $<$mem.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf \_\-pchain\_\-t}
\item 
struct {\bf \_\-tdata\_\-t}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf PRIO\_\-LOWEST}\ 1
\begin{CompactList}\small\item\em The lowest possible task priority. \item\end{CompactList}\item 
\#define {\bf PRIO\_\-NORMAL}\ 10
\begin{CompactList}\small\item\em The priority of most tasks. \item\end{CompactList}\item 
\#define {\bf PRIO\_\-HIGHEST}\ 20
\begin{CompactList}\small\item\em The highest possible task priority. \item\end{CompactList}\item 
\#define {\bf T\_\-DEAD}\ 0
\begin{CompactList}\small\item\em dead and gone, stack freed \item\end{CompactList}\item 
\#define {\bf T\_\-ZOMBIE}\ 1
\begin{CompactList}\small\item\em terminated, cleanup pending \item\end{CompactList}\item 
\#define {\bf T\_\-WAITING}\ 2
\begin{CompactList}\small\item\em waiting for an event \item\end{CompactList}\item 
\#define {\bf T\_\-SLEEPING}\ 3
\begin{CompactList}\small\item\em sleeping. wants to run. \item\end{CompactList}\item 
\#define {\bf T\_\-RUNNING}\ 4
\begin{CompactList}\small\item\em running \item\end{CompactList}\item 
\#define {\bf T\_\-KERNEL}\ (1 $<$$<$ 0)
\begin{CompactList}\small\item\em kernel task \item\end{CompactList}\item 
\#define {\bf T\_\-USER}\ (1 $<$$<$ 1)
\begin{CompactList}\small\item\em user task \item\end{CompactList}\item 
\#define {\bf T\_\-IDLE}\ (1 $<$$<$ 2)
\begin{CompactList}\small\item\em idle task \item\end{CompactList}\item 
\#define {\bf T\_\-SHUTDOWN}\ (1 $<$$<$ 7)
\begin{CompactList}\small\item\em shutdown requested \item\end{CompactList}\item 
\#define {\bf DEFAULT\_\-STACK\_\-SIZE}\ 512
\begin{CompactList}\small\item\em that's enough. \item\end{CompactList}\item 
\#define {\bf shutdown\_\-requested}()\ (0)
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef volatile unsigned char {\bf tstate\_\-t}
\begin{CompactList}\small\item\em task state type \item\end{CompactList}\item 
typedef volatile unsigned char {\bf tflags\_\-t}
\begin{CompactList}\small\item\em task flags type \item\end{CompactList}\item 
typedef unsigned char {\bf priority\_\-t}
\begin{CompactList}\small\item\em task priority type \item\end{CompactList}\item 
typedef unsigned long {\bf wakeup\_\-t}
\begin{CompactList}\small\item\em wakeup data area type \item\end{CompactList}\item 
typedef {\bf \_\-pchain\_\-t} {\bf pchain\_\-t}
\item 
typedef {\bf \_\-tdata\_\-t} {\bf tdata\_\-t}
\begin{CompactList}\small\item\em task data type \item\end{CompactList}\item 
typedef signed int {\bf tid\_\-t}
\begin{CompactList}\small\item\em task id type \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface: task management. 

\begin{Desc}
\item[Author:]Markus L. Noga $<${\tt markus@noga.de}$>$\end{Desc}
Defines types and flags used in task management.

Definition in file {\bf tm.h}.

\subsection{Define Documentation}
\index{tm.h@{tm.h}!DEFAULT_STACK_SIZE@{DEFAULT\_\-STACK\_\-SIZE}}
\index{DEFAULT_STACK_SIZE@{DEFAULT\_\-STACK\_\-SIZE}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFAULT\_\-STACK\_\-SIZE\ 512}\label{tm_8h_a12}


that's enough. 



Definition at line 81 of file tm.h.

Referenced by kmain().\index{tm.h@{tm.h}!PRIO_HIGHEST@{PRIO\_\-HIGHEST}}
\index{PRIO_HIGHEST@{PRIO\_\-HIGHEST}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PRIO\_\-HIGHEST\ 20}\label{tm_8h_a2}


The highest possible task priority. 



Definition at line 55 of file tm.h.\index{tm.h@{tm.h}!PRIO_LOWEST@{PRIO\_\-LOWEST}}
\index{PRIO_LOWEST@{PRIO\_\-LOWEST}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PRIO\_\-LOWEST\ 1}\label{tm_8h_a0}


The lowest possible task priority. 



Definition at line 51 of file tm.h.\index{tm.h@{tm.h}!PRIO_NORMAL@{PRIO\_\-NORMAL}}
\index{PRIO_NORMAL@{PRIO\_\-NORMAL}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PRIO\_\-NORMAL\ 10}\label{tm_8h_a1}


The priority of most tasks. 



Definition at line 53 of file tm.h.

Referenced by kmain().\index{tm.h@{tm.h}!shutdown_requested@{shutdown\_\-requested}}
\index{shutdown_requested@{shutdown\_\-requested}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define shutdown\_\-requested()\ (0)}\label{tm_8h_a13}




Definition at line 137 of file tm.h.\index{tm.h@{tm.h}!T_DEAD@{T\_\-DEAD}}
\index{T_DEAD@{T\_\-DEAD}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-DEAD\ 0}\label{tm_8h_a3}


dead and gone, stack freed 



Definition at line 65 of file tm.h.\index{tm.h@{tm.h}!T_IDLE@{T\_\-IDLE}}
\index{T_IDLE@{T\_\-IDLE}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-IDLE\ (1 $<$$<$ 2)}\label{tm_8h_a10}


idle task 



Definition at line 77 of file tm.h.\index{tm.h@{tm.h}!T_KERNEL@{T\_\-KERNEL}}
\index{T_KERNEL@{T\_\-KERNEL}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-KERNEL\ (1 $<$$<$ 0)}\label{tm_8h_a8}


kernel task 



Definition at line 75 of file tm.h.\index{tm.h@{tm.h}!T_RUNNING@{T\_\-RUNNING}}
\index{T_RUNNING@{T\_\-RUNNING}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-RUNNING\ 4}\label{tm_8h_a7}


running 



Definition at line 69 of file tm.h.\index{tm.h@{tm.h}!T_SHUTDOWN@{T\_\-SHUTDOWN}}
\index{T_SHUTDOWN@{T\_\-SHUTDOWN}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-SHUTDOWN\ (1 $<$$<$ 7)}\label{tm_8h_a11}


shutdown requested 



Definition at line 78 of file tm.h.\index{tm.h@{tm.h}!T_SLEEPING@{T\_\-SLEEPING}}
\index{T_SLEEPING@{T\_\-SLEEPING}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-SLEEPING\ 3}\label{tm_8h_a6}


sleeping. wants to run. 



Definition at line 68 of file tm.h.\index{tm.h@{tm.h}!T_USER@{T\_\-USER}}
\index{T_USER@{T\_\-USER}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-USER\ (1 $<$$<$ 1)}\label{tm_8h_a9}


user task 



Definition at line 76 of file tm.h.\index{tm.h@{tm.h}!T_WAITING@{T\_\-WAITING}}
\index{T_WAITING@{T\_\-WAITING}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-WAITING\ 2}\label{tm_8h_a5}


waiting for an event 



Definition at line 67 of file tm.h.\index{tm.h@{tm.h}!T_ZOMBIE@{T\_\-ZOMBIE}}
\index{T_ZOMBIE@{T\_\-ZOMBIE}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define T\_\-ZOMBIE\ 1}\label{tm_8h_a4}


terminated, cleanup pending 



Definition at line 66 of file tm.h.

\subsection{Typedef Documentation}
\index{tm.h@{tm.h}!pchain_t@{pchain\_\-t}}
\index{pchain_t@{pchain\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf \_\-pchain\_\-t} {\bf pchain\_\-t}}\label{tm_8h_a18}


priority chain data type a shorthand 

Definition at line 100 of file tm.h.\index{tm.h@{tm.h}!priority_t@{priority\_\-t}}
\index{priority_t@{priority\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef unsigned char {\bf priority\_\-t}}\label{tm_8h_a16}


task priority type 



Definition at line 48 of file tm.h.\index{tm.h@{tm.h}!tdata_t@{tdata\_\-t}}
\index{tdata_t@{tdata\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf \_\-tdata\_\-t} {\bf tdata\_\-t}}\label{tm_8h_a19}


task data type 

a shorthand 

Definition at line 125 of file tm.h.\index{tm.h@{tm.h}!tflags_t@{tflags\_\-t}}
\index{tflags_t@{tflags\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef volatile unsigned char {\bf tflags\_\-t}}\label{tm_8h_a15}


task flags type 



Definition at line 46 of file tm.h.\index{tm.h@{tm.h}!tid_t@{tid\_\-t}}
\index{tid_t@{tid\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef signed int {\bf tid\_\-t}}\label{tm_8h_a20}


task id type 

In effect, the kernel simply typecasts $\ast$tdata\_\-t to tid\_\-t. 

Definition at line 143 of file tm.h.\index{tm.h@{tm.h}!tstate_t@{tstate\_\-t}}
\index{tstate_t@{tstate\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef volatile unsigned char {\bf tstate\_\-t}}\label{tm_8h_a14}


task state type 



Definition at line 45 of file tm.h.\index{tm.h@{tm.h}!wakeup_t@{wakeup\_\-t}}
\index{wakeup_t@{wakeup\_\-t}!tm.h@{tm.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef unsigned long {\bf wakeup\_\-t}}\label{tm_8h_a17}


wakeup data area type 



Definition at line 57 of file tm.h.

Referenced by wait\_\-event().