Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46416
b: refs/heads/master
c: 11bf04c
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Starikovskiy authored and Len Brown committed Feb 3, 2007
1 parent 9f28f53 commit 6c55f4c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f18c5a08bf035b51939281f5b49aa3ae45cea6ce
refs/heads/master: 11bf04c44fd284a5f4e2348a04da6f749cace250
53 changes: 32 additions & 21 deletions trunk/drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
/* Use the acpiid in MADT to map cpus in case of SMP */

#ifndef CONFIG_SMP
#define convert_acpiid_to_cpu(acpi_id) (-1)
static int get_cpu_id(acpi_handle handle, u32 acpi_id) {return -1;}
#else

static struct acpi_table_madt *madt;
Expand Down Expand Up @@ -483,7 +483,7 @@ static int map_mat_entry(acpi_handle handle, u32 acpi_id)
return apic_id;
}

static int get_apic_id(acpi_handle handle, u32 acpi_id)
static int get_cpu_id(acpi_handle handle, u32 acpi_id)
{
int i;
int apic_id = -1;
Expand All @@ -506,7 +506,7 @@ static int get_apic_id(acpi_handle handle, u32 acpi_id)
Driver Interface
-------------------------------------------------------------------------- */

static int acpi_processor_get_info(struct acpi_processor *pr)
static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
{
acpi_status status = 0;
union acpi_object object = { 0 };
Expand Down Expand Up @@ -535,24 +535,35 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No bus mastering arbitration control\n"));

/*
* Evalute the processor object. Note that it is common on SMP to
* have the first (boot) processor with a valid PBLK address while
* all others have a NULL address.
*/
status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Evaluating processor object\n");
return -ENODEV;
}

/*
* TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
* >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c
*/
pr->acpi_id = object.processor.proc_id;
/* Check if it is a Device with HID and UID */
if (has_uid) {
unsigned long value;
status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
NULL, &value);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Evaluating processor _UID\n");
return -ENODEV;
}
pr->acpi_id = value;
} else {
/*
* Evalute the processor object. Note that it is common on SMP to
* have the first (boot) processor with a valid PBLK address while
* all others have a NULL address.
*/
status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Evaluating processor object\n");
return -ENODEV;
}

cpu_index = get_apic_id(pr->handle, pr->acpi_id);
/*
* TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
* >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c
*/
pr->acpi_id = object.processor.proc_id;
}
cpu_index = get_cpu_id(pr->handle, pr->acpi_id);

/* Handle UP system running SMP kernel, with no LAPIC in MADT */
if (!cpu0_initialized && (cpu_index == -1) &&
Expand Down Expand Up @@ -621,7 +632,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)

pr = acpi_driver_data(device);

result = acpi_processor_get_info(pr);
result = acpi_processor_get_info(pr, device->flags.unique_id);
if (result) {
/* Processor is physically not present */
return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/acpi/acpi_drivers.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/* _HID definitions */

#define ACPI_POWER_HID "ACPI_PWR"
#define ACPI_PROCESSOR_HID "ACPI_CPU"
#define ACPI_PROCESSOR_HID "ACPI0007"
#define ACPI_SYSTEM_HID "ACPI_SYS"
#define ACPI_THERMAL_HID "ACPI_THM"
#define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
Expand Down

0 comments on commit 6c55f4c

Please sign in to comment.