Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys/arch/x86/x86 Don't try to include opt_*.h file...



details:   https://anonhg.NetBSD.org/src/rev/e1a0039b4971
branches:  pgoyette-compat
changeset: 321051:e1a0039b4971
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Mar 17 00:41:33 2018 +0000

description:
Don't try to include opt_*.h files if we're not being built as part
of a kernel (these files only exist for kernel builds).

Don't compile non-compat code if we're not building a module.  (This
file is built for both built-in kernel ucode support and for compat
support.)

diffstat:

 sys/arch/x86/x86/cpu_ucode.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (56 lines):

diff -r e50471e7a726 -r e1a0039b4971 sys/arch/x86/x86/cpu_ucode.c
--- a/sys/arch/x86/x86/cpu_ucode.c      Sat Mar 17 00:11:13 2018 +0000
+++ b/sys/arch/x86/x86/cpu_ucode.c      Sat Mar 17 00:41:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode.c,v 1.5 2015/01/07 07:05:48 ozaki-r Exp $ */
+/* $NetBSD: cpu_ucode.c,v 1.5.16.1 2018/03/17 00:41:33 pgoyette Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,10 +29,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c,v 1.5 2015/01/07 07:05:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c,v 1.5.16.1 2018/03/17 00:41:33 pgoyette Exp $");
 
+#if defined(_KERNEL_OPT)
 #include "opt_cpu_ucode.h"
 #include "opt_compat_netbsd.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/cpuio.h>
@@ -47,6 +49,8 @@
 
 static struct cpu_ucode_softc ucode_softc;
 
+#ifndef _MODULE
+
 int
 cpu_ucode_get_version(struct cpu_ucode_version *data)
 {
@@ -62,6 +66,7 @@
 
        return 0;
 }
+#endif /* ! _MODULE */
 
 #ifdef COMPAT_60
 int
@@ -79,6 +84,7 @@
 }
 #endif /* COMPAT60 */
 
+#ifndef _MODULE
 int
 cpu_ucode_md_open(firmware_handle_t *fwh, int loader_version, const char *fwname)
 {
@@ -121,6 +127,7 @@
        sc->sc_blobsize = 0;
        return error;
 }
+#endif /* ! _MODULE */
 
 #ifdef COMPAT_60
 int



Home | Main Index | Thread Index | Old Index