aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoseph Koshy <jkoshy@FreeBSD.org>2005-08-22 18:20:41 +0000
committerJoseph Koshy <jkoshy@FreeBSD.org>2005-08-22 18:20:41 +0000
commite753fde4e63cc34d9cab3273529edac187c750d8 (patch)
tree2240230a84888031330d01c050217dd4bc58bf3d /sys
parent744d67975ffc6d972976f6bf34c9489f9d51fc87 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/hwpmc/hwpmc_x86.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/hwpmc/hwpmc_x86.c b/sys/dev/hwpmc/hwpmc_x86.c
index 089a63e17a5dd..a742effc2a529 100644
--- a/sys/dev/hwpmc/hwpmc_x86.c
+++ b/sys/dev/hwpmc/hwpmc_x86.c
@@ -170,10 +170,20 @@ pmc_intel_initialize(void)
struct pmc_mdep *
pmc_md_initialize()
{
+ int i;
+ struct pmc_mdep *md;
+
/* determine the CPU kind */
+ md = NULL;
if (strcmp(cpu_vendor, "AuthenticAMD") == 0)
- return pmc_amd_initialize();
+ md = pmc_amd_initialize();
else if (strcmp(cpu_vendor, "GenuineIntel") == 0)
- return pmc_intel_initialize();
- return NULL;
+ md = pmc_intel_initialize();
+
+ /* disallow sampling if we do not have an LAPIC */
+ if (md != NULL && lapic == NULL)
+ for (i = 1; i < md->pmd_nclass; i++)
+ md->pmd_classes[i].pm_caps &= ~PMC_CAP_INTERRUPT;
+
+ return md;
}