diff mbox

[PULL] boot-wrappe: boot kernel in Hyp mode

Message ID 87k43f626l.fsf@rustcorp.com.au
State New
Headers show

Commit Message

Rusty Russell Feb. 22, 2012, 2:18 a.m. UTC
On Tue, 21 Feb 2012 12:33:45 +0000, Dave Martin <dave.martin@linaro.org> wrote:
> > "fiq", I assume.

Yep, fixed.

> > > -          popgt    {r11, r12}
> > > -          movgts   pc, lr
> > > +          ldmgtfd sp!, {r10-r12,pc}^
> > 
> > I was going to say 'This is more conventionally written "ldmiagt"'
> > but it looks like we'd need to uncomment the '.syntax unified'
> > at the top of the file and fix the warnings for that. 'ldmgtia',
> > then.
> 
> I did attempt to write it the other way around, and couldn't figure out
> why it didn't work... but I didn't try .syntax unified.

Being an ARM newbie, I found the old two-insn version much clearer than
Dave's single one.

This returns it to the original.  If noone complains, I'll fold this
into the previous patch and re-push.  Otherwise, I'll just fix the typo.

Thanks,
Rusty.

commit c1b47d034a719e9db4660a533336b89f0019e80d
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Wed Feb 22 12:39:19 2012 +1030

    Fix typo, return to simpler two-instruction function return sequences.
diff mbox

Patch

diff --git a/boot.S b/boot.S
index 0f61c3c..76de65f 100644
--- a/boot.S
+++ b/boot.S
@@ -130,7 +130,7 @@  vectors:
 	.word 0 /* dabt */
 	b	into_hyp_mode /* hvc */
 	.word 0 /* irq */
-	.word 0 /* fix */
+	.word 0 /* fiq */
 
 into_hyp_mode:
 	@ Check CPU nr again
diff --git a/monitor.S b/monitor.S
index 334186e..09689bd 100644
--- a/monitor.S
+++ b/monitor.S
@@ -25,7 +25,7 @@ 
 	@
 1:
 	ldr	sp, =_monitor_stack
-	push	{r10-r12,lr}
+	push	{r10-r12}
 
 	cmp	r7, #0xffffffff
 	beq	_non_sec
@@ -36,7 +36,8 @@ 
 	movnes	pc, lr
 	and	r12, r7, #0xf
 	cmp	r12, #0x0
-	ldmgtfd	sp!, {r10-r12,pc}^
+	popgt   {r10-r12}
+	movgts  pc, lr
 
 	@ Check the VMID is 0
 	mrc	p15, 0, r10, c1, c1, 0		@ SCR
@@ -48,7 +49,8 @@ 
 	lsr	r11, r11, #16
 	and	r11, r11, #0xff
 	cmp	r11, #0
-	ldmnefd	sp!, {r10-r12,pc}^
+	popne	{r10-r12}
+	movnes	pc, lr
 
 	@ Jump to the right function
 	and	r12, r7, #0xf
@@ -71,7 +73,8 @@  _non_sec:
 	ldr	r11, =0x131
 	orr	r12, r12, r11
 	mcr	p15, 0, r12, c1, c1, 0
-	ldmfd	sp!, {r10-r12,pc}^
+	pop	{r10-r12}
+	movs	pc, lr
 
 	@
 	@ Read/Write HVBAR
@@ -82,7 +85,8 @@  _write_hvbar:
 	isb
 	mcr	p15, 4, r0, c12, c0, 0
 	mcr	p15, 0, r10, c1, c1, 0		@ Restore SCR
-	ldmfd	sp!, {r10-r12,pc}^
+	pop	{r10-r12}
+	movs	pc, lr
 
 	.ltorg