zephyr: migrate includes to <zephyr/...>
Zephyr has prefixed all of its includes with <zephyr/...>. While the
_old_ mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still
enabled by default, it's better to be prepared for its removal in the
future.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
diff --git a/boot/zephyr/arm_cleanup.c b/boot/zephyr/arm_cleanup.c
index c6f738b..d58956f 100644
--- a/boot/zephyr/arm_cleanup.c
+++ b/boot/zephyr/arm_cleanup.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <arch/arm/aarch32/cortex_m/cmsis.h>
-#include <toolchain.h>
+#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
+#include <zephyr/toolchain.h>
#if CONFIG_CPU_HAS_NXP_MPU
#include <fsl_sysmpu.h>
diff --git a/boot/zephyr/boot_serial_extensions.c b/boot/zephyr/boot_serial_extensions.c
index 763dedb..a026668 100644
--- a/boot/zephyr/boot_serial_extensions.c
+++ b/boot/zephyr/boot_serial_extensions.c
@@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <zephyr.h>
-#include <drivers/flash.h>
-#include <mgmt/mcumgr/zephyr_groups.h>
+#include <zephyr/zephyr.h>
+#include <zephyr/drivers/flash.h>
+#include <zephyr/mgmt/mcumgr/zephyr_groups.h>
#include <flash_map_backend/flash_map_backend.h>
#include <sysflash/sysflash.h>
diff --git a/boot/zephyr/flash_map_extended.c b/boot/zephyr/flash_map_extended.c
index c5832cb..c902978 100644
--- a/boot/zephyr/flash_map_extended.c
+++ b/boot/zephyr/flash_map_extended.c
@@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <zephyr.h>
-#include <devicetree.h>
-#include <drivers/flash.h>
+#include <zephyr/zephyr.h>
+#include <zephyr/devicetree.h>
+#include <zephyr/drivers/flash.h>
#include "target.h"
diff --git a/boot/zephyr/hooks_sample.c b/boot/zephyr/hooks_sample.c
index a4dbfb5..b151d0d 100644
--- a/boot/zephyr/hooks_sample.c
+++ b/boot/zephyr/hooks_sample.c
@@ -15,7 +15,7 @@
*/
#include <assert.h>
-#include <zephyr.h>
+#include <zephyr/zephyr.h>
#include "bootutil/image.h"
#include "bootutil/bootutil.h"
#include "bootutil/fault_injection_hardening.h"
diff --git a/boot/zephyr/include/flash_map_backend/flash_map_backend.h b/boot/zephyr/include/flash_map_backend/flash_map_backend.h
index 6bf027e..5c5fd41 100644
--- a/boot/zephyr/include/flash_map_backend/flash_map_backend.h
+++ b/boot/zephyr/include/flash_map_backend/flash_map_backend.h
@@ -8,7 +8,7 @@
#ifndef __FLASH_MAP_BACKEND_H__
#define __FLASH_MAP_BACKEND_H__
-#include <storage/flash_map.h> // the zephyr flash_map
+#include <zephyr/storage/flash_map.h> // the zephyr flash_map
#ifdef __cplusplus
extern "C" {
diff --git a/boot/zephyr/include/mcuboot_config/mcuboot_config.h b/boot/zephyr/include/mcuboot_config/mcuboot_config.h
index d56b92a..0b4897a 100644
--- a/boot/zephyr/include/mcuboot_config/mcuboot_config.h
+++ b/boot/zephyr/include/mcuboot_config/mcuboot_config.h
@@ -271,7 +271,7 @@
#endif /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
#elif CONFIG_IWDG_STM32 /* CONFIG_NRFX_WDT */
-#include <drivers/watchdog.h>
+#include <zephyr/drivers/watchdog.h>
#define MCUBOOT_WATCHDOG_FEED() \
do { \
diff --git a/boot/zephyr/include/mcuboot_config/mcuboot_logging.h b/boot/zephyr/include/mcuboot_config/mcuboot_logging.h
index 6f24868..dfe1d65 100644
--- a/boot/zephyr/include/mcuboot_config/mcuboot_logging.h
+++ b/boot/zephyr/include/mcuboot_config/mcuboot_logging.h
@@ -27,7 +27,7 @@
#define MCUBOOT_LOG_DBG(...) LOG_DBG(__VA_ARGS__)
#define MCUBOOT_LOG_SIM(...) IGNORE(__VA_ARGS__)
-#include <logging/log.h>
+#include <zephyr/logging/log.h>
#endif /* !__BOOTSIM__ */
diff --git a/boot/zephyr/include/sysflash/sysflash.h b/boot/zephyr/include/sysflash/sysflash.h
index 99ca273..95f6cda 100644
--- a/boot/zephyr/include/sysflash/sysflash.h
+++ b/boot/zephyr/include/sysflash/sysflash.h
@@ -3,7 +3,7 @@
#ifndef __SYSFLASH_H__
#define __SYSFLASH_H__
-#include <devicetree.h>
+#include <zephyr/devicetree.h>
#include <mcuboot_config/mcuboot_config.h>
#ifndef CONFIG_SINGLE_APPLICATION_SLOT
diff --git a/boot/zephyr/include/target.h b/boot/zephyr/include/target.h
index 97365c2..5562434 100644
--- a/boot/zephyr/include/target.h
+++ b/boot/zephyr/include/target.h
@@ -19,9 +19,9 @@
* Otherwise, the Zephyr SoC header and the DTS provide most
* everything we need.
*/
-#include <devicetree.h>
+#include <zephyr/devicetree.h>
#include <soc.h>
-#include <storage/flash_map.h>
+#include <zephyr/storage/flash_map.h>
#define FLASH_ALIGN FLASH_WRITE_BLOCK_SIZE
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index c9da8e5..b1c394f 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -17,15 +17,15 @@
*/
#include <assert.h>
-#include <zephyr.h>
-#include <devicetree.h>
-#include <drivers/gpio.h>
-#include <sys/__assert.h>
-#include <drivers/flash.h>
-#include <drivers/timer/system_timer.h>
-#include <usb/usb_device.h>
+#include <zephyr/zephyr.h>
+#include <zephyr/devicetree.h>
+#include <zephyr/drivers/gpio.h>
+#include <zephyr/sys/__assert.h>
+#include <zephyr/drivers/flash.h>
+#include <zephyr/drivers/timer/system_timer.h>
+#include <zephyr/usb/usb_device.h>
#include <soc.h>
-#include <linker/linker-defs.h>
+#include <zephyr/linker/linker-defs.h>
#include "target.h"
@@ -47,7 +47,7 @@
#endif
#if defined(CONFIG_BOOT_USB_DFU_WAIT) || defined(CONFIG_BOOT_USB_DFU_GPIO)
-#include <usb/class/usb_dfu.h>
+#include <zephyr/usb/class/usb_dfu.h>
#endif
#if CONFIG_MCUBOOT_CLEANUP_ARM_CORE
@@ -74,7 +74,7 @@
#warning "The log internal thread for log processing can't transfer the log"\
"well for MCUBoot."
#else
-#include <logging/log_ctrl.h>
+#include <zephyr/logging/log_ctrl.h>
#define BOOT_LOG_PROCESSING_INTERVAL K_MSEC(30) /* [ms] */
diff --git a/boot/zephyr/os.c b/boot/zephyr/os.c
index 4721eb1..8588a91 100644
--- a/boot/zephyr/os.c
+++ b/boot/zephyr/os.c
@@ -17,7 +17,7 @@
* under the License.
*/
-#include <zephyr.h>
+#include <zephyr/zephyr.h>
#include <string.h>
#include "os/os_heap.h"
diff --git a/boot/zephyr/serial_adapter.c b/boot/zephyr/serial_adapter.c
index 18fab9b..4934f6d 100644
--- a/boot/zephyr/serial_adapter.c
+++ b/boot/zephyr/serial_adapter.c
@@ -15,12 +15,12 @@
*/
#include <stdio.h>
-#include <drivers/uart.h>
+#include <zephyr/drivers/uart.h>
#include <assert.h>
#include <string.h>
-#include <zephyr.h>
+#include <zephyr/zephyr.h>
#include "bootutil/bootutil_log.h"
-#include <usb/usb_device.h>
+#include <zephyr/usb/usb_device.h>
#if defined(CONFIG_BOOT_SERIAL_UART) && defined(CONFIG_UART_CONSOLE)
#error Zephyr UART console must been disabled if serial_adapter module is used.
diff --git a/samples/zephyr/hello-world/src/main.c b/samples/zephyr/hello-world/src/main.c
index 027bb5f..584a21c 100644
--- a/samples/zephyr/hello-world/src/main.c
+++ b/samples/zephyr/hello-world/src/main.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <zephyr.h>
-#include <sys/printk.h>
+#include <zephyr/zephyr.h>
+#include <zephyr/sys/printk.h>
void main(void)
{