Deleted Added
full compact
hwpmc_intel.c (259665) hwpmc_intel.c (263446)
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 259665 2013-12-20 20:22:10Z gnn $");
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_intel.c 263446 2014-03-20 20:51:08Z hiren $");
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>

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

172 cputype = PMC_CPU_INTEL_IVYBRIDGE_XEON;
173 nclasses = 3;
174 break;
175 case 0x3C: /* Per Intel document 325462-045US 01/2013. */
176 case 0x45:
177 cputype = PMC_CPU_INTEL_HASWELL;
178 nclasses = 5;
179 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>

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

172 cputype = PMC_CPU_INTEL_IVYBRIDGE_XEON;
173 nclasses = 3;
174 break;
175 case 0x3C: /* Per Intel document 325462-045US 01/2013. */
176 case 0x45:
177 cputype = PMC_CPU_INTEL_HASWELL;
178 nclasses = 5;
179 break;
180 case 0x4D: /* Per Intel document 330061-001 01/2014. */
181 cputype = PMC_CPU_INTEL_ATOM_SILVERMONT;
182 nclasses = 3;
183 break;
180 }
181 break;
182#if defined(__i386__) || defined(__amd64__)
183 case 0xF00: /* P4 */
184 if (model >= 0 && model <= 6) /* known models */
185 cputype = PMC_CPU_INTEL_PIV;
186 break;
187 }

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

204 if (error)
205 goto error;
206 switch (cputype) {
207#if defined(__i386__) || defined(__amd64__)
208 /*
209 * Intel Core, Core 2 and Atom processors.
210 */
211 case PMC_CPU_INTEL_ATOM:
184 }
185 break;
186#if defined(__i386__) || defined(__amd64__)
187 case 0xF00: /* P4 */
188 if (model >= 0 && model <= 6) /* known models */
189 cputype = PMC_CPU_INTEL_PIV;
190 break;
191 }

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

208 if (error)
209 goto error;
210 switch (cputype) {
211#if defined(__i386__) || defined(__amd64__)
212 /*
213 * Intel Core, Core 2 and Atom processors.
214 */
215 case PMC_CPU_INTEL_ATOM:
216 case PMC_CPU_INTEL_ATOM_SILVERMONT:
212 case PMC_CPU_INTEL_CORE:
213 case PMC_CPU_INTEL_CORE2:
214 case PMC_CPU_INTEL_CORE2EXTREME:
215 case PMC_CPU_INTEL_COREI7:
216 case PMC_CPU_INTEL_IVYBRIDGE:
217 case PMC_CPU_INTEL_SANDYBRIDGE:
218 case PMC_CPU_INTEL_WESTMERE:
219 case PMC_CPU_INTEL_SANDYBRIDGE_XEON:

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

292void
293pmc_intel_finalize(struct pmc_mdep *md)
294{
295 pmc_tsc_finalize(md);
296
297 switch (md->pmd_cputype) {
298#if defined(__i386__) || defined(__amd64__)
299 case PMC_CPU_INTEL_ATOM:
217 case PMC_CPU_INTEL_CORE:
218 case PMC_CPU_INTEL_CORE2:
219 case PMC_CPU_INTEL_CORE2EXTREME:
220 case PMC_CPU_INTEL_COREI7:
221 case PMC_CPU_INTEL_IVYBRIDGE:
222 case PMC_CPU_INTEL_SANDYBRIDGE:
223 case PMC_CPU_INTEL_WESTMERE:
224 case PMC_CPU_INTEL_SANDYBRIDGE_XEON:

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

297void
298pmc_intel_finalize(struct pmc_mdep *md)
299{
300 pmc_tsc_finalize(md);
301
302 switch (md->pmd_cputype) {
303#if defined(__i386__) || defined(__amd64__)
304 case PMC_CPU_INTEL_ATOM:
305 case PMC_CPU_INTEL_ATOM_SILVERMONT:
300 case PMC_CPU_INTEL_CORE:
301 case PMC_CPU_INTEL_CORE2:
302 case PMC_CPU_INTEL_CORE2EXTREME:
303 case PMC_CPU_INTEL_COREI7:
304 case PMC_CPU_INTEL_HASWELL:
305 case PMC_CPU_INTEL_IVYBRIDGE:
306 case PMC_CPU_INTEL_SANDYBRIDGE:
307 case PMC_CPU_INTEL_WESTMERE:

--- 41 unchanged lines hidden ---
306 case PMC_CPU_INTEL_CORE:
307 case PMC_CPU_INTEL_CORE2:
308 case PMC_CPU_INTEL_CORE2EXTREME:
309 case PMC_CPU_INTEL_COREI7:
310 case PMC_CPU_INTEL_HASWELL:
311 case PMC_CPU_INTEL_IVYBRIDGE:
312 case PMC_CPU_INTEL_SANDYBRIDGE:
313 case PMC_CPU_INTEL_WESTMERE:

--- 41 unchanged lines hidden ---