diff options
author | cognet <cognet@FreeBSD.org> | 2005-05-24 21:42:31 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2005-05-24 21:42:31 +0000 |
commit | 7001627d7dedbce03ba2c066c62efaf50565750a (patch) | |
tree | 12f091eb261568049595ae9b7ac55b6b1b921927 /sys/arm | |
parent | 8f10c3fc8a36c6b21d65271673ed2906412a0089 (diff) | |
download | FreeBSD-src-7001627d7dedbce03ba2c066c62efaf50565750a.zip FreeBSD-src-7001627d7dedbce03ba2c066c62efaf50565750a.tar.gz |
Make sure we clean the RAS start address once we're done.
This fixes the random segfaults which occurs at high interrupts rate.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/include/atomic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index e44a25c..30f0fcd 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -143,6 +143,8 @@ atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_in "cmp %1, %3\n" "streq %4, [%2]\n" "2:\n" + "mov %1, #0\n" + "str %1, [%0]\n" "moveq %1, #1\n" "movne %1, #0\n" : "=r" (ras_start), "=r" (done) @@ -166,6 +168,8 @@ atomic_add_32(volatile u_int32_t *p, u_int32_t val) "add %1, %1, %3\n" "str %1, [%2]\n" "2:\n" + "mov %1, #0\n" + "str %1, [%0]\n" : "=r" (ras_start), "=r" (start), "+r" (p), "+r" (val)); } @@ -185,6 +189,9 @@ atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) "sub %1, %1, %3\n" "str %1, [%2]\n" "2:\n" + "mov %1, #0\n" + "str %1, [%0]\n" + : "=r" (ras_start), "=r" (start), "+r" (p), "+r" (val)); } @@ -204,6 +211,9 @@ atomic_set_32(volatile uint32_t *address, uint32_t setmask) "orr %1, %1, %3\n" "str %1, [%2]\n" "2:\n" + "mov %1, #0\n" + "str %1, [%0]\n" + : "=r" (ras_start), "=r" (start), "+r" (address), "+r" (setmask)); } @@ -223,6 +233,8 @@ atomic_clear_32(volatile uint32_t *address, uint32_t clearmask) "bic %1, %1, %3\n" "str %1, [%2]\n" "2:\n" + "mov %1, #0\n" + "str %1, [%0]\n" : "=r" (ras_start), "=r" (start), "+r" (address), "+r" (clearmask)); } |