From owner-freebsd-arm@FreeBSD.ORG Tue May 1 05:43:08 2012 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8298110657A0 for ; Tue, 1 May 2012 05:43:08 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDDF8FC15 for ; Tue, 1 May 2012 05:43:08 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q415h2Fu007677 for arm@freebsd.org; Tue, 1 May 2012 05:43:02 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id gun7attxjvy8zt8qm5ex7ycike; for arm@freebsd.org; Tue, 01 May 2012 05:43:02 +0000 (UTC) (envelope-from tim@kientzle.com) From: Tim Kientzle Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Apr 2012 22:43:01 -0700 Message-Id: <1BB6F5DA-36E9-471A-8926-F56275D90962@kientzle.com> To: arm@freebsd.org Mime-Version: 1.0 (Apple Message framework v1257) X-Mailer: Apple Mail (2.1257) Cc: Subject: Request for Review: improving Ubldr syscall linkage. X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2012 05:43:08 -0000 Any comments on the following before I commit? Basically, this just: * Removes some redundant loads * Uses blx for the subroutine call * Uses bx for the subroutine return The only odd point: The ARM reference I have lists blx only for ARMv6 and ARMv7 instruction sets =85 or am I misreading that somehow? It seems to work, but my only ARM board is ARMv7 and I don't want to screw up anything for older CPUs. Index: sys/boot/arm/uboot/start.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/arm/uboot/start.S (revision 234747) +++ sys/boot/arm/uboot/start.S (working copy) @@ -49,30 +49,22 @@ * syscall() */ ENTRY(syscall) - /* Save caller's lr */ + /* Save caller's lr and r8 */ ldr ip, =3Dsaved_regs str lr, [ip, #4] - /* Save loader's r8 */ - ldr ip, =3Dsaved_regs str r8, [ip, #8] - /* Restore U-Boot's r8 */ - ldr ip, =3Dsaved_regs ldr r8, [ip, #0] /* Call into U-Boot */ - ldr lr, =3Dreturn_from_syscall ldr ip, =3Dsyscall_ptr - ldr pc, [ip] - -return_from_syscall: - /* Restore loader's r8 */ + ldr ip, [ip, #0] + blx ip + /* Restore loader's r8 and lr */ ldr ip, =3Dsaved_regs ldr r8, [ip, #8] - /* Restore caller's lr */ - ldr ip, =3Dsaved_regs ldr lr, [ip, #4] /* Return to caller */ - mov pc, lr + bx lr =20 /* * Data section