Skip to contentSkip to conversation

parisc: use long branch in fork_like macro

PATCH New Helge Deller 1 participant 1 message May 16, 2013 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: use long branch in fork_like macro

please add to stable kernel v3.9
upstream commit bbbfde782084b4f0d85ddffb88f1cf4650ff40e4

From: John David Anglin <[email protected]>

The "b" branch instruction used in the fork_like macro only can handle 17-bit pc-relative offsets.
This fails with an out of range offset with some .config files. Rewrite to use the "be" instruction which
can branch to any address in a space.

arch/parisc/kernel/entry.S +2 -1
index aa486e4..36f4f1d 100644
@@ -1702,7 +1702,8 @@ ENTRY(sys_\name\()_wrapper)
 	ldo	TASK_REGS(%r1),%r1
 	reg_save %r1
 	mfctl	%cr27, %r28
-	b	sys_\name
+	ldil	L%sys_\name, %r31
+	be	R%sys_\name(%sr4,%r31)
 	STREG	%r28, PT_CR27(%r1)
 ENDPROC(sys_\name\()_wrapper)
 	.endm