diff options
author | David-Horner <ds2horner@gmail.com> | 2019-05-15 15:55:06 -0400 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-05-15 12:55:06 -0700 |
commit | 2ff4f572360f49c716a4fbc72c912397cece842e (patch) | |
tree | 0c7629eb318bcd6d1ad0b353fc0e27baf969d81e | |
parent | ba63c32418dcb3b72859957f83373b8a5644e169 (diff) | |
download | riscv-isa-manual-2ff4f572360f49c716a4fbc72c912397cece842e.zip riscv-isa-manual-2ff4f572360f49c716a4fbc72c912397cece842e.tar.gz riscv-isa-manual-2ff4f572360f49c716a4fbc72c912397cece842e.tar.bz2 |
Correct iteration in LR/SC CAS example. (#384)
Address argument was clobbered.
Signed-off-by: David Horner <ds2horner@gmail.com>
-rw-r--r-- | src/a.tex | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -232,8 +232,9 @@ only take four instructions. cas: lr.w t0, (a0) # Load original value. bne t0, a1, fail # Doesn't match, so fail. - sc.w a0, a2, (a0) # Try to update. - bnez a0, cas # Retry if store-conditional failed. + sc.w t0, a2, (a0) # Try to update. + bnez t0, cas # Retry if store-conditional failed. + li a0, 0 # Set return to success. jr ra # Return. fail: li a0, 1 # Set return to failure. |