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