Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern move the compat code in compat.
details: https://anonhg.NetBSD.org/src/rev/74497a5e53c0
branches: trunk
changeset: 321479:74497a5e53c0
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 17 19:03:25 2018 +0000
description:
move the compat code in compat.
diffstat:
sys/kern/kern_cpu.c | 25 ++++---------------------
1 files changed, 4 insertions(+), 21 deletions(-)
diffs (65 lines):
diff -r 2094d65e95c0 -r 74497a5e53c0 sys/kern/kern_cpu.c
--- a/sys/kern/kern_cpu.c Sat Mar 17 19:00:23 2018 +0000
+++ b/sys/kern/kern_cpu.c Sat Mar 17 19:03:25 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_cpu.c,v 1.71 2015/08/29 12:24:00 maxv Exp $ */
+/* $NetBSD: kern_cpu.c,v 1.72 2018/03/17 19:03:25 christos Exp $ */
/*-
* Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc.
@@ -56,10 +56,9 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.71 2015/08/29 12:24:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.72 2018/03/17 19:03:25 christos Exp $");
#include "opt_cpu_ucode.h"
-#include "opt_compat_netbsd.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -128,6 +127,7 @@
kcpuset_t * kcpuset_attached __read_mostly = NULL;
kcpuset_t * kcpuset_running __read_mostly = NULL;
+int (*compat_cpuctl_ioctl)(u_long, void *) = (void *)enosys;
static char cpu_model[128];
@@ -285,12 +285,6 @@
error = cpu_ucode_get_version((struct cpu_ucode_version *)data);
break;
-#ifdef COMPAT_60
- case OIOC_CPU_UCODE_GET_VERSION:
- error = compat6_cpu_ucode_get_version((struct compat6_cpu_ucode *)data);
- break;
-#endif
-
case IOC_CPU_UCODE_APPLY:
error = kauth_authorize_machdep(l->l_cred,
KAUTH_MACHDEP_CPU_UCODE_APPLY,
@@ -299,21 +293,10 @@
break;
error = cpu_ucode_apply((const struct cpu_ucode *)data);
break;
-
-#ifdef COMPAT_60
- case OIOC_CPU_UCODE_APPLY:
- error = kauth_authorize_machdep(l->l_cred,
- KAUTH_MACHDEP_CPU_UCODE_APPLY,
- NULL, NULL, NULL, NULL);
- if (error != 0)
- break;
- error = compat6_cpu_ucode_apply((const struct compat6_cpu_ucode *)data);
- break;
-#endif
#endif
default:
- error = ENOTTY;
+ error = (*compat_cpuctl_ioctl)(cmd, data);
break;
}
mutex_exit(&cpu_lock);
Home |
Main Index |
Thread Index |
Old Index