Skip to content

Commit 6492f39

Browse files
committed
target/arc: Fix setting LF bit for spinlock
Signed-off-by: Yuriy Kolerov <[email protected]>
1 parent 8d452e7 commit 6492f39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

target/arc/op_helper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ target_ulong helper_llock(CPUARCState *env, target_ulong addr)
9292

9393
target_ulong ret = cpu_ldl_data_ra(env, addr, GETPC());
9494
entry->lpa_lf = (haddr & (~LPA_LFS_ALIGNEMENT_MASK));
95-
entry->lpa_lf += 1; /* least significant bit is LF flag */
95+
entry->lpa_lf |= 1; /* least significant bit is LF flag */
9696
entry->read_value = ret;
9797
qemu_mutex_unlock(&entry->mutex);
9898
return ret;
@@ -149,7 +149,7 @@ target_ulong helper_llockl(CPUARCState *env, target_ulong addr)
149149

150150
target_ulong ret = cpu_ldq_data_ra(env, addr, GETPC());
151151
entry->lpa_lf = (haddr & (~LPA_LFS_ALIGNEMENT_MASK));
152-
entry->lpa_lf += 1; /* least significant bit is LF flag */
152+
entry->lpa_lf |= 1; /* least significant bit is LF flag */
153153
entry->read_value = ret;
154154
qemu_mutex_unlock(&entry->mutex);
155155
return ret;
@@ -194,7 +194,7 @@ uint64_t helper_llockd(CPUARCState *env, target_ulong addr)
194194
uint64_t ret = cpu_ldq_data_ra(env, addr, GETPC());
195195

196196
entry->lpa_lf = (haddr & (~LPA_LFS_ALIGNEMENT_MASK));
197-
entry->lpa_lf += 1; /* least significant bit is LF flag */
197+
entry->lpa_lf |= 1; /* least significant bit is LF flag */
198198
entry->read_value = ret;
199199

200200
qemu_mutex_unlock(&entry->mutex);

0 commit comments

Comments
 (0)