Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2012 14:45:59 +0000 (UTC)
From:      Fabien Thomas <fabient@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240203 - head/sys/dev/hwpmc
Message-ID:  <201209071445.q87Ejxkr017007@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fabient
Date: Fri Sep  7 14:45:59 2012
New Revision: 240203
URL: http://svn.freebsd.org/changeset/base/240203

Log:
  Complete and merge the list between Sandy/Ivy bridge of events
  that can run on specific PMC.
  
  MFC after:	1 month

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_core.c	Fri Sep  7 14:10:22 2012	(r240202)
+++ head/sys/dev/hwpmc/hwpmc_core.c	Fri Sep  7 14:45:59 2012	(r240203)
@@ -1695,36 +1695,29 @@ iap_event_westmere_ok_on_counter(enum pm
 }
 
 static int
-iap_event_sandybridge_ok_on_counter(enum pmc_event pe, int ri)
-{
-	uint32_t mask;
-	
-	switch (pe) {
-		/*
-		 * Events valid only on counter 2.
-		 */
-	case PMC_EV_IAP_EVENT_48H_01H:
-		mask = 0x4;
-		break;
-	default:
-		mask = ~0;	/* Any row index is ok. */
-	}
-	
-	return (mask & (1 << ri));
-}
-
-static int
-iap_event_ivybridge_ok_on_counter(enum pmc_event pe, int ri)
+iap_event_sb_ib_ok_on_counter(enum pmc_event pe, int ri)
 {
 	uint32_t mask;
 
 	switch (pe) {
-		/*
-		 * Events valid only on counter 2.
-		 */
+		/* Events valid only on counter 0. */
+	case PMC_EV_IAP_EVENT_B7H_01H:
+		mask = 0x1;
+		break;
+		/* Events valid only on counter 1. */
+	case PMC_EV_IAP_EVENT_C0H_01H:
+		mask = 0x1;
+		break;
+		/* Events valid only on counter 2. */
 	case PMC_EV_IAP_EVENT_48H_01H:
 		mask = 0x4;
 		break;
+		/* Events valid only on counter 3. */
+	case PMC_EV_IAP_EVENT_BBH_01H:
+	case PMC_EV_IAP_EVENT_CDH_01H:
+	case PMC_EV_IAP_EVENT_CDH_02H:
+		mask = 0x8;
+		break;
 	default:
 		mask = ~0;	/* Any row index is ok. */
 	}
@@ -1808,12 +1801,9 @@ iap_allocate_pmc(int cpu, int ri, struct
 		if (iap_event_corei7_ok_on_counter(ev, ri) == 0)
 			return (EINVAL);
 		break;
-	case PMC_CPU_INTEL_IVYBRIDGE:
-		if (iap_event_ivybridge_ok_on_counter(ev, ri) == 0)
-			return (EINVAL);
-		break;
 	case PMC_CPU_INTEL_SANDYBRIDGE:
-		if (iap_event_sandybridge_ok_on_counter(ev, ri) == 0)
+	case PMC_CPU_INTEL_IVYBRIDGE:
+		if (iap_event_sb_ib_ok_on_counter(ev, ri) == 0)
 			return (EINVAL);
 		break;
 	case PMC_CPU_INTEL_WESTMERE:



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