Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
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 <zephyr/sys/sys_io.h>
18#include <zephyr/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
25{
26 __builtin_stwio((void *)addr, data);
27}
28
30{
31 return __builtin_ldwio((void *)addr);
32}
33
35{
36 sys_write32(data, addr);
37}
38
40{
41 return __builtin_ldbuio((void *)addr);
42}
43
45{
46 sys_write32(data, addr);
47}
48
50{
51 return __builtin_ldhuio((void *)addr);
52}
53
54#endif /* _ASMLANGUAGE */
55
56#endif /* _ASM_INLINE_GCC_PUBLIC_GCC_H */
#define ALWAYS_INLINE
Definition common.h:129
static ALWAYS_INLINE void sys_write8(uint8_t data, mm_reg_t addr)
Definition asm_inline_gcc.h:34
static ALWAYS_INLINE uint32_t sys_read32(mm_reg_t addr)
Definition asm_inline_gcc.h:29
static ALWAYS_INLINE uint16_t sys_read16(mm_reg_t addr)
Definition asm_inline_gcc.h:49
static ALWAYS_INLINE void sys_write16(uint16_t data, mm_reg_t addr)
Definition asm_inline_gcc.h:44
static ALWAYS_INLINE uint8_t sys_read8(mm_reg_t addr)
Definition asm_inline_gcc.h:39
static ALWAYS_INLINE void sys_write32(uint32_t data, mm_reg_t addr)
Definition asm_inline_gcc.h:24
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
uintptr_t mm_reg_t
Definition sys_io.h:20
static fdata_t data[2]
Definition test_fifo_contexts.c:15
Macros to abstract toolchain specific capabilities.