Module Name:    src
Committed By:   christos
Date:           Sat Mar 17 19:03:25 UTC 2018

Modified Files:
        src/sys/kern: kern_cpu.c

Log Message:
move the compat code in compat.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/kern/kern_cpu.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/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.71 src/sys/kern/kern_cpu.c:1.72
--- src/sys/kern/kern_cpu.c:1.71	Sat Aug 29 08:24:00 2015
+++ src/sys/kern/kern_cpu.c	Sat Mar 17 15:03:25 2018
@@ -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 @@ struct cpu_info **cpu_infos		__read_most
 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 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void
 		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 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void
 			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);

Reply via email to