1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __ASM_I386_PROCESSOR_H
20 #define __ASM_I386_PROCESSOR_H
21 #include <asm/vm86.h>
22 #include <asm/math_emu.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #include <asm/segment.h>
25 #include <asm/page.h>
26 #include <asm/types.h>
27 #include <asm/sigcontext.h>
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #include <asm/cpufeature.h>
30 #include <asm/msr.h>
31 #include <asm/system.h>
32 #include <linux/cache.h>
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #include <linux/threads.h>
35 #include <asm/percpu.h>
36 #include <linux/cpumask.h>
37 #include <linux/init.h>
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #include <asm/processor-flags.h>
40 struct desc_struct {
41  unsigned long a,b;
42 };
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 #define desc_empty(desc)   (!((desc)->a | (desc)->b))
45 #define desc_equal(desc1, desc2)   (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
46 #define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
47 struct cpuinfo_x86 {
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  __u8 x86;
50  __u8 x86_vendor;
51  __u8 x86_model;
52  __u8 x86_mask;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  char wp_works_ok;
55  char hlt_works_ok;
56  char hard_math;
57  char rfu;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  int cpuid_level;
60  unsigned long x86_capability[NCAPINTS];
61  char x86_vendor_id[16];
62  char x86_model_id[64];
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  int x86_cache_size;
65  int x86_cache_alignment;
66  char fdiv_bug;
67  char f00f_bug;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  char coma_bug;
70  char pad0;
71  int x86_power;
72  unsigned long loops_per_jiffy;
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74  unsigned char x86_max_cores;
75  unsigned char apicid;
76  unsigned short x86_clflush_size;
77 } __attribute__((__aligned__(SMP_CACHE_BYTES)));
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define X86_VENDOR_INTEL 0
80 #define X86_VENDOR_CYRIX 1
81 #define X86_VENDOR_AMD 2
82 #define X86_VENDOR_UMC 3
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define X86_VENDOR_NEXGEN 4
85 #define X86_VENDOR_CENTAUR 5
86 #define X86_VENDOR_TRANSMETA 7
87 #define X86_VENDOR_NSC 8
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define X86_VENDOR_NUM 9
90 #define X86_VENDOR_UNKNOWN 0xff
91 #define cpu_data(cpu) boot_cpu_data
92 #define current_cpu_data boot_cpu_data
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define load_cr3(pgdir) write_cr3(__pa(pgdir))
95 #define TASK_SIZE (PAGE_OFFSET)
96 #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
97 #define HAVE_ARCH_PICK_MMAP_LAYOUT
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 #define IO_BITMAP_BITS 65536
100 #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
101 #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
102 #define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 #define INVALID_IO_BITMAP_OFFSET 0x8000
105 #define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000
106 struct i387_fsave_struct {
107  long cwd;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  long swd;
110  long twd;
111  long fip;
112  long fcs;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  long foo;
115  long fos;
116  long st_space[20];
117  long status;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 };
120 struct i387_fxsave_struct {
121  unsigned short cwd;
122  unsigned short swd;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124  unsigned short twd;
125  unsigned short fop;
126  long fip;
127  long fcs;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129  long foo;
130  long fos;
131  long mxcsr;
132  long mxcsr_mask;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134  long st_space[32];
135  long xmm_space[32];
136  long padding[56];
137 } __attribute__ ((aligned (16)));
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 struct i387_soft_struct {
140  long cwd;
141  long swd;
142  long twd;
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  long fip;
145  long fcs;
146  long foo;
147  long fos;
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149  long st_space[20];
150  unsigned char ftop, changed, lookahead, no_update, rm, alimit;
151  struct info *info;
152  unsigned long entry_eip;
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 };
155 union i387_union {
156  struct i387_fsave_struct fsave;
157  struct i387_fxsave_struct fxsave;
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159  struct i387_soft_struct soft;
160 };
161 typedef struct {
162  unsigned long seg;
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 } mm_segment_t;
165 struct thread_struct;
166 struct i386_hw_tss {
167  unsigned short back_link,__blh;
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169  unsigned long esp0;
170  unsigned short ss0,__ss0h;
171  unsigned long esp1;
172  unsigned short ss1,__ss1h;
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  unsigned long esp2;
175  unsigned short ss2,__ss2h;
176  unsigned long __cr3;
177  unsigned long eip;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  unsigned long eflags;
180  unsigned long eax,ecx,edx,ebx;
181  unsigned long esp;
182  unsigned long ebp;
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  unsigned long esi;
185  unsigned long edi;
186  unsigned short es, __esh;
187  unsigned short cs, __csh;
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  unsigned short ss, __ssh;
190  unsigned short ds, __dsh;
191  unsigned short fs, __fsh;
192  unsigned short gs, __gsh;
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194  unsigned short ldt, __ldth;
195  unsigned short trace, io_bitmap_base;
196 } __attribute__((packed));
197 struct tss_struct {
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199  struct i386_hw_tss x86_tss;
200  unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
201  unsigned long io_bitmap_max;
202  struct thread_struct *io_bitmap_owner;
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  unsigned long __cacheline_filler[35];
205  unsigned long stack[64];
206 } __attribute__((packed));
207 #define ARCH_MIN_TASKALIGN 16
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 struct thread_struct {
210  struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
211  unsigned long esp0;
212  unsigned long sysenter_cs;
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  unsigned long eip;
215  unsigned long esp;
216  unsigned long fs;
217  unsigned long gs;
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219  unsigned long debugreg[8];
220  unsigned long cr2, trap_no, error_code;
221  union i387_union i387;
222  struct vm86_struct __user * vm86_info;
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  unsigned long screen_bitmap;
225  unsigned long v86flags, v86mask, saved_esp0;
226  unsigned int saved_fs, saved_gs;
227  unsigned long *io_bitmap_ptr;
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229  unsigned long iopl;
230  unsigned long io_bitmap_max;
231 };
232 #define INIT_THREAD {   .esp0 = sizeof(init_stack) + (long)&init_stack,   .vm86_info = NULL,   .sysenter_cs = __KERNEL_CS,   .io_bitmap_ptr = NULL,   .fs = __KERNEL_PERCPU,  }
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 #define INIT_TSS {   .x86_tss = {   .esp0 = sizeof(init_stack) + (long)&init_stack,   .ss0 = __KERNEL_DS,   .ss1 = __KERNEL_CS,   .io_bitmap_base = INVALID_IO_BITMAP_OFFSET,   },   .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 },  }
235 #define start_thread(regs, new_eip, new_esp) do {   __asm__("movl %0,%%gs": :"r" (0));   regs->xfs = 0;   set_fs(USER_DS);   regs->xds = __USER_DS;   regs->xes = __USER_DS;   regs->xss = __USER_DS;   regs->xcs = __USER_CS;   regs->eip = new_eip;   regs->esp = new_esp;  } while (0)
236 struct task_struct;
237 struct mm_struct;
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 #define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
240 #define KSTK_TOP(info)  ({   unsigned long *__ptr = (unsigned long *)(info);   (unsigned long)(&__ptr[THREAD_SIZE_LONGS]);  })
241 #define task_pt_regs(task)  ({   struct pt_regs *__regs__;   __regs__ = (struct pt_regs *)(KSTK_TOP(task_stack_page(task))-8);   __regs__ - 1;  })
242 #define KSTK_EIP(task) (task_pt_regs(task)->eip)
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 #define KSTK_ESP(task) (task_pt_regs(task)->esp)
245 struct microcode_header {
246  unsigned int hdrver;
247  unsigned int rev;
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249  unsigned int date;
250  unsigned int sig;
251  unsigned int cksum;
252  unsigned int ldrver;
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254  unsigned int pf;
255  unsigned int datasize;
256  unsigned int totalsize;
257  unsigned int reserved[3];
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 };
260 struct microcode {
261  struct microcode_header hdr;
262  unsigned int bits[0];
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 };
265 typedef struct microcode microcode_t;
266 typedef struct microcode_header microcode_header_t;
267 struct extended_signature {
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269  unsigned int sig;
270  unsigned int pf;
271  unsigned int cksum;
272 };
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 struct extended_sigtable {
275  unsigned int count;
276  unsigned int cksum;
277  unsigned int reserved[3];
278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279  struct extended_signature sigs[0];
280 };
281 #define cpu_relax() rep_nop()
282 #define paravirt_enabled() 0
283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284 #define __cpuid native_cpuid
285 #define get_debugreg(var, register)   (var) = native_get_debugreg(register)
286 #define set_debugreg(value, register)   native_set_debugreg(register, value)
287 #define set_iopl_mask native_set_iopl_mask
288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 #define GENERIC_NOP1 ".byte 0x90\n"
290 #define GENERIC_NOP2 ".byte 0x89,0xf6\n"
291 #define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
292 #define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 #define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
295 #define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
296 #define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
297 #define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299 #define K8_NOP1 GENERIC_NOP1
300 #define K8_NOP2 ".byte 0x66,0x90\n"
301 #define K8_NOP3 ".byte 0x66,0x66,0x90\n"
302 #define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 #define K8_NOP5 K8_NOP3 K8_NOP2
305 #define K8_NOP6 K8_NOP3 K8_NOP3
306 #define K8_NOP7 K8_NOP4 K8_NOP3
307 #define K8_NOP8 K8_NOP4 K8_NOP4
308 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309 #define K7_NOP1 GENERIC_NOP1
310 #define K7_NOP2 ".byte 0x8b,0xc0\n"
311 #define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
312 #define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
313 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314 #define K7_NOP5 K7_NOP4 ASM_NOP1
315 #define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
316 #define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
317 #define K7_NOP8 K7_NOP7 ASM_NOP1
318 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319 #define P6_NOP1 GENERIC_NOP1
320 #define P6_NOP2 ".byte 0x66,0x90\n"
321 #define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
322 #define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
323 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324 #define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
325 #define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
326 #define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
327 #define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
328 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329 #define ASM_NOP1 GENERIC_NOP1
330 #define ASM_NOP2 GENERIC_NOP2
331 #define ASM_NOP3 GENERIC_NOP3
332 #define ASM_NOP4 GENERIC_NOP4
333 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
334 #define ASM_NOP5 GENERIC_NOP5
335 #define ASM_NOP6 GENERIC_NOP6
336 #define ASM_NOP7 GENERIC_NOP7
337 #define ASM_NOP8 GENERIC_NOP8
338 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
339 #define ASM_NOP_MAX 8
340 #define ARCH_HAS_PREFETCH
341 #define ARCH_HAS_PREFETCH
342 #define ARCH_HAS_PREFETCHW
343 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
344 #define ARCH_HAS_SPINLOCK_PREFETCH
345 #define spin_lock_prefetch(x) prefetchw(x)
346 #define cache_line_size() (boot_cpu_data.x86_cache_alignment)
347 #endif
348 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
349