ChibiOS  21.6.0
chport.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006,2007,2008,2009,2010,2011,2012,2013,2014,
3  2015,2016,2017,2018,2019,2020,2021 Giovanni Di Sirio.
4 
5  This file is part of ChibiOS.
6 
7  ChibiOS is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation version 3 of the License.
10 
11  ChibiOS is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /**
21  * @file rt/include/chport.h
22  * @brief Port wrapper header.
23  *
24  * @addtogroup port_wrapper
25  * @details This module performs checks on the information exported by
26  * the port layer. The port layer is checked at compile time
27  * in order to make sure that it exports all the required macros
28  * and definitions.
29  * @note This module does not export any functionality.
30  * @{
31  */
32 
33 #ifndef CHPORT_H
34 #define CHPORT_H
35 
36 /* Inclusion of the port layer.*/
37 #include "chcore.h"
38 
39 /*===========================================================================*/
40 /* Module constants. */
41 /*===========================================================================*/
42 
43 /*===========================================================================*/
44 /* Module pre-compile time settings. */
45 /*===========================================================================*/
46 
47 /*===========================================================================*/
48 /* Derived constants and error checks. */
49 /*===========================================================================*/
50 
51 /* Required macros checks.*/
52 #if !defined(PORT_COMPILER_NAME)
53 #error "PORT_COMPILER_NAME not defined in chcore.h"
54 #endif
55 
56 #if !defined(PORT_IDLE_THREAD_STACK_SIZE)
57 #error "PORT_IDLE_THREAD_STACK_SIZE not defined in chcore.h"
58 #endif
59 
60 #if !defined(PORT_INT_REQUIRED_STACK)
61 #error "PORT_INT_REQUIRED_STACK not defined in chcore.h"
62 #endif
63 
64 #if !defined(PORT_SUPPORTS_RT)
65 #error "PORT_SUPPORTS_RT not defined in chcore.h"
66 #endif
67 
68 #if !defined(PORT_NATURAL_ALIGN)
69 #error "PORT_NATURAL_ALIGN not defined in chcore.h"
70 #endif
71 
72 #if !defined(PORT_STACK_ALIGN)
73 #error "PORT_STACK_ALIGN not defined in chcore.h"
74 #endif
75 
76 #if !defined(PORT_WORKING_AREA_ALIGN)
77 #error "PORT_WORKING_AREA_ALIGN not defined in chcore.h"
78 #endif
79 
80 #if !defined(PORT_ARCHITECTURE_NAME)
81 #error "PORT_ARCHITECTURE_NAME not defined in chcore.h"
82 #endif
83 
84 #if !defined(PORT_CORE_VARIANT_NAME)
85 #error "PORT_CORE_VARIANT_NAME not defined in chcore.h"
86 #endif
87 
88 #if !defined(PORT_INFO)
89 #error "PORT_INFO not defined in chcore.h"
90 #endif
91 
92 #if !defined(PORT_IRQ_IS_VALID_PRIORITY)
93 #error "PORT_IRQ_IS_VALID_PRIORITY not defined in chcore.h"
94 #endif
95 
96 #if !defined(PORT_IRQ_IS_VALID_KERNEL_PRIORITY)
97 #error "PORT_IRQ_IS_VALID_KERNEL_PRIORITY not defined in chcore.h"
98 #endif
99 
100 #if !defined(PORT_SETUP_CONTEXT)
101 #error "PORT_SETUP_CONTEXT not defined in chcore.h"
102 #endif
103 
104 #if !defined(PORT_WA_SIZE)
105 #error "PORT_WA_SIZE not defined in chcore.h"
106 #endif
107 
108 #if !defined(PORT_IRQ_PROLOGUE)
109 #error "PORT_IRQ_PROLOGUE not defined in chcore.h"
110 #endif
111 
112 #if !defined(PORT_IRQ_EPILOGUE)
113 #error "PORT_IRQ_EPILOGUE not defined in chcore.h"
114 #endif
115 
116 #if !defined(PORT_IRQ_HANDLER)
117 #error "PORT_IRQ_HANDLER not defined in chcore.h"
118 #endif
119 
120 #if !defined(PORT_FAST_IRQ_HANDLER)
121 #error "PORT_FAST_IRQ_HANDLER not defined in chcore.h"
122 #endif
123 
124 /* Just in case the port layer does not export the following definitions.*/
125 #if !defined(PORT_CORES_NUMBER)
126 #define PORT_CORES_NUMBER 1
127 #endif
128 
129 #if (PORT_CORES_NUMBER < 1) || (PORT_CORES_NUMBER > 64)
130 #error "invalid PORT_CORES_NUMBER value"
131 #endif
132 
133 #if PORT_CORES_NUMBER == 1
134 #if CH_CFG_SMP_MODE != FALSE
135 #error "this port does not support SMP"
136 #endif
137 #endif
138 
139 /*===========================================================================*/
140 /* Module data structures and types. */
141 /*===========================================================================*/
142 
143 /*===========================================================================*/
144 /* Module macros. */
145 /*===========================================================================*/
146 
147 /*===========================================================================*/
148 /* External declarations. */
149 /*===========================================================================*/
150 
151 /*===========================================================================*/
152 /* Module inline functions. */
153 /*===========================================================================*/
154 
155 #endif /* CHPORT_H */
156 
157 /** @} */
chcore.h
Port related template macros and structures.