Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
asm_inline_gcc.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_ARCH_NIOS2_ASM_INLINE_GCC_H_
8
#define ZEPHYR_INCLUDE_ARCH_NIOS2_ASM_INLINE_GCC_H_
9
10
/*
11
* The file must not be included directly
12
* Include arch/cpu.h instead
13
*/
14
15
#ifndef _ASMLANGUAGE
16
#include <
zephyr/types.h
>
17
#include <
sys/sys_io.h
>
18
#include <
toolchain.h
>
19
20
/* Using the *io variants of these instructions to prevent issues on
21
* devices that have an instruction/data cache
22
*/
23
24
static
ALWAYS_INLINE
void
sys_write32
(
uint32_t
data
,
mm_reg_t
addr)
25
{
26
__builtin_stwio((
void
*)addr,
data
);
27
}
28
29
static
ALWAYS_INLINE
uint32_t
sys_read32
(
mm_reg_t
addr)
30
{
31
return
__builtin_ldwio((
void
*)addr);
32
}
33
34
static
ALWAYS_INLINE
void
sys_write8
(
uint8_t
data
,
mm_reg_t
addr)
35
{
36
sys_write32
(
data
, addr);
37
}
38
39
static
ALWAYS_INLINE
uint8_t
sys_read8
(
mm_reg_t
addr)
40
{
41
return
__builtin_ldbuio((
void
*)addr);
42
}
43
44
static
ALWAYS_INLINE
void
sys_write16
(
uint16_t
data
,
mm_reg_t
addr)
45
{
46
sys_write32
(
data
, addr);
47
}
48
49
static
ALWAYS_INLINE
uint16_t
sys_read16
(
mm_reg_t
addr)
50
{
51
return
__builtin_ldhuio((
void
*)addr);
52
}
53
54
#endif
/* _ASMLANGUAGE */
55
56
#endif
/* _ASM_INLINE_GCC_PUBLIC_GCC_H */
ALWAYS_INLINE
#define ALWAYS_INLINE
Definition:
common.h:116
types.h
sys_write8
static ALWAYS_INLINE void sys_write8(uint8_t data, mm_reg_t addr)
Definition:
asm_inline_gcc.h:34
sys_read32
static ALWAYS_INLINE uint32_t sys_read32(mm_reg_t addr)
Definition:
asm_inline_gcc.h:29
sys_read16
static ALWAYS_INLINE uint16_t sys_read16(mm_reg_t addr)
Definition:
asm_inline_gcc.h:49
sys_write16
static ALWAYS_INLINE void sys_write16(uint16_t data, mm_reg_t addr)
Definition:
asm_inline_gcc.h:44
sys_read8
static ALWAYS_INLINE uint8_t sys_read8(mm_reg_t addr)
Definition:
asm_inline_gcc.h:39
sys_write32
static ALWAYS_INLINE void sys_write32(uint32_t data, mm_reg_t addr)
Definition:
asm_inline_gcc.h:24
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:60
uint8_t
__UINT8_TYPE__ uint8_t
Definition:
stdint.h:58
uint16_t
__UINT16_TYPE__ uint16_t
Definition:
stdint.h:59
sys_io.h
mm_reg_t
uintptr_t mm_reg_t
Definition:
sys_io.h:20
data
static fdata_t data[2]
Definition:
test_fifo_contexts.c:15
toolchain.h
Macros to abstract toolchain specific capabilities.
include
arch
nios2
asm_inline_gcc.h
Generated on Sun Oct 9 2022 09:21:56 for Zephyr API Documentation by
1.9.4