Atomic memory access (read-modify-write) emulation functions using LR/SC pairs - source file.
More...
Atomic memory access (read-modify-write) emulation functions using LR/SC pairs - source file.
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ neorv32_cpu_amoaddw()
uint32_t neorv32_cpu_amoaddw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic ADD (AMOADD.W). return <= MEM[addr]; MEM[addr] <= MEM[addr] + wdata
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically added to original data at address (32-bit). |
- Returns
- Pre-operation data loaded from address (32-bit)
◆ neorv32_cpu_amoandw()
uint32_t neorv32_cpu_amoandw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic AND (AMOAND.W). return <= MEM[addr]; MEM[addr] <= MEM[addr] and wdata
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically AND-ed with original data at address (32-bit). |
- Returns
- Pre-operation data loaded from address (32-bit)
◆ neorv32_cpu_amomaxuw()
uint32_t neorv32_cpu_amomaxuw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic unsigned MAX (AMOMAXU.W). return <= MEM[addr]; MEM[addr] <= maximum_unsigned(MEM[addr], wdata)
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically MAX-ed with original data at address (unsigned 32-bit). |
- Returns
- Pre-operation data loaded from address (unsigned 32-bit)
◆ neorv32_cpu_amomaxw()
int32_t neorv32_cpu_amomaxw |
( |
uint32_t | addr, |
|
|
int32_t | wdata ) |
Atomic signed MAX (AMOMAX.W). return <= MEM[addr]; MEM[addr] <= maximum_signed(MEM[addr], wdata)
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically MAX-ed with original data at address (signed 32-bit). |
- Returns
- Pre-operation data loaded from address (signed 32-bit)
◆ neorv32_cpu_amominuw()
uint32_t neorv32_cpu_amominuw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic unsigned MIN (AMOMINU.W). return <= MEM[addr]; MEM[addr] <= minimum_unsigned(MEM[addr], wdata)
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically MIN-ed with original data at address (unsigned 32-bit). |
- Returns
- Pre-operation data loaded from address (unsigned 32-bit)
◆ neorv32_cpu_amominw()
int32_t neorv32_cpu_amominw |
( |
uint32_t | addr, |
|
|
int32_t | wdata ) |
Atomic signed MIN (AMOMIN.W). return <= MEM[addr]; MEM[addr] <= minimum_signed(MEM[addr], wdata)
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically MIN-ed with original data at address (signed 32-bit). |
- Returns
- Pre-operation data loaded from address (signed 32-bit)
◆ neorv32_cpu_amoorw()
uint32_t neorv32_cpu_amoorw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic OR (AMOOR.W). return <= MEM[addr]; MEM[addr] <= MEM[addr] or wdata
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically OR-ed with original data at address (32-bit). |
- Returns
- Pre-operation data loaded from address (32-bit)
◆ neorv32_cpu_amoswapw()
uint32_t neorv32_cpu_amoswapw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic SWAP (AMOSWAP.W). return <= MEM[addr]; MEM[addr] <= wdata
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically stored to address (32-bit). |
- Returns
- Pre-operation data loaded from address (32-bit)
◆ neorv32_cpu_amoxorw()
uint32_t neorv32_cpu_amoxorw |
( |
uint32_t | addr, |
|
|
uint32_t | wdata ) |
Atomic XOR (AMOXOR.W). return <= MEM[addr]; MEM[addr] <= MEM[addr] xor wdata
- Note
- This function requires the CPU A ISA extension.
- Parameters
-
[in] | addr | 32-bit memory address, word-aligned. |
[in] | wdata | Data word to be atomically XOR-ed with original data at address (32-bit). |
- Returns
- Pre-operation data loaded from address (32-bit)