2 * arch/i386/kernel/acpi/cstate.c
4 * Copyright (C) 2005 Intel Corporation
5 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
6 * - Added _PDC for SMP C-states on Intel CPUs
9 #include <linux/kernel.h>
10 #include <linux/module.h>
11 #include <linux/init.h>
12 #include <linux/acpi.h>
14 #include <acpi/processor.h>
17 static void acpi_processor_power_init_intel_pdc(struct acpi_processor_power
20 struct acpi_object_list
*obj_list
;
21 union acpi_object
*obj
;
24 /* allocate and initialize pdc. It will be used later. */
25 obj_list
= kmalloc(sizeof(struct acpi_object_list
), GFP_KERNEL
);
27 printk(KERN_ERR
"Memory allocation error\n");
31 obj
= kmalloc(sizeof(union acpi_object
), GFP_KERNEL
);
33 printk(KERN_ERR
"Memory allocation error\n");
38 buf
= kmalloc(12, GFP_KERNEL
);
40 printk(KERN_ERR
"Memory allocation error\n");
46 buf
[0] = ACPI_PDC_REVISION_ID
;
48 buf
[2] = ACPI_PDC_C_CAPABILITY_SMP
;
50 obj
->type
= ACPI_TYPE_BUFFER
;
51 obj
->buffer
.length
= 12;
52 obj
->buffer
.pointer
= (u8
*) buf
;
54 obj_list
->pointer
= obj
;
60 /* Initialize _PDC data based on the CPU vendor */
61 void acpi_processor_power_init_pdc(struct acpi_processor_power
*pow
,
64 struct cpuinfo_x86
*c
= cpu_data
+ cpu
;
67 if (c
->x86_vendor
== X86_VENDOR_INTEL
)
68 acpi_processor_power_init_intel_pdc(pow
);
73 EXPORT_SYMBOL(acpi_processor_power_init_pdc
);
76 * Initialize bm_flags based on the CPU cache properties
77 * On SMP it depends on cache configuration
78 * - When cache is not shared among all CPUs, we flush cache
80 * - When cache is shared among all CPUs, we use bm_check
81 * mechanism as in UP case
83 * This routine is called only after all the CPUs are online
85 void acpi_processor_power_init_bm_check(struct acpi_processor_flags
*flags
,
88 struct cpuinfo_x86
*c
= cpu_data
+ cpu
;
91 if (num_online_cpus() == 1)
93 else if (c
->x86_vendor
== X86_VENDOR_INTEL
) {
95 * Today all CPUs that support C3 share cache.
96 * TBD: This needs to look at cache shared map, once
97 * multi-core detection patch makes to the base.
103 EXPORT_SYMBOL(acpi_processor_power_init_bm_check
);