cpudrv_mach.h revision 173531301317dd4f31e83d4785873141e984ab86
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CPUDRV_MACH_H
#define _SYS_CPUDRV_MACH_H
#include <sys/cpu_module.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* We currently refuse to power manage if the CPU in not ready to
* take cross calls (cross calls fail silently if CPU is not ready
* for it).
*/
/*
* If a failure occurs during attach(), then CPU power management
* is disabled.
*/
extern boolean_t cpudrv_enabled;
#define CPUDRV_PM_DISABLED() (!cpudrv_enabled)
/*
* Currently, there is no governor on sun4u,
*/
#define CPUDRV_PM_RESET_GOVERNOR_THREAD(cpupm)
/*
* Currently, there is no need for a handler on sun4u.
*/
/*
* Topspeed is always the head speed.
*/
/*
* There is no notion of changing topspeed on sun4u.
*/
#define CPUDRV_PM_REDEFINE_TOPSPEED(dip)
/*
* There are no PPM callbacks for sun4u.
*/
#define CPUDRV_PM_SET_PPM_CALLBACKS()
/*
* clock-divisors property tells the supported speeds
* as divisors of the normal speed. Divisors are in increasing
* order starting with 1 (for normal speed). For example, a
* property value of "1, 2, 32" represents full, 1/2 and 1/32
* speeds.
*/
&nspeeds) != DDI_PROP_SUCCESS) { \
"clock-divisors property not defined\n", \
return (DDI_FAILURE); \
} \
}
/*
* Convert speed to Hz.
*/
/*
* Compute the idle cnt percentage for a given speed.
*/
/*
* Compute the user cnt percentage for a given speed.
*/
/*
* pm-components property defintions for sun4u.
*
* Fully constructed pm-components property should be an array of
* strings that look something like:
*
* pmc[0] = "NAME=CPU Speed"
* pmc[1] = "1=1/32 of Normal"
* pmc[2] = "2=1/2 of Normal"
* pmc[3] = "3=Normal"
*
* The amount of memory needed for each string is:
* digits for power level + '=' + '1/' + digits for speed +
* description text + '\0'
*/
#define CPUDRV_PM_COMP_NORMAL "Normal"
#define CPUDRV_PM_COMP_OTHER " of Normal"
#define CPUDRV_PM_COMP_SIZE() \
sizeof (CPUDRV_PM_COMP_OTHER) + 1);
else \
}
extern boolean_t cpudrv_pm_enabled(void);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CPUDRV_MACH_H */