This source file includes following definitions.
- apic_write
- apic_read
- smp_processor_id
1 #ifndef __ASM_SMP_H
2 #define __ASM_SMP_H
3
4 #ifdef __SMP__
5 #ifndef ASSEMBLY
6
7 #include <asm/i82489.h>
8 #include <linux/tasks.h>
9 #include <linux/ptrace.h>
10
11
12
13
14
15
16
17
18
19
20
21 #define SMP_MAGIC_IDENT ('_'<<24)|('P'<<16)|('M'<<8)|'_'
22
23 struct intel_mp_floating
24 {
25 char mpf_signature[4];
26 unsigned long mpf_physptr;
27 unsigned char mpf_length;
28 unsigned char mpf_specification;
29 unsigned char mpf_checksum;
30 unsigned char mpf_feature1;
31 unsigned char mpf_feature2;
32 unsigned char mpf_feature3;
33 unsigned char mpf_feature4;
34 unsigned char mpf_feature5;
35 };
36
37 struct mp_config_table
38 {
39 char mpc_signature[4];
40 #define MPC_SIGNATURE "PCMP"
41 unsigned short mpc_length;
42 char mpc_spec;
43 char mpc_checksum;
44 char mpc_oem[8];
45 char mpc_productid[12];
46 unsigned long mpc_oemptr;
47 unsigned short mpc_oemsize;
48 unsigned short mpc_oemcount;
49 unsigned long mpc_lapic;
50 unsigned long reserved;
51 };
52
53
54
55 #define MP_PROCESSOR 0
56 #define MP_BUS 1
57 #define MP_IOAPIC 2
58 #define MP_INTSRC 3
59 #define MP_LINTSRC 4
60
61 struct mpc_config_processor
62 {
63 unsigned char mpc_type;
64 unsigned char mpc_apicid;
65 unsigned char mpc_apicver;
66 unsigned char mpc_cpuflag;
67 #define CPU_ENABLED 1
68 #define CPU_BOOTPROCESSOR 2
69 unsigned long mpc_cpufeature;
70 #define CPU_STEPPING_MASK 0x0F
71 #define CPU_MODEL_MASK 0xF0
72 #define CPU_FAMILY_MASK 0xF00
73 unsigned long mpc_featureflag;
74 unsigned long mpc_reserved[2];
75 };
76
77 struct mpc_config_bus
78 {
79 unsigned char mpc_type;
80 unsigned char mpc_busid;
81 unsigned char mpc_bustype[6] __attribute((packed));
82 };
83
84 #define BUSTYPE_EISA "EISA"
85 #define BUSTYPE_ISA "ISA"
86 #define BUSTYPE_INTERN "INTERN"
87 #define BUSTYPE_MCA "MCA"
88 #define BUSTYPE_VL "VL"
89 #define BUSTYPE_PCI "PCI"
90 #define BUSTYPE_PCMCIA "PCMCIA"
91
92
93
94 struct mpc_config_ioapic
95 {
96 unsigned char mpc_type;
97 unsigned char mpc_apicid;
98 unsigned char mpc_apicver;
99 unsigned char mpc_flags;
100 #define MPC_APIC_USABLE 0x01
101 unsigned long mpc_apicaddr;
102 };
103
104 struct mpc_config_intsrc
105 {
106 unsigned char mpc_type;
107 unsigned char mpc_irqtype;
108 unsigned short mpc_irqflag;
109 unsigned char mpc_srcbus;
110 unsigned char mpc_srcbusirq;
111 unsigned char mpc_dstapic;
112 unsigned char mpc_dstirq;
113 };
114
115 #define MP_INT_VECTORED 0
116 #define MP_INT_NMI 1
117 #define MP_INT_SMI 2
118 #define MP_INT_EXTINT 3
119
120 #define MP_IRQDIR_DEFAULT 0
121 #define MP_IRQDIR_HIGH 1
122 #define MP_IRQDIR_LOW 3
123
124
125 struct mpc_config_intlocal
126 {
127 unsigned char mpc_type;
128 unsigned char mpc_irqtype;
129 unsigned short mpc_irqflag;
130 unsigned char mpc_srcbusid;
131 unsigned char mpc_srcbusirq;
132 unsigned char mpc_destapic;
133 #define MP_APIC_ALL 0xFF
134 unsigned char mpc_destapiclint;
135 };
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154 struct cpuinfo_x86
155 {
156 char hard_math;
157 char x86;
158 char x86_model;
159 char x86_mask;
160 char x86_vendor_id[16];
161 int x86_capability;
162 int fdiv_bug;
163 char wp_works_ok;
164 char hlt_works_ok;
165 unsigned long udelay_val;
166 };
167
168
169 extern struct cpuinfo_x86 cpu_data[NR_CPUS];
170
171
172
173
174
175 extern void smp_scan_config(unsigned long, unsigned long);
176 extern unsigned long smp_alloc_memory(unsigned long mem_base);
177 extern unsigned char *apic_reg;
178 extern unsigned char *kernel_stacks[NR_CPUS];
179 extern unsigned char boot_cpu_id;
180 extern unsigned long cpu_present_map;
181 extern void smp_invalidate(void);
182 extern volatile unsigned long kernel_flag, kernel_counter;
183 extern volatile unsigned char active_kernel_processor;
184 extern void smp_message_irq(int cpl, struct pt_regs *regs);
185 extern void smp_reschedule_irq(int cpl, struct pt_regs *regs);
186 extern unsigned long ipi_count;
187 extern void smp_invalidate_rcv(void);
188 extern volatile unsigned long kernel_counter;
189 extern volatile unsigned long syscall_count;
190
191
192
193
194
195 extern void smp_callin(void);
196 extern void smp_boot_cpus(void);
197 extern void smp_store_cpu_info(int id);
198
199
200
201
202
203
204
205
206 extern __inline void apic_write(unsigned long reg, unsigned long v)
207 {
208 *((unsigned long *)(apic_reg+reg))=v;
209 }
210
211 extern __inline unsigned long apic_read(unsigned long reg)
212 {
213 return *((unsigned long *)(apic_reg+reg));
214 }
215
216
217
218
219
220
221
222
223 extern __inline int smp_processor_id(void)
224 {
225 return GET_APIC_ID(apic_read(APIC_ID));
226 }
227
228 #endif
229
230 #define NO_PROC_ID 0xFF
231
232
233
234
235
236
237
238
239
240
241
242 #define PROC_CHANGE_PENALTY 20
243
244 #endif
245 #endif