aarch32: Add header shims to support old file locations

Out-of-tree code can still be using the old file locations. Introduce
header shims to include the headers from the new correct location and
print a warning message.

Add also a new Kconfig symbol to suppress such warning.

The shim will go away after two releases, so make sure to adapt your
application for the new locations.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2019-12-17 17:13:47 +00:00 committed by Anas Nashif
commit d048faacf2
29 changed files with 434 additions and 0 deletions

View file

@ -413,3 +413,14 @@ config MISRA_SANE
arrays are not permitted (and gcc will enforce this). arrays are not permitted (and gcc will enforce this).
endmenu endmenu
menu "Compatibility"
config COMPAT_INCLUDES
bool "Suppress warnings when using header shims"
default y
help
Suppress any warnings from the pre-processor when including
deprecated header files.
endmenu

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_CMSE_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_CMSE_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <aarch32/cortex_m/cmse.h> instead."
#endif
#include <aarch32/cortex_m/cmse.h>
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_CMSE_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_EXC_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_EXC_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <aarch32/cortex_m/exc.h> instead."
#endif
#include <aarch32/cortex_m/exc.h>
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_EXC_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_STACK_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_STACK_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <aarch32/cortex_m/stack.h> instead."
#endif
#include <aarch32/cortex_m/stack.h>
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_STACK_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_TZ_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_TZ_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <aarch32/cortex_m/tz.h> instead."
#endif
#include <aarch32/cortex_m/tz.h>
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_M_TZ_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_R_EXC_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_R_EXC_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <aarch32/cortex_r/exc.h> instead."
#endif
#include <aarch32/cortex_r/exc.h>
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_R_EXC_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_R_STACK_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_R_STACK_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <aarch32/cortex_r/stack.h> instead."
#endif
#include <aarch32/cortex_r/stack.h>
#endif /* ZEPHYR_ARCH_ARM_INCLUDE_CORTEX_R_STACK_H_ */

16
include/arch/arm/arch.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ARCH_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_ARCH_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/arch.h> instead."
#endif
#include <arch/arm/aarch32/arch.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_ARCH_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ASM_INLINE_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_ASM_INLINE_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/asm_inline.h> instead."
#endif
#include <arch/arm/aarch32/asm_inline.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_ASM_INLINE_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ASM_INLINE_GCC_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_ASM_INLINE_GCC_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/asm_inline_gcc.h> instead."
#endif
#include <arch/arm/aarch32/asm_inline_gcc.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_ASM_INLINE_GCC_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_CMSIS_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_CMSIS_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/cmsis.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/cmsis.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_CMSIS_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_CPU_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_CPU_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/cpu.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/cpu.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_CPU_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MEMORY_MAP_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MEMORY_MAP_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/memory_map.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/memory_map.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MEMORY_MAP_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/mpu/arm_mpu.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/mpu/arm_mpu.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_V7M_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_V7M_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/mpu/arm_mpu_v7m.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/mpu/arm_mpu_v7m.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_V7M_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_V8M_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_V8M_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/mpu/arm_mpu_v8m.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/mpu/arm_mpu_v8m.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_ARM_MPU_V8M_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_NXP_MPU_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_NXP_MPU_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_m/mpu/nxp_mpu.h> instead."
#endif
#include <arch/arm/aarch32/cortex_m/mpu/nxp_mpu.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_NXP_MPU_H_ */

View file

@ -0,0 +1,7 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <arch/arm/aarch32/cortex_m/scripts/linker.ld>

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_R_CPU_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_R_CPU_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_r/cpu.h> instead."
#endif
#include <arch/arm/aarch32/cortex_r/cpu.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_R_CPU_H_ */

View file

@ -0,0 +1,9 @@
/*
* Copyright (c) 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
/* Set initial alignment to the 32 byte minimum for all MPUs */
_app_data_align = 32;
. = ALIGN(32);

View file

@ -0,0 +1,7 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <arch/arm/aarch32/cortex_r/scripts/linker.ld>

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_R_SYS_IO_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_R_SYS_IO_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/cortex_r/sys_io.h> instead."
#endif
#include <arch/arm/aarch32/cortex_r/sys_io.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_R_SYS_IO_H_ */

16
include/arch/arm/error.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ERROR_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_ERROR_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/error.h> instead."
#endif
#include <arch/arm/aarch32/error.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_ERROR_H_ */

16
include/arch/arm/exc.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_EXC_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_EXC_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/exc.h> instead."
#endif
#include <arch/arm/aarch32/exc.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_EXC_H_ */

16
include/arch/arm/irq.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_IRQ_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_IRQ_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/irq.h> instead."
#endif
#include <arch/arm/aarch32/irq.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_IRQ_H_ */

16
include/arch/arm/misc.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_MISC_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_MISC_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/misc.h> instead."
#endif
#include <arch/arm/aarch32/misc.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_MISC_H_ */

16
include/arch/arm/nmi.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_NMI_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_NMI_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/nmi.h> instead."
#endif
#include <arch/arm/aarch32/nmi.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_NMI_H_ */

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_SYSCALL_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_SYSCALL_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/syscall.h> instead."
#endif
#include <arch/arm/aarch32/syscall.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_SYSCALL_H_ */

16
include/arch/arm/thread.h Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_THREAD_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_THREAD_H_
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <arch/arm/aarch32/thread.h> instead."
#endif
#include <arch/arm/aarch32/thread.h>
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_THREAD_H_ */