1 #ifndef __ASM_MACH_APIC_H
2 #define __ASM_MACH_APIC_H
3
4 #include <asm/apic.h>
5 #include <asm/io_apic.h>
6 #include <asm/genapic.h>
7 #include <asm/smp.h>
8
9 /* ESR was originally disabled in Linux for NUMA-Q. Do we really need to? */
10 #define esr_disable (0)
11
12 /* The following are dependent on APIC delivery mode (logical vs. physical). */
13 #define INT_DELIVERY_MODE (genapic->int_delivery_mode)
14 #define INT_DEST_MODE (genapic->int_dest_mode)
15 #define TARGET_CPUS (genapic->target_cpus())
16 #define init_apic_ldr (genapic->init_apic_ldr)
17 #define clustered_apic_check (genapic->clustered_apic_check)
18 #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
19 #define vector_allocation_cpumask(cpu) (genapic->vector_allocation_cpumask(cpu))
20
enable_apic_mode(void)21 static inline void enable_apic_mode(void)
22 {
23 /* Not needed for modern ES7000 which boot in Virtual Wire mode. */
24 /*es7000_sw_apic();*/
25 }
26
27 #define apicid_to_node(apicid) ((int)apicid_to_node[(u32)apicid])
28
29 extern u32 bios_cpu_apicid[];
30
multi_timer_check(int apic,int irq)31 static inline int multi_timer_check(int apic, int irq)
32 {
33 return 0;
34 }
35
36 extern void generic_apic_probe(void);
37 extern void generic_bigsmp_probe(void);
38
39 /*
40 * The following functions based around phys_cpu_present_map are disabled in
41 * some i386 Linux subarchitectures, and in x86_64 'cluster' genapic mode. I'm
42 * really not sure why, since all local APICs should have distinct physical
43 * IDs, and we need to know what they are.
44 */
apic_id_registered(void)45 static inline int apic_id_registered(void)
46 {
47 return physid_isset(get_apic_id(),
48 phys_cpu_present_map);
49 }
50
ioapic_phys_id_map(physid_mask_t * map)51 static inline void ioapic_phys_id_map(physid_mask_t *map)
52 {
53 *map = phys_cpu_present_map;
54 }
55
check_apicid_used(const physid_mask_t * map,int apicid)56 static inline int check_apicid_used(const physid_mask_t *map, int apicid)
57 {
58 return physid_isset(apicid, *map);
59 }
60
check_apicid_present(int apicid)61 static inline int check_apicid_present(int apicid)
62 {
63 return physid_isset(apicid, phys_cpu_present_map);
64 }
65
set_apicid(int phys_apicid,physid_mask_t * map)66 static inline void set_apicid(int phys_apicid, physid_mask_t *map)
67 {
68 physid_set(phys_apicid, *map);
69 }
70
71 #endif /* __ASM_MACH_APIC_H */
72