Linux v2.6.15-rc6
[pohmelfs.git] / include / asm-i386 / mach-visws / mach_apic.h
blobde438c7147a8c3eb9c9805ee78418995d16b3490
1 #ifndef __ASM_MACH_APIC_H
2 #define __ASM_MACH_APIC_H
4 #include <mach_apicdef.h>
5 #include <asm/smp.h>
7 #define APIC_DFR_VALUE (APIC_DFR_FLAT)
9 #define no_balance_irq (0)
10 #define esr_disable (0)
12 #define INT_DELIVERY_MODE dest_LowestPrio
13 #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
15 #ifdef CONFIG_SMP
16 #define TARGET_CPUS cpu_online_map
17 #else
18 #define TARGET_CPUS cpumask_of_cpu(0)
19 #endif
21 #define check_apicid_used(bitmap, apicid) physid_isset(apicid, bitmap)
22 #define check_apicid_present(bit) physid_isset(bit, phys_cpu_present_map)
24 static inline int apic_id_registered(void)
26 return physid_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map);
30 * Set up the logical destination ID.
32 * Intel recommends to set DFR, LDR and TPR before enabling
33 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
34 * document number 292116). So here it goes...
36 static inline void init_apic_ldr(void)
38 unsigned long val;
40 apic_write_around(APIC_DFR, APIC_DFR_VALUE);
41 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
42 val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
43 apic_write_around(APIC_LDR, val);
46 static inline void summit_check(char *oem, char *productid)
50 static inline void clustered_apic_check(void)
54 /* Mapping from cpu number to logical apicid */
55 static inline int cpu_to_logical_apicid(int cpu)
57 return 1 << cpu;
60 static inline int cpu_present_to_apicid(int mps_cpu)
62 if (mps_cpu < get_physical_broadcast())
63 return mps_cpu;
64 else
65 return BAD_APICID;
68 static inline physid_mask_t apicid_to_cpu_present(int apicid)
70 return physid_mask_of_physid(apicid);
73 #define WAKE_SECONDARY_VIA_INIT
75 static inline void setup_portio_remap(void)
79 static inline void enable_apic_mode(void)
83 static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
85 return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
88 static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
90 return cpus_addr(cpumask)[0];
93 static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
95 return cpuid_apic >> index_msb;
98 #endif /* __ASM_MACH_APIC_H */