This source file includes following definitions.
- start_thread
- thread_saved_pc
1
2
3
4
5
6
7 #ifndef __ASM_I386_PROCESSOR_H
8 #define __ASM_I386_PROCESSOR_H
9
10
11
12
13 extern char hard_math;
14 extern char x86;
15 extern char x86_vendor_id[13];
16 extern char x86_model;
17 extern char x86_mask;
18 extern int x86_capability;
19 extern int fdiv_bug;
20 extern char ignore_irq13;
21 extern char wp_works_ok;
22 extern char hlt_works_ok;
23
24
25
26
27
28 extern int EISA_bus;
29 #define MCA_bus 0
30 #define MCA_bus__is_a_macro
31
32
33
34
35
36 #define TASK_SIZE (0xC0000000UL)
37
38
39
40
41 #define IO_BITMAP_SIZE 32
42
43 struct i387_hard_struct {
44 long cwd;
45 long swd;
46 long twd;
47 long fip;
48 long fcs;
49 long foo;
50 long fos;
51 long st_space[20];
52 };
53
54 struct i387_soft_struct {
55 long cwd;
56 long swd;
57 long twd;
58 long fip;
59 long fcs;
60 long foo;
61 long fos;
62 long top;
63 struct fpu_reg regs[8];
64 unsigned char lookahead;
65 struct info *info;
66 unsigned long entry_eip;
67 };
68
69 union i387_union {
70 struct i387_hard_struct hard;
71 struct i387_soft_struct soft;
72 };
73
74 struct thread_struct {
75 unsigned short back_link,__blh;
76 unsigned long esp0;
77 unsigned short ss0,__ss0h;
78 unsigned long esp1;
79 unsigned short ss1,__ss1h;
80 unsigned long esp2;
81 unsigned short ss2,__ss2h;
82 unsigned long cr3;
83 unsigned long eip;
84 unsigned long eflags;
85 unsigned long eax,ecx,edx,ebx;
86 unsigned long esp;
87 unsigned long ebp;
88 unsigned long esi;
89 unsigned long edi;
90 unsigned short es, __esh;
91 unsigned short cs, __csh;
92 unsigned short ss, __ssh;
93 unsigned short ds, __dsh;
94 unsigned short fs, __fsh;
95 unsigned short gs, __gsh;
96 unsigned short ldt, __ldth;
97 unsigned short trace, bitmap;
98 unsigned long io_bitmap[IO_BITMAP_SIZE+1];
99 unsigned long tr;
100 unsigned long cr2, trap_no, error_code;
101
102 union i387_union i387;
103
104 struct vm86_struct * vm86_info;
105 unsigned long screen_bitmap;
106 unsigned long v86flags, v86mask, v86mode;
107 };
108
109 #define INIT_MMAP { &init_mm, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
110
111 #define INIT_TSS { \
112 0,0, \
113 sizeof(init_kernel_stack) + (long) &init_kernel_stack, \
114 KERNEL_DS, 0, \
115 0,0,0,0,0,0, \
116 (long) &swapper_pg_dir, \
117 0,0,0,0,0,0,0,0,0,0, \
118 USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \
119 _LDT(0),0, \
120 0, 0x8000, \
121 {~0, }, \
122 _TSS(0), 0, 0,0, \
123 { { 0, }, }, \
124 NULL, 0, 0, 0, 0 \
125 }
126
127 static inline void start_thread(struct pt_regs * regs, unsigned long eip, unsigned long esp)
128 {
129 regs->cs = USER_CS;
130 regs->ds = regs->es = regs->ss = regs->fs = regs->gs = USER_DS;
131 regs->eip = eip;
132 regs->esp = esp;
133 }
134
135
136
137
138 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
139 {
140 return ((unsigned long *)t->esp)[3];
141 }
142
143 #endif