diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_DYNAMIC/cfg/sbconf.h b/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_DYNAMIC/cfg/sbconf.h new file mode 100644 index 000000000..94ea0cdba --- /dev/null +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_DYNAMIC/cfg/sbconf.h @@ -0,0 +1,50 @@ +/* + ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file sb/templates/sbconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup SB_CONFIG + * @details Sandboxes-related settings and hooks. + * @{ + */ + +#ifndef SBCONF_H +#define SBCONF_H + +#define __CHIBIOS_SB_CONF__ +#define __CHIBIOS_SB_CONF_VER_3_0__ + +/** + * @brief Number of memory regions for each sandbox. + */ +#if !defined(SB_CFG_NUM_REGIONS) || defined(__DOXYGEN__) +#define SB_CFG_NUM_REGIONS 2 +#endif + +/** + * @brief Enables Posix API in sandboxes using VFS. + */ +#if !defined(SB_CFG_ENABLE_VFS) || defined(__DOXYGEN__) +#define SB_CFG_ENABLE_VFS TRUE +#endif + +#endif /* SBCONF_H */ + +/** @} */ diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/cfg/sbconf.h b/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/cfg/sbconf.h new file mode 100644 index 000000000..94ea0cdba --- /dev/null +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/cfg/sbconf.h @@ -0,0 +1,50 @@ +/* + ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file sb/templates/sbconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup SB_CONFIG + * @details Sandboxes-related settings and hooks. + * @{ + */ + +#ifndef SBCONF_H +#define SBCONF_H + +#define __CHIBIOS_SB_CONF__ +#define __CHIBIOS_SB_CONF_VER_3_0__ + +/** + * @brief Number of memory regions for each sandbox. + */ +#if !defined(SB_CFG_NUM_REGIONS) || defined(__DOXYGEN__) +#define SB_CFG_NUM_REGIONS 2 +#endif + +/** + * @brief Enables Posix API in sandboxes using VFS. + */ +#if !defined(SB_CFG_ENABLE_VFS) || defined(__DOXYGEN__) +#define SB_CFG_ENABLE_VFS TRUE +#endif + +#endif /* SBCONF_H */ + +/** @} */ diff --git a/os/sb/host/sb.h b/os/sb/host/sb.h index 9219d9444..3f72f3238 100644 --- a/os/sb/host/sb.h +++ b/os/sb/host/sb.h @@ -49,17 +49,17 @@ /** * @brief Safety Extensions version string. */ -#define CH_SB_VERSION "2.1.0" +#define CH_SB_VERSION "3.0.0" /** * @brief Safety Extensions version major number. */ -#define CH_SB_MAJOR 2 +#define CH_SB_MAJOR 3 /** * @brief Safety Extensions version minor number. */ -#define CH_SB_MINOR 1 +#define CH_SB_MINOR 0 /** * @brief Safety Extensions version patch number. @@ -71,24 +71,29 @@ /* Module pre-compile time settings. */ /*===========================================================================*/ -/** - * @brief Number of memory regions for each sandbox. - */ -#if !defined(SB_CFG_NUM_REGIONS) || defined(__DOXYGEN__) -#define SB_CFG_NUM_REGIONS 2 -#endif - -/** - * @brief Enables Posix API in sandboxes using VFS. - */ -#if !defined(SB_CFG_ENABLE_VFS) || defined(__DOXYGEN__) -#define SB_CFG_ENABLE_VFS TRUE -#endif +#include "sbconf.h" /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ +#if !defined(__CHIBIOS_SB_CONF__) +#error "missing or wrong configuration file" +#endif + +#if !defined(__CHIBIOS_SB_CONF_VER_3_0__) +#error "obsolete or unknown configuration file" +#endif + +/* Checks on configuration options.*/ +#if !defined(SB_CFG_NUM_REGIONS) || defined(__DOXYGEN__) +#error "SB_CFG_NUM_REGIONS not defined in sbconf.h" +#endif + +#if !defined(SB_CFG_ENABLE_VFS) || defined(__DOXYGEN__) +#error "SB_CFG_ENABLE_VFS not defined in sbconf.h" +#endif + /* License checks.*/ #if !defined(CH_CUSTOMER_LIC_SB) || !defined(CH_LICENSE_FEATURES) #error "malformed chlicense.h"