/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <sys/x86_archext.h>
#include <sys/machsystm.h>
#include <sys/cpu_acpi.h>
static int pwrnow_init(cpu_t *);
static void pwrnow_fini(cpu_t *);
static void pwrnow_stop(cpu_t *);
static boolean_t pwrnow_cpb_supported(void);
/*
* Interfaces for modules implementing AMD's PowerNow!.
*/
"PowerNow! Technology",
};
/*
* Error returns
*/
/*
* MSR registers for changing and reading processor power state.
*/
/*
* Debugging support
*/
#ifdef DEBUG
volatile int pwrnow_debug = 0;
#else
#endif
/*
* Write the ctrl register.
*/
static void
{
switch (pct_ctrl->cr_addrspace_id) {
break;
default:
return;
}
}
/*
* Transition the current processor to the requested state.
*/
static void
{
req_pstate += req_state;
/*
* Initiate the processor p-state change.
*/
}
static void
{
/*
* If thread is already running on target CPU then just
* make the transition request. Otherwise, we'll need to
* make a cross-call.
*/
}
if (!CPUSET_ISNULL(set)) {
}
}
/*
* Validate that this processor supports PowerNow! and if so,
* get the P-state data from ACPI and cache it.
*/
static int
{
static int logged = 0;
/*
* Cache the P-state specific ACPI data.
*/
if (cpu_acpi_cache_pstate_data(handle) != 0) {
if (!logged) {
"disabled due to errors parsing ACPI P-state "
"objects exported by BIOS.");
logged = 1;
}
return (PWRNOW_RET_NO_PM);
}
switch (pct_stat->cr_addrspace_id) {
PWRNOW_DEBUG(("Transitions will use fixed hardware\n"));
break;
default:
return (PWRNOW_RET_NO_PM);
}
/*
* Check for Core Performance Boost support
*/
if (pwrnow_cpb_supported())
return (PWRNOW_RET_SUCCESS);
}
/*
* Free resources allocated by pwrnow_init().
*/
static void
{
}
{
/* Required features */
PWRNOW_DEBUG(("No CPUID or MSR support."));
return (B_FALSE);
}
/*
* Get the Advanced Power Management Information.
*/
(void) __cpuid_insn(&cpu_regs);
/*
* We currently only support CPU power management of
* processors that are P-state TSC invariant
*/
PWRNOW_DEBUG(("No support for CPUs that are not P-state "
"TSC invariant.\n"));
return (B_FALSE);
}
/*
* We only support the "Fire and Forget" style of PowerNow! (i.e.,
* single MSR write to change speed).
*/
PWRNOW_DEBUG(("Hardware P-State control is not supported.\n"));
return (B_FALSE);
}
return (B_TRUE);
}
static boolean_t
pwrnow_cpb_supported(void)
{
/* Required features */
PWRNOW_DEBUG(("No CPUID or MSR support."));
return (B_FALSE);
}
/*
* Get the Advanced Power Management Information.
*/
(void) __cpuid_insn(&cpu_regs);
return (B_FALSE);
return (B_TRUE);
}
static void
{
}