debuggers.hg

view xen/arch/ia64/xen/acpi.c @ 17972:cddaea5d6528

[IA64] removed an unused header file.

removed an unused header file and MAX_NUMNODES were defined in
two place. so removed unnecessary MAX_NUMNODES definitions.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed Jun 11 15:38:00 2008 +0900 (2008-06-11)
parents 9af7a535225f
children
line source
1 /*
2 * acpi.c - Architecture-Specific Low-Level ACPI Support
3 *
4 * Copyright (C) 1999 VA Linux Systems
5 * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com>
6 * Copyright (C) 2000, 2002-2003 Hewlett-Packard Co.
7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 * Copyright (C) 2000 Intel Corp.
9 * Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
10 * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
11 * Copyright (C) 2001 Jenna Hall <jenna.s.hall@intel.com>
12 * Copyright (C) 2001 Takayoshi Kochi <t-kochi@bq.jp.nec.com>
13 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
14 *
15 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 *
31 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 */
34 #include <linux/config.h>
35 #include <linux/module.h>
36 #include <linux/init.h>
37 #include <linux/kernel.h>
38 #include <linux/sched.h>
39 #include <linux/smp.h>
40 #include <linux/string.h>
41 #include <linux/types.h>
42 #include <linux/irq.h>
43 #include <linux/acpi.h>
44 #include <linux/efi.h>
45 #include <linux/mmzone.h>
46 #include <asm/io.h>
47 #include <asm/iosapic.h>
48 #include <asm/machvec.h>
49 #include <asm/page.h>
50 #include <asm/system.h>
51 #include <asm/numa.h>
52 #include <asm/sal.h>
53 #include <asm/hw_irq.h>
54 #ifdef XEN
55 #include <xen/errno.h>
56 #include <xen/nodemask.h>
57 extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
58 #endif
60 #define BAD_MADT_ENTRY(entry, end) ( \
61 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
62 ((struct acpi_subtable_header *)entry)->length != sizeof(*entry))
64 #define PREFIX "ACPI: "
66 void (*pm_idle) (void);
67 EXPORT_SYMBOL(pm_idle);
68 void (*pm_power_off) (void);
70 unsigned char acpi_kbd_controller_present = 1;
71 unsigned char acpi_legacy_devices;
73 const char *
74 acpi_get_sysname (void)
75 {
76 /* #ifdef CONFIG_IA64_GENERIC */
77 unsigned long rsdp_phys;
78 struct acpi_table_rsdp *rsdp;
79 struct acpi_table_xsdt *xsdt;
80 struct acpi_table_header *hdr;
82 rsdp_phys = acpi_find_rsdp();
83 if (!rsdp_phys) {
84 printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n");
85 return "dig";
86 }
88 rsdp = (struct acpi_table_rsdp *) __va(rsdp_phys);
89 if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) {
90 printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
91 return "dig";
92 }
94 xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_physical_address);
95 hdr = &xsdt->header;
96 if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) {
97 printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
98 return "dig";
99 }
101 if (!strcmp(hdr->oem_id, "HP")) {
102 return "hpzx1";
103 }
104 else if (!strcmp(hdr->oem_id, "SGI")) {
105 return "sn2";
106 }
108 return "dig";
109 /*
110 #else
111 # if defined (CONFIG_IA64_HP_SIM)
112 return "hpsim";
113 # elif defined (CONFIG_IA64_HP_ZX1)
114 return "hpzx1";
115 # elif defined (CONFIG_IA64_SGI_SN2)
116 return "sn2";
117 # elif defined (CONFIG_IA64_DIG)
118 return "dig";
119 # else
120 # error Unknown platform. Fix acpi.c.
121 # endif
122 #endif
123 */
124 }
126 #ifdef CONFIG_ACPI_BOOT
128 #define ACPI_MAX_PLATFORM_INTERRUPTS 256
130 /* Array to record platform interrupt vectors for generic interrupt routing. */
131 int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = {
132 [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1
133 };
135 enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
137 /*
138 * Interrupt routing API for device drivers. Provides interrupt vector for
139 * a generic platform event. Currently only CPEI is implemented.
140 */
141 int
142 acpi_request_vector (u32 int_type)
143 {
144 int vector = -1;
146 if (int_type < ACPI_MAX_PLATFORM_INTERRUPTS) {
147 /* corrected platform error interrupt */
148 vector = platform_intr_list[int_type];
149 } else
150 printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n");
151 return vector;
152 }
154 char *
155 __acpi_map_table (unsigned long phys_addr, unsigned long size)
156 {
157 return __va(phys_addr);
158 }
160 /* --------------------------------------------------------------------------
161 Boot-time Table Parsing
162 -------------------------------------------------------------------------- */
164 static int total_cpus __initdata;
165 static int available_cpus __initdata;
166 struct acpi_table_madt * acpi_madt __initdata;
167 static u8 has_8259;
169 static int __init
170 acpi_parse_lapic_addr_ovr (
171 struct acpi_subtable_header *header, const unsigned long end)
172 {
173 struct acpi_table_lapic_addr_ovr *lapic;
175 lapic = (struct acpi_table_lapic_addr_ovr *) header;
177 if (BAD_MADT_ENTRY(lapic, end))
178 return -EINVAL;
180 acpi_table_print_madt_entry(header);
182 if (lapic->address) {
183 iounmap((void *) ipi_base_addr);
184 ipi_base_addr = (void __iomem *) ioremap(lapic->address, 0);
185 }
186 return 0;
187 }
190 static int __init
191 acpi_parse_lsapic (struct acpi_subtable_header *header, const unsigned long end)
192 {
193 struct acpi_table_lsapic *lsapic;
195 lsapic = (struct acpi_table_lsapic *) header;
197 if (BAD_MADT_ENTRY(lsapic, end))
198 return -EINVAL;
200 acpi_table_print_madt_entry(header);
202 printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid);
204 if (!lsapic->flags.enabled)
205 printk(" disabled");
206 else {
207 printk(" enabled");
208 #ifdef CONFIG_SMP
209 if (available_cpus < NR_CPUS) {
210 smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid;
211 if (hard_smp_processor_id()
212 == (unsigned int) smp_boot_data.cpu_phys_id[available_cpus])
213 printk(" (BSP)");
214 ++available_cpus;
215 } else {
216 printk(" - however, ignored...");
217 }
218 #else
219 ++available_cpus;
220 #endif
221 }
223 printk("\n");
225 total_cpus++;
226 return 0;
227 }
230 static int __init
231 acpi_parse_lapic_nmi (struct acpi_subtable_header *header, const unsigned long end)
232 {
233 struct acpi_table_lapic_nmi *lacpi_nmi;
235 lacpi_nmi = (struct acpi_table_lapic_nmi*) header;
237 if (BAD_MADT_ENTRY(lacpi_nmi, end))
238 return -EINVAL;
240 acpi_table_print_madt_entry(header);
242 /* TBD: Support lapic_nmi entries */
243 return 0;
244 }
247 static int __init
248 acpi_parse_iosapic (struct acpi_subtable_header *header, const unsigned long end)
249 {
250 struct acpi_table_iosapic *iosapic;
252 iosapic = (struct acpi_table_iosapic *) header;
254 if (BAD_MADT_ENTRY(iosapic, end))
255 return -EINVAL;
257 acpi_table_print_madt_entry(header);
259 iosapic_init(iosapic->address, iosapic->global_irq_base);
261 return 0;
262 }
264 static int __init
265 acpi_parse_plat_int_src (
266 struct acpi_subtable_header *header, const unsigned long end)
267 {
268 struct acpi_table_plat_int_src *plintsrc;
269 int vector;
271 plintsrc = (struct acpi_table_plat_int_src *) header;
273 if (BAD_MADT_ENTRY(plintsrc, end))
274 return -EINVAL;
276 acpi_table_print_madt_entry(header);
278 /*
279 * Get vector assignment for this interrupt, set attributes,
280 * and program the IOSAPIC routing table.
281 */
282 vector = iosapic_register_platform_intr(plintsrc->type,
283 plintsrc->global_irq,
284 plintsrc->iosapic_vector,
285 plintsrc->eid,
286 plintsrc->id,
287 (plintsrc->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
288 (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
290 platform_intr_list[plintsrc->type] = vector;
291 return 0;
292 }
295 static int __init
296 acpi_parse_int_src_ovr (
297 struct acpi_subtable_header *header, const unsigned long end)
298 {
299 struct acpi_table_int_src_ovr *p;
301 p = (struct acpi_table_int_src_ovr *) header;
303 if (BAD_MADT_ENTRY(p, end))
304 return -EINVAL;
306 acpi_table_print_madt_entry(header);
308 iosapic_override_isa_irq(p->bus_irq, p->global_irq,
309 (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
310 (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
311 return 0;
312 }
314 static int __init
315 acpi_parse_nmi_src (struct acpi_subtable_header *header, const unsigned long end)
316 {
317 struct acpi_table_nmi_src *nmi_src;
319 nmi_src = (struct acpi_table_nmi_src*) header;
321 if (BAD_MADT_ENTRY(nmi_src, end))
322 return -EINVAL;
324 acpi_table_print_madt_entry(header);
326 /* TBD: Support nimsrc entries */
327 return 0;
328 }
329 /* Hook from generic ACPI tables.c */
330 void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
331 {
332 if (!strncmp(oem_id, "IBM", 3) &&
333 (!strncmp(oem_table_id, "SERMOW", 6))){
335 /* Unfortunatly ITC_DRIFT is not yet part of the
336 * official SAL spec, so the ITC_DRIFT bit is not
337 * set by the BIOS on this hardware.
338 */
339 sal_platform_features |= IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT;
341 #if 0
342 /*Start cyclone clock*/
343 cyclone_setup(0);
344 #endif
345 }
346 }
348 static int __init
349 acpi_parse_madt (struct acpi_table_header *table)
350 {
351 acpi_madt = (struct acpi_table_madt *)table;
353 /* remember the value for reference after free_initmem() */
354 #ifdef CONFIG_ITANIUM
355 has_8259 = 1; /* Firmware on old Itanium systems is broken */
356 #else
357 has_8259 = acpi_madt->flags & ACPI_MADT_PCAT_COMPAT;
358 #endif
359 iosapic_system_init(has_8259);
361 /* Get base address of IPI Message Block */
363 if (acpi_madt->address)
364 ipi_base_addr = (void __iomem *)ioremap(acpi_madt->address, 0);
366 printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
368 acpi_madt_oem_check(acpi_madt->header.oem_id,
369 acpi_madt->header.oem_table_id);
371 return 0;
372 }
374 #ifdef CONFIG_ACPI_NUMA
376 #undef SLIT_DEBUG
378 #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
380 static int __initdata srat_num_cpus; /* number of cpus */
381 static u32 __initdata pxm_flag[PXM_FLAG_LEN];
382 #define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag))
383 #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag))
384 /* maps to convert between proximity domain and logical node ID */
385 int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
386 int __initdata nid_to_pxm_map[MAX_NUMNODES];
387 static struct acpi_table_slit __initdata *slit_table;
389 #define NID_INVAL -1
390 #define PXM_INVAL -1
392 int __init pxm_to_node(int pxm)
393 {
394 if (pxm < 0)
395 return NID_INVAL;
396 return pxm_to_nid_map[pxm];
397 }
399 int __init node_to_pxm(int node)
400 {
401 if (node < 0)
402 return PXM_INVAL;
403 return nid_to_pxm_map[node];
404 }
407 /*
408 * ACPI 2.0 SLIT (System Locality Information Table)
409 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
410 */
411 void __init
412 acpi_numa_slit_init (struct acpi_table_slit *slit)
413 {
414 u32 len;
416 len = sizeof(struct acpi_table_header) + 8
417 + slit->locality_count * slit->locality_count;
418 if (slit->header.length != len) {
419 printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
420 len, slit->header.length);
421 memset(numa_slit, 10, sizeof(numa_slit));
422 return;
423 }
424 slit_table = slit;
425 }
427 void __init
428 acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa)
429 {
430 /* record this node in proximity bitmap */
431 pxm_bit_set(pa->proximity_domain);
433 node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid);
434 /* nid should be overridden as logical node id later */
435 node_cpuid[srat_num_cpus].nid = pa->proximity_domain;
436 srat_num_cpus++;
437 }
439 void __init
440 acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
441 {
442 unsigned long paddr, size;
443 u8 pxm;
444 struct node_memblk_s *p, *q, *pend;
446 pxm = ma->proximity_domain;
448 /* fill node memory chunk structure */
449 paddr = ma->base_addr_hi;
450 paddr = (paddr << 32) | ma->base_addr_lo;
451 size = ma->length_hi;
452 size = (size << 32) | ma->length_lo;
454 /* Ignore disabled entries */
455 if (!ma->flags.enabled)
456 return;
458 /* record this node in proximity bitmap */
459 pxm_bit_set(pxm);
461 /* Insertion sort based on base address */
462 pend = &node_memblk[num_node_memblks];
463 for (p = &node_memblk[0]; p < pend; p++) {
464 if (paddr < p->start_paddr)
465 break;
466 }
467 if (p < pend) {
468 for (q = pend - 1; q >= p; q--)
469 *(q + 1) = *q;
470 }
471 p->start_paddr = paddr;
472 p->size = size;
473 p->nid = pxm;
474 num_node_memblks++;
475 }
477 static unsigned int numnodes;
478 void __init
479 acpi_numa_arch_fixup (void)
480 {
481 int i, j, node_from, node_to;
483 /* If there's no SRAT, fix the phys_id */
484 if (srat_num_cpus == 0) {
485 node_cpuid[0].phys_id = hard_smp_processor_id();
486 return;
487 }
489 /* calculate total number of nodes in system from PXM bitmap */
490 numnodes = 0; /* init total nodes in system */
492 memset(pxm_to_nid_map, PXM_INVAL, sizeof(pxm_to_nid_map));
493 memset(nid_to_pxm_map, NID_INVAL, sizeof(nid_to_pxm_map));
494 for (i = 0; i < MAX_PXM_DOMAINS; i++) {
495 if (pxm_bit_test(i)) {
496 pxm_to_nid_map[i] = numnodes;
497 node_set_online(numnodes);
498 nid_to_pxm_map[numnodes++] = i;
499 }
500 }
502 /* set logical node id in memory chunk structure */
503 for (i = 0; i < num_node_memblks; i++)
504 node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid];
506 /* assign memory bank numbers for each chunk on each node */
507 for (i = 0; i < numnodes; i++) {
508 int bank;
510 bank = 0;
511 for (j = 0; j < num_node_memblks; j++)
512 if (node_memblk[j].nid == i)
513 node_memblk[j].bank = bank++;
514 }
516 /* set logical node id in cpu structure */
517 for (i = 0; i < srat_num_cpus; i++)
518 node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
520 printk(KERN_INFO "Number of logical nodes in system = %d\n",
521 numnodes);
522 printk(KERN_INFO "Number of memory chunks in system = %d\n",
523 num_node_memblks);
525 if (!slit_table)
526 return;
527 memset(numa_slit, -1, sizeof(numa_slit));
528 for (i = 0; i < slit_table->locality_count; i++) {
529 if (!pxm_bit_test(i))
530 continue;
531 node_from = pxm_to_nid_map[i];
532 for (j=0; j < slit_table->locality_count; j++) {
533 if (!pxm_bit_test(j))
534 continue;
535 node_to = pxm_to_nid_map[j];
536 node_distance(node_from, node_to) =
537 slit_table->entry[i * slit_table->locality_count + j];
538 }
539 }
541 #ifdef SLIT_DEBUG
542 printk("ACPI 2.0 SLIT locality table:\n");
543 for (i = 0; i < numnodes; i++) {
544 for (j = 0; j < numnodes; j++)
545 printk("%03d ", node_distance(i,j));
546 printk("\n");
547 }
548 #endif
549 }
550 #endif /* CONFIG_ACPI_NUMA */
552 #if 0
553 unsigned int
554 acpi_register_gsi (u32 gsi, int polarity, int trigger)
555 {
556 return acpi_register_irq(gsi, polarity, trigger);
557 }
558 EXPORT_SYMBOL(acpi_register_gsi);
559 #endif
560 static int __init
561 acpi_parse_fadt (struct acpi_table_header *table)
562 {
563 struct acpi_table_header *fadt_header;
564 struct acpi_table_fadt *fadt;
566 fadt_header = (struct acpi_table_header *)table;
567 if (fadt_header->revision != 3)
568 return -ENODEV; /* Only deal with ACPI 2.0 FADT */
570 fadt = (struct acpi_table_fadt *) fadt_header;
572 if (!(fadt->boot_flags & BAF_8042_KEYBOARD_CONTROLLER))
573 acpi_kbd_controller_present = 0;
575 if (fadt->boot_flags & BAF_LEGACY_DEVICES)
576 acpi_legacy_devices = 1;
578 #if 0
579 acpi_register_gsi(fadt->sci_interrupt, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE);
580 #endif
581 return 0;
582 }
584 unsigned long __init
585 acpi_find_rsdp (void)
586 {
587 unsigned long rsdp_phys = 0;
589 if (efi.acpi20)
590 rsdp_phys = __pa(efi.acpi20);
591 else if (efi.acpi)
592 printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n");
593 return rsdp_phys;
594 }
596 int __init
597 acpi_boot_init (void)
598 {
600 /*
601 * MADT
602 * ----
603 * Parse the Multiple APIC Description Table (MADT), if exists.
604 * Note that this table provides platform SMP configuration
605 * information -- the successor to MPS tables.
606 */
608 if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) {
609 printk(KERN_ERR PREFIX "Can't find MADT\n");
610 goto skip_madt;
611 }
613 /* Local APIC */
615 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
616 printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
618 if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1)
619 printk(KERN_ERR PREFIX "Error parsing MADT - no LSAPIC entries\n");
621 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0)
622 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
624 /* I/O APIC */
626 if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
627 printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n");
629 /* System-Level Interrupt Routing */
631 if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
632 printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n");
634 if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
635 printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
637 if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
638 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
639 skip_madt:
641 /*
642 * FADT says whether a legacy keyboard controller is present.
643 * The FADT also contains an SCI_INT line, by which the system
644 * gets interrupts such as power and sleep buttons. If it's not
645 * on a Legacy interrupt, it needs to be setup.
646 */
647 if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt))
648 printk(KERN_ERR PREFIX "Can't find FADT\n");
650 #ifdef CONFIG_SMP
651 if (available_cpus == 0) {
652 printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
653 printk(KERN_INFO "CPU 0 (0x%04x)\n", hard_smp_processor_id());
654 smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id();
655 available_cpus = 1; /* We've got at least one of these, no? */
656 }
657 smp_boot_data.cpu_count = available_cpus;
659 smp_build_cpu_map();
660 # ifdef CONFIG_ACPI_NUMA
661 if (srat_num_cpus == 0) {
662 int cpu, i = 1;
663 for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++)
664 if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
665 node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
666 }
667 build_cpu_to_node_map();
668 # endif
669 #endif
670 /* Make boot-up look pretty */
671 printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
672 return 0;
673 }
675 int
676 acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
677 {
678 int vector;
680 if (has_8259 && gsi < 16)
681 *irq = isa_irq_to_vector(gsi);
682 else {
683 vector = gsi_to_vector(gsi);
684 if (vector == -1)
685 return -1;
687 *irq = vector;
688 }
689 return 0;
690 }
691 #if 0
692 int
693 acpi_register_irq (u32 gsi, u32 polarity, u32 trigger)
694 {
695 if (has_8259 && gsi < 16)
696 return isa_irq_to_vector(gsi);
698 return iosapic_register_intr(gsi,
699 (polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
700 (trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
701 }
702 EXPORT_SYMBOL(acpi_register_irq);
703 #endif
704 #endif /* CONFIG_ACPI_BOOT */