ia64/xen-unstable

view xen/include/xen/cpuidle.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents 112e81ae5824
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 */