Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2014 17:59:37 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r269315 - projects/arm64/sys/arm64/arm64
Message-ID:  <201407301759.s6UHxbB6048739@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/systm.h>
 #include <sys/proc.h>
 
+#include <machine/frame.h>
+
 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;
+}
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407301759.s6UHxbB6048739>