[PATCH 1/2] Add a list of processor objects to the ACPI core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a convenience structure to the ACPI core that allows drivers to 
obtain the list of CPU devices. This is left in the core since the 
scanning is performed at boot time and the drivers may be built as 
modules.

Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>

---

Am I missing a straightforward function to call from a driver that gives 
me the handles of all the objects of a specific type? There must be a 
better way of doing it than this :)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 6d85289..3b8d036 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -30,6 +30,9 @@ struct acpi_device_bus_id{
 	struct list_head node;
 };
 
+struct acpi_handle_list acpi_processor_list;
+EXPORT_SYMBOL(processor_list);
+
 /*
  * Creates hid/cid(s) string needed for modalias and uevent
  * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get:
@@ -1044,6 +1047,11 @@ static void acpi_device_set_id(struct acpi_device *device,
 		break;
 	case ACPI_BUS_TYPE_PROCESSOR:
 		hid = ACPI_PROCESSOR_HID;
+		if (acpi_processor_list.count < ACPI_MAX_HANDLES) {
+			acpi_processor_list.handles[acpi_processor_list.count]
+				=handle;
+			acpi_processor_list.count++;
+		}
 		break;
 	case ACPI_BUS_TYPE_SYSTEM:
 		hid = ACPI_SYSTEM_HID;

-- 
Matthew Garrett | mjg59@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux