Skip to contentSkip to conversation

ARM: contextidr: avoid using bfi instruction during notifier

PATCH New Will Deacon 1 participant 1 message Aug 23, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: contextidr: avoid using bfi instruction during notifier

The bfi instruction is not available on ARMv6, so instead use an and/orr sequence in the contextidr_notifier. This gets rid of the assembler error:

Assembler messages:
Error: selected processor does not support ARM mode `bfi r3,r2,#0,#8'

---

Tested on my Integrator/CP w/ an 1136 tile.

 arch/arm/mm/context.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/mm/context.c +4 -3
index 119bc52..4e07eec 100644
@@ -63,10 +63,11 @@ static int contextidr_notifier(struct notifier_block *unused, unsigned long cmd,
 	pid = task_pid_nr(thread->task) << ASID_BITS;
 	asm volatile(
 	"	mrc	p15, 0, %0, c13, c0, 1\n"
-	"	bfi	%1, %0, #0, %2\n"
-	"	mcr	p15, 0, %1, c13, c0, 1\n"
+	"	and	%0, %0, %2\n"
+	"	orr	%0, %0, %1\n"
+	"	mcr	p15, 0, %0, c13, c0, 1\n"
 	: "=r" (contextidr), "+r" (pid)
-	: "I" (ASID_BITS));
+	: "I" (~ASID_MASK));
 	isb();
 
 	return NOTIFY_OK;
Signature · 1 line
1.7.4.1