Module Name:    src
Committed By:   christos
Date:           Sun Aug  9 15:32:44 UTC 2020

Modified Files:
        src/sys/arch/x86/x86: cpu.c x86_machdep.c

Log Message:
move lcall sniffer to x86_machdep since xen/pv has its own cpu.c


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/x86/x86/x86_machdep.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/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.197 src/sys/arch/x86/x86/cpu.c:1.198
--- src/sys/arch/x86/x86/cpu.c:1.197	Sat Aug  8 15:08:48 2020
+++ src/sys/arch/x86/x86/cpu.c	Sun Aug  9 11:32:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.197 2020/08/08 19:08:48 christos Exp $	*/
+/*	$NetBSD: cpu.c,v 1.198 2020/08/09 15:32:44 christos Exp $	*/
 
 /*
  * Copyright (c) 2000-2020 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.197 2020/08/08 19:08:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.198 2020/08/09 15:32:44 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -1451,26 +1451,3 @@ cpu_kick(struct cpu_info *ci)
 {
 	x86_send_ipi(ci, X86_IPI_AST);
 }
-
-int
-x86_cpu_is_lcall(const void *ip)
-{
-        static const uint8_t lcall[] = { 0x9a, 0, 0, 0, 0 };
-	int error;
-        const size_t sz = sizeof(lcall) + 2;
-        uint8_t tmp[sizeof(lcall) + 2];
-
-	if ((error = copyin(ip, tmp, sz)) != 0)
-		return error;
-
-	if (memcmp(tmp, lcall, sizeof(lcall)) != 0 || tmp[sz - 1] != 0)
-		return EINVAL;
-
-	switch (tmp[sz - 2]) {
-        case (uint8_t)0x07: /* NetBSD */
-	case (uint8_t)0x87: /* BSD/OS */
-		return 0;
-	default:
-		return EINVAL;
-        }
-}

Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.145 src/sys/arch/x86/x86/x86_machdep.c:1.146
--- src/sys/arch/x86/x86/x86_machdep.c:1.145	Sun Jul 19 10:31:31 2020
+++ src/sys/arch/x86/x86/x86_machdep.c	Sun Aug  9 11:32:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_machdep.c,v 1.145 2020/07/19 14:31:31 maxv Exp $	*/
+/*	$NetBSD: x86_machdep.c,v 1.146 2020/08/09 15:32:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.145 2020/07/19 14:31:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.146 2020/08/09 15:32:44 christos Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -1508,3 +1508,26 @@ cpu_initclocks(void)
 	/* Now start the clocks on this CPU (the boot CPU). */
 	(*x86_initclock_func)();
 }
+
+int
+x86_cpu_is_lcall(const void *ip)
+{
+        static const uint8_t lcall[] = { 0x9a, 0, 0, 0, 0 };
+	int error;
+        const size_t sz = sizeof(lcall) + 2;
+        uint8_t tmp[sizeof(lcall) + 2];
+
+	if ((error = copyin(ip, tmp, sz)) != 0)
+		return error;
+
+	if (memcmp(tmp, lcall, sizeof(lcall)) != 0 || tmp[sz - 1] != 0)
+		return EINVAL;
+
+	switch (tmp[sz - 2]) {
+        case (uint8_t)0x07: /* NetBSD */
+	case (uint8_t)0x87: /* BSD/OS */
+		return 0;
+	default:
+		return EINVAL;
+        }
+}

Reply via email to