aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/processor_core.c')
-rw-r--r--drivers/acpi/processor_core.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 33a38d604630..9125d7d96372 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -108,13 +108,12 @@ static int map_gicc_mpidr(struct acpi_subtable_header *entry,
108 return -EINVAL; 108 return -EINVAL;
109} 109}
110 110
111static phys_cpuid_t map_madt_entry(int type, u32 acpi_id) 111static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
112 int type, u32 acpi_id)
112{ 113{
113 unsigned long madt_end, entry; 114 unsigned long madt_end, entry;
114 phys_cpuid_t phys_id = PHYS_CPUID_INVALID; /* CPU hardware ID */ 115 phys_cpuid_t phys_id = PHYS_CPUID_INVALID; /* CPU hardware ID */
115 struct acpi_table_madt *madt;
116 116
117 madt = get_madt_table();
118 if (!madt) 117 if (!madt)
119 return phys_id; 118 return phys_id;
120 119
@@ -145,6 +144,25 @@ static phys_cpuid_t map_madt_entry(int type, u32 acpi_id)
145 return phys_id; 144 return phys_id;
146} 145}
147 146
147phys_cpuid_t __init acpi_map_madt_entry(u32 acpi_id)
148{
149 struct acpi_table_madt *madt = NULL;
150 acpi_size tbl_size;
151 phys_cpuid_t rv;
152
153 acpi_get_table_with_size(ACPI_SIG_MADT, 0,
154 (struct acpi_table_header **)&madt,
155 &tbl_size);
156 if (!madt)
157 return PHYS_CPUID_INVALID;
158
159 rv = map_madt_entry(madt, 1, acpi_id);
160
161 early_acpi_os_unmap_memory(madt, tbl_size);
162
163 return rv;
164}
165
148static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id) 166static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
149{ 167{
150 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 168 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -185,7 +203,7 @@ phys_cpuid_t acpi_get_phys_id(acpi_handle handle, int type, u32 acpi_id)
185 203
186 phys_id = map_mat_entry(handle, type, acpi_id); 204 phys_id = map_mat_entry(handle, type, acpi_id);
187 if (invalid_phys_cpuid(phys_id)) 205 if (invalid_phys_cpuid(phys_id))
188 phys_id = map_madt_entry(type, acpi_id); 206 phys_id = map_madt_entry(get_madt_table(), type, acpi_id);
189 207
190 return phys_id; 208 return phys_id;
191} 209}