Zephyr Project API
3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sys_io.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Meta
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
/* Memory mapped registers I/O functions in riscv arch C code */
8
9
#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_SYS_IO_H_
10
#define ZEPHYR_INCLUDE_ARCH_RISCV_SYS_IO_H_
11
12
#ifndef _ASMLANGUAGE
13
14
#include <
zephyr/toolchain.h
>
15
#include <
zephyr/types.h
>
16
#include <
zephyr/sys/sys_io.h
>
17
18
#ifndef CONFIG_RISCV_SOC_HAS_CUSTOM_SYS_IO
19
#include <
zephyr/arch/common/sys_io.h
>
20
#endif
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
#ifdef CONFIG_RISCV_SOC_HAS_CUSTOM_SYS_IO
27
28
extern
uint8_t
z_soc_sys_read8(
mem_addr_t
addr);
29
extern
void
z_soc_sys_write8(
uint8_t
data
,
mem_addr_t
addr);
30
extern
uint16_t
z_soc_sys_read16(
mem_addr_t
addr);
31
extern
void
z_soc_sys_write16(
uint16_t
data
,
mem_addr_t
addr);
32
extern
uint32_t
z_soc_sys_read32(
mem_addr_t
addr);
33
extern
void
z_soc_sys_write32(
uint32_t
data
,
mem_addr_t
addr);
34
extern
uint64_t
z_soc_sys_read64(
mem_addr_t
addr);
35
extern
void
z_soc_sys_write64(
uint64_t
data
,
mem_addr_t
addr);
36
37
static
ALWAYS_INLINE
uint8_t
sys_read8
(
mem_addr_t
addr)
38
{
39
return
z_soc_sys_read8(addr);
40
}
41
42
static
ALWAYS_INLINE
void
sys_write8
(
uint8_t
data
,
mem_addr_t
addr)
43
{
44
return
z_soc_sys_write8(
data
, addr);
45
}
46
47
static
ALWAYS_INLINE
uint16_t
sys_read16
(
mem_addr_t
addr)
48
{
49
return
z_soc_sys_read16(addr);
50
}
51
52
static
ALWAYS_INLINE
void
sys_write16
(
uint16_t
data
,
mem_addr_t
addr)
53
{
54
return
z_soc_sys_write16(
data
, addr);
55
}
56
57
static
ALWAYS_INLINE
uint32_t
sys_read32
(
mem_addr_t
addr)
58
{
59
return
z_soc_sys_read32(addr);
60
}
61
62
static
ALWAYS_INLINE
void
sys_write32
(
uint32_t
data
,
mem_addr_t
addr)
63
{
64
return
z_soc_sys_write32(
data
, addr);
65
}
66
67
static
ALWAYS_INLINE
uint64_t
sys_read64
(
mem_addr_t
addr)
68
{
69
return
z_soc_sys_read64(addr);
70
}
71
72
static
ALWAYS_INLINE
void
sys_write64
(
uint64_t
data
,
mem_addr_t
addr)
73
{
74
return
z_soc_sys_write64(
data
, addr);
75
}
76
77
#endif
/* CONFIG_RISCV_SOC_HAS_CUSTOM_SYS_IO */
78
79
#ifdef __cplusplus
80
}
81
#endif
82
83
#endif
/* _ASMLANGUAGE */
84
85
#endif
/* ZEPHYR_INCLUDE_ARCH_RISCV_SYS_IO_H_ */
sys_write64
static ALWAYS_INLINE void sys_write64(uint64_t data, mem_addr_t addr)
Definition
sys_io.h:95
sys_write32
static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr)
Definition
sys_io.h:69
sys_read8
static ALWAYS_INLINE uint8_t sys_read8(mem_addr_t addr)
Definition
sys_io.h:27
sys_write16
static ALWAYS_INLINE void sys_write16(uint16_t data, mem_addr_t addr)
Definition
sys_io.h:53
sys_read32
static ALWAYS_INLINE uint32_t sys_read32(mem_addr_t addr)
Definition
sys_io.h:59
sys_read16
static ALWAYS_INLINE uint16_t sys_read16(mem_addr_t addr)
Definition
sys_io.h:43
sys_write8
static ALWAYS_INLINE void sys_write8(uint8_t data, mem_addr_t addr)
Definition
sys_io.h:37
sys_read64
static ALWAYS_INLINE uint64_t sys_read64(mem_addr_t addr)
Definition
sys_io.h:75
sys_io.h
ALWAYS_INLINE
#define ALWAYS_INLINE
Definition
common.h:129
types.h
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:91
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
sys_io.h
mem_addr_t
uintptr_t mem_addr_t
Definition
sys_io.h:21
data
static fdata_t data[2]
Definition
test_fifo_contexts.c:15
toolchain.h
Macros to abstract toolchain specific capabilities.
include
zephyr
arch
riscv
sys_io.h
Generated on Sun Sep 15 2024 17:01:29 for Zephyr Project API by
1.9.8