svn commit: r361535 - head/sys/powerpc/include
Brandon Bergren
bdragon at FreeBSD.org
Tue May 26 19:03:46 UTC 2020
Author: bdragon
Date: Tue May 26 19:03:45 2020
New Revision: 361535
URL: https://svnweb.freebsd.org/changeset/base/361535
Log:
[PowerPC] Fix atomic_cmpset_masked().
A recent kernel change caused the previously unused atomic_cmpset_masked() to
be used.
It had a typo in it.
Instead of reading the old value from an uninitialized variable, read it
from the passed-in pointer as intended.
This fixes crashes on 64 bit Book-E.
Obtained from: jhibbits
Modified:
head/sys/powerpc/include/atomic.h
Modified: head/sys/powerpc/include/atomic.h
==============================================================================
--- head/sys/powerpc/include/atomic.h Tue May 26 17:54:11 2020 (r361534)
+++ head/sys/powerpc/include/atomic.h Tue May 26 19:03:45 2020 (r361535)
@@ -621,7 +621,7 @@ atomic_cmpset_masked(uint32_t *p, uint32_t cmpval, uin
uint32_t tmp;
__asm __volatile (
- "1:\tlwarx %2, 0, %2\n\t" /* load old value */
+ "1:\tlwarx %2, 0, %3\n\t" /* load old value */
"and %0, %2, %7\n\t"
"cmplw %4, %0\n\t" /* compare */
"bne- 2f\n\t" /* exit if not equal */
More information about the svn-src-all
mailing list