ia64/xen-unstable

view xen/arch/ia64/xen/acpi.c @ 8432:934470721c46

Remove acpi_count_madt functions. Only appear to be used
for diagnostic tracing in xen/ia64.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Dec 21 20:18:19 2005 +0100 (2005-12-21)
parents 03ea37841682
children 0b0be946cf9c
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 = (unsigned long) 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 int vector;
270 plintsrc = (struct acpi_table_plat_int_src *) header;
272 if (BAD_MADT_ENTRY(plintsrc, end))
273 return -EINVAL;
275 acpi_table_print_madt_entry(header);
277 #if 0
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 #endif
292 return 0;
293 }
296 static int __init
297 acpi_parse_int_src_ovr (
298 acpi_table_entry_header *header, const unsigned long end)
299 {
300 struct acpi_table_int_src_ovr *p;
302 p = (struct acpi_table_int_src_ovr *) header;
304 if (BAD_MADT_ENTRY(p, end))
305 return -EINVAL;
307 acpi_table_print_madt_entry(header);
309 #if 0
310 iosapic_override_isa_irq(p->bus_irq, p->global_irq,
311 (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
312 (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
313 #endif
314 return 0;
315 }
317 static int __init
318 acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
319 {
320 struct acpi_table_nmi_src *nmi_src;
322 nmi_src = (struct acpi_table_nmi_src*) header;
324 if (BAD_MADT_ENTRY(nmi_src, end))
325 return -EINVAL;
327 acpi_table_print_madt_entry(header);
329 /* TBD: Support nimsrc entries */
330 return 0;
331 }
332 /* Hook from generic ACPI tables.c */
333 void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
334 {
335 if (!strncmp(oem_id, "IBM", 3) &&
336 (!strncmp(oem_table_id, "SERMOW", 6))){
338 /* Unfortunatly ITC_DRIFT is not yet part of the
339 * official SAL spec, so the ITC_DRIFT bit is not
340 * set by the BIOS on this hardware.
341 */
342 sal_platform_features |= IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT;
344 #if 0
345 /*Start cyclone clock*/
346 cyclone_setup(0);
347 #endif
348 }
349 }
351 static int __init
352 acpi_parse_madt (unsigned long phys_addr, unsigned long size)
353 {
354 if (!phys_addr || !size)
355 return -EINVAL;
357 acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
359 /* remember the value for reference after free_initmem() */
360 #ifdef CONFIG_ITANIUM
361 has_8259 = 1; /* Firmware on old Itanium systems is broken */
362 #else
363 has_8259 = acpi_madt->flags.pcat_compat;
364 #endif
365 #if 0
366 iosapic_system_init(has_8259);
367 #endif
369 /* Get base address of IPI Message Block */
371 if (acpi_madt->lapic_address)
372 ipi_base_addr = (unsigned long) ioremap(acpi_madt->lapic_address, 0);
374 printk(KERN_INFO PREFIX "Local APIC address 0x%lx\n", ipi_base_addr);
376 acpi_madt_oem_check(acpi_madt->header.oem_id,
377 acpi_madt->header.oem_table_id);
379 return 0;
380 }
382 #ifdef CONFIG_ACPI_NUMA
384 #undef SLIT_DEBUG
386 #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
388 static int __initdata srat_num_cpus; /* number of cpus */
389 static u32 __initdata pxm_flag[PXM_FLAG_LEN];
390 #define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag))
391 #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag))
392 /* maps to convert between proximity domain and logical node ID */
393 int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
394 int __initdata nid_to_pxm_map[MAX_NUMNODES];
395 static struct acpi_table_slit __initdata *slit_table;
397 /*
398 * ACPI 2.0 SLIT (System Locality Information Table)
399 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
400 */
401 void __init
402 acpi_numa_slit_init (struct acpi_table_slit *slit)
403 {
404 u32 len;
406 len = sizeof(struct acpi_table_header) + 8
407 + slit->localities * slit->localities;
408 if (slit->header.length != len) {
409 printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
410 len, slit->header.length);
411 memset(numa_slit, 10, sizeof(numa_slit));
412 return;
413 }
414 slit_table = slit;
415 }
417 void __init
418 acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa)
419 {
420 /* record this node in proximity bitmap */
421 pxm_bit_set(pa->proximity_domain);
423 node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid);
424 /* nid should be overridden as logical node id later */
425 node_cpuid[srat_num_cpus].nid = pa->proximity_domain;
426 srat_num_cpus++;
427 }
429 void __init
430 acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
431 {
432 unsigned long paddr, size;
433 u8 pxm;
434 struct node_memblk_s *p, *q, *pend;
436 pxm = ma->proximity_domain;
438 /* fill node memory chunk structure */
439 paddr = ma->base_addr_hi;
440 paddr = (paddr << 32) | ma->base_addr_lo;
441 size = ma->length_hi;
442 size = (size << 32) | ma->length_lo;
444 /* Ignore disabled entries */
445 if (!ma->flags.enabled)
446 return;
448 /* record this node in proximity bitmap */
449 pxm_bit_set(pxm);
451 /* Insertion sort based on base address */
452 pend = &node_memblk[num_node_memblks];
453 for (p = &node_memblk[0]; p < pend; p++) {
454 if (paddr < p->start_paddr)
455 break;
456 }
457 if (p < pend) {
458 for (q = pend - 1; q >= p; q--)
459 *(q + 1) = *q;
460 }
461 p->start_paddr = paddr;
462 p->size = size;
463 p->nid = pxm;
464 num_node_memblks++;
465 }
467 void __init
468 acpi_numa_arch_fixup (void)
469 {
470 int i, j, node_from, node_to;
472 /* If there's no SRAT, fix the phys_id */
473 if (srat_num_cpus == 0) {
474 node_cpuid[0].phys_id = hard_smp_processor_id();
475 return;
476 }
478 /* calculate total number of nodes in system from PXM bitmap */
479 numnodes = 0; /* init total nodes in system */
481 memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map));
482 memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map));
483 for (i = 0; i < MAX_PXM_DOMAINS; i++) {
484 if (pxm_bit_test(i)) {
485 pxm_to_nid_map[i] = numnodes;
486 node_set_online(numnodes);
487 nid_to_pxm_map[numnodes++] = i;
488 }
489 }
491 /* set logical node id in memory chunk structure */
492 for (i = 0; i < num_node_memblks; i++)
493 node_memblk[i].nid = pxm_to_nid_map[node_memblk[i].nid];
495 /* assign memory bank numbers for each chunk on each node */
496 for (i = 0; i < numnodes; i++) {
497 int bank;
499 bank = 0;
500 for (j = 0; j < num_node_memblks; j++)
501 if (node_memblk[j].nid == i)
502 node_memblk[j].bank = bank++;
503 }
505 /* set logical node id in cpu structure */
506 for (i = 0; i < srat_num_cpus; i++)
507 node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
509 printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes);
510 printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
512 if (!slit_table) return;
513 memset(numa_slit, -1, sizeof(numa_slit));
514 for (i=0; i<slit_table->localities; i++) {
515 if (!pxm_bit_test(i))
516 continue;
517 node_from = pxm_to_nid_map[i];
518 for (j=0; j<slit_table->localities; j++) {
519 if (!pxm_bit_test(j))
520 continue;
521 node_to = pxm_to_nid_map[j];
522 node_distance(node_from, node_to) =
523 slit_table->entry[i*slit_table->localities + j];
524 }
525 }
527 #ifdef SLIT_DEBUG
528 printk("ACPI 2.0 SLIT locality table:\n");
529 for (i = 0; i < numnodes; i++) {
530 for (j = 0; j < numnodes; j++)
531 printk("%03d ", node_distance(i,j));
532 printk("\n");
533 }
534 #endif
535 }
536 #endif /* CONFIG_ACPI_NUMA */
538 #if 0
539 unsigned int
540 acpi_register_gsi (u32 gsi, int polarity, int trigger)
541 {
542 return acpi_register_irq(gsi, polarity, trigger);
543 }
544 EXPORT_SYMBOL(acpi_register_gsi);
545 #endif
546 static int __init
547 acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
548 {
549 struct acpi_table_header *fadt_header;
550 struct fadt_descriptor_rev2 *fadt;
552 if (!phys_addr || !size)
553 return -EINVAL;
555 fadt_header = (struct acpi_table_header *) __va(phys_addr);
556 if (fadt_header->revision != 3)
557 return -ENODEV; /* Only deal with ACPI 2.0 FADT */
559 fadt = (struct fadt_descriptor_rev2 *) fadt_header;
561 if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
562 acpi_kbd_controller_present = 0;
564 if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
565 acpi_legacy_devices = 1;
567 #if 0
568 acpi_register_gsi(fadt->sci_int, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE);
569 #endif
570 return 0;
571 }
573 unsigned long __init
574 acpi_find_rsdp (void)
575 {
576 unsigned long rsdp_phys = 0;
578 if (efi.acpi20)
579 rsdp_phys = __pa(efi.acpi20);
580 else if (efi.acpi)
581 printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n");
582 return rsdp_phys;
583 }
585 int __init
586 acpi_boot_init (void)
587 {
589 /*
590 * MADT
591 * ----
592 * Parse the Multiple APIC Description Table (MADT), if exists.
593 * Note that this table provides platform SMP configuration
594 * information -- the successor to MPS tables.
595 */
597 if (acpi_table_parse(ACPI_APIC, acpi_parse_madt) < 1) {
598 printk(KERN_ERR PREFIX "Can't find MADT\n");
599 goto skip_madt;
600 }
602 /* Local APIC */
604 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
605 printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
607 if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1)
608 printk(KERN_ERR PREFIX "Error parsing MADT - no LSAPIC entries\n");
610 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0)
611 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
613 /* I/O APIC */
615 if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
616 printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n");
618 /* System-Level Interrupt Routing */
620 if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
621 printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n");
623 if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
624 printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
626 if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
627 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
628 skip_madt:
630 /*
631 * FADT says whether a legacy keyboard controller is present.
632 * The FADT also contains an SCI_INT line, by which the system
633 * gets interrupts such as power and sleep buttons. If it's not
634 * on a Legacy interrupt, it needs to be setup.
635 */
636 if (acpi_table_parse(ACPI_FADT, acpi_parse_fadt) < 1)
637 printk(KERN_ERR PREFIX "Can't find FADT\n");
639 #ifdef CONFIG_SMP
640 if (available_cpus == 0) {
641 printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
642 printk(KERN_INFO "CPU 0 (0x%04x)", hard_smp_processor_id());
643 smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id();
644 available_cpus = 1; /* We've got at least one of these, no? */
645 }
646 smp_boot_data.cpu_count = available_cpus;
648 smp_build_cpu_map();
649 # ifdef CONFIG_ACPI_NUMA
650 if (srat_num_cpus == 0) {
651 int cpu, i = 1;
652 for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++)
653 if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
654 node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
655 }
656 build_cpu_to_node_map();
657 # endif
658 #endif
659 /* Make boot-up look pretty */
660 printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
661 return 0;
662 }
663 #if 0
664 int
665 acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
666 {
667 int vector;
669 if (has_8259 && gsi < 16)
670 *irq = isa_irq_to_vector(gsi);
671 else {
672 vector = gsi_to_vector(gsi);
673 if (vector == -1)
674 return -1;
676 *irq = vector;
677 }
678 return 0;
679 }
681 int
682 acpi_register_irq (u32 gsi, u32 polarity, u32 trigger)
683 {
684 if (has_8259 && gsi < 16)
685 return isa_irq_to_vector(gsi);
687 return iosapic_register_intr(gsi,
688 (polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
689 (trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
690 }
691 EXPORT_SYMBOL(acpi_register_irq);
692 #endif
693 #endif /* CONFIG_ACPI_BOOT */