Module Name: src
Committed By: pgoyette
Date: Sat Mar 31 01:20:44 UTC 2018
Modified Files:
src/sys/compat/common [pgoyette-compat]: compat_60_mod.c kern_cpu_60.c
src/sys/modules/compat_60 [pgoyette-compat]: Makefile
Log Message:
Re-enable inclusion of CPU_UCODE for i386/amd64. Even though it won't
build correctly on XEN (won't use the XEN ABI), it works fine on real
hardware.
To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/compat/common/compat_60_mod.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/compat/common/kern_cpu_60.c
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/sys/modules/compat_60/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/common/compat_60_mod.c
diff -u src/sys/compat/common/compat_60_mod.c:1.1.2.14 src/sys/compat/common/compat_60_mod.c:1.1.2.15
--- src/sys/compat/common/compat_60_mod.c:1.1.2.14 Mon Mar 26 10:49:45 2018
+++ src/sys/compat/common/compat_60_mod.c Sat Mar 31 01:20:44 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_60_mod.c,v 1.1.2.14 2018/03/26 10:49:45 pgoyette Exp $ */
+/* $NetBSD: compat_60_mod.c,v 1.1.2.15 2018/03/31 01:20:44 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.14 2018/03/26 10:49:45 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.15 2018/03/31 01:20:44 pgoyette Exp $");
#include <sys/systm.h>
#include <sys/module.h>
@@ -78,11 +78,9 @@ compat_60_fini(void)
{
int error = 0;
-#ifdef NOTYET
#ifdef CPU_UCODE
kern_cpu_60_fini();
#endif
-#endif
ccd_60_fini();
kern_tty_60_fini();
@@ -91,11 +89,9 @@ compat_60_fini(void)
if (error != 0) {
kern_tty_60_init();
ccd_60_init();
-#ifdef NOTYET
#ifdef CPU_UCODE
kern_cpu_60_init();
#endif
-#endif
return error;
}
@@ -104,11 +100,9 @@ compat_60_fini(void)
kern_sa_60_init();
kern_tty_60_init();
ccd_60_init();
-#ifdef NOTYET
#ifdef CPU_UCODE
kern_cpu_60_init();
#endif
-#endif
return error;
}
Index: src/sys/compat/common/kern_cpu_60.c
diff -u src/sys/compat/common/kern_cpu_60.c:1.1.2.5 src/sys/compat/common/kern_cpu_60.c:1.1.2.6
--- src/sys/compat/common/kern_cpu_60.c:1.1.2.5 Sun Mar 18 23:34:25 2018
+++ src/sys/compat/common/kern_cpu_60.c Sat Mar 31 01:20:44 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_cpu_60.c,v 1.1.2.5 2018/03/18 23:34:25 pgoyette Exp $ */
+/* $NetBSD: kern_cpu_60.c,v 1.1.2.6 2018/03/31 01:20:44 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.c,v 1.1.2.5 2018/03/18 23:34:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.c,v 1.1.2.6 2018/03/31 01:20:44 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_cpu_ucode.h"
@@ -50,9 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.
static int
compat6_cpuctl_ioctl(struct lwp *l, u_long cmd, void *data)
{
-#if defined(CPU_UCODE) && defined(COMPAT_60)
- int error;
-#endif
switch (cmd) {
#if defined(CPU_UCODE) && defined(COMPAT_60)
@@ -60,11 +57,15 @@ compat6_cpuctl_ioctl(struct lwp *l, u_lo
return compat6_cpu_ucode_get_version(data);
case OIOC_CPU_UCODE_APPLY:
+ {
+ int error;
+
error = kauth_authorize_machdep(l->l_cred,
KAUTH_MACHDEP_CPU_UCODE_APPLY, NULL, NULL, NULL, NULL);
if (error)
return error;
return compat6_cpu_ucode_apply(data);
+ }
#endif
default:
return ENOTTY;
Index: src/sys/modules/compat_60/Makefile
diff -u src/sys/modules/compat_60/Makefile:1.1.2.12 src/sys/modules/compat_60/Makefile:1.1.2.13
--- src/sys/modules/compat_60/Makefile:1.1.2.12 Mon Mar 26 10:49:45 2018
+++ src/sys/modules/compat_60/Makefile Sat Mar 31 01:20:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.2.12 2018/03/26 10:49:45 pgoyette Exp $
+# $NetBSD: Makefile,v 1.1.2.13 2018/03/31 01:20:44 pgoyette Exp $
.include "../Makefile.inc"
@@ -11,13 +11,11 @@ CPPFLAGS+= -DCOMPAT_60 -DCOMPAT_70 -DCOM
SRCS+= compat_60_mod.c kern_sa_60.c tty_60.c kern_time_60.c ccd_60.c \
kern_cpu_60.c
-.if NOTYET
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
CPPFLAGS+= -DCPU_UCODE
.PATH: ${S}/arch/x86/x86
SRCS+= compat_60_cpu_ucode.c
.endif
-.endif
.include <bsd.kmodule.mk>