Deleted Added
full compact
hwpmc_core.c (210621) hwpmc_core.c (212224)
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 * Intel Core, Core 2 and Atom PMCs.
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 * Intel Core, Core 2 and Atom PMCs.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_core.c 210621 2010-07-29 17:52:23Z gnn $");
32__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_core.c 212224 2010-09-05 13:31:14Z fabient $");
33
34#include <sys/param.h>
35#include <sys/bus.h>
36#include <sys/pmc.h>
37#include <sys/pmckern.h>
38#include <sys/systm.h>
39
40#include <machine/intr_machdep.h>

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

2229 KASSERT(ipa_version >= 2,
2230 ("[core,%d] ipa_version %d too small", __LINE__,
2231 ipa_version));
2232
2233 core_iaf_ri = core_iap_npmc;
2234 core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F;
2235 core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF;
2236
33
34#include <sys/param.h>
35#include <sys/bus.h>
36#include <sys/pmc.h>
37#include <sys/pmckern.h>
38#include <sys/systm.h>
39
40#include <machine/intr_machdep.h>

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

2229 KASSERT(ipa_version >= 2,
2230 ("[core,%d] ipa_version %d too small", __LINE__,
2231 ipa_version));
2232
2233 core_iaf_ri = core_iap_npmc;
2234 core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F;
2235 core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF;
2236
2237 if (core_iaf_npmc > 0) {
2238 iaf_initialize(md, maxcpu, core_iaf_npmc,
2239 core_iaf_width);
2240 core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) <<
2241 IAF_OFFSET;
2242 } else {
2243 /*
2244 * Adjust the number of classes exported to
2245 * user space.
2246 */
2247 md->pmd_nclass--;
2248 KASSERT(md->pmd_nclass == 2,
2249 ("[core,%d] unexpected nclass %d", __LINE__,
2250 md->pmd_nclass));
2251 }
2237 iaf_initialize(md, maxcpu, core_iaf_npmc, core_iaf_width);
2238 core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << IAF_OFFSET;
2252 }
2253
2254 PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask,
2255 core_iaf_ri);
2256
2257 core_pcpu = malloc(sizeof(struct core_cpu **) * maxcpu, M_PMC,
2258 M_ZERO | M_WAITOK);
2259

--- 22 unchanged lines hidden ---
2239 }
2240
2241 PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask,
2242 core_iaf_ri);
2243
2244 core_pcpu = malloc(sizeof(struct core_cpu **) * maxcpu, M_PMC,
2245 M_ZERO | M_WAITOK);
2246

--- 22 unchanged lines hidden ---