OR1K support
|
Functions | |
uint32_t | or1k_coreid (void) |
uint32_t | or1k_numcores (void) |
uint32_t | or1k_sync_ll (void *address) |
int | or1k_sync_sc (void *address, uint32_t value) |
uint32_t | or1k_sync_cas (void *address, uint32_t compare, uint32_t swap) |
int | or1k_sync_tsl (void *address) |
uint32_t or1k_coreid | ( | void | ) |
Read core identifier
uint32_t or1k_numcores | ( | void | ) |
Read number of cores
uint32_t or1k_sync_cas | ( | void * | address, |
uint32_t | compare, | ||
uint32_t | swap | ||
) |
Compare and Swap
Loads a data item from the memory and compares a given value to it. If the values match, a new value is written to the memory, if they mismatch, the operation is aborted. The whole operation is atomic, i.e., it is guaranteed that no other core changes the value between the read and the write.
address | Address to operate on |
compare | Compare value |
swap | New value to write |
uint32_t or1k_sync_ll | ( | void * | address | ) |
Load linked
Load a value from the given address and link it. If the following or1k_sync_sc() goes to the same address and there was no conflicting access between loading and storing, the value is written back, else the write fails.
address | Address to load value from |
int or1k_sync_sc | ( | void * | address, |
uint32_t | value | ||
) |
Store conditional
Conditionally store a value to the address. The address must have been read before using or1k_sync_ll() and there must be no other load link after that, otherwise this will always fail. In case there was no other write to the same address in between the load link and the store conditional, the store is successful, otherwise it will also fail.
address | Address to conditionally store to |
value | Value to write to address |
int or1k_sync_tsl | ( | void * | address | ) |
Test and Set Lock
Check for a lock on an address. This means, if there is 0 at an address it will overwrite it with one and return 0. If the lock was already set (value 1 read from address), the function returns 1. The operation is atomic.
address | Address of the lock |