/*
* 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
*/
/*
*/
/*
* Copyright (c) 2009, Intel Corporation.
* All Rights Reserved.
*/
#include <sys/x86_archext.h>
#include <sys/machsystm.h>
#include <sys/archsystm.h>
#include <sys/speedstep.h>
#include <sys/cpu_acpi.h>
static int speedstep_init(cpu_t *);
static void speedstep_fini(cpu_t *);
static void speedstep_stop(cpu_t *);
static boolean_t speedstep_turbo_supported(void);
/*
* Interfaces for modules implementing Intel's Enhanced SpeedStep.
*/
"Enhanced SpeedStep Technology",
};
/*
* Error returns
*/
/*
* MSR registers for changing and reading processor power state.
*/
/*
* Debugging support
*/
#ifdef DEBUG
volatile int ess_debug = 0;
#else
#endif
/*
* Write the ctrl register. How it is written, depends upon the _PCT
* APCI object value.
*/
static void
{
switch (pct_ctrl->cr_addrspace_id) {
/*
* Read current power state because reserved bits must be
* preserved, compose new value, and write it.
*/
break;
case ACPI_ADR_SPACE_SYSTEM_IO:
break;
default:
return;
}
}
/*
* Transition the current processor to the requested state.
*/
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 Speedstep 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 (ESS_RET_NO_PM);
}
switch (pct_stat->cr_addrspace_id) {
ESSDEBUG(("Transitions will use fixed hardware\n"));
break;
case ACPI_ADR_SPACE_SYSTEM_IO:
ESSDEBUG(("Transitions will use system IO\n"));
break;
default:
return (ESS_RET_NO_PM);
}
if (speedstep_turbo_supported())
return (ESS_RET_SUCCESS);
}
/*
* Free resources allocated by speedstep_init().
*/
static void
{
}
static void
{
}
{
/* Required features */
return (B_FALSE);
}
/*
* are P-state TSC invariant.
*/
return (B_FALSE);
}
/*
* Enhanced SpeedStep supported?
*/
(void) __cpuid_insn(&cpu_regs);
return (B_FALSE);
}
return (B_TRUE);
}
{
/* Required features */
return (B_FALSE);
}
/*
* turbo mode supported?
*/
(void) __cpuid_insn(&cpu_regs);
return (B_FALSE);
}
return (B_TRUE);
}