Fix compile error (s/LAPIC_PCINT/LAPIC_LVT_PCINT/) trunk
authormsaitoh <msaitoh@NetBSD.org>
Fri, 14 Jun 2019 11:50:35 +0000
branchtrunk
changeset 452003 2d6d70d4519f
parent 452002 73a5e7e68b89
child 452004 5e91de31a0cf
Fix compile error (s/LAPIC_PCINT/LAPIC_LVT_PCINT/)
sys/dev/tprof/tprof_x86_amd.c
sys/dev/tprof/tprof_x86_intel.c
--- a/sys/dev/tprof/tprof_x86_amd.c	Fri Jun 14 11:08:18 2019 +0000
+++ b/sys/dev/tprof/tprof_x86_amd.c	Fri Jun 14 11:50:35 2019 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_amd.c,v 1.3 2019/05/29 17:09:17 maxv Exp $	*/
+/*	$NetBSD: tprof_x86_amd.c,v 1.4 2019/06/14 11:50:35 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.3 2019/05/29 17:09:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.4 2019/06/14 11:50:35 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -135,8 +135,8 @@
 	wrmsr(PERFCTR(ctrno), counter_reset_val);
 	wrmsr(PERFEVTSEL(ctrno), pesr);
 
-	amd_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_PCINT);
-	lapic_writereg(LAPIC_PCINT, LAPIC_DLMODE_NMI);
+	amd_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_LVT_PCINT);
+	lapic_writereg(LAPIC_LVT_PCINT, LAPIC_DLMODE_NMI);
 
 	wrmsr(PERFEVTSEL(ctrno), pesr | PESR_EN);
 }
@@ -148,7 +148,7 @@
 
 	wrmsr(PERFEVTSEL(ctrno), 0);
 
-	lapic_writereg(LAPIC_PCINT, amd_lapic_saved[cpu_index(ci)]);
+	lapic_writereg(LAPIC_LVT_PCINT, amd_lapic_saved[cpu_index(ci)]);
 }
 
 static int
--- a/sys/dev/tprof/tprof_x86_intel.c	Fri Jun 14 11:08:18 2019 +0000
+++ b/sys/dev/tprof/tprof_x86_intel.c	Fri Jun 14 11:50:35 2019 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_intel.c,v 1.2 2018/07/24 09:47:35 maxv Exp $	*/
+/*	$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.2 2018/07/24 09:47:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -119,8 +119,8 @@
 	wrmsr(MSR_PERFCTR0, counter_reset_val);
 	wrmsr(MSR_EVNTSEL0, evtval);
 
-	intel_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_PCINT);
-	lapic_writereg(LAPIC_PCINT, LAPIC_DLMODE_NMI);
+	intel_lapic_saved[cpu_index(ci)] = lapic_readreg(LAPIC_LVT_PCINT);
+	lapic_writereg(LAPIC_LVT_PCINT, LAPIC_DLMODE_NMI);
 }
 
 static void
@@ -131,7 +131,7 @@
 	wrmsr(MSR_EVNTSEL0, 0);
 	wrmsr(MSR_PERFCTR0, 0);
 
-	lapic_writereg(LAPIC_PCINT, intel_lapic_saved[cpu_index(ci)]);
+	lapic_writereg(LAPIC_LVT_PCINT, intel_lapic_saved[cpu_index(ci)]);
 }
 
 static int
@@ -162,9 +162,9 @@
 	wrmsr(MSR_PERFCTR0, counter_reset_val);
 
 	/* unmask PMI */
-	pcint = lapic_readreg(LAPIC_PCINT);
+	pcint = lapic_readreg(LAPIC_LVT_PCINT);
 	KASSERT((pcint & LAPIC_LVT_MASKED) != 0);
-	lapic_writereg(LAPIC_PCINT, pcint & ~LAPIC_LVT_MASKED);
+	lapic_writereg(LAPIC_LVT_PCINT, pcint & ~LAPIC_LVT_MASKED);
 
 	return 1;
 }