Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Simplify the ifdefs, and error out if XEN a...



details:   https://anonhg.NetBSD.org/src/rev/9128cc925d32
branches:  trunk
changeset: 836832:9128cc925d32
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Nov 08 10:55:41 2018 +0000

description:
Simplify the ifdefs, and error out if XEN and USER_LDT are both defined.

diffstat:

 sys/arch/x86/x86/sys_machdep.c |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (40 lines):

diff -r 3344b2cb01ac -r 9128cc925d32 sys/arch/x86/x86/sys_machdep.c
--- a/sys/arch/x86/x86/sys_machdep.c    Thu Nov 08 09:00:24 2018 +0000
+++ b/sys/arch/x86/x86/sys_machdep.c    Thu Nov 08 10:55:41 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_machdep.c,v 1.49 2018/09/03 16:29:29 riastradh Exp $       */
+/*     $NetBSD: sys_machdep.c,v 1.50 2018/11/08 10:55:41 maxv Exp $    */
 
 /*
  * Copyright (c) 1998, 2007, 2009, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.49 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.50 2018/11/08 10:55:41 maxv Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_user_ldt.h"
@@ -63,18 +63,14 @@
 #include <machine/sysarch.h>
 #include <machine/mtrr.h>
 
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(XEN)
 #undef IOPERM  /* not implemented */
 #else
-#if defined(XEN)
-#undef IOPERM
-#else /* defined(XEN) */
 #define        IOPERM
-#endif /* defined(XEN) */
 #endif
 
-#ifdef XEN
-#undef USER_LDT
+#if defined(XEN) && defined(USER_LDT)
+#error "USER_LDT not supported on XEN"
 #endif
 
 extern struct vm_map *kernel_map;



Home | Main Index | Thread Index | Old Index