Files
Linux_Drivers/linux_5.10/scripts/atomic/fallbacks/inc_unless_negative
sam.xiang 5c7dd7acc3 [linux] create linux_5.10.4 from T-head official:
repo: https://github.com/T-head-Semi/linux
	commit: b1313fe517ca3703119dcc99ef3bbf75ab42bcfb

Change-Id: I6cbb35294024ea3a66140e311f4bb705fd7fd626
2023-03-10 20:32:41 +08:00

15 lines
255 B
Plaintext
Executable File

cat <<EOF
static __always_inline bool
${arch}${atomic}_inc_unless_negative(${atomic}_t *v)
{
${int} c = ${arch}${atomic}_read(v);
do {
if (unlikely(c < 0))
return false;
} while (!${arch}${atomic}_try_cmpxchg(v, &c, c + 1));
return true;
}
EOF