summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-01-24 17:02:02 -0800
committerMegan Wachs <megan@sifive.com>2017-01-24 17:02:02 -0800
commitd6e76482adced83f835a1d1f075826ccf24034ca (patch)
tree6187f1bb28911df04c0ae3fdb2ff1cd60c32c204
parentc72e4fcd4a77354d0d427cef263ebe438aeeae6e (diff)
use relaxed memory model for bitbang demo to avoid unncessary fences in the output
-rw-r--r--software/demo_gpio/demo_gpio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/software/demo_gpio/demo_gpio.c b/software/demo_gpio/demo_gpio.c
index 040d864..00bc8cd 100644
--- a/software/demo_gpio/demo_gpio.c
+++ b/software/demo_gpio/demo_gpio.c
@@ -232,10 +232,9 @@ int main(int argc, char **argv)
* Atomics give a quick way to control a single bit.
*************************************************************************/
uint32_t mask = (1 << PIN_19_OFFSET);
- uint32_t other_mask = (1 << PIN_19_OFFSET);
while (1){
- atomic_fetch_xor(&GPIO_REG(GPIO_OUTPUT_VAL), mask);
+ atomic_fetch_xor_explicit(&GPIO_REG(GPIO_OUTPUT_VAL), mask, memory_order_relaxed);
}
return 0;