13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24 /*
25 * Copyright (c) 2009, Intel Corporation.
26 * All Rights Reserved.
27 */
28
29 #include <sys/x86_archext.h>
30 #include <sys/machsystm.h>
31 #include <sys/archsystm.h>
32 #include <sys/x_call.h>
33 #include <sys/acpi/acpi.h>
34 #include <sys/acpica.h>
35 #include <sys/speedstep.h>
36 #include <sys/cpu_acpi.h>
37 #include <sys/cpupm.h>
38 #include <sys/dtrace.h>
39 #include <sys/sdt.h>
40
41 typedef struct turbo_kstat_s {
42 struct kstat_named turbo_supported; /* turbo flag */
43 struct kstat_named t_mcnt; /* IA32_MPERF_MSR */
44 struct kstat_named t_acnt; /* IA32_APERF_MSR */
45 } turbo_kstat_t;
46
47 static int turbo_kstat_update(kstat_t *, int);
48 static void get_turbo_info(cpupm_mach_turbo_info_t *);
49 static void reset_turbo_info(void);
50 static void record_turbo_info(cpupm_mach_turbo_info_t *, uint32_t, uint32_t);
51 static void update_turbo_info(cpupm_mach_turbo_info_t *);
52
53 static kmutex_t turbo_mutex;
|
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24 /*
25 * Copyright (c) 2009, Intel Corporation.
26 * All Rights Reserved.
27 */
28
29 #include <sys/x86_archext.h>
30 #include <sys/machsystm.h>
31 #include <sys/archsystm.h>
32 #include <sys/x_call.h>
33 #include <acpica/include/acpi.h>
34 #include <sys/acpica.h>
35 #include <sys/speedstep.h>
36 #include <sys/cpu_acpi.h>
37 #include <sys/cpupm.h>
38 #include <sys/dtrace.h>
39 #include <sys/sdt.h>
40
41 typedef struct turbo_kstat_s {
42 struct kstat_named turbo_supported; /* turbo flag */
43 struct kstat_named t_mcnt; /* IA32_MPERF_MSR */
44 struct kstat_named t_acnt; /* IA32_APERF_MSR */
45 } turbo_kstat_t;
46
47 static int turbo_kstat_update(kstat_t *, int);
48 static void get_turbo_info(cpupm_mach_turbo_info_t *);
49 static void reset_turbo_info(void);
50 static void record_turbo_info(cpupm_mach_turbo_info_t *, uint32_t, uint32_t);
51 static void update_turbo_info(cpupm_mach_turbo_info_t *);
52
53 static kmutex_t turbo_mutex;
|