cpupm_amd.c revision 0e7515250c8395f368aa45fb9acae7c4f8f8b786
19512fe8ahl/*
29512fe8ahl * CDDL HEADER START
39512fe8ahl *
49512fe8ahl * The contents of this file are subject to the terms of the
59512fe8ahl * Common Development and Distribution License (the "License").
69512fe8ahl * You may not use this file except in compliance with the License.
79512fe8ahl *
89512fe8ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
99512fe8ahl * or http://www.opensolaris.org/os/licensing.
109512fe8ahl * See the License for the specific language governing permissions
119512fe8ahl * and limitations under the License.
129512fe8ahl *
139512fe8ahl * When distributing Covered Code, include this CDDL HEADER in each
149512fe8ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
159512fe8ahl * If applicable, add the following below this CDDL HEADER, with the
169512fe8ahl * fields enclosed by brackets "[]" replaced with your own identifying
179512fe8ahl * information: Portions Copyright [yyyy] [name of copyright owner]
189512fe8ahl *
199512fe8ahl * CDDL HEADER END
209512fe8ahl */
219512fe8ahl/*
229512fe8ahl * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
239512fe8ahl * Use is subject to license terms.
249512fe8ahl */
259512fe8ahl
269512fe8ahl/*
279512fe8ahl * AMD specific CPU power management support.
289512fe8ahl */
299512fe8ahl
309512fe8ahl#include <sys/x86_archext.h>
319512fe8ahl#include <sys/cpu_acpi.h>
329512fe8ahl#include <sys/pwrnow.h>
339512fe8ahl
349512fe8ahlboolean_t
359512fe8ahlcpupm_amd_init(cpu_t *cp)
369512fe8ahl{
379512fe8ahl	cpupm_mach_state_t *mach_state =
389512fe8ahl	    (cpupm_mach_state_t *)(cp->cpu_m.mcpu_pm_mach_state);
399512fe8ahl
409512fe8ahl	/* AMD? */
419512fe8ahl	if (x86_vendor != X86_VENDOR_AMD)
429512fe8ahl		return (B_FALSE);
439512fe8ahl
449512fe8ahl	/*
459512fe8ahl	 * If we support PowerNow! on this processor, then set the
469512fe8ahl	 * correct cma_ops for the processor.
479512fe8ahl	 */
489512fe8ahl	mach_state->ms_pstate.cma_ops = pwrnow_supported() ?
499512fe8ahl	    &pwrnow_ops : NULL;
509512fe8ahl
519512fe8ahl	return (B_TRUE);
529512fe8ahl}
539512fe8ahl