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