xref: /onnv-gate/usr/src/uts/i86pc/os/cpupm/cpupm_amd.c (revision 8906:e559381f1e2b)
1*8906SEric.Saxe@Sun.COM /*
2*8906SEric.Saxe@Sun.COM  * CDDL HEADER START
3*8906SEric.Saxe@Sun.COM  *
4*8906SEric.Saxe@Sun.COM  * The contents of this file are subject to the terms of the
5*8906SEric.Saxe@Sun.COM  * Common Development and Distribution License (the "License").
6*8906SEric.Saxe@Sun.COM  * You may not use this file except in compliance with the License.
7*8906SEric.Saxe@Sun.COM  *
8*8906SEric.Saxe@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*8906SEric.Saxe@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*8906SEric.Saxe@Sun.COM  * See the License for the specific language governing permissions
11*8906SEric.Saxe@Sun.COM  * and limitations under the License.
12*8906SEric.Saxe@Sun.COM  *
13*8906SEric.Saxe@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*8906SEric.Saxe@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*8906SEric.Saxe@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*8906SEric.Saxe@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*8906SEric.Saxe@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*8906SEric.Saxe@Sun.COM  *
19*8906SEric.Saxe@Sun.COM  * CDDL HEADER END
20*8906SEric.Saxe@Sun.COM  */
21*8906SEric.Saxe@Sun.COM /*
22*8906SEric.Saxe@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*8906SEric.Saxe@Sun.COM  * Use is subject to license terms.
24*8906SEric.Saxe@Sun.COM  */
25*8906SEric.Saxe@Sun.COM 
26*8906SEric.Saxe@Sun.COM /*
27*8906SEric.Saxe@Sun.COM  * AMD specific CPU power management support.
28*8906SEric.Saxe@Sun.COM  */
29*8906SEric.Saxe@Sun.COM 
30*8906SEric.Saxe@Sun.COM #include <sys/x86_archext.h>
31*8906SEric.Saxe@Sun.COM #include <sys/cpu_acpi.h>
32*8906SEric.Saxe@Sun.COM #include <sys/pwrnow.h>
33*8906SEric.Saxe@Sun.COM 
34*8906SEric.Saxe@Sun.COM boolean_t
cpupm_amd_init(cpu_t * cp)35*8906SEric.Saxe@Sun.COM cpupm_amd_init(cpu_t *cp)
36*8906SEric.Saxe@Sun.COM {
37*8906SEric.Saxe@Sun.COM 	cpupm_mach_state_t *mach_state =
38*8906SEric.Saxe@Sun.COM 	    (cpupm_mach_state_t *)(cp->cpu_m.mcpu_pm_mach_state);
39*8906SEric.Saxe@Sun.COM 
40*8906SEric.Saxe@Sun.COM 	/* AMD? */
41*8906SEric.Saxe@Sun.COM 	if (x86_vendor != X86_VENDOR_AMD)
42*8906SEric.Saxe@Sun.COM 		return (B_FALSE);
43*8906SEric.Saxe@Sun.COM 
44*8906SEric.Saxe@Sun.COM 	/*
45*8906SEric.Saxe@Sun.COM 	 * If we support PowerNow! on this processor, then set the
46*8906SEric.Saxe@Sun.COM 	 * correct cma_ops for the processor.
47*8906SEric.Saxe@Sun.COM 	 */
48*8906SEric.Saxe@Sun.COM 	mach_state->ms_pstate.cma_ops = pwrnow_supported() ?
49*8906SEric.Saxe@Sun.COM 	    &pwrnow_ops : NULL;
50*8906SEric.Saxe@Sun.COM 
51*8906SEric.Saxe@Sun.COM 	return (B_TRUE);
52*8906SEric.Saxe@Sun.COM }
53