Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16c85a1f authored by Catalin Marinas's avatar Catalin Marinas
Browse files

arm64: Use acquire/release semantics instead of explicit DMB



This patch changes the test_and_*_bit functions to use the
load-acquire/store-release instructions instead of explicit DMB.

Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent c47d6a04
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -46,13 +46,11 @@ ENTRY( \name )
	mov	x2, #1
	mov	x2, #1
	add	x1, x1, x0, lsr #3	// Get word offset
	add	x1, x1, x0, lsr #3	// Get word offset
	lsl	x4, x2, x3		// Create mask
	lsl	x4, x2, x3		// Create mask
	smp_dmb	ish
1:	ldaxr	x2, [x1]
1:	ldxr	x2, [x1]
	lsr	x0, x2, x3		// Save old value of bit
	lsr	x0, x2, x3		// Save old value of bit
	\instr	x2, x2, x4		// toggle bit
	\instr	x2, x2, x4		// toggle bit
	stxr	w5, x2, [x1]
	stlxr	w5, x2, [x1]
	cbnz	w5, 1b
	cbnz	w5, 1b
	smp_dmb	ish
	and	x0, x0, #1
	and	x0, x0, #1
3:	ret
3:	ret
ENDPROC(\name	)
ENDPROC(\name	)