svn commit: r269315 - projects/arm64/sys/arm64/arm64

Andrew Turner andrew at FreeBSD.org
Wed Jul 30 17:59:38 UTC 2014


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;
+}
+


More information about the svn-src-projects mailing list