From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 17:30:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB57D1065675; Wed, 3 Dec 2008 17:30:36 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7978FC21; Wed, 3 Dec 2008 17:30:36 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mB3HUaY3096971; Wed, 3 Dec 2008 17:30:36 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mB3HUabM096968; Wed, 3 Dec 2008 17:30:36 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200812031730.mB3HUabM096968@svn.freebsd.org> From: Joseph Koshy Date: Wed, 3 Dec 2008 17:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185585 - in head: lib/libpmc sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2008 17:30:36 -0000 Author: jkoshy Date: Wed Dec 3 17:30:36 2008 New Revision: 185585 URL: http://svn.freebsd.org/changeset/base/185585 Log: Fixes for Core2 Extreme support. Submitted by: "Artem Belevich" Modified: head/lib/libpmc/libpmc.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Wed Dec 3 16:29:12 2008 (r185584) +++ head/lib/libpmc/libpmc.c Wed Dec 3 17:30:36 2008 (r185585) @@ -603,7 +603,8 @@ iap_allocate_pmc(enum pmc_event pe, char if (n != 1) return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM || - cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2) { + cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 || + cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME) { if (KWMATCH(p, IAP_KW_SNOOPRESPONSE)) { n = pmc_parse_mask(iap_snoopresponse_mask, p, &evmask); @@ -2273,6 +2274,7 @@ pmc_event_names_of_class(enum pmc_class count = PMC_EVENT_TABLE_SIZE(core); break; case PMC_CPU_INTEL_CORE2: + case PMC_CPU_INTEL_CORE2EXTREME: ev = core2_event_table; count = PMC_EVENT_TABLE_SIZE(core2); break; @@ -2455,6 +2457,7 @@ pmc_init(void) pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: + case PMC_CPU_INTEL_CORE2EXTREME: PMC_MDEP_INIT(core2); pmc_class_table[n++] = &iaf_class_table_descr; pmc_class_table[n] = &core2_class_table_descr; @@ -2553,6 +2556,7 @@ _pmc_name_of_event(enum pmc_event pe, en evfence = core_event_table + PMC_EVENT_TABLE_SIZE(core); break; case PMC_CPU_INTEL_CORE2: + case PMC_CPU_INTEL_CORE2EXTREME: ev = core2_event_table; evfence = core2_event_table + PMC_EVENT_TABLE_SIZE(core2); break; Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Wed Dec 3 16:29:12 2008 (r185584) +++ head/sys/dev/hwpmc/hwpmc_core.c Wed Dec 3 17:30:36 2008 (r185585) @@ -527,8 +527,8 @@ struct iap_event_descr { }; #define IAP_F_CC (1 << 0) /* CPU: Core */ -#define IAP_F_CC2 (1 << 1) /* CPU: Core2 */ -#define IAP_F_CC2E (1 << 2) /* CPU: Core2 Extreme */ +#define IAP_F_CC2 (1 << 1) /* CPU: Core2 family */ +#define IAP_F_CC2E (1 << 2) /* CPU: Core2 Extreme only */ #define IAP_F_CA (1 << 3) /* CPU: Atom */ #define IAP_F_FM (1 << 4) /* Fixed mask */ @@ -1111,7 +1111,7 @@ iap_allocate_pmc(int cpu, int ri, struct cpuflag = IAP_F_CC2; break; case PMC_CPU_INTEL_CORE2EXTREME: - cpuflag = IAP_F_CC2E; + cpuflag = IAP_F_CC2 | IAP_F_CC2E; break; } Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Wed Dec 3 16:29:12 2008 (r185584) +++ head/sys/dev/hwpmc/hwpmc_intel.c Wed Dec 3 17:30:36 2008 (r185585) @@ -168,6 +168,7 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_ATOM: case PMC_CPU_INTEL_CORE: case PMC_CPU_INTEL_CORE2: + case PMC_CPU_INTEL_CORE2EXTREME: error = pmc_core_initialize(pmc_mdep, ncpus); break; @@ -238,6 +239,7 @@ pmc_intel_finalize(struct pmc_mdep *md) case PMC_CPU_INTEL_ATOM: case PMC_CPU_INTEL_CORE: case PMC_CPU_INTEL_CORE2: + case PMC_CPU_INTEL_CORE2EXTREME: pmc_core_finalize(md); break;