x86: Move mpc_oem_pci_bus to x86_init_ops
[deliverable/linux.git] / arch / x86 / include / asm / mpspec.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_MPSPEC_H
2#define _ASM_X86_MPSPEC_H
c2805aa1 3
86c9835b
IM
4#include <linux/init.h>
5
c2805aa1
TG
6#include <asm/mpspec_def.h>
7
11494547 8extern int apic_version[MAX_APICS];
a1ae299d 9extern int pic_mode;
11494547 10
96a388de 11#ifdef CONFIG_X86_32
b2af018f
IM
12
13/*
14 * Summit or generic (i.e. installer) kernels need lots of bus entries.
15 * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
16 */
17#if CONFIG_BASE_SMALL == 0
18# define MAX_MP_BUSSES 260
19#else
20# define MAX_MP_BUSSES 32
21#endif
22
23#define MAX_IRQ_SOURCES 256
c2805aa1 24
c2805aa1 25extern unsigned int def_to_bigsmp;
ae9d983b 26extern u8 apicid_2_node[];
c2805aa1 27
d49c4288
YL
28#ifdef CONFIG_X86_NUMAQ
29extern int mp_bus_id_to_node[MAX_MP_BUSSES];
30extern int mp_bus_id_to_local[MAX_MP_BUSSES];
31extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
32#endif
33
b2af018f 34#define MAX_APICID 256
ae9d983b 35
b2af018f 36#else /* CONFIG_X86_64: */
c2805aa1 37
b2af018f 38#define MAX_MP_BUSSES 256
c2805aa1 39/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */
b2af018f 40#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4)
c2805aa1 41
b2af018f 42#endif /* CONFIG_X86_64 */
ab530e1f 43
8643f9d0
YL
44extern void early_find_smp_config(void);
45extern void early_get_smp_config(void);
46
c0a282c2
AS
47#if defined(CONFIG_MCA) || defined(CONFIG_EISA)
48extern int mp_bus_id_to_type[MAX_MP_BUSSES];
49#endif
50
a6333c3c 51extern DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
c0a282c2 52
c2805aa1 53extern unsigned int boot_cpu_physical_apicid;
e0da3364 54extern unsigned int max_physical_apicid;
c2805aa1 55extern int smp_found_config;
c2805aa1
TG
56extern int mpc_default_type;
57extern unsigned long mp_lapic_addr;
58
c2805aa1 59extern void get_smp_config(void);
550fe4f1 60
af1cf204 61#ifdef CONFIG_X86_MPPARSE
550fe4f1 62extern void find_smp_config(void);
2944e16b 63extern void early_reserve_e820_mpc_new(void);
abfe0af9 64extern int enable_update_mptable;
fd6c6661 65extern int default_mpc_apic_id(struct mpc_cpu *m);
72302142 66extern void default_smp_read_mpc_oem(struct mpc_table *mpc);
af1cf204 67#else
550fe4f1 68static inline void find_smp_config(void) { }
af1cf204 69static inline void early_reserve_e820_mpc_new(void) { }
abfe0af9 70#define enable_update_mptable 0
fd6c6661 71#define default_mpc_apic_id NULL
72302142 72#define default_smp_read_mpc_oem NULL
af1cf204 73#endif
c2805aa1 74
903dcb5a 75void __cpuinit generic_processor_info(int apicid, int version);
c2805aa1 76#ifdef CONFIG_ACPI
a65d1d64 77extern void mp_register_ioapic(int id, u32 address, u32 gsi_base);
c2805aa1
TG
78extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
79 u32 gsi);
80extern void mp_config_acpi_legacy_irqs(void);
a2f809b0
YL
81struct device;
82extern int mp_register_gsi(struct device *dev, u32 gsi, int edge_level,
83 int active_high_low);
cc6c5006 84extern int acpi_probe_gsi(void);
835fc943 85#ifdef CONFIG_X86_IO_APIC
4924e228 86extern int mp_find_ioapic(int gsi);
c3e137d1 87extern int mp_find_ioapic_pin(int ioapic, int gsi);
835fc943 88#endif
cc6c5006
YL
89#else /* !CONFIG_ACPI: */
90static inline int acpi_probe_gsi(void)
91{
92 return 0;
93}
c2805aa1
TG
94#endif /* CONFIG_ACPI */
95
96#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
97
30971e17 98struct physid_mask {
c2805aa1
TG
99 unsigned long mask[PHYSID_ARRAY_SIZE];
100};
101
102typedef struct physid_mask physid_mask_t;
103
104#define physid_set(physid, map) set_bit(physid, (map).mask)
105#define physid_clear(physid, map) clear_bit(physid, (map).mask)
106#define physid_isset(physid, map) test_bit(physid, (map).mask)
30971e17 107#define physid_test_and_set(physid, map) \
c2805aa1
TG
108 test_and_set_bit(physid, (map).mask)
109
30971e17 110#define physids_and(dst, src1, src2) \
c2805aa1
TG
111 bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
112
30971e17 113#define physids_or(dst, src1, src2) \
c2805aa1
TG
114 bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
115
30971e17 116#define physids_clear(map) \
c2805aa1
TG
117 bitmap_zero((map).mask, MAX_APICS)
118
30971e17 119#define physids_complement(dst, src) \
c2805aa1
TG
120 bitmap_complement((dst).mask, (src).mask, MAX_APICS)
121
30971e17 122#define physids_empty(map) \
c2805aa1
TG
123 bitmap_empty((map).mask, MAX_APICS)
124
30971e17 125#define physids_equal(map1, map2) \
c2805aa1
TG
126 bitmap_equal((map1).mask, (map2).mask, MAX_APICS)
127
30971e17 128#define physids_weight(map) \
c2805aa1
TG
129 bitmap_weight((map).mask, MAX_APICS)
130
30971e17 131#define physids_shift_right(d, s, n) \
c2805aa1
TG
132 bitmap_shift_right((d).mask, (s).mask, n, MAX_APICS)
133
30971e17 134#define physids_shift_left(d, s, n) \
c2805aa1
TG
135 bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS)
136
137#define physids_coerce(map) ((map).mask[0])
138
139#define physids_promote(physids) \
140 ({ \
141 physid_mask_t __physid_mask = PHYSID_MASK_NONE; \
142 __physid_mask.mask[0] = physids; \
143 __physid_mask; \
144 })
145
b6df1b8b 146/* Note: will create very large stack frames if physid_mask_t is big */
c2805aa1
TG
147#define physid_mask_of_physid(physid) \
148 ({ \
149 physid_mask_t __physid_mask = PHYSID_MASK_NONE; \
150 physid_set(physid, __physid_mask); \
151 __physid_mask; \
152 })
153
b6df1b8b
JS
154static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map)
155{
156 physids_clear(*map);
157 physid_set(physid, *map);
158}
159
c2805aa1
TG
160#define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} }
161#define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} }
162
163extern physid_mask_t phys_cpu_present_map;
164
fb5b33c9
IM
165extern int generic_mps_oem_check(struct mpc_table *, char *, char *);
166
167extern int default_acpi_madt_oem_check(char *, char *);
168
1965aae3 169#endif /* _ASM_X86_MPSPEC_H */
This page took 0.198664 seconds and 5 git commands to generate.