aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/acpi/boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/acpi/boot.c')
-rw-r--r--arch/i386/kernel/acpi/boot.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 5fafbacdd4cb..2147511ea78d 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -166,7 +166,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
166 166
167#ifdef CONFIG_PCI_MMCONFIG 167#ifdef CONFIG_PCI_MMCONFIG
168/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ 168/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
169struct acpi_table_mcfg_config *pci_mmcfg_config; 169struct acpi_mcfg_allocation *pci_mmcfg_config;
170int pci_mmcfg_config_num; 170int pci_mmcfg_config_num;
171 171
172int __init acpi_parse_mcfg(struct acpi_table_header *header) 172int __init acpi_parse_mcfg(struct acpi_table_header *header)
@@ -179,17 +179,13 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
179 return -EINVAL; 179 return -EINVAL;
180 180
181 mcfg = (struct acpi_table_mcfg *)header; 181 mcfg = (struct acpi_table_mcfg *)header;
182 if (!mcfg) {
183 printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
184 return -ENODEV;
185 }
186 182
187 /* how many config structures do we have */ 183 /* how many config structures do we have */
188 pci_mmcfg_config_num = 0; 184 pci_mmcfg_config_num = 0;
189 i = header->length - sizeof(struct acpi_table_mcfg); 185 i = header->length - sizeof(struct acpi_table_mcfg);
190 while (i >= sizeof(struct acpi_table_mcfg_config)) { 186 while (i >= sizeof(struct acpi_mcfg_allocation)) {
191 ++pci_mmcfg_config_num; 187 ++pci_mmcfg_config_num;
192 i -= sizeof(struct acpi_table_mcfg_config); 188 i -= sizeof(struct acpi_mcfg_allocation);
193 }; 189 };
194 if (pci_mmcfg_config_num == 0) { 190 if (pci_mmcfg_config_num == 0) {
195 printk(KERN_ERR PREFIX "MMCONFIG has no entries\n"); 191 printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
@@ -206,7 +202,7 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
206 202
207 memcpy(pci_mmcfg_config, &mcfg[1], config_size); 203 memcpy(pci_mmcfg_config, &mcfg[1], config_size);
208 for (i = 0; i < pci_mmcfg_config_num; ++i) { 204 for (i = 0; i < pci_mmcfg_config_num; ++i) {
209 if (pci_mmcfg_config[i].base_reserved) { 205 if (pci_mmcfg_config[i].address > 0xFFFFFFFF) {
210 printk(KERN_ERR PREFIX 206 printk(KERN_ERR PREFIX
211 "MMCONFIG not in low 4GB of memory\n"); 207 "MMCONFIG not in low 4GB of memory\n");
212 kfree(pci_mmcfg_config); 208 kfree(pci_mmcfg_config);
@@ -220,14 +216,14 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
220#endif /* CONFIG_PCI_MMCONFIG */ 216#endif /* CONFIG_PCI_MMCONFIG */
221 217
222#ifdef CONFIG_X86_LOCAL_APIC 218#ifdef CONFIG_X86_LOCAL_APIC
223static int __init acpi_parse_madt(struct acpi_table_header *header) 219static int __init acpi_parse_madt(struct acpi_table_header *table)
224{ 220{
225 struct acpi_table_madt *madt = NULL; 221 struct acpi_table_madt *madt = NULL;
226 222
227 if (!header|| !cpu_has_apic) 223 if (!cpu_has_apic)
228 return -EINVAL; 224 return -EINVAL;
229 225
230 madt = (struct acpi_table_madt *)header; 226 madt = (struct acpi_table_madt *)table;
231 if (!madt) { 227 if (!madt) {
232 printk(KERN_WARNING PREFIX "Unable to map MADT\n"); 228 printk(KERN_WARNING PREFIX "Unable to map MADT\n");
233 return -ENODEV; 229 return -ENODEV;