2017-01-14 00:46:53 +08:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 Nordic Semiconductor ASA
|
2023-11-06 21:58:00 +08:00
|
|
|
|
* Copyright (c) 2023 Arm Limited
|
2017-01-14 00:46:53 +08:00
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @file
|
|
|
|
|
* @brief CMSIS interface file
|
|
|
|
|
*
|
|
|
|
|
* This header contains the interface to the ARM CMSIS Core headers.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-06-30 00:22:37 +08:00
|
|
|
|
#ifndef ZEPHYR_MODULES_CMSIS_CMSIS_M_H_
|
|
|
|
|
#define ZEPHYR_MODULES_CMSIS_CMSIS_M_H_
|
2017-01-14 00:46:53 +08:00
|
|
|
|
|
2023-11-06 22:23:19 +08:00
|
|
|
|
#if defined(CONFIG_CMSIS_M_CHECK_DEVICE_DEFINES) && CONFIG_CMSIS_M_CHECK_DEVICE_DEFINES == 1U
|
|
|
|
|
#define __CHECK_DEVICE_DEFINES 1U
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-07-04 16:01:39 +08:00
|
|
|
|
#include <zephyr/arch/arm/cortex_m/nvic.h>
|
2020-04-16 00:27:43 +08:00
|
|
|
|
|
2022-10-11 18:57:51 +08:00
|
|
|
|
#include <soc.h>
|
|
|
|
|
|
2023-11-06 22:23:19 +08:00
|
|
|
|
#if __NVIC_PRIO_BITS != NUM_IRQ_PRIO_BITS
|
|
|
|
|
#error "NUM_IRQ_PRIO_BITS and __NVIC_PRIO_BITS are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if __MPU_PRESENT != CONFIG_CPU_HAS_ARM_MPU
|
|
|
|
|
#error "__MPU_PRESENT and CONFIG_CPU_HAS_ARM_MPU are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if __FPU_PRESENT != CONFIG_CPU_HAS_FPU
|
|
|
|
|
#error "__FPU_PRESENT and CONFIG_CPU_HAS_FPU are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* VTOR is only optional on armv6-m and armv8-m baseline. __VTOR_PRESENT is often
|
|
|
|
|
* left undefined on platform where it is not optional.
|
|
|
|
|
*/
|
|
|
|
|
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) && \
|
|
|
|
|
(__VTOR_PRESENT != CONFIG_CPU_CORTEX_M_HAS_VTOR)
|
|
|
|
|
#error "__VTOR_PRESENT and CONFIG_CPU_CORTEX_M_HAS_VTOR are not set to the same value."
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Some platform’s sdk incorrectly define __DSP_PRESENT for Cortex-M4 & Cortex-M7
|
|
|
|
|
* DSP extension. __ARM_FEATURE_DSP is set by the compiler for these. So ignore
|
|
|
|
|
* __DSP_PRESENT discrepancy when __ARM_FEATURE_DSP is defined.
|
|
|
|
|
*/
|
|
|
|
|
#if !defined(__ARM_FEATURE_DSP) && (__DSP_PRESENT != CONFIG_ARMV8_M_DSP)
|
|
|
|
|
#error "__DSP_PRESENT and CONFIG_ARMV8_M_DSP are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-05-15 20:47:08 +08:00
|
|
|
|
#if defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT != CONFIG_CPU_HAS_ICACHE)
|
2023-11-06 22:23:19 +08:00
|
|
|
|
#error "__ICACHE_PRESENT and CONFIG_CPU_HAS_ICACHE are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-05-15 20:47:08 +08:00
|
|
|
|
#if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT != CONFIG_CPU_HAS_DCACHE)
|
2023-11-06 22:23:19 +08:00
|
|
|
|
#error "__DCACHE_PRESENT and CONFIG_CPU_HAS_DCACHE are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-05-15 20:47:08 +08:00
|
|
|
|
#if defined(__MVE_PRESENT) && (__MVE_PRESENT != CONFIG_ARMV8_1_M_MVEI)
|
2023-11-06 22:23:19 +08:00
|
|
|
|
#error "__MVE_PRESENT and CONFIG_ARMV8_1_M_MVEI are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-05-15 20:47:08 +08:00
|
|
|
|
#if defined(__SAUREGION_PRESENT) && (__SAUREGION_PRESENT != CONFIG_CPU_HAS_ARM_SAU)
|
2023-11-06 22:23:19 +08:00
|
|
|
|
#error "__SAUREGION_PRESENT and CONFIG_CPU_HAS_ARM_SAU are not set to the same value"
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-06-30 00:22:37 +08:00
|
|
|
|
#endif /* ZEPHYR_MODULES_CMSIS_CMSIS_M_H_ */
|