/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2009, Intel Corporation.
* All Rights Reserved.
*/
/*
* CPU power management driver support for i86pc.
*/
#include <sys/cpudrv_mach.h>
#include <sys/machsystm.h>
#include <sys/cpu_idle.h>
/*
* Note that our driver numbers the power levels from lowest to
* highest starting at 1 (i.e., the lowest power level is 1 and
* the highest power level is cpupm->num_spd). The x86 modules get
* their power levels from ACPI which numbers power levels from
* highest to lowest starting at 0 (i.e., the lowest power level
* is (cpupm->num_spd - 1) and the highest power level is 0). So to
* map one of our driver power levels to one understood by ACPI we
* simply subtract our driver power level from cpupm->num_spd. Likewise,
* to map an ACPI power level to the proper driver power level, we
* subtract the ACPI power level from cpupm->num_spd.
*/
/*
* Change CPU speed using interface provided by module.
*/
int
{
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
/*
* Determine the cpu_id for the CPU device.
*/
{
}
{
return (B_FALSE);
/*
* Only check the instance specific setting it exists.
*/
}
return (B_TRUE);
}
/*
* Is the current thread the thread that is handling the
* PPC change notification?
*/
{
}
/*
* This routine changes the top speed to which the CPUs can transition by:
*
* - Resetting the up_spd for all speeds lower than the new top speed
* to point to the new top speed.
* - Updating the framework with a new "normal" (maximum power) for this
* device.
*/
void
{
int pm_level;
int instance;
int i;
/*
* Don't mess with speeds that are higher than the new
* top speed. They should be out of range anyway.
*/
continue;
/*
* This is the new top speed.
*/
}
}
/*
* This routine reads the ACPI _PPC object. It's accessed as a callback
* by the ppm driver whenever a _PPC change notification is received.
*/
int
{
int instance;
int plat_level;
return (plat_level);
}
/*
* This notification handler is called whenever the ACPI _PPC
* object changes. The _PPC is a sort of governor on power levels.
* It sets an upper threshold on which, _PSS defined, power levels
* are usuable. The _PPC value is dynamic and may change as properties
* (i.e., thermal or AC source) of the system change.
*/
/* ARGSUSED */
static void
{
int instance;
extern pm_cpupm_t cpupm;
return;
if (mach_state == NULL)
return;
/*
* We only handle _PPC change notifications.
*/
}
void
{
}
void
{
return;
}
continue;
}
}
}
void
{
/*
* This should never happen, unless ppm does not get loaded.
*/
if (cpupm_redefine_topspeed == NULL) {
"cpupm_redefine_topspeed has not been initialized - "
"ignoring notification");
return;
}
/*
* ppm callback needs to handle redefinition for all CPUs in
* the domain.
*/
}
{
int topspeed;
mach_state = (cpupm_mach_state_t *)
/*
* allocate ppm CPU domain and initialize the topspeed
* only if P-states are enabled.
*/
}
return (B_TRUE);
}
{
/*
* return TRUE if cpu pointer is NULL
*/
return (B_TRUE);
/*
* free ppm cpu pstate domains only if
* P-states are enabled
*/
}
return (B_TRUE);
}
{
/*
* return nspeeds = 0 if can't get cpu_t
*/
return (0);
}
void
{
}
{
return (cpupm_power_ready(cp));
}
/* ARGSUSED */
void
{
}