Deleted Added
full compact
hwpmc_intel.c (237196) hwpmc_intel.c (240164)
1/*-
2 * Copyright (c) 2008 Joseph Koshy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * SUCH DAMAGE.
25 */
26
27/*
28 * Common code for handling Intel CPUs.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Joseph Koshy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * SUCH DAMAGE.
25 */
26
27/*
28 * Common code for handling Intel CPUs.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_intel.c 237196 2012-06-17 13:48:39Z davide $");
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_intel.c 240164 2012-09-06 13:54:01Z fabient $");
33
34#include <sys/param.h>
35#include <sys/pmc.h>
36#include <sys/pmckern.h>
37#include <sys/systm.h>
38
39#include <machine/cpu.h>
40#include <machine/cputypes.h>

--- 100 unchanged lines hidden (view full) ---

141 case 0x2C: /* Per Intel document 253669-033US 12/2009. */
142 cputype = PMC_CPU_INTEL_WESTMERE;
143 nclasses = 5;
144 break;
145 case 0x2A: /* Per Intel document 253669-039US 05/2011. */
146 cputype = PMC_CPU_INTEL_SANDYBRIDGE;
147 nclasses = 5;
148 break;
33
34#include <sys/param.h>
35#include <sys/pmc.h>
36#include <sys/pmckern.h>
37#include <sys/systm.h>
38
39#include <machine/cpu.h>
40#include <machine/cputypes.h>

--- 100 unchanged lines hidden (view full) ---

141 case 0x2C: /* Per Intel document 253669-033US 12/2009. */
142 cputype = PMC_CPU_INTEL_WESTMERE;
143 nclasses = 5;
144 break;
145 case 0x2A: /* Per Intel document 253669-039US 05/2011. */
146 cputype = PMC_CPU_INTEL_SANDYBRIDGE;
147 nclasses = 5;
148 break;
149 case 0x3A: /* Per Intel document 253669-043US 05/2012. */
150 cputype = PMC_CPU_INTEL_IVYBRIDGE;
151 nclasses = 3;
152 break;
149 }
150 break;
151#if defined(__i386__) || defined(__amd64__)
152 case 0xF00: /* P4 */
153 if (model >= 0 && model <= 6) /* known models */
154 cputype = PMC_CPU_INTEL_PIV;
155 break;
156 }

--- 22 unchanged lines hidden (view full) ---

179 /*
180 * Intel Core, Core 2 and Atom processors.
181 */
182 case PMC_CPU_INTEL_ATOM:
183 case PMC_CPU_INTEL_CORE:
184 case PMC_CPU_INTEL_CORE2:
185 case PMC_CPU_INTEL_CORE2EXTREME:
186 case PMC_CPU_INTEL_COREI7:
153 }
154 break;
155#if defined(__i386__) || defined(__amd64__)
156 case 0xF00: /* P4 */
157 if (model >= 0 && model <= 6) /* known models */
158 cputype = PMC_CPU_INTEL_PIV;
159 break;
160 }

--- 22 unchanged lines hidden (view full) ---

183 /*
184 * Intel Core, Core 2 and Atom processors.
185 */
186 case PMC_CPU_INTEL_ATOM:
187 case PMC_CPU_INTEL_CORE:
188 case PMC_CPU_INTEL_CORE2:
189 case PMC_CPU_INTEL_CORE2EXTREME:
190 case PMC_CPU_INTEL_COREI7:
191 case PMC_CPU_INTEL_IVYBRIDGE:
187 case PMC_CPU_INTEL_SANDYBRIDGE:
188 case PMC_CPU_INTEL_WESTMERE:
189 error = pmc_core_initialize(pmc_mdep, ncpus);
190 break;
191
192 /*
193 * Intel Pentium 4 Processors, and P4/EMT64 processors.
194 */

--- 66 unchanged lines hidden (view full) ---

261
262 switch (md->pmd_cputype) {
263#if defined(__i386__) || defined(__amd64__)
264 case PMC_CPU_INTEL_ATOM:
265 case PMC_CPU_INTEL_CORE:
266 case PMC_CPU_INTEL_CORE2:
267 case PMC_CPU_INTEL_CORE2EXTREME:
268 case PMC_CPU_INTEL_COREI7:
192 case PMC_CPU_INTEL_SANDYBRIDGE:
193 case PMC_CPU_INTEL_WESTMERE:
194 error = pmc_core_initialize(pmc_mdep, ncpus);
195 break;
196
197 /*
198 * Intel Pentium 4 Processors, and P4/EMT64 processors.
199 */

--- 66 unchanged lines hidden (view full) ---

266
267 switch (md->pmd_cputype) {
268#if defined(__i386__) || defined(__amd64__)
269 case PMC_CPU_INTEL_ATOM:
270 case PMC_CPU_INTEL_CORE:
271 case PMC_CPU_INTEL_CORE2:
272 case PMC_CPU_INTEL_CORE2EXTREME:
273 case PMC_CPU_INTEL_COREI7:
274 case PMC_CPU_INTEL_IVYBRIDGE:
269 case PMC_CPU_INTEL_SANDYBRIDGE:
270 case PMC_CPU_INTEL_WESTMERE:
271 pmc_core_finalize(md);
272 break;
273
274 case PMC_CPU_INTEL_PIV:
275 pmc_p4_finalize(md);
276 break;

--- 32 unchanged lines hidden ---
275 case PMC_CPU_INTEL_SANDYBRIDGE:
276 case PMC_CPU_INTEL_WESTMERE:
277 pmc_core_finalize(md);
278 break;
279
280 case PMC_CPU_INTEL_PIV:
281 pmc_p4_finalize(md);
282 break;

--- 32 unchanged lines hidden ---