ChibiOS/RT 7.0.6
chinstances.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/chinstances.h
21 * @brief OS instances macros and structures.
22 *
23 * @addtogroup instances
24 * @{
25 */
26
27#ifndef CHINSTANCES_H
28#define CHINSTANCES_H
29
30/*===========================================================================*/
31/* Module constants. */
32/*===========================================================================*/
33
34/*===========================================================================*/
35/* Module pre-compile time settings. */
36/*===========================================================================*/
37
38/*===========================================================================*/
39/* Derived constants and error checks. */
40/*===========================================================================*/
41
42/*===========================================================================*/
43/* Module data structures and types. */
44/*===========================================================================*/
45
46/*===========================================================================*/
47/* Module macros. */
48/*===========================================================================*/
49
50/**
51 * @brief Current thread pointer get macro.
52 * @note This macro is not meant to be used in the application code but
53 * only from within the kernel, use @p chThdGetSelfX() instead.
54 */
55#define __instance_get_currthread(oip) (oip)->rlist.current
56
57/**
58 * @brief Current thread pointer set macro.
59 */
60#define __instance_set_currthread(oip, tp) (oip)->rlist.current = (tp)
61
62/*===========================================================================*/
63/* External declarations. */
64/*===========================================================================*/
65
66/*
67 * Scheduler APIs.
68 */
69#ifdef __cplusplus
70extern "C" {
71#endif
73 const os_instance_config_t *oicp);
74#ifdef __cplusplus
75}
76#endif
77
78/*===========================================================================*/
79/* Module inline functions. */
80/*===========================================================================*/
81
82#endif /* CHINSTANCES_H */
83
84/** @} */
void chInstanceObjectInit(os_instance_t *oip, const os_instance_config_t *oicp)
Initializes a system instance.
Definition chinstances.c:88
struct ch_os_instance os_instance_t
Type of an OS instance structure.
Definition chearly.h:137
struct ch_os_instance_config os_instance_config_t
Type of an system instance configuration.