Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 add cpu_set_onfault glue



details:   https://anonhg.NetBSD.org/src/rev/037fbfe94c29
branches:  trunk
changeset: 826136:037fbfe94c29
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Wed Aug 16 22:49:05 2017 +0000

description:
add cpu_set_onfault glue

diffstat:

 sys/arch/aarch64/aarch64/locore.S |  42 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 2 deletions(-)

diffs (70 lines):

diff -r 51ece96446e1 -r 037fbfe94c29 sys/arch/aarch64/aarch64/locore.S
--- a/sys/arch/aarch64/aarch64/locore.S Wed Aug 16 22:48:11 2017 +0000
+++ b/sys/arch/aarch64/aarch64/locore.S Wed Aug 16 22:49:05 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: locore.S,v 1.2 2017/08/16 22:49:05 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,10 @@
 
 #include "opt_ddb.h"
 
-RCSID("$NetBSD: locore.S,v 1.1 2014/08/10 05:47:37 matt Exp $")
+RCSID("$NetBSD: locore.S,v 1.2 2017/08/16 22:49:05 nisimura Exp $")
+
+// XXX:AARCH64
+lr     .req    x30
 
 /*
  * At IPL_SCHED:
@@ -116,6 +119,18 @@
 END(cpu_switchto)
 
 /*
+ *     x0 = lwp
+ *     x1 = ipl
+ */
+ENTRY_NP(cpu_switchto_softint)
+//
+//XXXAARCH64
+//
+       ret
+END(cpu_switchto_softint)
+
+
+/*
  * Called at IPL_SCHED
  *     x0 = old lwp (from cpu_switchto)
  *     x1 = new lwp (from cpu_switchto)
@@ -190,6 +205,29 @@
 END(cpu_Debugger)
 #endif /* DDB */
 
+/*
+ * int cpu_set_onfault(struct faultbuf *fb, register_t retval)
+ */
+ENTRY(cpu_set_onfault)
+       mov     x9, sp
+       stp     x19, x20, [x0, #0]
+       stp     x21, x22, [x0, #16]
+       stp     x23, x24, [x0, #32]
+       stp     x25, x26, [x0, #48]
+       stp     x27, x28, [x0, #64]
+       stp     x29, x9, [x0, #80]
+       stp     lr, x1, [x0, #96]
+       mrs     x3, tpidr_el1           /* curcpu */
+       ldr     x2, [x3, #CI_CURLWP]    /* curlwp */
+       str     x0, [x2, #L_MD_ONFAULT] /* l_md.md_onfault = fb */
+       mov     x0, #0
+END(cpu_set_onfault)
+
+/*
+ * setjmp(9)
+ * int setjmp(label_t *label);
+ * void longjmp(label_t *label);
+ */
 ENTRY(setjmp)
        stp     x19, x20, [x0, #0]
        stp     x21, x22, [x0, #16]



Home | Main Index | Thread Index | Old Index