Module Name: src Committed By: msaitoh Date: Fri Jun 14 11:50:35 UTC 2019
Modified Files: src/sys/dev/tprof: tprof_x86_amd.c tprof_x86_intel.c Log Message: Fix compile error (s/LAPIC_PCINT/LAPIC_LVT_PCINT/) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/tprof/tprof_x86_amd.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/tprof/tprof_x86_intel.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/dev/tprof/tprof_x86_amd.c diff -u src/sys/dev/tprof/tprof_x86_amd.c:1.3 src/sys/dev/tprof/tprof_x86_amd.c:1.4 --- src/sys/dev/tprof/tprof_x86_amd.c:1.3 Wed May 29 17:09:17 2019 +++ src/sys/dev/tprof/tprof_x86_amd.c Fri Jun 14 11:50:35 2019 @@ -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 @@ tprof_amd_start_cpu(void *arg1, void *ar 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 @@ tprof_amd_stop_cpu(void *arg1, void *arg 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 Index: src/sys/dev/tprof/tprof_x86_intel.c diff -u src/sys/dev/tprof/tprof_x86_intel.c:1.2 src/sys/dev/tprof/tprof_x86_intel.c:1.3 --- src/sys/dev/tprof/tprof_x86_intel.c:1.2 Tue Jul 24 09:47:35 2018 +++ src/sys/dev/tprof/tprof_x86_intel.c Fri Jun 14 11:50:35 2019 @@ -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 @@ tprof_intel_start_cpu(void *arg1, void * 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 @@ tprof_intel_stop_cpu(void *arg1, void *a 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 @@ tprof_intel_nmi(const struct trapframe * 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; }