diff options
author | Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> | 2007-02-02 11:48:23 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-02 21:14:31 -0500 |
commit | 11bf04c44fd284a5f4e2348a04da6f749cace250 (patch) | |
tree | 85c6a38144c9e588af27461b4a90af2688e45378 | |
parent | f18c5a08bf035b51939281f5b49aa3ae45cea6ce (diff) |
ACPICA: Allow processor to be declared with the Device() instead of Processor()
Allow processor to be declered with the Device(), such as:
Device(CPU1234) {
Name(_HID, "ACPI007")
Name(_UID, 1234)
}
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/processor_core.c | 53 | ||||
-rw-r--r-- | include/acpi/acpi_drivers.h | 2 |
2 files changed, 33 insertions, 22 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 6893c0bffb5a..eacf9a252019 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -377,7 +377,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device) | |||
377 | /* Use the acpiid in MADT to map cpus in case of SMP */ | 377 | /* Use the acpiid in MADT to map cpus in case of SMP */ |
378 | 378 | ||
379 | #ifndef CONFIG_SMP | 379 | #ifndef CONFIG_SMP |
380 | #define convert_acpiid_to_cpu(acpi_id) (-1) | 380 | static int get_cpu_id(acpi_handle handle, u32 acpi_id) {return -1;} |
381 | #else | 381 | #else |
382 | 382 | ||
383 | static struct acpi_table_madt *madt; | 383 | static struct acpi_table_madt *madt; |
@@ -483,7 +483,7 @@ exit: | |||
483 | return apic_id; | 483 | return apic_id; |
484 | } | 484 | } |
485 | 485 | ||
486 | static int get_apic_id(acpi_handle handle, u32 acpi_id) | 486 | static int get_cpu_id(acpi_handle handle, u32 acpi_id) |
487 | { | 487 | { |
488 | int i; | 488 | int i; |
489 | int apic_id = -1; | 489 | int apic_id = -1; |
@@ -506,7 +506,7 @@ static int get_apic_id(acpi_handle handle, u32 acpi_id) | |||
506 | Driver Interface | 506 | Driver Interface |
507 | -------------------------------------------------------------------------- */ | 507 | -------------------------------------------------------------------------- */ |
508 | 508 | ||
509 | static int acpi_processor_get_info(struct acpi_processor *pr) | 509 | static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid) |
510 | { | 510 | { |
511 | acpi_status status = 0; | 511 | acpi_status status = 0; |
512 | union acpi_object object = { 0 }; | 512 | union acpi_object object = { 0 }; |
@@ -535,24 +535,35 @@ static int acpi_processor_get_info(struct acpi_processor *pr) | |||
535 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 535 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
536 | "No bus mastering arbitration control\n")); | 536 | "No bus mastering arbitration control\n")); |
537 | 537 | ||
538 | /* | 538 | /* Check if it is a Device with HID and UID */ |
539 | * Evalute the processor object. Note that it is common on SMP to | 539 | if (has_uid) { |
540 | * have the first (boot) processor with a valid PBLK address while | 540 | unsigned long value; |
541 | * all others have a NULL address. | 541 | status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, |
542 | */ | 542 | NULL, &value); |
543 | status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); | 543 | if (ACPI_FAILURE(status)) { |
544 | if (ACPI_FAILURE(status)) { | 544 | printk(KERN_ERR PREFIX "Evaluating processor _UID\n"); |
545 | printk(KERN_ERR PREFIX "Evaluating processor object\n"); | 545 | return -ENODEV; |
546 | return -ENODEV; | 546 | } |
547 | } | 547 | pr->acpi_id = value; |
548 | 548 | } else { | |
549 | /* | 549 | /* |
550 | * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. | 550 | * Evalute the processor object. Note that it is common on SMP to |
551 | * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c | 551 | * have the first (boot) processor with a valid PBLK address while |
552 | */ | 552 | * all others have a NULL address. |
553 | pr->acpi_id = object.processor.proc_id; | 553 | */ |
554 | status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); | ||
555 | if (ACPI_FAILURE(status)) { | ||
556 | printk(KERN_ERR PREFIX "Evaluating processor object\n"); | ||
557 | return -ENODEV; | ||
558 | } | ||
554 | 559 | ||
555 | cpu_index = get_apic_id(pr->handle, pr->acpi_id); | 560 | /* |
561 | * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. | ||
562 | * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c | ||
563 | */ | ||
564 | pr->acpi_id = object.processor.proc_id; | ||
565 | } | ||
566 | cpu_index = get_cpu_id(pr->handle, pr->acpi_id); | ||
556 | 567 | ||
557 | /* Handle UP system running SMP kernel, with no LAPIC in MADT */ | 568 | /* Handle UP system running SMP kernel, with no LAPIC in MADT */ |
558 | if (!cpu0_initialized && (cpu_index == -1) && | 569 | if (!cpu0_initialized && (cpu_index == -1) && |
@@ -621,7 +632,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) | |||
621 | 632 | ||
622 | pr = acpi_driver_data(device); | 633 | pr = acpi_driver_data(device); |
623 | 634 | ||
624 | result = acpi_processor_get_info(pr); | 635 | result = acpi_processor_get_info(pr, device->flags.unique_id); |
625 | if (result) { | 636 | if (result) { |
626 | /* Processor is physically not present */ | 637 | /* Processor is physically not present */ |
627 | return 0; | 638 | return 0; |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 6a5bdcefec64..baaa734b1098 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -37,7 +37,7 @@ | |||
37 | /* _HID definitions */ | 37 | /* _HID definitions */ |
38 | 38 | ||
39 | #define ACPI_POWER_HID "ACPI_PWR" | 39 | #define ACPI_POWER_HID "ACPI_PWR" |
40 | #define ACPI_PROCESSOR_HID "ACPI_CPU" | 40 | #define ACPI_PROCESSOR_HID "ACPI0007" |
41 | #define ACPI_SYSTEM_HID "ACPI_SYS" | 41 | #define ACPI_SYSTEM_HID "ACPI_SYS" |
42 | #define ACPI_THERMAL_HID "ACPI_THM" | 42 | #define ACPI_THERMAL_HID "ACPI_THM" |
43 | #define ACPI_BUTTON_HID_POWERF "ACPI_FPB" | 43 | #define ACPI_BUTTON_HID_POWERF "ACPI_FPB" |