6#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_ATOMIC_H_
7#define ZEPHYR_INCLUDE_ARCH_RISCV_ATOMIC_H_
25 __asm__
volatile(
"amoswap.d.aq %0, %1, %2"
27 :
"r"(newval),
"A"(*target)
37 __asm__
volatile(
"amomax.d.aq %0, %1, %2"
39 :
"r"(value),
"A"(*target)
49 __asm__
volatile(
"amomin.d.aq %0, %1, %2"
51 :
"r"(value),
"A"(*target)
61 __asm__
volatile(
"amomaxu.d.aq %0, %1, %2"
63 :
"r"(value),
"A"(*target)
73 __asm__
volatile(
"amominu.d.aq %0, %1, %2"
75 :
"r"(value),
"A"(*target)
87 __asm__
volatile(
"amoswap.w.aq %0, %1, %2"
89 :
"r"(newval),
"A"(*target)
99 __asm__
volatile(
"amomax.w.aq %0, %1, %2"
101 :
"r"(value),
"A"(*target)
111 __asm__
volatile(
"amomin.w.aq %0, %1, %2"
113 :
"r"(value),
"A"(*target)
123 __asm__
volatile(
"amomaxu.w.aq %0, %1, %2"
125 :
"r"(value),
"A"(*target)
135 __asm__
volatile(
"amominu.w.aq %0, %1, %2"
137 :
"r"(value),
"A"(*target)
static ALWAYS_INLINE unsigned long atomic_maxu(unsigned long *target, unsigned long value)
Definition: atomic.h:119
static ALWAYS_INLINE atomic_val_t atomic_min(atomic_t *target, atomic_val_t value)
Definition: atomic.h:107
static ALWAYS_INLINE atomic_val_t atomic_swap(const atomic_t *target, atomic_val_t newval)
Copyright (c) 2024 NextSilicon SPDX-License-Identifier: Apache-2.0.
Definition: atomic.h:83
static ALWAYS_INLINE atomic_val_t atomic_max(atomic_t *target, atomic_val_t value)
Definition: atomic.h:95
static ALWAYS_INLINE unsigned long atomic_minu(unsigned long *target, unsigned long value)
Definition: atomic.h:131
long atomic_t
Definition: atomic_types.h:15
atomic_t atomic_val_t
Definition: atomic_types.h:16
#define ALWAYS_INLINE
Definition: common.h:129