ia64/xen-unstable

view xen/arch/ia64/xen/acpi.c @ 9405:29dfadcc5029

[IA64] Followup to xen time cleanup

Clean up to xen time handler. Tristan #if 0 some code because it seems
redundant, which however is actually problematic logic as a reason for
an intermittent timer oops issue of dom0. So delete it now.

Also remove vcpu_wake, since wakeup current has nothing meaningful and
simply waste cpu cycle.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Mon Mar 27 15:32:08 2006 -0700 (2006-03-27)
parents 0b0be946cf9c
children de2dc4e7966a
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/cyclone.h>
55 #define BAD_MADT_ENTRY(entry, end) ( \
56 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
57 ((acpi_table_entry_header *)entry)->length != sizeof(*entry))
59 #define PREFIX "ACPI: "
61 void (*pm_idle) (void);
62 EXPORT_SYMBOL(pm_idle);
63 void (*pm_power_off) (void);
65 unsigned char acpi_kbd_controller_present = 1;
66 unsigned char acpi_legacy_devices;
68 const char *
69 acpi_get_sysname (void)
70 {
71 /* #ifdef CONFIG_IA64_GENERIC */
72 unsigned long rsdp_phys;
73 struct acpi20_table_rsdp *rsdp;
74 struct acpi_table_xsdt *xsdt;
75 struct acpi_table_header *hdr;
77 rsdp_phys = acpi_find_rsdp();
78 if (!rsdp_phys) {
79 printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n");
80 return "dig";
81 }
83 rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys);
84 if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) {
85 printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
86 return "dig";
87 }
89 xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address);
90 hdr = &xsdt->header;
91 if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) {
92 printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
93 return "dig";
94 }
96 if (!strcmp(hdr->oem_id, "HP")) {
97 return "hpzx1";
98 }
99 else if (!strcmp(hdr->oem_id, "SGI")) {
100 return "sn2";
101 }
103 return "dig";
104 /*
105 #else
106 # if defined (CONFIG_IA64_HP_SIM)
107 return "hpsim";
108 # elif defined (CONFIG_IA64_HP_ZX1)
109 return "hpzx1";
110 # elif defined (CONFIG_IA64_SGI_SN2)
111 return "sn2";
112 # elif defined (CONFIG_IA64_DIG)
113 return "dig";
114 # else
115 # error Unknown platform. Fix acpi.c.
116 # endif
117 #endif
118 */
119 }
121 #ifdef CONFIG_ACPI_BOOT
123 #define ACPI_MAX_PLATFORM_INTERRUPTS 256
124 #define NR_IOSAPICS 4
126 #if 0
127 /* Array to record platform interrupt vectors for generic interrupt routing. */
128 int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = {
129 [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1
130 };
132 enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
134 /*
135 * Interrupt routing API for device drivers. Provides interrupt vector for
136 * a generic platform event. Currently only CPEI is implemented.
137 */
138 int
139 acpi_request_vector (u32 int_type)
140 {
141 int vector = -1;
143 if (int_type < ACPI_MAX_PLATFORM_INTERRUPTS) {
144 /* corrected platform error interrupt */
145 vector = platform_intr_list[int_type];
146 } else
147 printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n");
148 return vector;
149 }
150 #endif
151 char *
152 __acpi_map_table (unsigned long phys_addr, unsigned long size)
153 {
154 return __va(phys_addr);
155 }
157 /* --------------------------------------------------------------------------
158 Boot-time Table Parsing
159 -------------------------------------------------------------------------- */
161 static int total_cpus __initdata;
162 static int available_cpus __initdata;
163 struct acpi_table_madt * acpi_madt __initdata;
164 static u8 has_8259;
166 static int __init
167 acpi_parse_lapic_addr_ovr (
168 acpi_table_entry_header *header, const unsigned long end)
169 {
170 struct acpi_table_lapic_addr_ovr *lapic;
172 lapic = (struct acpi_table_lapic_addr_ovr *) header;
174 if (BAD_MADT_ENTRY(lapic, end))
175 return -EINVAL;
177 acpi_table_print_madt_entry(header);
179 if (lapic->address) {
180 iounmap((void *) ipi_base_addr);
181 ipi_base_addr = (void __iomem *) ioremap(lapic->address, 0);
182 }
183 return 0;
184 }
187 static int __init
188 acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
189 {
190 struct acpi_table_lsapic *lsapic;
192 lsapic = (struct acpi_table_lsapic *) header;
194 if (BAD_MADT_ENTRY(lsapic, end))
195 return -EINVAL;
197 acpi_table_print_madt_entry(header);
199 printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid);
201 if (!lsapic->flags.enabled)
202 printk(" disabled");
203 else {
204 printk(" enabled");
205 #ifdef CONFIG_SMP
206 if (available_cpus < NR_CPUS) {
207 smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid;
208 if (hard_smp_processor_id()
209 == (unsigned int) smp_boot_data.cpu_phys_id[available_cpus])
210 printk(" (BSP)");
211 ++available_cpus;
212 } else {
213 printk(" - however, ignored...");
214 }
215 #else
216 ++available_cpus;
217 #endif
218 }
220 printk("\n");
222 total_cpus++;
223 return 0;
224 }
227 static int __init
228 acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
229 {
230 struct acpi_table_lapic_nmi *lacpi_nmi;
232 lacpi_nmi = (struct acpi_table_lapic_nmi*) header;
234 if (BAD_MADT_ENTRY(lacpi_nmi, end))
235 return -EINVAL;
237 acpi_table_print_madt_entry(header);
239 /* TBD: Support lapic_nmi entries */
240 return 0;
241 }
244 static int __init
245 acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
246 {
247 struct acpi_table_iosapic *iosapic;
249 iosapic = (struct acpi_table_iosapic *) header;
251 if (BAD_MADT_ENTRY(iosapic, end))
252 return -EINVAL;
254 acpi_table_print_madt_entry(header);
256 #if 0
257 iosapic_init(iosapic->address, iosapic->global_irq_base);
258 #endif
260 return 0;
261 }
263 static int __init
264 acpi_parse_plat_int_src (
265 acpi_table_entry_header *header, const unsigned long end)
266 {
267 struct acpi_table_plat_int_src *plintsrc;
268 #if 0
269 int vector;
270 #endif
272 plintsrc = (struct acpi_table_plat_int_src *) header;
274 if (BAD_MADT_ENTRY(plintsrc, end))
275 return -EINVAL;
277 acpi_table_print_madt_entry(header);
279 #if 0
280 /*
281 * Get vector assignment for this interrupt, set attributes,
282 * and program the IOSAPIC routing table.
283 */
284 vector = iosapic_register_platform_intr(plintsrc->type,
285 plintsrc->global_irq,
286 plintsrc->iosapic_vector,
287 plintsrc->eid,
288 plintsrc->id,
289 (plintsrc->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
290 (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
292 platform_intr_list[plintsrc->type] = vector;
293 #endif
294 return 0;
295 }
298 static int __init
299 acpi_parse_int_src_ovr (
300 acpi_table_entry_header *header, const unsigned long end)
301 {
302 struct acpi_table_int_src_ovr *p;
304 p = (struct acpi_table_int_src_ovr *) header;
306 if (BAD_MADT_ENTRY(p, end))
307 return -EINVAL;
309 acpi_table_print_madt_entry(header);
311 #if 0
312 iosapic_override_isa_irq(p->bus_irq, p->global_irq,
313 (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
314 (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
315 #endif
316 return 0;
317 }
319 static int __init
320 acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
321 {
322 struct acpi_table_nmi_src *nmi_src;
324 nmi_src = (struct acpi_table_nmi_src*) header;
326 if (BAD_MADT_ENTRY(nmi_src, end))
327 return -EINVAL;
329 acpi_table_print_madt_entry(header);
331 /* TBD: Support nimsrc entries */
332 return 0;
333 }
334 /* Hook from generic ACPI tables.c */
335 void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
336 {
337 if (!strncmp(oem_id, "IBM", 3) &&
338 (!strncmp(oem_table_id, "SERMOW", 6))){
340 /* Unfortunatly ITC_DRIFT is not yet part of the
341 * official SAL spec, so the ITC_DRIFT bit is not
342 * set by the BIOS on this hardware.
343 */
344 sal_platform_features |= IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT;
346 #if 0
347 /*Start cyclone clock*/
348 cyclone_setup(0);
349 #endif
350 }
351 }
353 static int __init
354 acpi_parse_madt (unsigned long phys_addr, unsigned long size)
355 {
356 if (!phys_addr || !size)
357 return -EINVAL;
359 acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
361 /* remember the value for reference after free_initmem() */
362 #ifdef CONFIG_ITANIUM
363 has_8259 = 1; /* Firmware on old Itanium systems is broken */
364 #else
365 has_8259 = acpi_madt->flags.pcat_compat;
366 #endif
367 #if 0
368 iosapic_system_init(has_8259);
369 #endif
371 /* Get base address of IPI Message Block */
373 if (acpi_madt->lapic_address)
374 ipi_base_addr = (void __iomem *) ioremap(acpi_madt->lapic_address, 0);
376 printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
378 acpi_madt_oem_check(acpi_madt->header.oem_id,
379 acpi_madt->header.oem_table_id);
381 return 0;
382 }
384 #ifdef CONFIG_ACPI_NUMA
386 #undef SLIT_DEBUG
388 #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
390 static int __initdata srat_num_cpus; /* number of cpus */
391 static u32 __initdata pxm_flag[PXM_FLAG_LEN];
392 #define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag))
393 #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag))
394 /* maps to convert between proximity domain and logical node ID */
395 int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
396 int __initdata nid_to_pxm_map[MAX_NUMNODES];
397 static struct acpi_table_slit __initdata *slit_table;
399 /*
400 * ACPI 2.0 SLIT (System Locality Information Table)
401 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
402 */
403 void __init
404 acpi_numa_slit_init (struct acpi_table_slit *slit)
405 {
406 u32 len;
408 len = sizeof(struct acpi_table_header) + 8
409 + slit->localities * slit->localities;
410 if (slit->header.length != len) {
411 printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
412 len, slit->header.length);
413 memset(numa_slit, 10, sizeof(numa_slit));
414 return;
415 }
416 slit_table = slit;
417 }
419 void __init
420 acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa)
421 {
422 /* record this node in proximity bitmap */
423 pxm_bit_set(pa->proximity_domain);
425 node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid);
426 /* nid should be overridden as logical node id later */
427 node_cpuid[srat_num_cpus].nid = pa->proximity_domain;
428 srat_num_cpus++;
429 }
431 void __init
432 acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
433 {
434 unsigned long paddr, size;
435 u8 pxm;
436 struct node_memblk_s *p, *q, *pend;
438 pxm = ma->proximity_domain;
440 /* fill node memory chunk structure */
441 paddr = ma->base_addr_hi;
442 paddr = (paddr << 32) | ma->base_addr_lo;
443 size = ma->length_hi;
444 size = (size << 32) | ma->length_lo;
446 /* Ignore disabled entries */
447 if (!ma->flags.enabled)
448 return;
450 /* record this node in proximity bitmap */
451 pxm_bit_set(pxm);
453 /* Insertion sort based on base address */
454 pend = &node_memblk[num_node_memblks];
455 for (p = &node_memblk[0]; p < pend; p++) {
456 if (paddr < p->start_paddr)
457 break;
458 }
459 if (p < pend) {
460 for (q = pend - 1; q >= p; q--)
461 *(q + 1) = *q;
462 }
463 p->start_paddr = paddr;
464 p->size = size;
465 p->nid = pxm;
466 num_node_memblks++;
467 }
469 void __init
470 acpi_numa_arch_fixup (void)
471 {
472 int i, j, node_from, node_to;
474 /* If there's no SRAT, fix the phys_id */
475 if (srat_num_cpus == 0) {
476 node_cpuid[0].phys_id = hard_smp_processor_id();
477 return;
478 }
480 /* calculate total number of nodes in system from PXM bitmap */
481 numnodes = 0; /* init total nodes in system */
483 memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map));
484 memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map));
485 for (i = 0; i < MAX_PXM_DOMAINS; i++) {
486 if (pxm_bit_test(i)) {
487 pxm_to_nid_map[i] = numnodes;
488 node_set_online(numnodes);
489 nid_to_pxm_map[numnodes++] = i;
490 }
491 }
493 /* set logical node id in memory chunk structure */
494 for (i = 0; i < num_node_memblks; i++)
495 node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid];
497 /* assign memory bank numbers for each chunk on each node */
498 for (i = 0; i < numnodes; i++) {
499 int bank;
501 bank = 0;
502 for (j = 0; j < num_node_memblks; j++)
503 if (node_memblk[j].nid == i)
504 node_memblk[j].bank = bank++;
505 }
507 /* set logical node id in cpu structure */
508 for (i = 0; i < srat_num_cpus; i++)
509 node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
511 printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes);
512 printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
514 if (!slit_table) return;
515 memset(numa_slit, -1, sizeof(numa_slit));
516 for (i=0; i<slit_table->localities; i++) {
517 if (!pxm_bit_test(i))
518 continue;
519 node_from = pxm_to_nid_map[i];
520 for (j=0; j<slit_table->localities; j++) {
521 if (!pxm_bit_test(j))
522 continue;
523 node_to = pxm_to_nid_map[j];
524 node_distance(node_from, node_to) =
525 slit_table->entry[i*slit_table->localities + j];
526 }
527 }
529 #ifdef SLIT_DEBUG
530 printk("ACPI 2.0 SLIT locality table:\n");
531 for (i = 0; i < numnodes; i++) {
532 for (j = 0; j < numnodes; j++)
533 printk("%03d ", node_distance(i,j));
534 printk("\n");
535 }
536 #endif
537 }
538 #endif /* CONFIG_ACPI_NUMA */
540 #if 0
541 unsigned int
542 acpi_register_gsi (u32 gsi, int polarity, int trigger)
543 {
544 return acpi_register_irq(gsi, polarity, trigger);
545 }
546 EXPORT_SYMBOL(acpi_register_gsi);
547 #endif
548 static int __init
549 acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
550 {
551 struct acpi_table_header *fadt_header;
552 struct fadt_descriptor_rev2 *fadt;
554 if (!phys_addr || !size)
555 return -EINVAL;
557 fadt_header = (struct acpi_table_header *) __va(phys_addr);
558 if (fadt_header->revision != 3)
559 return -ENODEV; /* Only deal with ACPI 2.0 FADT */
561 fadt = (struct fadt_descriptor_rev2 *) fadt_header;
563 if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
564 acpi_kbd_controller_present = 0;
566 if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
567 acpi_legacy_devices = 1;
569 #if 0
570 acpi_register_gsi(fadt->sci_int, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE);
571 #endif
572 return 0;
573 }
575 unsigned long __init
576 acpi_find_rsdp (void)
577 {
578 unsigned long rsdp_phys = 0;
580 if (efi.acpi20)
581 rsdp_phys = __pa(efi.acpi20);
582 else if (efi.acpi)
583 printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n");
584 return rsdp_phys;
585 }
587 int __init
588 acpi_boot_init (void)
589 {
591 /*
592 * MADT
593 * ----
594 * Parse the Multiple APIC Description Table (MADT), if exists.
595 * Note that this table provides platform SMP configuration
596 * information -- the successor to MPS tables.
597 */
599 if (acpi_table_parse(ACPI_APIC, acpi_parse_madt) < 1) {
600 printk(KERN_ERR PREFIX "Can't find MADT\n");
601 goto skip_madt;
602 }
604 /* Local APIC */
606 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
607 printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
609 if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1)
610 printk(KERN_ERR PREFIX "Error parsing MADT - no LSAPIC entries\n");
612 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0)
613 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
615 /* I/O APIC */
617 if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
618 printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n");
620 /* System-Level Interrupt Routing */
622 if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
623 printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n");
625 if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
626 printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
628 if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
629 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
630 skip_madt:
632 /*
633 * FADT says whether a legacy keyboard controller is present.
634 * The FADT also contains an SCI_INT line, by which the system
635 * gets interrupts such as power and sleep buttons. If it's not
636 * on a Legacy interrupt, it needs to be setup.
637 */
638 if (acpi_table_parse(ACPI_FADT, acpi_parse_fadt) < 1)
639 printk(KERN_ERR PREFIX "Can't find FADT\n");
641 #ifdef CONFIG_SMP
642 if (available_cpus == 0) {
643 printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
644 printk(KERN_INFO "CPU 0 (0x%04x)", hard_smp_processor_id());
645 smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id();
646 available_cpus = 1; /* We've got at least one of these, no? */
647 }
648 smp_boot_data.cpu_count = available_cpus;
650 smp_build_cpu_map();
651 # ifdef CONFIG_ACPI_NUMA
652 if (srat_num_cpus == 0) {
653 int cpu, i = 1;
654 for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++)
655 if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
656 node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
657 }
658 build_cpu_to_node_map();
659 # endif
660 #endif
661 /* Make boot-up look pretty */
662 printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
663 return 0;
664 }
665 #if 0
666 int
667 acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
668 {
669 int vector;
671 if (has_8259 && gsi < 16)
672 *irq = isa_irq_to_vector(gsi);
673 else {
674 vector = gsi_to_vector(gsi);
675 if (vector == -1)
676 return -1;
678 *irq = vector;
679 }
680 return 0;
681 }
683 int
684 acpi_register_irq (u32 gsi, u32 polarity, u32 trigger)
685 {
686 if (has_8259 && gsi < 16)
687 return isa_irq_to_vector(gsi);
689 return iosapic_register_intr(gsi,
690 (polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
691 (trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
692 }
693 EXPORT_SYMBOL(acpi_register_irq);
694 #endif
695 #endif /* CONFIG_ACPI_BOOT */