This source file includes following definitions.
- kb_wait
- hard_reset_now
- show_regs
- exit_thread
- flush_thread
- release_thread
- copy_thread
- dump_fpu
- dump_thread
1
2
3
4
5
6
7
8
9 #include <linux/errno.h>
10 #include <linux/sched.h>
11 #include <linux/kernel.h>
12 #include <linux/mm.h>
13 #include <linux/stddef.h>
14 #include <linux/unistd.h>
15 #include <linux/ptrace.h>
16 #include <linux/malloc.h>
17 #include <linux/ldt.h>
18 #include <linux/mman.h>
19 #include <linux/sys.h>
20 #include <linux/user.h>
21 #include <linux/a.out.h>
22
23 #include <asm/bootinfo.h>
24 #include <asm/segment.h>
25 #include <asm/pgtable.h>
26 #include <asm/system.h>
27 #include <asm/mipsregs.h>
28 #include <asm/processor.h>
29 #include <asm/stackframe.h>
30 #include <asm/io.h>
31
32 asmlinkage void ret_from_sys_call(void);
33
34
35
36
37
38
39
40
41 static inline void kb_wait(void)
42 {
43 int i;
44
45 for (i=0; i<0x10000; i++)
46 if ((inb_p(0x64) & 0x02) == 0)
47 break;
48 }
49
50
51
52
53
54 void hard_reset_now(void)
55 {
56 int i, j;
57
58 sti();
59 for (;;) {
60 for (i=0; i<100; i++) {
61 kb_wait();
62 for(j = 0; j < 100000 ; j++)
63 ;
64 outb(0xfe,0x64);
65 }
66 }
67 }
68
69 void show_regs(struct pt_regs * regs)
70 {
71
72
73
74 printk("$0 : %08x %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
75 0, regs->reg1, regs->reg2, regs->reg3,
76 regs->reg4, regs->reg5, regs->reg6, regs->reg7);
77 printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
78 regs->reg8, regs->reg9, regs->reg10, regs->reg11,
79 regs->reg12, regs->reg13, regs->reg14, regs->reg15);
80 printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
81 regs->reg16, regs->reg17, regs->reg18, regs->reg19,
82 regs->reg20, regs->reg21, regs->reg22, regs->reg23);
83 printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx\n",
84 regs->reg24, regs->reg25, regs->reg28, regs->reg29,
85 regs->reg30, regs->reg31);
86
87
88
89
90 printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n",
91 regs->cp0_epc, regs->cp0_status, regs->cp0_cause);
92 }
93
94
95
96
97 void exit_thread(void)
98 {
99
100
101
102 }
103
104 void flush_thread(void)
105 {
106
107
108
109 }
110
111 void release_thread(struct task_struct *dead_task)
112 {
113
114
115
116 }
117
118 void copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
119 struct task_struct * p, struct pt_regs * regs)
120 {
121 struct pt_regs * childregs;
122 unsigned long childksp;
123
124 childksp = p->kernel_stack_page + PAGE_SIZE - 8;
125
126
127
128 childregs = ((struct pt_regs *) (p->kernel_stack_page + PAGE_SIZE)) - 1;
129 *childregs = *regs;
130 childregs->reg2 = 0;
131 childregs->reg7 = 0;
132 regs->reg2 = p->pid;
133 if (childregs->cp0_status & ST0_CU0)
134 childregs->reg29 = childksp;
135 else
136 childregs->reg29 = usp;
137 p->tss.ksp = childksp;
138 p->tss.reg29 = (unsigned long) childregs;
139 p->tss.reg31 = (unsigned long) ret_from_sys_call;
140
141
142
143
144
145 p->tss.cp0_status = read_32bit_cp0_register(CP0_STATUS) &
146 ~(ST0_CU3|ST0_CU2|ST0_CU1|ST0_KSU|ST0_ERL|ST0_EXL);
147 childregs->cp0_status &= ~(ST0_CU3|ST0_CU2|ST0_CU1);
148 }
149
150
151
152
153
154
155 int dump_fpu (int shutup_the_gcc_warning_about_elf_fpregset_t)
156 {
157 int fpvalid = 0;
158
159
160
161
162 return fpvalid;
163 }
164
165
166
167
168 void dump_thread(struct pt_regs * regs, struct user * dump)
169 {
170
171
172
173 }