From owner-svn-src-projects@FreeBSD.ORG Sun Jul 6 13:49:53 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF12B923; Sun, 6 Jul 2014 13:49:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC94C2371; Sun, 6 Jul 2014 13:49:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66DnrhZ007058; Sun, 6 Jul 2014 13:49:53 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66Dnrg1007057; Sun, 6 Jul 2014 13:49:53 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201407061349.s66Dnrg1007057@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jul 2014 13:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r268312 - projects/arm64/sys/arm64/arm64 X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2014 13:49:54 -0000 Author: andrew Date: Sun Jul 6 13:49:53 2014 New Revision: 268312 URL: http://svnweb.freebsd.org/changeset/base/268312 Log: Load the exception vector on boot. We can now use brk to signal mi_startup returned as it should never happen. While here clean the stye a little. Modified: projects/arm64/sys/arm64/arm64/locore.S Modified: projects/arm64/sys/arm64/arm64/locore.S ============================================================================== --- projects/arm64/sys/arm64/arm64/locore.S Sun Jul 6 13:48:15 2014 (r268311) +++ projects/arm64/sys/arm64/arm64/locore.S Sun Jul 6 13:49:53 2014 (r268312) @@ -115,8 +115,8 @@ virtdone: bl initarm bl mi_startup -3: wfi - b 3b + /* We should not get here */ + brk 0 .align 3 .Lvirtdone: @@ -177,8 +177,8 @@ drop_to_el1: .quad SCTLR_RES1 #define VECT_EMPTY \ - .align 7; \ - 1: b 1b + .align 7; \ + 1: b 1b .align 11 hyp_vectors: @@ -406,6 +406,15 @@ build_block_pagetable: start_mmu: dsb sy + /* Load the exception vectors */ + /* + * TODO: We should use ldr x2, =exception_vectors here + * when clang supports it. + */ + adr x2, _exception_vectors + ldr x2, [x2] + msr vbar_el1, x2 + /* Load ttbr0 and ttbr1 */ msr ttbr0_el1, x27 msr ttbr1_el1, x26 @@ -436,6 +445,8 @@ start_mmu: ret .align 3 +_exception_vectors: + .quad exception_vectors mair: .quad MAIR(0x00, 0) | MAIR(0x44, 1) | MAIR(0xff, 2) tcr: