ia64/xen-unstable

view xen/include/xen/cpuidle.h @ 18748:112e81ae5824

CPUIDLE: Support C1 FFH entry

Add support for C1 FFH (mwait) entry. Meanwhile add timing for C1. The
timing for C1 should be accurate for FFH case, but may not for halt case.

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Oct 30 13:33:40 2008 +0000 (2008-10-30)
parents 1137464400a8
children
line source
1 /*
2 * cpuidle.h - xen idle state module derived from Linux
3 *
4 * (C) 2007 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
5 * Shaohua Li <shaohua.li@intel.com>
6 * Adam Belay <abelay@novell.com>
7 * Copyright (C) 2008 Intel Corporation
8 *
9 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or (at
14 * your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *
25 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 */
27 #ifndef _XEN_CPUIDLE_H
28 #define _XEN_CPUIDLE_H
30 #define ACPI_PROCESSOR_MAX_POWER 8
31 #define CPUIDLE_NAME_LEN 16
33 #define ACPI_CSTATE_EM_NONE 0
34 #define ACPI_CSTATE_EM_SYSIO 1
35 #define ACPI_CSTATE_EM_FFH 2
36 #define ACPI_CSTATE_EM_HALT 3
38 struct acpi_processor_cx
39 {
40 u8 idx;
41 u8 valid;
42 u8 type;
43 u32 address;
44 u8 entry_method; /* ACPI_CSTATE_EM_xxx */
45 u32 latency;
46 u32 latency_ticks;
47 u32 power;
48 u32 usage;
49 u64 time;
50 u32 target_residency;
51 };
53 struct acpi_processor_flags
54 {
55 u8 bm_control:1;
56 u8 bm_check:1;
57 u8 has_cst:1;
58 u8 power_setup_done:1;
59 u8 bm_rld_set:1;
60 };
62 struct acpi_processor_power
63 {
64 unsigned int cpu;
65 struct acpi_processor_flags flags;
66 struct acpi_processor_cx *last_state;
67 struct acpi_processor_cx *safe_state;
68 u32 last_residency;
69 void *gdata; /* governor specific data */
70 u32 count;
71 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
72 };
74 struct cpuidle_governor
75 {
76 char name[CPUIDLE_NAME_LEN];
77 unsigned int rating;
79 int (*enable) (struct acpi_processor_power *dev);
80 void (*disable) (struct acpi_processor_power *dev);
82 int (*select) (struct acpi_processor_power *dev);
83 void (*reflect) (struct acpi_processor_power *dev);
84 };
86 extern struct cpuidle_governor *cpuidle_current_governor;
88 #endif /* _XEN_CPUIDLE_H */