Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Hide differences between i386 and amd64 interrupt f...



details:   https://anonhg.NetBSD.org/src/rev/021eec979b24
branches:  trunk
changeset: 445982:021eec979b24
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Nov 19 10:05:09 2018 +0000

description:
Hide differences between i386 and amd64 interrupt frames so XEN does
not need to know there is one.   Hopefully unbreak i386 build.

diffstat:

 sys/arch/amd64/include/frame.h        |  10 +++++++++-
 sys/arch/i386/include/frame.h         |  10 +++++++++-
 sys/arch/xen/x86/hypervisor_machdep.c |   8 ++++----
 3 files changed, 22 insertions(+), 6 deletions(-)

diffs (77 lines):

diff -r 2d7d67fe4ba4 -r 021eec979b24 sys/arch/amd64/include/frame.h
--- a/sys/arch/amd64/include/frame.h    Mon Nov 19 09:23:05 2018 +0000
+++ b/sys/arch/amd64/include/frame.h    Mon Nov 19 10:05:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frame.h,v 1.18 2017/06/14 00:40:05 chs Exp $   */
+/*     $NetBSD: frame.h,v 1.19 2018/11/19 10:05:09 kre Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -97,6 +97,14 @@
        struct trapframe if_tf;
 };
 
+#ifdef XEN
+/*
+ * Need arch independany way to access IP and CS from intrframe
+ */
+#define        _INTRFRAME_IP   if_tf.tf_cs
+#define        _INTRFRAME_CS   if_tf.tf_rip
+#endif
+
 /*
  * Stack frame inside cpu_switchto()
  */
diff -r 2d7d67fe4ba4 -r 021eec979b24 sys/arch/i386/include/frame.h
--- a/sys/arch/i386/include/frame.h     Mon Nov 19 09:23:05 2018 +0000
+++ b/sys/arch/i386/include/frame.h     Mon Nov 19 10:05:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frame.h,v 1.37 2017/08/12 13:11:23 maxv Exp $  */
+/*     $NetBSD: frame.h,v 1.38 2018/11/19 10:05:09 kre Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -129,6 +129,14 @@
        int     if_ss;
 };
 
+#ifdef XEN
+/*
+ * need arch independant way to access ip and cs from intrframe
+ */
+#define        _INTRFRAME_CS   if_cs
+#define        _INTRFRAME_IP   if_eip
+#endif
+
 /*
  * Stack frame inside cpu_switchto()
  */
diff -r 2d7d67fe4ba4 -r 021eec979b24 sys/arch/xen/x86/hypervisor_machdep.c
--- a/sys/arch/xen/x86/hypervisor_machdep.c     Mon Nov 19 09:23:05 2018 +0000
+++ b/sys/arch/xen/x86/hypervisor_machdep.c     Mon Nov 19 10:05:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hypervisor_machdep.c,v 1.32 2018/11/18 23:50:48 cherry Exp $   */
+/*     $NetBSD: hypervisor_machdep.c,v 1.33 2018/11/19 10:05:09 kre Exp $      */
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.32 2018/11/18 23:50:48 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.33 2018/11/19 10:05:09 kre Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -263,8 +263,8 @@
 
        /* Save trapframe for clock handler */
        KASSERT(regs != NULL);
-       ci->ci_xen_clockf_usermode = USERMODE(regs->if_tf.tf_cs);
-       ci->ci_xen_clockf_pc = regs->if_tf.tf_rip;
+       ci->ci_xen_clockf_usermode = USERMODE(regs->_INTRFRAME_CS);
+       ci->ci_xen_clockf_pc = regs->_INTRFRAME_IP;
 
        // DDD printf("do_hypervisor_callback\n");
 



Home | Main Index | Thread Index | Old Index