Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 move lcall sniffer to x86_machdep since xen...
details: https://anonhg.NetBSD.org/src/rev/95d669664be8
branches: trunk
changeset: 974741:95d669664be8
user: christos <christos%NetBSD.org@localhost>
date: Sun Aug 09 15:32:44 2020 +0000
description:
move lcall sniffer to x86_machdep since xen/pv has its own cpu.c
diffstat:
sys/arch/x86/x86/cpu.c | 27 ++-------------------------
sys/arch/x86/x86/x86_machdep.c | 27 +++++++++++++++++++++++++--
2 files changed, 27 insertions(+), 27 deletions(-)
diffs (90 lines):
diff -r c4249e4c0eaf -r 95d669664be8 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c Sun Aug 09 15:15:29 2020 +0000
+++ b/sys/arch/x86/x86/cpu.c Sun Aug 09 15:32:44 2020 +0000
@@ -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 @@
{
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;
- }
-}
diff -r c4249e4c0eaf -r 95d669664be8 sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c Sun Aug 09 15:15:29 2020 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c Sun Aug 09 15:32:44 2020 +0000
@@ -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 @@
/* 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;
+ }
+}
Home |
Main Index |
Thread Index |
Old Index