thread_config.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-21 Freie Universit├Ąt Berlin
3  * 2021 Inria
4  * 2021 Kaspar Schleiser <kaspar@schleiser.de>
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
22 #ifndef THREAD_CONFIG_H
23 #define THREAD_CONFIG_H
24 
25 #include "cpu_conf.h"
26 #include "sched.h" /* for SCHED_PRIO_LEVELS */
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
39 #ifndef THREAD_STACKSIZE_DEFAULT
40 #error THREAD_STACKSIZE_DEFAULT must be defined per CPU
41 #endif
42 #ifdef DOXYGEN
43 #define THREAD_STACKSIZE_DEFAULT
44 #endif
45 
53 #ifndef THREAD_STACKSIZE_IDLE
54 #error THREAD_STACKSIZE_IDLE must be defined per CPU
55 #endif
56 #ifdef DOXYGEN
57 #define THREAD_STACKSIZE_IDLE
58 #endif
59 
67 #ifndef THREAD_EXTRA_STACKSIZE_PRINTF
68 #error THREAD_EXTRA_STACKSIZE_PRINTF must be defined per CPU
69 #endif
70 #ifdef DOXYGEN
71 #define THREAD_EXTRA_STACKSIZE_PRINTF
72 #endif
73 
78 #ifndef THREAD_STACKSIZE_MAIN
79 #define THREAD_STACKSIZE_MAIN (THREAD_STACKSIZE_DEFAULT + \
80  THREAD_EXTRA_STACKSIZE_PRINTF)
81 #endif
82 
86 #ifndef THREAD_STACKSIZE_LARGE
87 #define THREAD_STACKSIZE_LARGE (THREAD_STACKSIZE_MEDIUM * 2)
88 #endif
89 
93 #ifndef THREAD_STACKSIZE_MEDIUM
94 #define THREAD_STACKSIZE_MEDIUM THREAD_STACKSIZE_DEFAULT
95 #endif
96 
100 #ifndef THREAD_STACKSIZE_SMALL
101 #define THREAD_STACKSIZE_SMALL (THREAD_STACKSIZE_MEDIUM / 2)
102 #endif
103 
107 #ifndef THREAD_STACKSIZE_TINY
108 #define THREAD_STACKSIZE_TINY (THREAD_STACKSIZE_MEDIUM / 4)
109 #endif
110 
114 #ifndef THREAD_STACKSIZE_MINIMUM
115 #define THREAD_STACKSIZE_MINIMUM (sizeof(thread_t))
116 #endif
117 
122 #define THREAD_PRIORITY_MIN (SCHED_PRIO_LEVELS - 1)
123 
128 #define THREAD_PRIORITY_IDLE (THREAD_PRIORITY_MIN)
129 
134 #ifndef THREAD_PRIORITY_MAIN
135 #define THREAD_PRIORITY_MAIN (THREAD_PRIORITY_MIN - \
136  (SCHED_PRIO_LEVELS / 2))
137 #endif
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* THREAD_CONFIG_H */
Scheduler API definition.