Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2019 16:59:07 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r349315 - in stable/12/sys: dev/hwpmc modules/hwpmc
Message-ID:  <201906231659.x5NGx7hd086815@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Jun 23 16:59:06 2019
New Revision: 349315
URL: https://svnweb.freebsd.org/changeset/base/349315

Log:
  MFC r348740-r348741, r348995
  
  r348740:
  Don't refer to the cpu variable in a KASSERT before initializing it.
  
  r348741:
  For armv6 and armv7, build hwpmc_armv7.c as well as the base hwpmc_arm.c.
  
  Submitted by:	Arnaud YSMAL <arnaud.ysmal@stormshield.eu>
  
  r348995:
  Don't attempt to include hwpmc support for armv6, we're missing some of the
  necessary support functions in cpu-v6.h, and it may be that the only armv6
  platform we support (RPi, the bcm2835 SOC) is incapable of supporting hwpmc.
  
  Reported by:	dim@

Modified:
  stable/12/sys/dev/hwpmc/hwpmc_armv7.c
  stable/12/sys/modules/hwpmc/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/hwpmc/hwpmc_armv7.c
==============================================================================
--- stable/12/sys/dev/hwpmc/hwpmc_armv7.c	Sun Jun 23 16:16:55 2019	(r349314)
+++ stable/12/sys/dev/hwpmc/hwpmc_armv7.c	Sun Jun 23 16:59:06 2019	(r349315)
@@ -315,11 +315,11 @@ armv7_intr(struct trapframe *tf)
 	int error;
 	int reg, cpu;
 
+	cpu = curcpu;
 	KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
 	    ("[armv7,%d] CPU %d out of range", __LINE__, cpu));
 
 	retval = 0;
-	cpu = curcpu;
 	pc = armv7_pcpu[cpu];
 
 	for (ri = 0; ri < armv7_npmcs; ri++) {

Modified: stable/12/sys/modules/hwpmc/Makefile
==============================================================================
--- stable/12/sys/modules/hwpmc/Makefile	Sun Jun 23 16:16:55 2019	(r349314)
+++ stable/12/sys/modules/hwpmc/Makefile	Sun Jun 23 16:59:06 2019	(r349315)
@@ -22,6 +22,10 @@ SRCS+=	device_if.h bus_if.h
 SRCS+=	hwpmc_arm.c
 .endif
 
+.if ${MACHINE_ARCH} == "armv7"
+SRCS+= hwpmc_armv7.c
+.endif
+
 .if ${MACHINE_CPUARCH} == "i386"
 SRCS+=	hwpmc_amd.c hwpmc_core.c hwpmc_intel.c
 SRCS+=	hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906231659.x5NGx7hd086815>