debuggers.hg
changeset 17975:8475d1b9a364
[IA64] remove unused old acpi.c.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author | Isaku Yamahata <yamahata@valinux.co.jp> |
---|---|
date | Wed Jun 11 18:47:35 2008 +0900 (2008-06-11) |
parents | 220f3d62e272 |
children | db371fe47ac8 |
files | xen/arch/ia64/xen/acpi.c |
line diff
1.1 --- a/xen/arch/ia64/xen/acpi.c Wed Jun 11 18:45:13 2008 +0900 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,704 +0,0 @@ 1.4 -/* 1.5 - * acpi.c - Architecture-Specific Low-Level ACPI Support 1.6 - * 1.7 - * Copyright (C) 1999 VA Linux Systems 1.8 - * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com> 1.9 - * Copyright (C) 2000, 2002-2003 Hewlett-Packard Co. 1.10 - * David Mosberger-Tang <davidm@hpl.hp.com> 1.11 - * Copyright (C) 2000 Intel Corp. 1.12 - * Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com> 1.13 - * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 1.14 - * Copyright (C) 2001 Jenna Hall <jenna.s.hall@intel.com> 1.15 - * Copyright (C) 2001 Takayoshi Kochi <t-kochi@bq.jp.nec.com> 1.16 - * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de> 1.17 - * 1.18 - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.19 - * 1.20 - * This program is free software; you can redistribute it and/or modify 1.21 - * it under the terms of the GNU General Public License as published by 1.22 - * the Free Software Foundation; either version 2 of the License, or 1.23 - * (at your option) any later version. 1.24 - * 1.25 - * This program is distributed in the hope that it will be useful, 1.26 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 1.27 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.28 - * GNU General Public License for more details. 1.29 - * 1.30 - * You should have received a copy of the GNU General Public License 1.31 - * along with this program; if not, write to the Free Software 1.32 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1.33 - * 1.34 - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.35 - */ 1.36 - 1.37 -#include <linux/config.h> 1.38 -#include <linux/module.h> 1.39 -#include <linux/init.h> 1.40 -#include <linux/kernel.h> 1.41 -#include <linux/sched.h> 1.42 -#include <linux/smp.h> 1.43 -#include <linux/string.h> 1.44 -#include <linux/types.h> 1.45 -#include <linux/irq.h> 1.46 -#include <linux/acpi.h> 1.47 -#include <linux/efi.h> 1.48 -#include <linux/mmzone.h> 1.49 -#include <asm/io.h> 1.50 -#include <asm/iosapic.h> 1.51 -#include <asm/machvec.h> 1.52 -#include <asm/page.h> 1.53 -#include <asm/system.h> 1.54 -#include <asm/numa.h> 1.55 -#include <asm/sal.h> 1.56 -#include <asm/hw_irq.h> 1.57 -#ifdef XEN 1.58 -#include <xen/errno.h> 1.59 -#include <xen/nodemask.h> 1.60 -extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES]; 1.61 -#endif 1.62 - 1.63 -#define BAD_MADT_ENTRY(entry, end) ( \ 1.64 - (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ 1.65 - ((struct acpi_subtable_header *)entry)->length != sizeof(*entry)) 1.66 - 1.67 -#define PREFIX "ACPI: " 1.68 - 1.69 -void (*pm_idle) (void); 1.70 -EXPORT_SYMBOL(pm_idle); 1.71 -void (*pm_power_off) (void); 1.72 - 1.73 -unsigned char acpi_kbd_controller_present = 1; 1.74 -unsigned char acpi_legacy_devices; 1.75 - 1.76 -const char * 1.77 -acpi_get_sysname (void) 1.78 -{ 1.79 -/* #ifdef CONFIG_IA64_GENERIC */ 1.80 - unsigned long rsdp_phys; 1.81 - struct acpi_table_rsdp *rsdp; 1.82 - struct acpi_table_xsdt *xsdt; 1.83 - struct acpi_table_header *hdr; 1.84 - 1.85 - rsdp_phys = acpi_find_rsdp(); 1.86 - if (!rsdp_phys) { 1.87 - printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n"); 1.88 - return "dig"; 1.89 - } 1.90 - 1.91 - rsdp = (struct acpi_table_rsdp *) __va(rsdp_phys); 1.92 - if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) { 1.93 - printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); 1.94 - return "dig"; 1.95 - } 1.96 - 1.97 - xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_physical_address); 1.98 - hdr = &xsdt->header; 1.99 - if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) { 1.100 - printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); 1.101 - return "dig"; 1.102 - } 1.103 - 1.104 - if (!strcmp(hdr->oem_id, "HP")) { 1.105 - return "hpzx1"; 1.106 - } 1.107 - else if (!strcmp(hdr->oem_id, "SGI")) { 1.108 - return "sn2"; 1.109 - } 1.110 - 1.111 - return "dig"; 1.112 -/* 1.113 -#else 1.114 -# if defined (CONFIG_IA64_HP_SIM) 1.115 - return "hpsim"; 1.116 -# elif defined (CONFIG_IA64_HP_ZX1) 1.117 - return "hpzx1"; 1.118 -# elif defined (CONFIG_IA64_SGI_SN2) 1.119 - return "sn2"; 1.120 -# elif defined (CONFIG_IA64_DIG) 1.121 - return "dig"; 1.122 -# else 1.123 -# error Unknown platform. Fix acpi.c. 1.124 -# endif 1.125 -#endif 1.126 -*/ 1.127 -} 1.128 - 1.129 -#ifdef CONFIG_ACPI_BOOT 1.130 - 1.131 -#define ACPI_MAX_PLATFORM_INTERRUPTS 256 1.132 - 1.133 -/* Array to record platform interrupt vectors for generic interrupt routing. */ 1.134 -int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = { 1.135 - [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1 1.136 -}; 1.137 - 1.138 -enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC; 1.139 - 1.140 -/* 1.141 - * Interrupt routing API for device drivers. Provides interrupt vector for 1.142 - * a generic platform event. Currently only CPEI is implemented. 1.143 - */ 1.144 -int 1.145 -acpi_request_vector (u32 int_type) 1.146 -{ 1.147 - int vector = -1; 1.148 - 1.149 - if (int_type < ACPI_MAX_PLATFORM_INTERRUPTS) { 1.150 - /* corrected platform error interrupt */ 1.151 - vector = platform_intr_list[int_type]; 1.152 - } else 1.153 - printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n"); 1.154 - return vector; 1.155 -} 1.156 - 1.157 -char * 1.158 -__acpi_map_table (unsigned long phys_addr, unsigned long size) 1.159 -{ 1.160 - return __va(phys_addr); 1.161 -} 1.162 - 1.163 -/* -------------------------------------------------------------------------- 1.164 - Boot-time Table Parsing 1.165 - -------------------------------------------------------------------------- */ 1.166 - 1.167 -static int total_cpus __initdata; 1.168 -static int available_cpus __initdata; 1.169 -struct acpi_table_madt * acpi_madt __initdata; 1.170 -static u8 has_8259; 1.171 - 1.172 -static int __init 1.173 -acpi_parse_lapic_addr_ovr ( 1.174 - struct acpi_subtable_header *header, const unsigned long end) 1.175 -{ 1.176 - struct acpi_table_lapic_addr_ovr *lapic; 1.177 - 1.178 - lapic = (struct acpi_table_lapic_addr_ovr *) header; 1.179 - 1.180 - if (BAD_MADT_ENTRY(lapic, end)) 1.181 - return -EINVAL; 1.182 - 1.183 - acpi_table_print_madt_entry(header); 1.184 - 1.185 - if (lapic->address) { 1.186 - iounmap((void *) ipi_base_addr); 1.187 - ipi_base_addr = (void __iomem *) ioremap(lapic->address, 0); 1.188 - } 1.189 - return 0; 1.190 -} 1.191 - 1.192 - 1.193 -static int __init 1.194 -acpi_parse_lsapic (struct acpi_subtable_header *header, const unsigned long end) 1.195 -{ 1.196 - struct acpi_table_lsapic *lsapic; 1.197 - 1.198 - lsapic = (struct acpi_table_lsapic *) header; 1.199 - 1.200 - if (BAD_MADT_ENTRY(lsapic, end)) 1.201 - return -EINVAL; 1.202 - 1.203 - acpi_table_print_madt_entry(header); 1.204 - 1.205 - printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid); 1.206 - 1.207 - if (!lsapic->flags.enabled) 1.208 - printk(" disabled"); 1.209 - else { 1.210 - printk(" enabled"); 1.211 -#ifdef CONFIG_SMP 1.212 - if (available_cpus < NR_CPUS) { 1.213 - smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid; 1.214 - if (hard_smp_processor_id() 1.215 - == (unsigned int) smp_boot_data.cpu_phys_id[available_cpus]) 1.216 - printk(" (BSP)"); 1.217 - ++available_cpus; 1.218 - } else { 1.219 - printk(" - however, ignored..."); 1.220 - } 1.221 -#else 1.222 - ++available_cpus; 1.223 -#endif 1.224 - } 1.225 - 1.226 - printk("\n"); 1.227 - 1.228 - total_cpus++; 1.229 - return 0; 1.230 -} 1.231 - 1.232 - 1.233 -static int __init 1.234 -acpi_parse_lapic_nmi (struct acpi_subtable_header *header, const unsigned long end) 1.235 -{ 1.236 - struct acpi_table_lapic_nmi *lacpi_nmi; 1.237 - 1.238 - lacpi_nmi = (struct acpi_table_lapic_nmi*) header; 1.239 - 1.240 - if (BAD_MADT_ENTRY(lacpi_nmi, end)) 1.241 - return -EINVAL; 1.242 - 1.243 - acpi_table_print_madt_entry(header); 1.244 - 1.245 - /* TBD: Support lapic_nmi entries */ 1.246 - return 0; 1.247 -} 1.248 - 1.249 - 1.250 -static int __init 1.251 -acpi_parse_iosapic (struct acpi_subtable_header *header, const unsigned long end) 1.252 -{ 1.253 - struct acpi_table_iosapic *iosapic; 1.254 - 1.255 - iosapic = (struct acpi_table_iosapic *) header; 1.256 - 1.257 - if (BAD_MADT_ENTRY(iosapic, end)) 1.258 - return -EINVAL; 1.259 - 1.260 - acpi_table_print_madt_entry(header); 1.261 - 1.262 - iosapic_init(iosapic->address, iosapic->global_irq_base); 1.263 - 1.264 - return 0; 1.265 -} 1.266 - 1.267 -static int __init 1.268 -acpi_parse_plat_int_src ( 1.269 - struct acpi_subtable_header *header, const unsigned long end) 1.270 -{ 1.271 - struct acpi_table_plat_int_src *plintsrc; 1.272 - int vector; 1.273 - 1.274 - plintsrc = (struct acpi_table_plat_int_src *) header; 1.275 - 1.276 - if (BAD_MADT_ENTRY(plintsrc, end)) 1.277 - return -EINVAL; 1.278 - 1.279 - acpi_table_print_madt_entry(header); 1.280 - 1.281 - /* 1.282 - * Get vector assignment for this interrupt, set attributes, 1.283 - * and program the IOSAPIC routing table. 1.284 - */ 1.285 - vector = iosapic_register_platform_intr(plintsrc->type, 1.286 - plintsrc->global_irq, 1.287 - plintsrc->iosapic_vector, 1.288 - plintsrc->eid, 1.289 - plintsrc->id, 1.290 - (plintsrc->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, 1.291 - (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); 1.292 - 1.293 - platform_intr_list[plintsrc->type] = vector; 1.294 - return 0; 1.295 -} 1.296 - 1.297 - 1.298 -static int __init 1.299 -acpi_parse_int_src_ovr ( 1.300 - struct acpi_subtable_header *header, const unsigned long end) 1.301 -{ 1.302 - struct acpi_table_int_src_ovr *p; 1.303 - 1.304 - p = (struct acpi_table_int_src_ovr *) header; 1.305 - 1.306 - if (BAD_MADT_ENTRY(p, end)) 1.307 - return -EINVAL; 1.308 - 1.309 - acpi_table_print_madt_entry(header); 1.310 - 1.311 - iosapic_override_isa_irq(p->bus_irq, p->global_irq, 1.312 - (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, 1.313 - (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); 1.314 - return 0; 1.315 -} 1.316 - 1.317 -static int __init 1.318 -acpi_parse_nmi_src (struct acpi_subtable_header *header, const unsigned long end) 1.319 -{ 1.320 - struct acpi_table_nmi_src *nmi_src; 1.321 - 1.322 - nmi_src = (struct acpi_table_nmi_src*) header; 1.323 - 1.324 - if (BAD_MADT_ENTRY(nmi_src, end)) 1.325 - return -EINVAL; 1.326 - 1.327 - acpi_table_print_madt_entry(header); 1.328 - 1.329 - /* TBD: Support nimsrc entries */ 1.330 - return 0; 1.331 -} 1.332 -/* Hook from generic ACPI tables.c */ 1.333 -void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) 1.334 -{ 1.335 - if (!strncmp(oem_id, "IBM", 3) && 1.336 - (!strncmp(oem_table_id, "SERMOW", 6))){ 1.337 - 1.338 - /* Unfortunatly ITC_DRIFT is not yet part of the 1.339 - * official SAL spec, so the ITC_DRIFT bit is not 1.340 - * set by the BIOS on this hardware. 1.341 - */ 1.342 - sal_platform_features |= IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT; 1.343 - 1.344 -#if 0 1.345 - /*Start cyclone clock*/ 1.346 - cyclone_setup(0); 1.347 -#endif 1.348 - } 1.349 -} 1.350 - 1.351 -static int __init 1.352 -acpi_parse_madt (struct acpi_table_header *table) 1.353 -{ 1.354 - acpi_madt = (struct acpi_table_madt *)table; 1.355 - 1.356 - /* remember the value for reference after free_initmem() */ 1.357 -#ifdef CONFIG_ITANIUM 1.358 - has_8259 = 1; /* Firmware on old Itanium systems is broken */ 1.359 -#else 1.360 - has_8259 = acpi_madt->flags & ACPI_MADT_PCAT_COMPAT; 1.361 -#endif 1.362 - iosapic_system_init(has_8259); 1.363 - 1.364 - /* Get base address of IPI Message Block */ 1.365 - 1.366 - if (acpi_madt->address) 1.367 - ipi_base_addr = (void __iomem *)ioremap(acpi_madt->address, 0); 1.368 - 1.369 - printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); 1.370 - 1.371 - acpi_madt_oem_check(acpi_madt->header.oem_id, 1.372 - acpi_madt->header.oem_table_id); 1.373 - 1.374 - return 0; 1.375 -} 1.376 - 1.377 -#ifdef CONFIG_ACPI_NUMA 1.378 - 1.379 -#undef SLIT_DEBUG 1.380 - 1.381 -#define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32) 1.382 - 1.383 -static int __initdata srat_num_cpus; /* number of cpus */ 1.384 -static u32 __initdata pxm_flag[PXM_FLAG_LEN]; 1.385 -#define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag)) 1.386 -#define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) 1.387 -/* maps to convert between proximity domain and logical node ID */ 1.388 -int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS]; 1.389 -int __initdata nid_to_pxm_map[MAX_NUMNODES]; 1.390 -static struct acpi_table_slit __initdata *slit_table; 1.391 - 1.392 -#define NID_INVAL -1 1.393 -#define PXM_INVAL -1 1.394 - 1.395 -int __init pxm_to_node(int pxm) 1.396 -{ 1.397 - if (pxm < 0) 1.398 - return NID_INVAL; 1.399 - return pxm_to_nid_map[pxm]; 1.400 -} 1.401 - 1.402 -int __init node_to_pxm(int node) 1.403 -{ 1.404 - if (node < 0) 1.405 - return PXM_INVAL; 1.406 - return nid_to_pxm_map[node]; 1.407 -} 1.408 - 1.409 - 1.410 -/* 1.411 - * ACPI 2.0 SLIT (System Locality Information Table) 1.412 - * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf 1.413 - */ 1.414 -void __init 1.415 -acpi_numa_slit_init (struct acpi_table_slit *slit) 1.416 -{ 1.417 - u32 len; 1.418 - 1.419 - len = sizeof(struct acpi_table_header) + 8 1.420 - + slit->locality_count * slit->locality_count; 1.421 - if (slit->header.length != len) { 1.422 - printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", 1.423 - len, slit->header.length); 1.424 - memset(numa_slit, 10, sizeof(numa_slit)); 1.425 - return; 1.426 - } 1.427 - slit_table = slit; 1.428 -} 1.429 - 1.430 -void __init 1.431 -acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa) 1.432 -{ 1.433 - /* record this node in proximity bitmap */ 1.434 - pxm_bit_set(pa->proximity_domain); 1.435 - 1.436 - node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid); 1.437 - /* nid should be overridden as logical node id later */ 1.438 - node_cpuid[srat_num_cpus].nid = pa->proximity_domain; 1.439 - srat_num_cpus++; 1.440 -} 1.441 - 1.442 -void __init 1.443 -acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma) 1.444 -{ 1.445 - unsigned long paddr, size; 1.446 - u8 pxm; 1.447 - struct node_memblk_s *p, *q, *pend; 1.448 - 1.449 - pxm = ma->proximity_domain; 1.450 - 1.451 - /* fill node memory chunk structure */ 1.452 - paddr = ma->base_addr_hi; 1.453 - paddr = (paddr << 32) | ma->base_addr_lo; 1.454 - size = ma->length_hi; 1.455 - size = (size << 32) | ma->length_lo; 1.456 - 1.457 - /* Ignore disabled entries */ 1.458 - if (!ma->flags.enabled) 1.459 - return; 1.460 - 1.461 - /* record this node in proximity bitmap */ 1.462 - pxm_bit_set(pxm); 1.463 - 1.464 - /* Insertion sort based on base address */ 1.465 - pend = &node_memblk[num_node_memblks]; 1.466 - for (p = &node_memblk[0]; p < pend; p++) { 1.467 - if (paddr < p->start_paddr) 1.468 - break; 1.469 - } 1.470 - if (p < pend) { 1.471 - for (q = pend - 1; q >= p; q--) 1.472 - *(q + 1) = *q; 1.473 - } 1.474 - p->start_paddr = paddr; 1.475 - p->size = size; 1.476 - p->nid = pxm; 1.477 - num_node_memblks++; 1.478 -} 1.479 - 1.480 -static unsigned int numnodes; 1.481 -void __init 1.482 -acpi_numa_arch_fixup (void) 1.483 -{ 1.484 - int i, j, node_from, node_to; 1.485 - 1.486 - /* If there's no SRAT, fix the phys_id */ 1.487 - if (srat_num_cpus == 0) { 1.488 - node_cpuid[0].phys_id = hard_smp_processor_id(); 1.489 - return; 1.490 - } 1.491 - 1.492 - /* calculate total number of nodes in system from PXM bitmap */ 1.493 - numnodes = 0; /* init total nodes in system */ 1.494 - 1.495 - memset(pxm_to_nid_map, PXM_INVAL, sizeof(pxm_to_nid_map)); 1.496 - memset(nid_to_pxm_map, NID_INVAL, sizeof(nid_to_pxm_map)); 1.497 - for (i = 0; i < MAX_PXM_DOMAINS; i++) { 1.498 - if (pxm_bit_test(i)) { 1.499 - pxm_to_nid_map[i] = numnodes; 1.500 - node_set_online(numnodes); 1.501 - nid_to_pxm_map[numnodes++] = i; 1.502 - } 1.503 - } 1.504 - 1.505 - /* set logical node id in memory chunk structure */ 1.506 - for (i = 0; i < num_node_memblks; i++) 1.507 - node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid]; 1.508 - 1.509 - /* assign memory bank numbers for each chunk on each node */ 1.510 - for (i = 0; i < numnodes; i++) { 1.511 - int bank; 1.512 - 1.513 - bank = 0; 1.514 - for (j = 0; j < num_node_memblks; j++) 1.515 - if (node_memblk[j].nid == i) 1.516 - node_memblk[j].bank = bank++; 1.517 - } 1.518 - 1.519 - /* set logical node id in cpu structure */ 1.520 - for (i = 0; i < srat_num_cpus; i++) 1.521 - node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; 1.522 - 1.523 - printk(KERN_INFO "Number of logical nodes in system = %d\n", 1.524 - numnodes); 1.525 - printk(KERN_INFO "Number of memory chunks in system = %d\n", 1.526 - num_node_memblks); 1.527 - 1.528 - if (!slit_table) 1.529 - return; 1.530 - memset(numa_slit, -1, sizeof(numa_slit)); 1.531 - for (i = 0; i < slit_table->locality_count; i++) { 1.532 - if (!pxm_bit_test(i)) 1.533 - continue; 1.534 - node_from = pxm_to_nid_map[i]; 1.535 - for (j=0; j < slit_table->locality_count; j++) { 1.536 - if (!pxm_bit_test(j)) 1.537 - continue; 1.538 - node_to = pxm_to_nid_map[j]; 1.539 - node_distance(node_from, node_to) = 1.540 - slit_table->entry[i * slit_table->locality_count + j]; 1.541 - } 1.542 - } 1.543 - 1.544 -#ifdef SLIT_DEBUG 1.545 - printk("ACPI 2.0 SLIT locality table:\n"); 1.546 - for (i = 0; i < numnodes; i++) { 1.547 - for (j = 0; j < numnodes; j++) 1.548 - printk("%03d ", node_distance(i,j)); 1.549 - printk("\n"); 1.550 - } 1.551 -#endif 1.552 -} 1.553 -#endif /* CONFIG_ACPI_NUMA */ 1.554 - 1.555 -#if 0 1.556 -unsigned int 1.557 -acpi_register_gsi (u32 gsi, int polarity, int trigger) 1.558 -{ 1.559 - return acpi_register_irq(gsi, polarity, trigger); 1.560 -} 1.561 -EXPORT_SYMBOL(acpi_register_gsi); 1.562 -#endif 1.563 -static int __init 1.564 -acpi_parse_fadt (struct acpi_table_header *table) 1.565 -{ 1.566 - struct acpi_table_header *fadt_header; 1.567 - struct acpi_table_fadt *fadt; 1.568 - 1.569 - fadt_header = (struct acpi_table_header *)table; 1.570 - if (fadt_header->revision != 3) 1.571 - return -ENODEV; /* Only deal with ACPI 2.0 FADT */ 1.572 - 1.573 - fadt = (struct acpi_table_fadt *) fadt_header; 1.574 - 1.575 - if (!(fadt->boot_flags & BAF_8042_KEYBOARD_CONTROLLER)) 1.576 - acpi_kbd_controller_present = 0; 1.577 - 1.578 - if (fadt->boot_flags & BAF_LEGACY_DEVICES) 1.579 - acpi_legacy_devices = 1; 1.580 - 1.581 -#if 0 1.582 - acpi_register_gsi(fadt->sci_interrupt, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE); 1.583 -#endif 1.584 - return 0; 1.585 -} 1.586 - 1.587 -unsigned long __init 1.588 -acpi_find_rsdp (void) 1.589 -{ 1.590 - unsigned long rsdp_phys = 0; 1.591 - 1.592 - if (efi.acpi20) 1.593 - rsdp_phys = __pa(efi.acpi20); 1.594 - else if (efi.acpi) 1.595 - printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n"); 1.596 - return rsdp_phys; 1.597 -} 1.598 - 1.599 -int __init 1.600 -acpi_boot_init (void) 1.601 -{ 1.602 - 1.603 - /* 1.604 - * MADT 1.605 - * ---- 1.606 - * Parse the Multiple APIC Description Table (MADT), if exists. 1.607 - * Note that this table provides platform SMP configuration 1.608 - * information -- the successor to MPS tables. 1.609 - */ 1.610 - 1.611 - if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) { 1.612 - printk(KERN_ERR PREFIX "Can't find MADT\n"); 1.613 - goto skip_madt; 1.614 - } 1.615 - 1.616 - /* Local APIC */ 1.617 - 1.618 - if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0) 1.619 - printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n"); 1.620 - 1.621 - if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1) 1.622 - printk(KERN_ERR PREFIX "Error parsing MADT - no LSAPIC entries\n"); 1.623 - 1.624 - if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0) 1.625 - printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); 1.626 - 1.627 - /* I/O APIC */ 1.628 - 1.629 - if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) 1.630 - printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n"); 1.631 - 1.632 - /* System-Level Interrupt Routing */ 1.633 - 1.634 - if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0) 1.635 - printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n"); 1.636 - 1.637 - if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0) 1.638 - printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); 1.639 - 1.640 - if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0) 1.641 - printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); 1.642 - skip_madt: 1.643 - 1.644 - /* 1.645 - * FADT says whether a legacy keyboard controller is present. 1.646 - * The FADT also contains an SCI_INT line, by which the system 1.647 - * gets interrupts such as power and sleep buttons. If it's not 1.648 - * on a Legacy interrupt, it needs to be setup. 1.649 - */ 1.650 - if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt)) 1.651 - printk(KERN_ERR PREFIX "Can't find FADT\n"); 1.652 - 1.653 -#ifdef CONFIG_SMP 1.654 - if (available_cpus == 0) { 1.655 - printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n"); 1.656 - printk(KERN_INFO "CPU 0 (0x%04x)\n", hard_smp_processor_id()); 1.657 - smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id(); 1.658 - available_cpus = 1; /* We've got at least one of these, no? */ 1.659 - } 1.660 - smp_boot_data.cpu_count = available_cpus; 1.661 - 1.662 - smp_build_cpu_map(); 1.663 -# ifdef CONFIG_ACPI_NUMA 1.664 - if (srat_num_cpus == 0) { 1.665 - int cpu, i = 1; 1.666 - for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++) 1.667 - if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id()) 1.668 - node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu]; 1.669 - } 1.670 - build_cpu_to_node_map(); 1.671 -# endif 1.672 -#endif 1.673 - /* Make boot-up look pretty */ 1.674 - printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); 1.675 - return 0; 1.676 -} 1.677 - 1.678 -int 1.679 -acpi_gsi_to_irq (u32 gsi, unsigned int *irq) 1.680 -{ 1.681 - int vector; 1.682 - 1.683 - if (has_8259 && gsi < 16) 1.684 - *irq = isa_irq_to_vector(gsi); 1.685 - else { 1.686 - vector = gsi_to_vector(gsi); 1.687 - if (vector == -1) 1.688 - return -1; 1.689 - 1.690 - *irq = vector; 1.691 - } 1.692 - return 0; 1.693 -} 1.694 -#if 0 1.695 -int 1.696 -acpi_register_irq (u32 gsi, u32 polarity, u32 trigger) 1.697 -{ 1.698 - if (has_8259 && gsi < 16) 1.699 - return isa_irq_to_vector(gsi); 1.700 - 1.701 - return iosapic_register_intr(gsi, 1.702 - (polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, 1.703 - (trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); 1.704 -} 1.705 -EXPORT_SYMBOL(acpi_register_irq); 1.706 -#endif 1.707 -#endif /* CONFIG_ACPI_BOOT */