From owner-svn-src-projects@FreeBSD.ORG Wed Jul 30 17:59:38 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E545D9D; Wed, 30 Jul 2014 17:59:38 +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 0C7572066; Wed, 30 Jul 2014 17:59:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6UHxbCN048740; Wed, 30 Jul 2014 17:59:37 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6UHxbB6048739; Wed, 30 Jul 2014 17:59:37 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201407301759.s6UHxbB6048739@svn.freebsd.org> From: Andrew Turner Date: Wed, 30 Jul 2014 17:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r269315 - 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: Wed, 30 Jul 2014 17:59:38 -0000 Author: andrew Date: Wed Jul 30 17:59:37 2014 New Revision: 269315 URL: http://svnweb.freebsd.org/changeset/base/269315 Log: Add do_el1h_sync. For now it prints the exception details. Modified: projects/arm64/sys/arm64/arm64/trap.c Modified: projects/arm64/sys/arm64/arm64/trap.c ============================================================================== --- projects/arm64/sys/arm64/arm64/trap.c Wed Jul 30 17:58:17 2014 (r269314) +++ projects/arm64/sys/arm64/arm64/trap.c Wed Jul 30 17:59:37 2014 (r269315) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { @@ -39,3 +41,27 @@ cpu_fetch_syscall_args(struct thread *td panic("cpu_fetch_syscall_args"); } +void do_el1h_sync(struct trapframe *frame); +void do_el1h_sync(struct trapframe *frame) +{ + uint32_t exception; + uint64_t esr; + + /* Read the esr register to get the exception details */ + __asm __volatile("mrs %x0, esr_el1" : "=&r"(esr)); + KASSERT((esr & (1 << 25)) != 0, + ("Invalid instruction length in exception")); + + exception = (esr >> 26) & 0x3f; + + printf("In do_el1h_sync %llx %llx %x\n", frame->tf_elr, esr, exception); + switch(exception) { + case 0x3c: + printf("Breakpoint %u\n", (uint32_t)(esr & 0xffffff)); + break; + default: + panic("Unknown exception %x\n", exception); + } + frame->tf_elr += 4; +} +