From 4ecb904c6b94fdbc03c1bb2d16d93a5eadb2d054 Mon Sep 17 00:00:00 2001
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 19 Dec 2017 10:29:19 +0100
Subject: rt-app-basics: switch to verbatim

The verbatim text type is much easier to read. Use it instead for
commands and output.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 realtime/rt-app-basics/pres_rt-app-basics_en.tex | 52 ++++++++++++------------
 1 file changed, 26 insertions(+), 26 deletions(-)

(limited to 'realtime/rt-app-basics/pres_rt-app-basics_en.tex')

diff --git a/realtime/rt-app-basics/pres_rt-app-basics_en.tex b/realtime/rt-app-basics/pres_rt-app-basics_en.tex
index 90b2ce3..bfd7326 100644
--- a/realtime/rt-app-basics/pres_rt-app-basics_en.tex
+++ b/realtime/rt-app-basics/pres_rt-app-basics_en.tex
@@ -22,54 +22,54 @@ echo -1 > \
 
 \begin{frame}[fragile]
 \frametitle{Setting RT priority}
-\begin{lstlisting}
+\begin{verbatim}
 /* Set realtime priority */
 struct sched_param param;
 param.sched_priority = 99;
 if (sched_setscheduler(0, SCHED_FIFO, &param) < 0)
     perror("Can't set scheduling policy");
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Lock memory}
-\begin{lstlisting}
+\begin{verbatim}
 if (mlockall(MCL_CURRENT | MCL_FUTURE))
     perror("mlockall failed:");
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Configure malloc() behaviour}
-\begin{lstlisting}
+\begin{verbatim}
 /* Turn off malloc trimming.*/
 mallopt(M_TRIM_THRESHOLD, -1);
 
 /* Turn off mmap usage. */
 mallopt(M_MMAP_MAX, 0);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Reserve process memory}
-\begin{lstlisting}
+\begin{verbatim}
 buffer = malloc(MSIZE);
 
 for (i = 0; i < MSIZE; i += sysconf(_SC_PAGESIZE))
     buffer[i] = 0;
 
 free(buffer);
-\end{lstlisting}
+\end{verbatim}
 \textbf{BUT: Please avoid memory allocation from realtime context!!}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Prefault the stack (per Thread!)}
-\begin{lstlisting}
+\begin{verbatim}
 /* Prove that this thread is behaving well */
 for (i = 0; i < SAVE_STACK_SIZE; i += sysconf(_SC_PAGESIZE))
     buffer[i] = i;
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \subsubsection{Clocks and Timers}
@@ -97,14 +97,14 @@ since some unspecified starting point.
 
 \begin{frame}[fragile]
 \frametitle{Getting the time}
-\begin{lstlisting}
+\begin{verbatim}
 struct timespec tv;
 struct timespec res;
 
 clock_gettime(CLOCK_MONOTONIC, &tv);
 
 clock_getres(CLOCK_MONOTONIC, &res);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}
@@ -117,7 +117,7 @@ clock_getres(CLOCK_MONOTONIC, &res);
 
 \begin{frame}[fragile]
 \frametitle{Example: 1 / 2}
-\begin{lstlisting}
+\begin{verbatim}
 #include <stdio.h>
 #include <time.h>
 
@@ -131,12 +131,12 @@ void norm_ts(struct timespec *tv)
                 tv->tv_nsec -= NSEC_PER_SEC;
         }
 }
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Example: 2 / 2}
-\begin{lstlisting}
+\begin{verbatim}
 int main(void)
 {
         struct timespec tv;
@@ -151,7 +151,7 @@ int main(void)
                 clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &tv, NULL);
         } while(1);
 }
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \subsubsection{Locking}
@@ -166,7 +166,7 @@ int main(void)
 
 \begin{frame}[fragile]
 \frametitle{Locking example}
-\begin{lstlisting}
+\begin{verbatim}
 pthread_mutex_t master_lock;
 pthread_mutexattr_t mattr;
 
@@ -181,7 +181,7 @@ pthread_mutex_lock(&master_lock);
 pthread_mutex_unlock(&master_lock);
 
 pthread_mutex_destroy(&master_lock);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \subsubsection{Signalling}
@@ -195,7 +195,7 @@ pthread_mutex_destroy(&master_lock);
 
 \begin{frame}[fragile]
 \frametitle{pthread\_cond\_var: Initialization 1 / 2}
-\begin{lstlisting}
+\begin{verbatim}
 pthread_mutexattr_t mattr;
 pthread_condattr_t cattr;
 pthread_cond_t cond;
@@ -206,39 +206,39 @@ pthread_mutexattr_setpshared (&mattr, PTHREAD_PROCESS_SHARED);
 pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT);
 pthread_mutexattr_setrobust_np(&mattr, PTHREAD_MUTEX_ROBUST_NP);
 pthread_mutex_init (&mutex, &mattr);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{pthread\_cond\_var: Initialization 2 / 2}
-\begin{lstlisting}
+\begin{verbatim}
 pthread_condattr_init (&cattr);
 pthread_condattr_setpshared (&cattr, PTHREAD_PROCESS_SHARED);
 pthread_cond_init (&cond, &cattr);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{pthread\_cond\_var: Send signal}
-\begin{lstlisting}
+\begin{verbatim}
 /* Send signal */
 pthread_mutex_lock(&mutex);
 /* Do the homework */
 /* ... */
 pthread_cond_broadcast (&cond);
 pthread_mutex_unlock(&mutex);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{pthread\_cond\_var: Wait for signal}
-\begin{lstlisting}
+\begin{verbatim}
 /* Wait for signal */
 pthread_mutex_lock(&mutex);
 pthread_cond_wait (&cond, &mutex);
 /* -> We've been signalled */
 pthread_mutex_unlock(&mutex);
-\end{lstlisting}
+\end{verbatim}
 \end{frame}
 
 \subsubsection{sources}
-- 
cgit v1.2.3

