Consistently place C++ use of extern "C" after all include directives, within the negative branch of _ASMLANGUAGE if used. In arch.h the extern "C" in the including context is left active during include of target-specific mpu headers to avoid more complex restructuring. Background from issue #17997: Declarations that use C linkage should be placed within extern "C" so the language linkage is correct when the header is included by a C++ compiler. Similarly #include directives should be outside the extern "C" to ensure the language-specific default linkage is applied to any declarations provided by the included header. See: https://en.cppreference.com/w/cpp/language/language_linkage Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
62 lines
1.4 KiB
C
62 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2013-2016 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Private kernel definitions (ARM)
|
|
*
|
|
* This file contains private kernel structures definitions and various
|
|
* other definitions for the ARM Cortex-M processor architecture family.
|
|
*
|
|
* This file is also included by assembly language files which must #define
|
|
* _ASMLANGUAGE before including this header file. Note that kernel
|
|
* assembly source files obtains structure offset values via "absolute symbols"
|
|
* in the offsets.o module.
|
|
*/
|
|
|
|
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_KERNEL_ARCH_DATA_H_
|
|
#define ZEPHYR_ARCH_ARM_INCLUDE_KERNEL_ARCH_DATA_H_
|
|
|
|
#include <toolchain.h>
|
|
#include <linker/sections.h>
|
|
#include <arch/cpu.h>
|
|
#include <kernel_arch_thread.h>
|
|
|
|
/* stacks */
|
|
|
|
#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
|
|
#define STACK_ROUND_DOWN(x) ROUND_DOWN(x, STACK_ALIGN_SIZE)
|
|
|
|
#ifdef CONFIG_CPU_CORTEX_M
|
|
#include <cortex_m/stack.h>
|
|
#include <cortex_m/exc.h>
|
|
#elif defined(CONFIG_CPU_CORTEX_R)
|
|
#include <cortex_r/stack.h>
|
|
#include <cortex_r/exc.h>
|
|
#endif
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
#include <kernel.h>
|
|
#include <kernel_internal.h>
|
|
#include <zephyr/types.h>
|
|
#include <sys/dlist.h>
|
|
#include <sys/atomic.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct __esf _esf_t;
|
|
typedef struct __basic_sf _basic_sf_t;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_KERNEL_ARCH_DATA_H_ */
|