diff options
Diffstat (limited to 'drivers/acpi/processor_pdc.c')
-rw-r--r-- | drivers/acpi/processor_pdc.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index 931e735e9e37..87946b6da765 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c | |||
@@ -33,6 +33,49 @@ static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = { | |||
33 | {}, | 33 | {}, |
34 | }; | 34 | }; |
35 | 35 | ||
36 | static void acpi_processor_init_pdc(struct acpi_processor *pr) | ||
37 | { | ||
38 | struct acpi_object_list *obj_list; | ||
39 | union acpi_object *obj; | ||
40 | u32 *buf; | ||
41 | |||
42 | pr->pdc = NULL; | ||
43 | |||
44 | /* allocate and initialize pdc. It will be used later. */ | ||
45 | obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); | ||
46 | if (!obj_list) { | ||
47 | printk(KERN_ERR "Memory allocation error\n"); | ||
48 | return; | ||
49 | } | ||
50 | |||
51 | obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); | ||
52 | if (!obj) { | ||
53 | printk(KERN_ERR "Memory allocation error\n"); | ||
54 | kfree(obj_list); | ||
55 | return; | ||
56 | } | ||
57 | |||
58 | buf = kmalloc(12, GFP_KERNEL); | ||
59 | if (!buf) { | ||
60 | printk(KERN_ERR "Memory allocation error\n"); | ||
61 | kfree(obj); | ||
62 | kfree(obj_list); | ||
63 | return; | ||
64 | } | ||
65 | |||
66 | obj->type = ACPI_TYPE_BUFFER; | ||
67 | obj->buffer.length = 12; | ||
68 | obj->buffer.pointer = (u8 *) buf; | ||
69 | obj_list->count = 1; | ||
70 | obj_list->pointer = obj; | ||
71 | pr->pdc = obj_list; | ||
72 | |||
73 | /* Now let the arch do the bit-twiddling to buf[] */ | ||
74 | arch_acpi_processor_init_pdc(pr); | ||
75 | |||
76 | return; | ||
77 | } | ||
78 | |||
36 | /* | 79 | /* |
37 | * _PDC is required for a BIOS-OS handshake for most of the newer | 80 | * _PDC is required for a BIOS-OS handshake for most of the newer |
38 | * ACPI processor features. | 81 | * ACPI processor features. |
@@ -72,7 +115,7 @@ void acpi_processor_set_pdc(struct acpi_processor *pr) | |||
72 | if (arch_has_acpi_pdc() == false) | 115 | if (arch_has_acpi_pdc() == false) |
73 | return; | 116 | return; |
74 | 117 | ||
75 | arch_acpi_processor_init_pdc(pr); | 118 | acpi_processor_init_pdc(pr); |
76 | acpi_processor_eval_pdc(pr); | 119 | acpi_processor_eval_pdc(pr); |
77 | arch_acpi_processor_cleanup_pdc(pr); | 120 | arch_acpi_processor_cleanup_pdc(pr); |
78 | } | 121 | } |