16#ifndef neorv32_cpu_amo_h
17#define neorv32_cpu_amo_h
33#if defined __riscv_atomic
34 uint32_t amo_addr = addr;
37 asm volatile (
"lr.w %[dst], 0(%[addr])" : [dst]
"=r" (amo_rdata) : [addr]
"r" (amo_addr));
58inline uint32_t __attribute__ ((always_inline))
neorv32_cpu_amosc(uint32_t addr, uint32_t wdata) {
60#if defined __riscv_atomic
61 uint32_t amo_addr = addr;
62 uint32_t amo_wdata = wdata;
65 asm volatile (
"sc.w %[dst], %[src], (%[addr])" : [dst]
"=r" (amo_status) : [src]
"r" (amo_wdata), [addr]
"r" (amo_addr));
uint32_t neorv32_cpu_amominuw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:315
uint32_t neorv32_cpu_amomaxuw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:243
uint32_t neorv32_cpu_amosc(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.h:58
int32_t neorv32_cpu_amomaxw(uint32_t addr, int32_t wdata)
Definition neorv32_cpu_amo.c:207
uint32_t neorv32_cpu_amoxorw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:171
int32_t neorv32_cpu_amominw(uint32_t addr, int32_t wdata)
Definition neorv32_cpu_amo.c:279
uint32_t neorv32_cpu_amoandw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:99
uint32_t neorv32_cpu_amoswapw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:29
uint32_t neorv32_cpu_amolr(uint32_t addr)
Definition neorv32_cpu_amo.h:31
uint32_t neorv32_cpu_amoaddw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:63
uint32_t neorv32_cpu_amoorw(uint32_t addr, uint32_t wdata)
Definition neorv32_cpu_amo.c:135