debuggers.hg

view xen/arch/x86/genapic/x2apic.c @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children f875aaa791f0
line source
1 /*
2 * x2APIC driver.
3 *
4 * Copyright (c) 2008, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 */
20 #include <xen/cpumask.h>
21 #include <asm/apicdef.h>
22 #include <asm/genapic.h>
23 #include <xen/smp.h>
24 #include <asm/mach-default/mach_mpparse.h>
26 __init int probe_x2apic(void)
27 {
28 return x2apic_is_available();
29 }
31 struct genapic apic_x2apic= {
32 APIC_INIT("x2apic", probe_x2apic),
33 GENAPIC_X2APIC
34 };
36 void init_apic_ldr_x2apic(void)
37 {
38 /* We only use physical delivery mode. */
39 return;
40 }
42 void clustered_apic_check_x2apic(void)
43 {
44 /* We only use physical delivery mode. */
45 return;
46 }
48 cpumask_t target_cpus_x2apic(void)
49 {
50 /* Deliver interrupts only to CPU0 for now */
51 return cpumask_of_cpu(0);
52 }
54 unsigned int cpu_mask_to_apicid_x2apic(cpumask_t cpumask)
55 {
56 return cpu_physical_id(first_cpu(cpumask));
57 }
59 void send_IPI_mask_x2apic(cpumask_t cpumask, int vector)
60 {
61 unsigned int query_cpu;
62 u32 cfg, dest;
63 unsigned long flags;
65 ASSERT(cpus_subset(cpumask, cpu_online_map));
66 ASSERT(!cpus_empty(cpumask));
68 local_irq_save(flags);
70 cfg = APIC_DM_FIXED | 0 /* no shorthand */ | APIC_DEST_PHYSICAL | vector;
71 for_each_cpu_mask(query_cpu, cpumask)
72 {
73 dest = cpu_physical_id(query_cpu);
74 apic_icr_write(cfg, dest);
75 }
77 local_irq_restore(flags);
78 }