From ef281c4237cbe64c5e5ebe041d44752b9e18a893 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 25 Jun 2019 12:26:23 -0400 Subject: [PATCH] cleanup: include/: move sys_io.h to sys/sys_io.h move sys_io.h to sys/sys_io.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 --- boards/arm/96b_argonkey/pinmux.c | 2 +- boards/arm/96b_carbon/pinmux.c | 2 +- boards/arm/96b_neonkey/pinmux.c | 2 +- boards/arm/96b_stm32_sensor_mez/pinmux.c | 2 +- boards/arm/96b_wistrio/pinmux.c | 2 +- boards/arm/b_l072z_lrwan1/pinmux.c | 2 +- boards/arm/cy8ckit_062_wifi_bt_m0/pinmux.c | 2 +- boards/arm/cy8ckit_062_wifi_bt_m4/pinmux.c | 2 +- boards/arm/disco_l475_iot1/pinmux.c | 2 +- boards/arm/dragino_lsn50/pinmux.c | 2 +- boards/arm/mikroe_mini_m4_for_stm32/pinmux.c | 2 +- boards/arm/mps2_an385/pinmux.c | 2 +- boards/arm/nucleo_f030r8/pinmux.c | 2 +- boards/arm/nucleo_f070rb/pinmux.c | 2 +- boards/arm/nucleo_f091rc/pinmux.c | 2 +- boards/arm/nucleo_f103rb/pinmux.c | 2 +- boards/arm/nucleo_f207zg/pinmux.c | 2 +- boards/arm/nucleo_f302r8/pinmux.c | 2 +- boards/arm/nucleo_f334r8/pinmux.c | 2 +- boards/arm/nucleo_f401re/pinmux.c | 2 +- boards/arm/nucleo_f411re/pinmux.c | 2 +- boards/arm/nucleo_f412zg/pinmux.c | 2 +- boards/arm/nucleo_f413zh/pinmux.c | 2 +- boards/arm/nucleo_f429zi/pinmux.c | 2 +- boards/arm/nucleo_f446re/pinmux.c | 2 +- boards/arm/nucleo_f746zg/pinmux.c | 2 +- boards/arm/nucleo_f756zg/pinmux.c | 2 +- boards/arm/nucleo_l053r8/pinmux.c | 2 +- boards/arm/nucleo_l073rz/pinmux.c | 2 +- boards/arm/nucleo_l432kc/pinmux.c | 2 +- boards/arm/nucleo_l476rg/pinmux.c | 2 +- boards/arm/nucleo_l496zg/pinmux.c | 2 +- boards/arm/nucleo_l4r5zi/pinmux.c | 2 +- boards/arm/nucleo_wb55rg/pinmux.c | 2 +- boards/arm/olimex_stm32_e407/pinmux.c | 2 +- boards/arm/olimex_stm32_h407/pinmux.c | 2 +- boards/arm/olimex_stm32_p405/pinmux.c | 2 +- boards/arm/olimexino_stm32/pinmux.c | 2 +- boards/arm/stm3210c_eval/pinmux.c | 2 +- boards/arm/stm32373c_eval/pinmux.c | 2 +- boards/arm/stm32_min_dev/pinmux.c | 2 +- boards/arm/stm32f072_eval/pinmux.c | 2 +- boards/arm/stm32f072b_disco/pinmux.c | 2 +- boards/arm/stm32f0_disco/pinmux.c | 2 +- boards/arm/stm32f3_disco/pinmux.c | 2 +- boards/arm/stm32f411e_disco/pinmux.c | 2 +- boards/arm/stm32f412g_disco/pinmux.c | 2 +- boards/arm/stm32f429i_disc1/pinmux.c | 2 +- boards/arm/stm32f469i_disco/pinmux.c | 2 +- boards/arm/stm32f4_disco/pinmux.c | 2 +- boards/arm/stm32f723e_disco/pinmux.c | 2 +- boards/arm/stm32f746g_disco/pinmux.c | 2 +- boards/arm/stm32f769i_disco/pinmux.c | 2 +- boards/arm/stm32l476g_disco/pinmux.c | 2 +- boards/arm/stm32l496g_disco/pinmux.c | 2 +- boards/arm/stm32mp157c_dk2/pinmux.c | 2 +- boards/arm/v2m_beetle/pinmux.c | 2 +- boards/arm/v2m_musca/pinmux.c | 2 +- boards/arm/v2m_musca_b1/pinmux.c | 2 +- boards/x86/arduino_101/pinmux.c | 2 +- boards/x86/quark_se_c1000_devboard/pinmux.c | 2 +- boards/x86/tinytile/pinmux.c | 2 +- .../clock_control/quark_se_clock_control.c | 2 +- drivers/entropy/entropy_cc13xx_cc26xx.c | 2 +- drivers/ethernet/eth_dw.c | 2 +- drivers/ethernet/eth_smsc911x.c | 2 +- drivers/gpio/gpio_cc2650.c | 2 +- drivers/gpio/gpio_cc32xx.c | 2 +- drivers/gpio/gpio_dw.c | 2 +- drivers/gpio/gpio_intel_apl.c | 2 +- drivers/gpio/gpio_qmsi.c | 2 +- drivers/gpio/gpio_sch.c | 2 +- drivers/gpio/gpio_stellaris.c | 2 +- drivers/i2c/i2c_dw.c | 2 +- drivers/i2c/i2c_sifive.c | 2 +- drivers/interrupt_controller/shared_irq.c | 2 +- drivers/pinmux/pinmux_cc2650.c | 2 +- drivers/pwm/pwm_sifive.c | 2 +- drivers/serial/uart_altera_jtag_hal.c | 2 +- drivers/serial/uart_ns16550.c | 2 +- drivers/spi/spi_dw.c | 2 +- drivers/spi/spi_intel.c | 2 +- drivers/spi/spi_sifive.h | 2 +- include/arch/arc/v2/sys_io.h | 2 +- include/arch/common/sys_io.h | 2 +- include/arch/x86/sys_io.h | 2 +- include/sys/sys_io.h | 339 ++++++++++++++++++ include/sys_io.h | 332 +---------------- kernel/userspace.c | 2 +- soc/arc/quark_se_c1000_ss/power.c | 2 +- soc/arm/ti_simplelink/cc2650/soc.c | 2 +- soc/x86/intel_quark/quark_se/eoi.c | 2 +- soc/x86/intel_quark/quark_se/power.c | 2 +- 93 files changed, 434 insertions(+), 419 deletions(-) create mode 100644 include/sys/sys_io.h diff --git a/boards/arm/96b_argonkey/pinmux.c b/boards/arm/96b_argonkey/pinmux.c index dc76ebbc6b3..154f0ac7a24 100644 --- a/boards/arm/96b_argonkey/pinmux.c +++ b/boards/arm/96b_argonkey/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/96b_carbon/pinmux.c b/boards/arm/96b_carbon/pinmux.c index 91dae06ea07..09aa8f08ee0 100644 --- a/boards/arm/96b_carbon/pinmux.c +++ b/boards/arm/96b_carbon/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/96b_neonkey/pinmux.c b/boards/arm/96b_neonkey/pinmux.c index 4c0b74e2c2c..8c9743b6e91 100644 --- a/boards/arm/96b_neonkey/pinmux.c +++ b/boards/arm/96b_neonkey/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/96b_stm32_sensor_mez/pinmux.c b/boards/arm/96b_stm32_sensor_mez/pinmux.c index 914a25e030b..a661d28b138 100644 --- a/boards/arm/96b_stm32_sensor_mez/pinmux.c +++ b/boards/arm/96b_stm32_sensor_mez/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/96b_wistrio/pinmux.c b/boards/arm/96b_wistrio/pinmux.c index dcf53dfa209..987f1e9dff6 100644 --- a/boards/arm/96b_wistrio/pinmux.c +++ b/boards/arm/96b_wistrio/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/b_l072z_lrwan1/pinmux.c b/boards/arm/b_l072z_lrwan1/pinmux.c index c1c625deb2e..d5f99a90451 100644 --- a/boards/arm/b_l072z_lrwan1/pinmux.c +++ b/boards/arm/b_l072z_lrwan1/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/stm32/pinmux_stm32.h" diff --git a/boards/arm/cy8ckit_062_wifi_bt_m0/pinmux.c b/boards/arm/cy8ckit_062_wifi_bt_m0/pinmux.c index 5fcbfd34214..2e8257c4d90 100644 --- a/boards/arm/cy8ckit_062_wifi_bt_m0/pinmux.c +++ b/boards/arm/cy8ckit_062_wifi_bt_m0/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" diff --git a/boards/arm/cy8ckit_062_wifi_bt_m4/pinmux.c b/boards/arm/cy8ckit_062_wifi_bt_m4/pinmux.c index 5fcbfd34214..2e8257c4d90 100644 --- a/boards/arm/cy8ckit_062_wifi_bt_m4/pinmux.c +++ b/boards/arm/cy8ckit_062_wifi_bt_m4/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" diff --git a/boards/arm/disco_l475_iot1/pinmux.c b/boards/arm/disco_l475_iot1/pinmux.c index 383a252794d..2b14d20b39e 100644 --- a/boards/arm/disco_l475_iot1/pinmux.c +++ b/boards/arm/disco_l475_iot1/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/dragino_lsn50/pinmux.c b/boards/arm/dragino_lsn50/pinmux.c index 6e8cca591f1..e04f1baf969 100644 --- a/boards/arm/dragino_lsn50/pinmux.c +++ b/boards/arm/dragino_lsn50/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/stm32/pinmux_stm32.h" diff --git a/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c b/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c index d6b8182ff1a..16268e0bc86 100644 --- a/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c +++ b/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/mps2_an385/pinmux.c b/boards/arm/mps2_an385/pinmux.c index e3e409a85e0..a0c9cac4d40 100644 --- a/boards/arm/mps2_an385/pinmux.c +++ b/boards/arm/mps2_an385/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "pinmux/pinmux.h" diff --git a/boards/arm/nucleo_f030r8/pinmux.c b/boards/arm/nucleo_f030r8/pinmux.c index b99800bd16b..2e24884ece3 100644 --- a/boards/arm/nucleo_f030r8/pinmux.c +++ b/boards/arm/nucleo_f030r8/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include "pinmux/stm32/pinmux_stm32.h" diff --git a/boards/arm/nucleo_f070rb/pinmux.c b/boards/arm/nucleo_f070rb/pinmux.c index 048794d9c50..6bd3fb697ff 100644 --- a/boards/arm/nucleo_f070rb/pinmux.c +++ b/boards/arm/nucleo_f070rb/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include diff --git a/boards/arm/nucleo_f091rc/pinmux.c b/boards/arm/nucleo_f091rc/pinmux.c index baff16656c4..a73f5284dba 100644 --- a/boards/arm/nucleo_f091rc/pinmux.c +++ b/boards/arm/nucleo_f091rc/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f103rb/pinmux.c b/boards/arm/nucleo_f103rb/pinmux.c index 3a0e4afca60..6190e70cb2d 100644 --- a/boards/arm/nucleo_f103rb/pinmux.c +++ b/boards/arm/nucleo_f103rb/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f207zg/pinmux.c b/boards/arm/nucleo_f207zg/pinmux.c index f1d32dd689f..f200b805578 100644 --- a/boards/arm/nucleo_f207zg/pinmux.c +++ b/boards/arm/nucleo_f207zg/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f302r8/pinmux.c b/boards/arm/nucleo_f302r8/pinmux.c index 7e0c853fa06..b2de1953452 100644 --- a/boards/arm/nucleo_f302r8/pinmux.c +++ b/boards/arm/nucleo_f302r8/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f334r8/pinmux.c b/boards/arm/nucleo_f334r8/pinmux.c index 4f91828a518..d906cc5e1c4 100644 --- a/boards/arm/nucleo_f334r8/pinmux.c +++ b/boards/arm/nucleo_f334r8/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f401re/pinmux.c b/boards/arm/nucleo_f401re/pinmux.c index 789857c434d..5670ca529e6 100644 --- a/boards/arm/nucleo_f401re/pinmux.c +++ b/boards/arm/nucleo_f401re/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f411re/pinmux.c b/boards/arm/nucleo_f411re/pinmux.c index 7e5e7b4802e..f5dd55c01f1 100644 --- a/boards/arm/nucleo_f411re/pinmux.c +++ b/boards/arm/nucleo_f411re/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f412zg/pinmux.c b/boards/arm/nucleo_f412zg/pinmux.c index 498879aae0b..0416128c843 100644 --- a/boards/arm/nucleo_f412zg/pinmux.c +++ b/boards/arm/nucleo_f412zg/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f413zh/pinmux.c b/boards/arm/nucleo_f413zh/pinmux.c index d60b3eaf7c9..1185254fc67 100644 --- a/boards/arm/nucleo_f413zh/pinmux.c +++ b/boards/arm/nucleo_f413zh/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f429zi/pinmux.c b/boards/arm/nucleo_f429zi/pinmux.c index 664ee8aebb5..9bc0b1a4202 100644 --- a/boards/arm/nucleo_f429zi/pinmux.c +++ b/boards/arm/nucleo_f429zi/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f446re/pinmux.c b/boards/arm/nucleo_f446re/pinmux.c index 61a6a66113f..9f2f5f8ae00 100644 --- a/boards/arm/nucleo_f446re/pinmux.c +++ b/boards/arm/nucleo_f446re/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f746zg/pinmux.c b/boards/arm/nucleo_f746zg/pinmux.c index 16d4b30a2c8..b365f3632a2 100644 --- a/boards/arm/nucleo_f746zg/pinmux.c +++ b/boards/arm/nucleo_f746zg/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_f756zg/pinmux.c b/boards/arm/nucleo_f756zg/pinmux.c index 172c6bd9cb4..916f3c6e77f 100644 --- a/boards/arm/nucleo_f756zg/pinmux.c +++ b/boards/arm/nucleo_f756zg/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_l053r8/pinmux.c b/boards/arm/nucleo_l053r8/pinmux.c index 74e48685f3c..d53217d460a 100644 --- a/boards/arm/nucleo_l053r8/pinmux.c +++ b/boards/arm/nucleo_l053r8/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_l073rz/pinmux.c b/boards/arm/nucleo_l073rz/pinmux.c index a1a386e17bf..bc79f3e018e 100644 --- a/boards/arm/nucleo_l073rz/pinmux.c +++ b/boards/arm/nucleo_l073rz/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_l432kc/pinmux.c b/boards/arm/nucleo_l432kc/pinmux.c index 6138422f33c..1bf631215ce 100644 --- a/boards/arm/nucleo_l432kc/pinmux.c +++ b/boards/arm/nucleo_l432kc/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_l476rg/pinmux.c b/boards/arm/nucleo_l476rg/pinmux.c index 9a0b4869d39..000a17e344b 100644 --- a/boards/arm/nucleo_l476rg/pinmux.c +++ b/boards/arm/nucleo_l476rg/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_l496zg/pinmux.c b/boards/arm/nucleo_l496zg/pinmux.c index 784fca46bcd..46bad0be724 100644 --- a/boards/arm/nucleo_l496zg/pinmux.c +++ b/boards/arm/nucleo_l496zg/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_l4r5zi/pinmux.c b/boards/arm/nucleo_l4r5zi/pinmux.c index ed8e31a8594..6d2f45e515f 100644 --- a/boards/arm/nucleo_l4r5zi/pinmux.c +++ b/boards/arm/nucleo_l4r5zi/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/nucleo_wb55rg/pinmux.c b/boards/arm/nucleo_wb55rg/pinmux.c index dbe0f517935..00e946a063f 100644 --- a/boards/arm/nucleo_wb55rg/pinmux.c +++ b/boards/arm/nucleo_wb55rg/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/olimex_stm32_e407/pinmux.c b/boards/arm/olimex_stm32_e407/pinmux.c index 61896cd6ed0..64fd0b96b60 100644 --- a/boards/arm/olimex_stm32_e407/pinmux.c +++ b/boards/arm/olimex_stm32_e407/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/olimex_stm32_h407/pinmux.c b/boards/arm/olimex_stm32_h407/pinmux.c index b6e6998441f..728e192875f 100644 --- a/boards/arm/olimex_stm32_h407/pinmux.c +++ b/boards/arm/olimex_stm32_h407/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/olimex_stm32_p405/pinmux.c b/boards/arm/olimex_stm32_p405/pinmux.c index 2171f75542a..b6fbb1256fd 100644 --- a/boards/arm/olimex_stm32_p405/pinmux.c +++ b/boards/arm/olimex_stm32_p405/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/olimexino_stm32/pinmux.c b/boards/arm/olimexino_stm32/pinmux.c index 8736bb63393..9dcc83334d7 100644 --- a/boards/arm/olimexino_stm32/pinmux.c +++ b/boards/arm/olimexino_stm32/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm3210c_eval/pinmux.c b/boards/arm/stm3210c_eval/pinmux.c index e777e98aeee..55dbebb8af5 100644 --- a/boards/arm/stm3210c_eval/pinmux.c +++ b/boards/arm/stm3210c_eval/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32373c_eval/pinmux.c b/boards/arm/stm32373c_eval/pinmux.c index 15af6a54c88..1bd484c1c35 100644 --- a/boards/arm/stm32373c_eval/pinmux.c +++ b/boards/arm/stm32373c_eval/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32_min_dev/pinmux.c b/boards/arm/stm32_min_dev/pinmux.c index cfab65d0d23..ecc5d590605 100644 --- a/boards/arm/stm32_min_dev/pinmux.c +++ b/boards/arm/stm32_min_dev/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f072_eval/pinmux.c b/boards/arm/stm32f072_eval/pinmux.c index 6d6f8c3713c..be0662931a1 100644 --- a/boards/arm/stm32f072_eval/pinmux.c +++ b/boards/arm/stm32f072_eval/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/stm32/pinmux_stm32.h" diff --git a/boards/arm/stm32f072b_disco/pinmux.c b/boards/arm/stm32f072b_disco/pinmux.c index 216298d48c5..65f3dc7015a 100644 --- a/boards/arm/stm32f072b_disco/pinmux.c +++ b/boards/arm/stm32f072b_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include diff --git a/boards/arm/stm32f0_disco/pinmux.c b/boards/arm/stm32f0_disco/pinmux.c index c6ee3c3bbc4..3e434a78607 100644 --- a/boards/arm/stm32f0_disco/pinmux.c +++ b/boards/arm/stm32f0_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include "pinmux/stm32/pinmux_stm32.h" diff --git a/boards/arm/stm32f3_disco/pinmux.c b/boards/arm/stm32f3_disco/pinmux.c index 98dc7434192..f8827fdab81 100644 --- a/boards/arm/stm32f3_disco/pinmux.c +++ b/boards/arm/stm32f3_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f411e_disco/pinmux.c b/boards/arm/stm32f411e_disco/pinmux.c index cb397707bd7..45aadb5b2b6 100644 --- a/boards/arm/stm32f411e_disco/pinmux.c +++ b/boards/arm/stm32f411e_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f412g_disco/pinmux.c b/boards/arm/stm32f412g_disco/pinmux.c index aceb1b07fa9..fb200014a30 100644 --- a/boards/arm/stm32f412g_disco/pinmux.c +++ b/boards/arm/stm32f412g_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f429i_disc1/pinmux.c b/boards/arm/stm32f429i_disc1/pinmux.c index 69da2284d8d..0d8bde78ee3 100644 --- a/boards/arm/stm32f429i_disc1/pinmux.c +++ b/boards/arm/stm32f429i_disc1/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f469i_disco/pinmux.c b/boards/arm/stm32f469i_disco/pinmux.c index 6083fc7924e..3440e76354f 100644 --- a/boards/arm/stm32f469i_disco/pinmux.c +++ b/boards/arm/stm32f469i_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f4_disco/pinmux.c b/boards/arm/stm32f4_disco/pinmux.c index 5804c94df85..6208971ba29 100644 --- a/boards/arm/stm32f4_disco/pinmux.c +++ b/boards/arm/stm32f4_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f723e_disco/pinmux.c b/boards/arm/stm32f723e_disco/pinmux.c index 911a55a9794..17778c4ab17 100644 --- a/boards/arm/stm32f723e_disco/pinmux.c +++ b/boards/arm/stm32f723e_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f746g_disco/pinmux.c b/boards/arm/stm32f746g_disco/pinmux.c index 9b1c8e1ed5c..fdf08d56e15 100644 --- a/boards/arm/stm32f746g_disco/pinmux.c +++ b/boards/arm/stm32f746g_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32f769i_disco/pinmux.c b/boards/arm/stm32f769i_disco/pinmux.c index aba970932c5..18701719df3 100644 --- a/boards/arm/stm32f769i_disco/pinmux.c +++ b/boards/arm/stm32f769i_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32l476g_disco/pinmux.c b/boards/arm/stm32l476g_disco/pinmux.c index d18d21f2c29..6e76b3925dc 100644 --- a/boards/arm/stm32l476g_disco/pinmux.c +++ b/boards/arm/stm32l476g_disco/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32l496g_disco/pinmux.c b/boards/arm/stm32l496g_disco/pinmux.c index 63747af3650..017ed797878 100644 --- a/boards/arm/stm32l496g_disco/pinmux.c +++ b/boards/arm/stm32l496g_disco/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/stm32mp157c_dk2/pinmux.c b/boards/arm/stm32mp157c_dk2/pinmux.c index 452991b6523..e885413577f 100644 --- a/boards/arm/stm32mp157c_dk2/pinmux.c +++ b/boards/arm/stm32mp157c_dk2/pinmux.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/boards/arm/v2m_beetle/pinmux.c b/boards/arm/v2m_beetle/pinmux.c index de3bfaa7505..e0f1cfbe8bb 100644 --- a/boards/arm/v2m_beetle/pinmux.c +++ b/boards/arm/v2m_beetle/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "pinmux/pinmux.h" diff --git a/boards/arm/v2m_musca/pinmux.c b/boards/arm/v2m_musca/pinmux.c index 3368aa86790..22ce77dffb5 100644 --- a/boards/arm/v2m_musca/pinmux.c +++ b/boards/arm/v2m_musca/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "pinmux/pinmux.h" diff --git a/boards/arm/v2m_musca_b1/pinmux.c b/boards/arm/v2m_musca_b1/pinmux.c index f73bbfb958b..2bacf75c284 100644 --- a/boards/arm/v2m_musca_b1/pinmux.c +++ b/boards/arm/v2m_musca_b1/pinmux.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "pinmux/pinmux.h" diff --git a/boards/x86/arduino_101/pinmux.c b/boards/x86/arduino_101/pinmux.c index 6fd67ebb3a3..0079270be61 100644 --- a/boards/x86/arduino_101/pinmux.c +++ b/boards/x86/arduino_101/pinmux.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include diff --git a/boards/x86/quark_se_c1000_devboard/pinmux.c b/boards/x86/quark_se_c1000_devboard/pinmux.c index c810b983901..9937563edb8 100644 --- a/boards/x86/quark_se_c1000_devboard/pinmux.c +++ b/boards/x86/quark_se_c1000_devboard/pinmux.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include diff --git a/boards/x86/tinytile/pinmux.c b/boards/x86/tinytile/pinmux.c index ea6d3146c9c..b5595810fb8 100644 --- a/boards/x86/tinytile/pinmux.c +++ b/boards/x86/tinytile/pinmux.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "pinmux/pinmux.h" #include "pinmux_quark_mcu.h" diff --git a/drivers/clock_control/quark_se_clock_control.c b/drivers/clock_control/quark_se_clock_control.c index 38bdddea8ad..6cdce338963 100644 --- a/drivers/clock_control/quark_se_clock_control.c +++ b/drivers/clock_control/quark_se_clock_control.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/entropy/entropy_cc13xx_cc26xx.c b/drivers/entropy/entropy_cc13xx_cc26xx.c index 1b4e4bbf00d..d8d5275f701 100644 --- a/drivers/entropy/entropy_cc13xx_cc26xx.c +++ b/drivers/entropy/entropy_cc13xx_cc26xx.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/ethernet/eth_dw.c b/drivers/ethernet/eth_dw.c index 02db4ecc856..d58f7d01cf6 100644 --- a/drivers/ethernet/eth_dw.c +++ b/drivers/ethernet/eth_dw.c @@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include -#include +#include #include #include diff --git a/drivers/ethernet/eth_smsc911x.c b/drivers/ethernet/eth_smsc911x.c index 9172dfe717e..7ea1082e599 100644 --- a/drivers/ethernet/eth_smsc911x.c +++ b/drivers/ethernet/eth_smsc911x.c @@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include -#include +#include #include #include "ethernet/eth_stats.h" diff --git a/drivers/gpio/gpio_cc2650.c b/drivers/gpio/gpio_cc2650.c index eff37cdbebd..f1c43a9f127 100644 --- a/drivers/gpio/gpio_cc2650.c +++ b/drivers/gpio/gpio_cc2650.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "gpio_utils.h" diff --git a/drivers/gpio/gpio_cc32xx.c b/drivers/gpio/gpio_cc32xx.c index c2499ef8459..a6856a90cd8 100644 --- a/drivers/gpio/gpio_cc32xx.c +++ b/drivers/gpio/gpio_cc32xx.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include /* Driverlib includes */ #include diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c index 679fd53fc10..dd14332df09 100644 --- a/drivers/gpio/gpio_dw.c +++ b/drivers/gpio/gpio_dw.c @@ -12,7 +12,7 @@ #include "gpio_utils.h" #include -#include +#include #include #include #include diff --git a/drivers/gpio/gpio_intel_apl.c b/drivers/gpio/gpio_intel_apl.c index a744684226b..b6374ad07f2 100644 --- a/drivers/gpio/gpio_intel_apl.c +++ b/drivers/gpio/gpio_intel_apl.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/gpio/gpio_qmsi.c b/drivers/gpio/gpio_qmsi.c index 4f826a49a63..376285bfe27 100644 --- a/drivers/gpio/gpio_qmsi.c +++ b/drivers/gpio/gpio_qmsi.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include "qm_gpio.h" diff --git a/drivers/gpio/gpio_sch.c b/drivers/gpio/gpio_sch.c index ab4f9de7a90..a9872ef1d71 100644 --- a/drivers/gpio/gpio_sch.c +++ b/drivers/gpio/gpio_sch.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "gpio_sch.h" diff --git a/drivers/gpio/gpio_stellaris.c b/drivers/gpio/gpio_stellaris.c index 9619933be00..852ff81b306 100644 --- a/drivers/gpio/gpio_stellaris.c +++ b/drivers/gpio/gpio_stellaris.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "gpio_utils.h" typedef void (*config_func_t)(struct device *dev); diff --git a/drivers/i2c/i2c_dw.c b/drivers/i2c/i2c_dw.c index 7ab56acd9b9..ef6a98456aa 100644 --- a/drivers/i2c/i2c_dw.c +++ b/drivers/i2c/i2c_dw.c @@ -18,7 +18,7 @@ #include #include -#include +#include #include diff --git a/drivers/i2c/i2c_sifive.c b/drivers/i2c/i2c_sifive.c index b9bd8adb316..1c570761d0d 100644 --- a/drivers/i2c/i2c_sifive.c +++ b/drivers/i2c/i2c_sifive.c @@ -10,7 +10,7 @@ LOG_MODULE_REGISTER(i2c_sifive); #include #include -#include +#include #include "i2c-priv.h" diff --git a/drivers/interrupt_controller/shared_irq.c b/drivers/interrupt_controller/shared_irq.c index 32d959269aa..ecbdad499b6 100644 --- a/drivers/interrupt_controller/shared_irq.c +++ b/drivers/interrupt_controller/shared_irq.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #ifdef CONFIG_IOAPIC #include diff --git a/drivers/pinmux/pinmux_cc2650.c b/drivers/pinmux/pinmux_cc2650.c index 026c2e0d488..d0f30bf8813 100644 --- a/drivers/pinmux/pinmux_cc2650.c +++ b/drivers/pinmux/pinmux_cc2650.c @@ -56,7 +56,7 @@ #include #include #include -#include +#include #define IOCFG_REG(Func) \ diff --git a/drivers/pwm/pwm_sifive.c b/drivers/pwm/pwm_sifive.c index 05ecb83827d..b66d5339b98 100644 --- a/drivers/pwm/pwm_sifive.c +++ b/drivers/pwm/pwm_sifive.c @@ -8,7 +8,7 @@ LOG_MODULE_REGISTER(pwm_sifive, CONFIG_PWM_LOG_LEVEL); -#include +#include #include #include diff --git a/drivers/serial/uart_altera_jtag_hal.c b/drivers/serial/uart_altera_jtag_hal.c index c48e8ae66f8..03936f5e09f 100644 --- a/drivers/serial/uart_altera_jtag_hal.c +++ b/drivers/serial/uart_altera_jtag_hal.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "altera_avalon_jtag_uart.h" #include "altera_avalon_jtag_uart_regs.h" diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c index 1601a1b5790..41c64f80915 100644 --- a/drivers/serial/uart_ns16550.c +++ b/drivers/serial/uart_ns16550.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "uart_ns16550.h" diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index a5290973c91..c6c5a810699 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(spi_dw); #include #include -#include +#include #include #include diff --git a/drivers/spi/spi_intel.c b/drivers/spi/spi_intel.c index 712e760ceed..c19baf82c52 100644 --- a/drivers/spi/spi_intel.c +++ b/drivers/spi/spi_intel.c @@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(spi_intel); #include #include -#include +#include #include #include diff --git a/drivers/spi/spi_sifive.h b/drivers/spi/spi_sifive.h index 326d1958040..7288f08e7ba 100644 --- a/drivers/spi/spi_sifive.h +++ b/drivers/spi/spi_sifive.h @@ -9,7 +9,7 @@ #include "spi_context.h" -#include +#include #include #include diff --git a/include/arch/arc/v2/sys_io.h b/include/arch/arc/v2/sys_io.h index 84152bd98fd..da73b31ef3a 100644 --- a/include/arch/arc/v2/sys_io.h +++ b/include/arch/arc/v2/sys_io.h @@ -13,7 +13,7 @@ extern "C" { #ifndef _ASMLANGUAGE -#include +#include #include #include diff --git a/include/arch/common/sys_io.h b/include/arch/common/sys_io.h index ec90d550cc4..e1e976726e6 100644 --- a/include/arch/common/sys_io.h +++ b/include/arch/common/sys_io.h @@ -19,7 +19,7 @@ extern "C" { #ifndef _ASMLANGUAGE #include -#include +#include static ALWAYS_INLINE u8_t sys_read8(mem_addr_t addr) diff --git a/include/arch/x86/sys_io.h b/include/arch/x86/sys_io.h index e82a653c99d..4eb909e8541 100644 --- a/include/arch/x86/sys_io.h +++ b/include/arch/x86/sys_io.h @@ -12,7 +12,7 @@ #if !defined(_ASMLANGUAGE) -#include +#include #include #include diff --git a/include/sys/sys_io.h b/include/sys/sys_io.h new file mode 100644 index 00000000000..60336b468e5 --- /dev/null +++ b/include/sys/sys_io.h @@ -0,0 +1,339 @@ +/* Port and memory mapped registers I/O operations */ + +/* + * Copyright (c) 2015 Intel Corporation. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_SYS_SYS_IO_H_ +#define ZEPHYR_INCLUDE_SYS_SYS_IO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +typedef u32_t io_port_t; +typedef u32_t mm_reg_t; +typedef uintptr_t mem_addr_t; + +/* Port I/O functions */ + +/** + * @fn static inline void sys_out8(u8_t data, io_port_t port); + * @brief Output a byte to an I/O port + * + * This function writes a byte to the given port. + * + * @param data the byte to write + * @param port the port address where to write the byte + */ + +/** + * @fn static inline u8_t sys_in8(io_port_t port); + * @brief Input a byte from an I/O port + * + * This function reads a byte from the port. + * + * @param port the port address from where to read the byte + * + * @return the byte read + */ + +/** + * @fn static inline void sys_out16(u16_t data, io_port_t port); + * @brief Output a 16 bits to an I/O port + * + * This function writes a 16 bits to the given port. + * + * @param data the 16 bits to write + * @param port the port address where to write the 16 bits + */ + +/** + * @fn static inline u16_t sys_in16(io_port_t port); + * @brief Input 16 bits from an I/O port + * + * This function reads 16 bits from the port. + * + * @param port the port address from where to read the 16 bits + * + * @return the 16 bits read + */ + +/** + * @fn static inline void sys_out32(u32_t data, io_port_t port); + * @brief Output 32 bits to an I/O port + * + * This function writes 32 bits to the given port. + * + * @param data the 32 bits to write + * @param port the port address where to write the 32 bits + */ + +/** + * @fn static inline u32_t sys_in32(io_port_t port); + * @brief Input 32 bits from an I/O port + * + * This function reads 32 bits from the port. + * + * @param port the port address from where to read the 32 bits + * + * @return the 32 bits read + */ + +/** + * @fn static inline void sys_io_set_bit(io_port_t port, unsigned int bit) + * @brief Set the designated bit from port to 1 + * + * This functions takes the designated bit starting from port and sets it to 1. + * + * @param port the port address from where to look for the bit + * @param bit the designated bit to set (from 0 to n) + */ + +/** + * @fn static inline void sys_io_clear_bit(io_port_t port, unsigned int bit) + * @brief Clear the designated bit from port to 0 + * + * This functions takes the designated bit starting from port and sets it to 0. + * + * @param port the port address from where to look for the bit + * @param bit the designated bit to clear (from 0 to n) + */ + +/** + * @fn static inline int sys_io_test_bit(io_port_t port, unsigned int bit) + * @brief Test the bit from port if it is set or not + * + * This functions takes the designated bit starting from port and tests its + * current setting. It will return the current setting. + * + * @param port the port address from where to look for the bit + * @param bit the designated bit to test (from 0 to n) + * + * @return 1 if it is set, 0 otherwise + */ + +/** + * @fn static inline int sys_io_test_and_set_bit(io_port_t port, unsigned int bit) + * @brief Test the bit from port and set it + * + * This functions takes the designated bit starting from port, tests its + * current setting and sets it. It will return the previous setting. + * + * @param port the port address from where to look for the bit + * @param bit the designated bit to test and set (from 0 to n) + * + * @return 1 if it was set, 0 otherwise + */ + +/** + * @fn static inline int sys_io_test_and_clear_bit(io_port_t port, unsigned int bit) + * @brief Test the bit from port and clear it + * + * This functions takes the designated bit starting from port, tests its + * current setting and clears it. It will return the previous setting. + * + * @param port the port address from where to look for the bit + * @param bit the designated bit to test and clear (from 0 to n) + * + * @return 0 if it was clear, 1 otherwise + */ + +/* Memory mapped registers I/O functions */ + +/** + * @fn static inline void sys_write8(u8_t data, mm_reg_t addr); + * @brief Write a byte to a memory mapped register + * + * This function writes a byte to the given memory mapped register. + * + * @param data the byte to write + * @param addr the memory mapped register address where to write the byte + */ + +/** + * @fn static inline u8_t sys_read8(mm_reg_t addr); + * @brief Read a byte from a memory mapped register + * + * This function reads a byte from the given memory mapped register. + * + * @param addr the memory mapped register address from where to read the byte + * + * @return the byte read + */ + +/** + * @fn static inline void sys_write16(u16_t data, mm_reg_t addr); + * @brief Write 16 bits to a memory mapped register + * + * This function writes 16 bits to the given memory mapped register. + * + * @param data the 16 bits to write + * @param addr the memory mapped register address where to write the 16 bits + */ + +/** + * @fn static inline u16_t sys_read16(mm_reg_t addr); + * @brief Read 16 bits from a memory mapped register + * + * This function reads 16 bits from the given memory mapped register. + * + * @param addr the memory mapped register address from where to read + * the 16 bits + * + * @return the 16 bits read + */ + +/** + * @fn static inline void sys_write32(u32_t data, mm_reg_t addr); + * @brief Write 32 bits to a memory mapped register + * + * This function writes 32 bits to the given memory mapped register. + * + * @param data the 32 bits to write + * @param addr the memory mapped register address where to write the 32 bits + */ + +/** + * @fn static inline u32_t sys_read32(mm_reg_t addr); + * @brief Read 32 bits from a memory mapped register + * + * This function reads 32 bits from the given memory mapped register. + * + * @param addr the memory mapped register address from where to read + * the 32 bits + * + * @return the 32 bits read + */ + +/* Memory bits manipulation functions */ + +/** + * @fn static inline void sys_set_bit(mem_addr_t addr, unsigned int bit) + * @brief Set the designated bit from addr to 1 + * + * This functions takes the designated bit starting from addr and sets it to 1. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to set (from 0 to 31) + */ + +/** + * @fn static inline void sys_clear_bit(mem_addr_t addr, unsigned int bit) + * @brief Clear the designated bit from addr to 0 + * + * This functions takes the designated bit starting from addr and sets it to 0. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to clear (from 0 to 31) + */ + +/** + * @fn static inline int sys_test_bit(mem_addr_t addr, unsigned int bit) + * @brief Test the bit if it is set or not + * + * This functions takes the designated bit starting from addr and tests its + * current setting. It will return the current setting. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to test (from 0 to 31) + * + * @return 1 if it is set, 0 otherwise + */ + +/** + * @fn static inline int sys_test_and_set_bit(mem_addr_t addr, unsigned int bit) + * @brief Test the bit and set it + * + * This functions takes the designated bit starting from addr, tests its + * current setting and sets it. It will return the previous setting. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to test and set (from 0 to 31) + * + * @return 1 if it was set, 0 otherwise + */ + +/** + * @fn static inline int sys_test_and_clear_bit(mem_addr_t addr, unsigned int bit) + * @brief Test the bit and clear it + * + * This functions takes the designated bit starting from addr, test its + * current setting and clears it. It will return the previous setting. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to test and clear (from 0 to 31) + * + * @return 0 if it was clear, 1 otherwise + */ + +/** + * @fn static inline void sys_bitfield_set_bit(mem_addr_t addr, unsigned int bit) + * @brief Set the designated bit from addr to 1 + * + * This functions takes the designated bit starting from addr and sets it to 1. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to set (arbitrary) + */ + +/** + * @fn static inline void sys_bitfield_clear_bit(mem_addr_t addr, unsigned int bit) + * @brief Clear the designated bit from addr to 0 + * + * This functions takes the designated bit starting from addr and sets it to 0. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to clear (arbitrary) + */ + +/** + * @fn static inline int sys_bitfield_test_bit(mem_addr_t addr, unsigned int bit) + * @brief Test the bit if it is set or not + * + * This functions takes the designated bit starting from addr and tests its + * current setting. It will return the current setting. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to test (arbitrary + * + * @return 1 if it is set, 0 otherwise + */ + +/** + * @fn static inline int sys_bitfield_test_and_set_bit(mem_addr_t addr, unsigned int bit) + * @brief Test the bit and set it + * + * This functions takes the designated bit starting from addr, tests its + * current setting and sets it. It will return the previous setting. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to test and set (arbitrary) + * + * @return 1 if it was set, 0 otherwise + */ + +/** + * @fn static inline int sys_bitfield_test_and_clear_bit(mem_addr_t addr, unsigned int bit) + * @brief Test the bit and clear it + * + * This functions takes the designated bit starting from addr, test its + * current setting and clears it. It will return the previous setting. + * + * @param addr the memory address from where to look for the bit + * @param bit the designated bit to test and clear (arbitrary) + * + * @return 0 if it was clear, 1 otherwise + */ + + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_SYS_SYS_IO_H_ */ diff --git a/include/sys_io.h b/include/sys_io.h index 5b1bfbf73ae..51d82984474 100644 --- a/include/sys_io.h +++ b/include/sys_io.h @@ -1,339 +1,15 @@ -/* Port and memory mapped registers I/O operations */ - /* - * Copyright (c) 2015 Intel Corporation. + * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ - #ifndef ZEPHYR_INCLUDE_SYS_IO_H_ #define ZEPHYR_INCLUDE_SYS_IO_H_ -#ifdef __cplusplus -extern "C" { +#ifndef CONFIG_COMPAT_INCLUDES +#warning "This header file has moved, include instead." #endif -#include -#include - -typedef u32_t io_port_t; -typedef u32_t mm_reg_t; -typedef uintptr_t mem_addr_t; - -/* Port I/O functions */ - -/** - * @fn static inline void sys_out8(u8_t data, io_port_t port); - * @brief Output a byte to an I/O port - * - * This function writes a byte to the given port. - * - * @param data the byte to write - * @param port the port address where to write the byte - */ - -/** - * @fn static inline u8_t sys_in8(io_port_t port); - * @brief Input a byte from an I/O port - * - * This function reads a byte from the port. - * - * @param port the port address from where to read the byte - * - * @return the byte read - */ - -/** - * @fn static inline void sys_out16(u16_t data, io_port_t port); - * @brief Output a 16 bits to an I/O port - * - * This function writes a 16 bits to the given port. - * - * @param data the 16 bits to write - * @param port the port address where to write the 16 bits - */ - -/** - * @fn static inline u16_t sys_in16(io_port_t port); - * @brief Input 16 bits from an I/O port - * - * This function reads 16 bits from the port. - * - * @param port the port address from where to read the 16 bits - * - * @return the 16 bits read - */ - -/** - * @fn static inline void sys_out32(u32_t data, io_port_t port); - * @brief Output 32 bits to an I/O port - * - * This function writes 32 bits to the given port. - * - * @param data the 32 bits to write - * @param port the port address where to write the 32 bits - */ - -/** - * @fn static inline u32_t sys_in32(io_port_t port); - * @brief Input 32 bits from an I/O port - * - * This function reads 32 bits from the port. - * - * @param port the port address from where to read the 32 bits - * - * @return the 32 bits read - */ - -/** - * @fn static inline void sys_io_set_bit(io_port_t port, unsigned int bit) - * @brief Set the designated bit from port to 1 - * - * This functions takes the designated bit starting from port and sets it to 1. - * - * @param port the port address from where to look for the bit - * @param bit the designated bit to set (from 0 to n) - */ - -/** - * @fn static inline void sys_io_clear_bit(io_port_t port, unsigned int bit) - * @brief Clear the designated bit from port to 0 - * - * This functions takes the designated bit starting from port and sets it to 0. - * - * @param port the port address from where to look for the bit - * @param bit the designated bit to clear (from 0 to n) - */ - -/** - * @fn static inline int sys_io_test_bit(io_port_t port, unsigned int bit) - * @brief Test the bit from port if it is set or not - * - * This functions takes the designated bit starting from port and tests its - * current setting. It will return the current setting. - * - * @param port the port address from where to look for the bit - * @param bit the designated bit to test (from 0 to n) - * - * @return 1 if it is set, 0 otherwise - */ - -/** - * @fn static inline int sys_io_test_and_set_bit(io_port_t port, unsigned int bit) - * @brief Test the bit from port and set it - * - * This functions takes the designated bit starting from port, tests its - * current setting and sets it. It will return the previous setting. - * - * @param port the port address from where to look for the bit - * @param bit the designated bit to test and set (from 0 to n) - * - * @return 1 if it was set, 0 otherwise - */ - -/** - * @fn static inline int sys_io_test_and_clear_bit(io_port_t port, unsigned int bit) - * @brief Test the bit from port and clear it - * - * This functions takes the designated bit starting from port, tests its - * current setting and clears it. It will return the previous setting. - * - * @param port the port address from where to look for the bit - * @param bit the designated bit to test and clear (from 0 to n) - * - * @return 0 if it was clear, 1 otherwise - */ - -/* Memory mapped registers I/O functions */ - -/** - * @fn static inline void sys_write8(u8_t data, mm_reg_t addr); - * @brief Write a byte to a memory mapped register - * - * This function writes a byte to the given memory mapped register. - * - * @param data the byte to write - * @param addr the memory mapped register address where to write the byte - */ - -/** - * @fn static inline u8_t sys_read8(mm_reg_t addr); - * @brief Read a byte from a memory mapped register - * - * This function reads a byte from the given memory mapped register. - * - * @param addr the memory mapped register address from where to read the byte - * - * @return the byte read - */ - -/** - * @fn static inline void sys_write16(u16_t data, mm_reg_t addr); - * @brief Write 16 bits to a memory mapped register - * - * This function writes 16 bits to the given memory mapped register. - * - * @param data the 16 bits to write - * @param addr the memory mapped register address where to write the 16 bits - */ - -/** - * @fn static inline u16_t sys_read16(mm_reg_t addr); - * @brief Read 16 bits from a memory mapped register - * - * This function reads 16 bits from the given memory mapped register. - * - * @param addr the memory mapped register address from where to read - * the 16 bits - * - * @return the 16 bits read - */ - -/** - * @fn static inline void sys_write32(u32_t data, mm_reg_t addr); - * @brief Write 32 bits to a memory mapped register - * - * This function writes 32 bits to the given memory mapped register. - * - * @param data the 32 bits to write - * @param addr the memory mapped register address where to write the 32 bits - */ - -/** - * @fn static inline u32_t sys_read32(mm_reg_t addr); - * @brief Read 32 bits from a memory mapped register - * - * This function reads 32 bits from the given memory mapped register. - * - * @param addr the memory mapped register address from where to read - * the 32 bits - * - * @return the 32 bits read - */ - -/* Memory bits manipulation functions */ - -/** - * @fn static inline void sys_set_bit(mem_addr_t addr, unsigned int bit) - * @brief Set the designated bit from addr to 1 - * - * This functions takes the designated bit starting from addr and sets it to 1. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to set (from 0 to 31) - */ - -/** - * @fn static inline void sys_clear_bit(mem_addr_t addr, unsigned int bit) - * @brief Clear the designated bit from addr to 0 - * - * This functions takes the designated bit starting from addr and sets it to 0. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to clear (from 0 to 31) - */ - -/** - * @fn static inline int sys_test_bit(mem_addr_t addr, unsigned int bit) - * @brief Test the bit if it is set or not - * - * This functions takes the designated bit starting from addr and tests its - * current setting. It will return the current setting. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to test (from 0 to 31) - * - * @return 1 if it is set, 0 otherwise - */ - -/** - * @fn static inline int sys_test_and_set_bit(mem_addr_t addr, unsigned int bit) - * @brief Test the bit and set it - * - * This functions takes the designated bit starting from addr, tests its - * current setting and sets it. It will return the previous setting. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to test and set (from 0 to 31) - * - * @return 1 if it was set, 0 otherwise - */ - -/** - * @fn static inline int sys_test_and_clear_bit(mem_addr_t addr, unsigned int bit) - * @brief Test the bit and clear it - * - * This functions takes the designated bit starting from addr, test its - * current setting and clears it. It will return the previous setting. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to test and clear (from 0 to 31) - * - * @return 0 if it was clear, 1 otherwise - */ - -/** - * @fn static inline void sys_bitfield_set_bit(mem_addr_t addr, unsigned int bit) - * @brief Set the designated bit from addr to 1 - * - * This functions takes the designated bit starting from addr and sets it to 1. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to set (arbitrary) - */ - -/** - * @fn static inline void sys_bitfield_clear_bit(mem_addr_t addr, unsigned int bit) - * @brief Clear the designated bit from addr to 0 - * - * This functions takes the designated bit starting from addr and sets it to 0. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to clear (arbitrary) - */ - -/** - * @fn static inline int sys_bitfield_test_bit(mem_addr_t addr, unsigned int bit) - * @brief Test the bit if it is set or not - * - * This functions takes the designated bit starting from addr and tests its - * current setting. It will return the current setting. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to test (arbitrary - * - * @return 1 if it is set, 0 otherwise - */ - -/** - * @fn static inline int sys_bitfield_test_and_set_bit(mem_addr_t addr, unsigned int bit) - * @brief Test the bit and set it - * - * This functions takes the designated bit starting from addr, tests its - * current setting and sets it. It will return the previous setting. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to test and set (arbitrary) - * - * @return 1 if it was set, 0 otherwise - */ - -/** - * @fn static inline int sys_bitfield_test_and_clear_bit(mem_addr_t addr, unsigned int bit) - * @brief Test the bit and clear it - * - * This functions takes the designated bit starting from addr, test its - * current setting and clears it. It will return the previous setting. - * - * @param addr the memory address from where to look for the bit - * @param bit the designated bit to test and clear (arbitrary) - * - * @return 0 if it was clear, 1 otherwise - */ - - -#ifdef __cplusplus -} -#endif +#include #endif /* ZEPHYR_INCLUDE_SYS_IO_H_ */ diff --git a/kernel/userspace.c b/kernel/userspace.c index fd16640c383..0eb7400e91b 100644 --- a/kernel/userspace.c +++ b/kernel/userspace.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/soc/arc/quark_se_c1000_ss/power.c b/soc/arc/quark_se_c1000_ss/power.c index bcc89a2f9a0..9746dc10d33 100644 --- a/soc/arc/quark_se_c1000_ss/power.c +++ b/soc/arc/quark_se_c1000_ss/power.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include diff --git a/soc/arm/ti_simplelink/cc2650/soc.c b/soc/arm/ti_simplelink/cc2650/soc.c index ac762343e83..3c6307aef15 100644 --- a/soc/arm/ti_simplelink/cc2650/soc.c +++ b/soc/arm/ti_simplelink/cc2650/soc.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include "soc.h" diff --git a/soc/x86/intel_quark/quark_se/eoi.c b/soc/x86/intel_quark/quark_se/eoi.c index c9148ecbebf..db2a26ec9f6 100644 --- a/soc/x86/intel_quark/quark_se/eoi.c +++ b/soc/x86/intel_quark/quark_se/eoi.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include void z_lakemont_eoi(void) diff --git a/soc/x86/intel_quark/quark_se/power.c b/soc/x86/intel_quark/quark_se/power.c index b2d7e146362..500f9f059af 100644 --- a/soc/x86/intel_quark/quark_se/power.c +++ b/soc/x86/intel_quark/quark_se/power.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include