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 <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2019-06-25 12:26:23 -04:00
commit ef281c4237
93 changed files with 434 additions and 419 deletions

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/stm32/pinmux_stm32.h"

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/stm32/pinmux_stm32.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <gpio/gpio_cmsdk_ahb.h>
#include "pinmux/pinmux.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include "pinmux/stm32/pinmux_stm32.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -9,7 +9,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -9,7 +9,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/stm32/pinmux_stm32.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include "pinmux/stm32/pinmux_stm32.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -9,7 +9,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <pinmux/stm32/pinmux_stm32.h>

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <gpio/gpio_cmsdk_ahb.h>
#include "pinmux/pinmux.h"

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <gpio/gpio_cmsdk_ahb.h>
#include "pinmux/pinmux.h"

View file

@ -9,7 +9,7 @@
#include <kernel.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <gpio/gpio_cmsdk_ahb.h>
#include "pinmux/pinmux.h"

View file

@ -10,7 +10,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include <pinmux_quark_mcu.h>

View file

@ -11,7 +11,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include <pinmux_quark_mcu.h>

View file

@ -10,7 +10,7 @@
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "pinmux/pinmux.h"
#include "pinmux_quark_mcu.h"

View file

@ -14,7 +14,7 @@
#include <device.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <clock_control.h>
#include <clock_control/quark_se_clock_control.h>

View file

@ -9,7 +9,7 @@
#include <entropy.h>
#include <irq.h>
#include <ring_buffer.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <driverlib/prcm.h>
#include <driverlib/trng.h>

View file

@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <net/ethernet.h>
#include <ethernet/eth_stats.h>

View file

@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <net/ethernet.h>
#include "ethernet/eth_stats.h"

View file

@ -9,7 +9,7 @@
#include <gpio.h>
#include <init.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "gpio_utils.h"

View file

@ -9,7 +9,7 @@
#include <gpio.h>
#include <init.h>
#include <kernel.h>
#include <sys_io.h>
#include <sys/sys_io.h>
/* Driverlib includes */
#include <inc/hw_types.h>

View file

@ -12,7 +12,7 @@
#include "gpio_utils.h"
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <init.h>
#include <misc/util.h>
#include <misc/__assert.h>

View file

@ -24,7 +24,7 @@
#include <errno.h>
#include <gpio.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <misc/__assert.h>
#include <misc/slist.h>
#include <misc/speculation.h>

View file

@ -10,7 +10,7 @@
#include <drivers/interrupt_controller/ioapic.h>
#include <gpio.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <misc/util.h>
#include "qm_gpio.h"

View file

@ -11,7 +11,7 @@
#include <kernel.h>
#include <soc.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <misc/util.h>
#include "gpio_sch.h"

View file

@ -8,7 +8,7 @@
#include <device.h>
#include <gpio.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "gpio_utils.h"
typedef void (*config_func_t)(struct device *dev);

View file

@ -18,7 +18,7 @@
#include <soc.h>
#include <errno.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <misc/util.h>

View file

@ -10,7 +10,7 @@ LOG_MODULE_REGISTER(i2c_sifive);
#include <device.h>
#include <i2c.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "i2c-priv.h"

View file

@ -10,7 +10,7 @@
#include <device.h>
#include <shared_irq.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#ifdef CONFIG_IOAPIC
#include <drivers/interrupt_controller/ioapic.h>

View file

@ -56,7 +56,7 @@
#include <device.h>
#include <pinmux.h>
#include <soc.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#define IOCFG_REG(Func) \

View file

@ -8,7 +8,7 @@
LOG_MODULE_REGISTER(pwm_sifive, CONFIG_PWM_LOG_LEVEL);
#include <sys_io.h>
#include <sys/sys_io.h>
#include <device.h>
#include <pwm.h>

View file

@ -8,7 +8,7 @@
#include <kernel.h>
#include <arch/cpu.h>
#include <uart.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "altera_avalon_jtag_uart.h"
#include "altera_avalon_jtag_uart_regs.h"

View file

@ -30,7 +30,7 @@
#include <toolchain.h>
#include <linker/sections.h>
#include <uart.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "uart_ns16550.h"

View file

@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(spi_dw);
#include <device.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <clock_control.h>
#include <misc/util.h>

View file

@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(spi_intel);
#include <soc.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <power/power.h>
#include <spi.h>

View file

@ -9,7 +9,7 @@
#include "spi_context.h"
#include <sys_io.h>
#include <sys/sys_io.h>
#include <device.h>
#include <spi.h>

View file

@ -13,7 +13,7 @@ extern "C" {
#ifndef _ASMLANGUAGE
#include <sys_io.h>
#include <sys/sys_io.h>
#include <arch/arc/v2/aux_regs.h>
#include <zephyr/types.h>

View file

@ -19,7 +19,7 @@ extern "C" {
#ifndef _ASMLANGUAGE
#include <zephyr/types.h>
#include <sys_io.h>
#include <sys/sys_io.h>
static ALWAYS_INLINE u8_t sys_read8(mem_addr_t addr)

View file

@ -12,7 +12,7 @@
#if !defined(_ASMLANGUAGE)
#include <sys_io.h>
#include <sys/sys_io.h>
#include <zephyr/types.h>
#include <stddef.h>

339
include/sys/sys_io.h Normal file
View file

@ -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 <zephyr/types.h>
#include <stddef.h>
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_ */

View file

@ -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 <sys/sys_io.h> instead."
#endif
#include <zephyr/types.h>
#include <stddef.h>
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 <sys/sys_io.h>
#endif /* ZEPHYR_INCLUDE_SYS_IO_H_ */

View file

@ -11,7 +11,7 @@
#include <misc/printk.h>
#include <misc/rb.h>
#include <kernel_structs.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <ksched.h>
#include <syscall.h>
#include <syscall_handler.h>

View file

@ -5,7 +5,7 @@
*/
#include <zephyr.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <misc/__assert.h>
#include <power/power.h>
#include <soc_power.h>

View file

@ -7,7 +7,7 @@
#include <toolchain/gcc.h>
#include <init.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include "soc.h"

View file

@ -16,7 +16,7 @@
#include <kernel.h>
#include <arch/x86/irq_controller.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <interrupt_controller/ioapic_priv.h>
void z_lakemont_eoi(void)

View file

@ -5,7 +5,7 @@
*/
#include <zephyr.h>
#include <sys_io.h>
#include <sys/sys_io.h>
#include <misc/__assert.h>
#include <power/power.h>
#include <soc_power.h>