Module Name: src Committed By: kre Date: Mon Nov 19 10:05:09 UTC 2018
Modified Files: src/sys/arch/amd64/include: frame.h src/sys/arch/i386/include: frame.h src/sys/arch/xen/x86: hypervisor_machdep.c Log Message: Hide differences between i386 and amd64 interrupt frames so XEN does not need to know there is one. Hopefully unbreak i386 build. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amd64/include/frame.h cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/include/frame.h cvs rdiff -u -r1.32 -r1.33 src/sys/arch/xen/x86/hypervisor_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/include/frame.h diff -u src/sys/arch/amd64/include/frame.h:1.18 src/sys/arch/amd64/include/frame.h:1.19 --- src/sys/arch/amd64/include/frame.h:1.18 Wed Jun 14 00:40:05 2017 +++ src/sys/arch/amd64/include/frame.h Mon Nov 19 10:05:09 2018 @@ -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 intrframe { 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() */ Index: src/sys/arch/i386/include/frame.h diff -u src/sys/arch/i386/include/frame.h:1.37 src/sys/arch/i386/include/frame.h:1.38 --- src/sys/arch/i386/include/frame.h:1.37 Sat Aug 12 13:11:23 2017 +++ src/sys/arch/i386/include/frame.h Mon Nov 19 10:05:09 2018 @@ -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 @@ struct intrframe { 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() */ Index: src/sys/arch/xen/x86/hypervisor_machdep.c diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.32 src/sys/arch/xen/x86/hypervisor_machdep.c:1.33 --- src/sys/arch/xen/x86/hypervisor_machdep.c:1.32 Sun Nov 18 23:50:48 2018 +++ src/sys/arch/xen/x86/hypervisor_machdep.c Mon Nov 19 10:05:09 2018 @@ -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 @@ do_hypervisor_callback(struct intrframe /* 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");