mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
In atomic_fetchadd_32(), do not blindly increase the value of %3.
It should just contain the value we want to add, as if we're interrupted between the add and the str, we will restart from the beginning. Just use a register we can scratch instead. MFC After: 1 week
This commit is contained in:
parent
9f0c02d425
commit
9acb0e651b
1 changed files with 3 additions and 2 deletions
|
|
@ -271,9 +271,10 @@ atomic_fetchadd_32(volatile uint32_t *p, uint32_t v)
|
|||
"mov %0, #0xe0000004\n"
|
||||
"str %1, [%0]\n"
|
||||
"ldr %1, [%2]\n"
|
||||
"add %3, %1, %3\n"
|
||||
"str %3, [%2]\n"
|
||||
"add %0, %1, %3\n"
|
||||
"str %0, [%2]\n"
|
||||
"2:\n"
|
||||
"mov %0, #0xe0000004\n"
|
||||
"mov %3, #0\n"
|
||||
"str %3, [%0]\n"
|
||||
: "=r" (ras_start), "=r" (start), "+r" (p), "+r" (v)
|
||||
|
|
|
|||
Loading…
Reference in a new issue