Skip to content

Commit

Permalink
cleanup: include/: move misc/util.h to sys/util.h
Browse files Browse the repository at this point in the history
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif committed Jun 28, 2019
1 parent d222553 commit a2fd7d7
Show file tree
Hide file tree
Showing 295 changed files with 1,103 additions and 1,088 deletions.
2 changes: 1 addition & 1 deletion arch/arc/core/cache.c
Expand Up @@ -15,7 +15,7 @@


#include <kernel.h> #include <kernel.h>
#include <arch/cpu.h> #include <arch/cpu.h>
#include <misc/util.h> #include <sys/util.h>
#include <toolchain.h> #include <toolchain.h>
#include <cache.h> #include <cache.h>
#include <linker/linker-defs.h> #include <linker/linker-defs.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/include/kernel_arch_data.h
Expand Up @@ -34,7 +34,7 @@ extern "C" {
#include <kernel.h> #include <kernel.h>
#include <kernel_internal.h> #include <kernel_internal.h>
#include <zephyr/types.h> #include <zephyr/types.h>
#include <misc/util.h> #include <sys/util.h>
#include <sys/dlist.h> #include <sys/dlist.h>
#endif #endif


Expand Down
2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/scb.c
Expand Up @@ -16,7 +16,7 @@


#include <kernel.h> #include <kernel.h>
#include <arch/cpu.h> #include <arch/cpu.h>
#include <misc/util.h> #include <sys/util.h>
#include <arch/arm/cortex_m/cmsis.h> #include <arch/arm/cortex_m/cmsis.h>


/** /**
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/vector_table.h
Expand Up @@ -29,7 +29,7 @@ extern "C" {


#include <toolchain.h> #include <toolchain.h>
#include <linker/sections.h> #include <linker/sections.h>
#include <misc/util.h> #include <sys/util.h>


GTEXT(__start) GTEXT(__start)
GTEXT(_vector_table) GTEXT(_vector_table)
Expand Down
2 changes: 1 addition & 1 deletion arch/nios2/include/kernel_arch_data.h
Expand Up @@ -34,7 +34,7 @@ extern "C" {
#include <kernel.h> #include <kernel.h>
#include <kernel_internal.h> #include <kernel_internal.h>
#include <zephyr/types.h> #include <zephyr/types.h>
#include <misc/util.h> #include <sys/util.h>
#include <sys/dlist.h> #include <sys/dlist.h>
#endif #endif


Expand Down
2 changes: 1 addition & 1 deletion arch/riscv32/include/kernel_arch_data.h
Expand Up @@ -27,7 +27,7 @@ extern "C" {
#ifndef _ASMLANGUAGE #ifndef _ASMLANGUAGE
#include <kernel.h> #include <kernel.h>
#include <zephyr/types.h> #include <zephyr/types.h>
#include <misc/util.h> #include <sys/util.h>
#include <sys/dlist.h> #include <sys/dlist.h>
#include <kernel_internal.h> #include <kernel_internal.h>


Expand Down
2 changes: 1 addition & 1 deletion arch/x86/core/ia32/cache.c
Expand Up @@ -12,7 +12,7 @@


#include <kernel.h> #include <kernel.h>
#include <arch/cpu.h> #include <arch/cpu.h>
#include <misc/util.h> #include <sys/util.h>
#include <toolchain.h> #include <toolchain.h>
#include <cache.h> #include <cache.h>
#include <cache_private.h> #include <cache_private.h>
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/kernel_arch_data.h
Expand Up @@ -31,7 +31,7 @@
#include <asm_inline.h> #include <asm_inline.h>
#include <exception.h> #include <exception.h>
#include <kernel_arch_thread.h> #include <kernel_arch_thread.h>
#include <misc/util.h> #include <sys/util.h>


#ifndef _ASMLANGUAGE #ifndef _ASMLANGUAGE
#include <kernel.h> #include <kernel.h>
Expand Down Expand Up @@ -110,7 +110,7 @@


#ifndef _ASMLANGUAGE #ifndef _ASMLANGUAGE


#include <misc/util.h> #include <sys/util.h>


#ifdef _THREAD_WRAPPER_REQUIRED #ifdef _THREAD_WRAPPER_REQUIRED
extern void z_x86_thread_entry_wrapper(k_thread_entry_t entry, extern void z_x86_thread_entry_wrapper(k_thread_entry_t entry,
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/core/xtensa_intgen.py
Expand Up @@ -94,7 +94,7 @@ def emit_int_handler(ints):


# Re-include the core-isa header and be sure our definitions match, for sanity # Re-include the core-isa header and be sure our definitions match, for sanity
cprint("#include <xtensa/config/core-isa.h>") cprint("#include <xtensa/config/core-isa.h>")
cprint("#include <misc/util.h>") cprint("#include <sys/util.h>")
cprint("#include <sw_isr_table.h>") cprint("#include <sw_isr_table.h>")
cprint("") cprint("")
for l in ints_by_lvl: for l in ints_by_lvl:
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/kernel_arch_data.h
Expand Up @@ -34,7 +34,7 @@ extern "C" {
#include <kernel_internal.h> #include <kernel_internal.h>
#include <zephyr/types.h> #include <zephyr/types.h>
#include <sys/dlist.h> #include <sys/dlist.h>
#include <misc/util.h> #include <sys/util.h>


/* Bitmask definitions for the struct k_thread->flags bit field */ /* Bitmask definitions for the struct k_thread->flags bit field */


Expand Down
2 changes: 1 addition & 1 deletion boards/posix/native_posix/hw_models_top.c
Expand Up @@ -21,7 +21,7 @@
#include "posix_soc_if.h" #include "posix_soc_if.h"
#include "posix_arch_internal.h" #include "posix_arch_internal.h"
#include "sdl_events.h" #include "sdl_events.h"
#include <misc/util.h> #include <sys/util.h>




static u64_t simu_time; /* The actual time as known by the HW models */ static u64_t simu_time; /* The actual time as known by the HW models */
Expand Down
2 changes: 1 addition & 1 deletion boards/posix/native_posix/main.c
Expand Up @@ -29,7 +29,7 @@
#include <soc.h> #include <soc.h>
#include "hw_models_top.h" #include "hw_models_top.h"
#include <stdlib.h> #include <stdlib.h>
#include "misc/util.h" #include <sys/util.h>
#include "cmdline.h" #include "cmdline.h"


void posix_exit(int exit_code) void posix_exit(int exit_code)
Expand Down
2 changes: 1 addition & 1 deletion boards/posix/native_posix/timer_model.c
Expand Up @@ -27,7 +27,7 @@
#include "board_soc.h" #include "board_soc.h"
#include "zephyr/types.h" #include "zephyr/types.h"
#include "posix_trace.h" #include "posix_trace.h"
#include "misc/util.h" #include <sys/util.h>
#include "cmdline.h" #include "cmdline.h"
#include "soc.h" #include "soc.h"


Expand Down
2 changes: 1 addition & 1 deletion boards/posix/nrf52_bsim/board_soc.h
Expand Up @@ -20,7 +20,7 @@
#define _POSIX_NRF52_BOARD_SOC_H #define _POSIX_NRF52_BOARD_SOC_H


#include <toolchain.h> #include <toolchain.h>
#include <misc/util.h> #include <sys/util.h>


#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/adc/adc_intel_quark_se_c1000_ss.c
Expand Up @@ -21,7 +21,7 @@
#include <soc.h> #include <soc.h>
#include <drivers/adc.h> #include <drivers/adc.h>
#include <arch/cpu.h> #include <arch/cpu.h>
#include <misc/util.h> #include <sys/util.h>


#define ADC_CONTEXT_USES_KERNEL_TIMER #define ADC_CONTEXT_USES_KERNEL_TIMER
#include "adc_context.h" #include "adc_context.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/adc/adc_sam_afec.c
Expand Up @@ -14,7 +14,7 @@


#include <errno.h> #include <errno.h>
#include <sys/__assert.h> #include <sys/__assert.h>
#include <misc/util.h> #include <sys/util.h>
#include <device.h> #include <device.h>
#include <init.h> #include <init.h>
#include <soc.h> #include <soc.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/audio/tlv320dac310x.c
Expand Up @@ -6,7 +6,7 @@


#include <errno.h> #include <errno.h>


#include <misc/util.h> #include <sys/util.h>


#include <device.h> #include <device.h>
#include <drivers/i2c.h> #include <drivers/i2c.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci/h4.c
Expand Up @@ -14,7 +14,7 @@


#include <init.h> #include <init.h>
#include <drivers/uart.h> #include <drivers/uart.h>
#include <misc/util.h> #include <sys/util.h>
#include <sys/byteorder.h> #include <sys/byteorder.h>
#include <string.h> #include <string.h>


Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci/h5.c
Expand Up @@ -13,7 +13,7 @@


#include <init.h> #include <init.h>
#include <drivers/uart.h> #include <drivers/uart.h>
#include <misc/util.h> #include <sys/util.h>
#include <sys/byteorder.h> #include <sys/byteorder.h>
#include <misc/stack.h> #include <misc/stack.h>
#include <sys/printk.h> #include <sys/printk.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci/ipm_stm32wb.c
Expand Up @@ -8,7 +8,7 @@




#include <init.h> #include <init.h>
#include <misc/util.h> #include <sys/util.h>


#include <bluetooth/hci.h> #include <bluetooth/hci.h>
#include <bluetooth/hci_driver.h> #include <bluetooth/hci_driver.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci/spi.c
Expand Up @@ -10,7 +10,7 @@
#include <init.h> #include <init.h>
#include <drivers/spi.h> #include <drivers/spi.h>
#include <sys/byteorder.h> #include <sys/byteorder.h>
#include <misc/util.h> #include <sys/util.h>


#include <bluetooth/hci.h> #include <bluetooth/hci.h>
#include <bluetooth/hci_driver.h> #include <bluetooth/hci_driver.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci/userchan.c
Expand Up @@ -9,7 +9,7 @@
#include <zephyr.h> #include <zephyr.h>
#include <device.h> #include <device.h>
#include <init.h> #include <init.h>
#include <misc/util.h> #include <sys/util.h>
#include <sys/byteorder.h> #include <sys/byteorder.h>


#include <errno.h> #include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/can/can_stm32.c
Expand Up @@ -6,7 +6,7 @@


#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <string.h> #include <string.h>
#include <kernel.h> #include <kernel.h>
#include <soc.h> #include <soc.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/beetle_clock_control.c
Expand Up @@ -14,7 +14,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/arm_clock_control.h> #include <clock_control/arm_clock_control.h>


#define MAINCLK_BASE_FREQ 24000000 #define MAINCLK_BASE_FREQ 24000000
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_common.c
Expand Up @@ -8,7 +8,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h" #include "clock_stm32_ll_common.h"


Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32_ll_mp1.c
Expand Up @@ -6,7 +6,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>


/** /**
Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32f0_f3.c
Expand Up @@ -8,7 +8,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h" #include "clock_stm32_ll_common.h"


Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32f1.c
Expand Up @@ -8,7 +8,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h" #include "clock_stm32_ll_common.h"


Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32f2_f4_f7.c
Expand Up @@ -8,7 +8,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h" #include "clock_stm32_ll_common.h"


Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32l0_l1.c
Expand Up @@ -8,7 +8,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h" #include "clock_stm32_ll_common.h"


Expand Down
2 changes: 1 addition & 1 deletion drivers/clock_control/clock_stm32l4_wb.c
Expand Up @@ -8,7 +8,7 @@


#include <soc.h> #include <soc.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h" #include "clock_stm32_ll_common.h"


Expand Down
2 changes: 1 addition & 1 deletion drivers/counter/counter_ll_stm32_rtc.c
Expand Up @@ -13,7 +13,7 @@


#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <misc/util.h> #include <sys/util.h>
#include <kernel.h> #include <kernel.h>
#include <soc.h> #include <soc.h>
#include <drivers/counter.h> #include <drivers/counter.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/counter/counter_qmsi_aonpt.c
Expand Up @@ -12,7 +12,7 @@
#include <drivers/counter.h> #include <drivers/counter.h>
#include <power/power.h> #include <power/power.h>
#include <soc.h> #include <soc.h>
#include <misc/util.h> #include <sys/util.h>


#include "qm_aon_counters.h" #include "qm_aon_counters.h"
#include "qm_isr.h" #include "qm_isr.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/counter/counter_rtc_qmsi.c
Expand Up @@ -13,7 +13,7 @@
#include <kernel.h> #include <kernel.h>
#include <power/power.h> #include <power/power.h>
#include <soc.h> #include <soc.h>
#include <misc/util.h> #include <sys/util.h>


#include "qm_isr.h" #include "qm_isr.h"
#include "qm_rtc.h" #include "qm_rtc.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/crypto/crypto_ataes132a_priv.h
Expand Up @@ -10,7 +10,7 @@


#include <drivers/i2c.h> #include <drivers/i2c.h>
#include <kernel.h> #include <kernel.h>
#include <misc/util.h> #include <sys/util.h>


/* Configuration Read Only Registers */ /* Configuration Read Only Registers */
#define ATAES_SERIALNUM_REG 0xF000 #define ATAES_SERIALNUM_REG 0xF000
Expand Down
2 changes: 1 addition & 1 deletion drivers/display/grove_lcd_rgb.c
Expand Up @@ -11,7 +11,7 @@


#include <drivers/i2c.h> #include <drivers/i2c.h>
#include <display/grove_lcd.h> #include <display/grove_lcd.h>
#include <misc/util.h> #include <sys/util.h>


#define LOG_LEVEL CONFIG_DISPLAY_LOG_LEVEL #define LOG_LEVEL CONFIG_DISPLAY_LOG_LEVEL
#include <logging/log.h> #include <logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/dma/dma_stm32f4x.c
Expand Up @@ -13,7 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <soc.h> #include <soc.h>
#include <string.h> #include <string.h>
#include <misc/util.h> #include <sys/util.h>


#define LOG_LEVEL CONFIG_DMA_LOG_LEVEL #define LOG_LEVEL CONFIG_DMA_LOG_LEVEL
#include <logging/log.h> #include <logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/entropy/entropy_stm32.c
Expand Up @@ -10,7 +10,7 @@
#include <random/rand32.h> #include <random/rand32.h>
#include <init.h> #include <init.h>
#include <sys/__assert.h> #include <sys/__assert.h>
#include <misc/util.h> #include <sys/util.h>
#include <errno.h> #include <errno.h>
#include <soc.h> #include <soc.h>
#include <sys/printk.h> #include <sys/printk.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/entropy/fake_entropy_native_posix.c
Expand Up @@ -14,7 +14,7 @@
#include "device.h" #include "device.h"
#include <drivers/entropy.h> #include <drivers/entropy.h>
#include "init.h" #include "init.h"
#include "misc/util.h" #include <sys/util.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "posix_trace.h" #include "posix_trace.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_dw_priv.h
Expand Up @@ -12,7 +12,7 @@
#include <pci/pci_mgr.h> #include <pci/pci_mgr.h>
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */


#include <misc/util.h> #include <sys/util.h>


#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_mcux.c
Expand Up @@ -20,7 +20,7 @@
LOG_MODULE_REGISTER(LOG_MODULE_NAME); LOG_MODULE_REGISTER(LOG_MODULE_NAME);


#include <device.h> #include <device.h>
#include <misc/util.h> #include <sys/util.h>
#include <kernel.h> #include <kernel.h>
#include <net/net_pkt.h> #include <net/net_pkt.h>
#include <net/net_if.h> #include <net/net_if.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_sam_gmac.c
Expand Up @@ -27,7 +27,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <kernel.h> #include <kernel.h>
#include <device.h> #include <device.h>
#include <sys/__assert.h> #include <sys/__assert.h>
#include <misc/util.h> #include <sys/util.h>
#include <errno.h> #include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include <net/net_pkt.h> #include <net/net_pkt.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_stm32_hal.c
Expand Up @@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <kernel.h> #include <kernel.h>
#include <device.h> #include <device.h>
#include <sys/__assert.h> #include <sys/__assert.h>
#include <misc/util.h> #include <sys/util.h>
#include <errno.h> #include <errno.h>
#include <stdbool.h> #include <stdbool.h>
#include <net/net_pkt.h> #include <net/net_pkt.h>
Expand Down

0 comments on commit a2fd7d7

Please sign in to comment.