5cff782560a1c3cf913ba5574a5123a299f3315emh * CDDL HEADER START
5cff782560a1c3cf913ba5574a5123a299f3315emh * The contents of this file are subject to the terms of the
5cff782560a1c3cf913ba5574a5123a299f3315emh * Common Development and Distribution License (the "License").
5cff782560a1c3cf913ba5574a5123a299f3315emh * You may not use this file except in compliance with the License.
5cff782560a1c3cf913ba5574a5123a299f3315emh * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5cff782560a1c3cf913ba5574a5123a299f3315emh * See the License for the specific language governing permissions
5cff782560a1c3cf913ba5574a5123a299f3315emh * and limitations under the License.
5cff782560a1c3cf913ba5574a5123a299f3315emh * When distributing Covered Code, include this CDDL HEADER in each
5cff782560a1c3cf913ba5574a5123a299f3315emh * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5cff782560a1c3cf913ba5574a5123a299f3315emh * If applicable, add the following below this CDDL HEADER, with the
5cff782560a1c3cf913ba5574a5123a299f3315emh * fields enclosed by brackets "[]" replaced with your own identifying
5cff782560a1c3cf913ba5574a5123a299f3315emh * information: Portions Copyright [yyyy] [name of copyright owner]
5cff782560a1c3cf913ba5574a5123a299f3315emh * CDDL HEADER END
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5cff782560a1c3cf913ba5574a5123a299f3315emh * Use is subject to license terms.
5cff782560a1c3cf913ba5574a5123a299f3315emhextern "C" {
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * P-state related macros
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_PSTATES(sp) sp->cs_pstates.ss_states
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_PSTATES_COUNT(sp) sp->cs_pstates.ss_count
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_PSTATE_TRANSLAT(pstate) pstate->ps_translat
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_PSTATE_CTRL(pstate) pstate->ps_ctrl
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * T-state related macros
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSTATES(sp) sp->cs_tstates.ss_states
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSTATES_COUNT(sp) sp->cs_tstates.ss_count
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_FREQPER(tstate) tstate->ts_freqper
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSTATE_TRANSLAT(tstate) tstate->ts_translat
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSTATE_CTRL(tstate) tstate->ts_ctrl
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSTATE_STAT(tstate) tstate->ts_state
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * C-state realted macros
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CPU_ACPI_CSTATES(sp) sp->cs_cstates.ss_states
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CPU_ACPI_CSTATES_COUNT(sp) sp->cs_cstates.ss_count
5cff782560a1c3cf913ba5574a5123a299f3315emh#define CPU_ACPI_IS_OBJ_CACHED(sp, obj) (sp->cpu_acpi_cached & obj)
5cff782560a1c3cf913ba5574a5123a299f3315emh#define CPU_ACPI_OBJ_IS_CACHED(sp, obj) (sp->cpu_acpi_cached |= obj)
5cff782560a1c3cf913ba5574a5123a299f3315emh#define CPU_ACPI_OBJ_IS_NOT_CACHED(sp, obj) (sp->cpu_acpi_cached &= ~obj)
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_PSTATES_SIZE(cnt) (cnt * sizeof (cpu_acpi_pstate_t))
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_PSS_CNT (sizeof (cpu_acpi_pstate_t) / sizeof (uint32_t))
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSTATES_SIZE(cnt) (cnt * sizeof (cpu_acpi_tstate_t))
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood#define CPU_ACPI_TSS_CNT (sizeof (cpu_acpi_tstate_t) / sizeof (uint32_t))
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CPU_ACPI_CSTATES_SIZE(cnt) (cnt * sizeof (cpu_acpi_cstate_t))
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe#define CPU_ACPI_CST_CNT (sizeof (cpu_acpi_cstate_t) / sizeof (uint32_t))
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * CPU Domain Coordination Types
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * Container for ACPI processor state dependency information
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodtypedef cpu_acpi_state_dependency_t cpu_acpi_psd_t;
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodtypedef cpu_acpi_state_dependency_t cpu_acpi_tsd_t;
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxetypedef cpu_acpi_state_dependency_t cpu_acpi_csd_t;
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * Container for ACPI processor control register information
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * Container for ACPI _PSS information
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywood * Container for _TSS information
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxe * Container for _CST information
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodtypedef cpu_acpi_supported_states_t cpu_acpi_pstates_t;
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodtypedef cpu_acpi_supported_states_t cpu_acpi_tstates_t;
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxetypedef cpu_acpi_supported_states_t cpu_acpi_cstates_t;
5cff782560a1c3cf913ba5574a5123a299f3315emh * Container for cached ACPI data.
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodextern void cpu_acpi_cache_tpc(cpu_acpi_handle_t);
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodextern int cpu_acpi_cache_pstate_data(cpu_acpi_handle_t);
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodextern void cpu_acpi_free_pstate_data(cpu_acpi_handle_t);
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodextern int cpu_acpi_cache_tstate_data(cpu_acpi_handle_t);
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodextern void cpu_acpi_free_tstate_data(cpu_acpi_handle_t);
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxeextern int cpu_acpi_cache_cstate_data(cpu_acpi_handle_t);
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxeextern void cpu_acpi_free_cstate_data(cpu_acpi_handle_t);
7f606acec863be28b51fb0f694ca86b41ca76e6dMark Haywoodextern void cpu_acpi_install_notify_handler(cpu_acpi_handle_t,
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxeextern void cpu_acpi_remove_notify_handler(cpu_acpi_handle_t,
5cff782560a1c3cf913ba5574a5123a299f3315emhextern int cpu_acpi_write_pdc(cpu_acpi_handle_t, uint32_t, uint32_t,
5cff782560a1c3cf913ba5574a5123a299f3315emhextern int cpu_acpi_write_port(ACPI_IO_ADDRESS, uint32_t, uint32_t);
5cff782560a1c3cf913ba5574a5123a299f3315emhextern int cpu_acpi_read_port(ACPI_IO_ADDRESS, uint32_t *, uint32_t);
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxeextern void cpu_acpi_set_register(uint32_t, uint32_t);
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxeextern void cpu_acpi_get_register(uint32_t, uint32_t *);
5cff782560a1c3cf913ba5574a5123a299f3315emhextern uint_t cpu_acpi_get_speeds(cpu_acpi_handle_t, int **);
0e7515250c8395f368aa45fb9acae7c4f8f8b786Eric Saxeextern uint_t cpu_acpi_get_max_cstates(cpu_acpi_handle_t);
5cff782560a1c3cf913ba5574a5123a299f3315emh#endif /* _CPU_ACPI_H */