13 #include <linux/errno.h>
14 #include <linux/module.h>
15 #include <linux/sched.h>
16 #include <linux/kernel.h>
18 #include <linux/stddef.h>
19 #include <linux/ptrace.h>
22 #include <linux/reboot.h>
26 #include <linux/slab.h>
29 #include <asm/oplib.h>
30 #include <asm/uaccess.h>
32 #include <asm/pgalloc.h>
33 #include <asm/pgtable.h>
34 #include <asm/delay.h>
35 #include <asm/processor.h>
39 #include <asm/unistd.h>
40 #include <asm/setup.h>
63 extern void fpsave(
unsigned long *,
unsigned long *,
void *,
unsigned long *);
73 set_thread_flag(TIF_POLLING_NRFLAG);
77 while (!need_resched()) {
94 panic(
"Halt failed!");
112 panic(
"Reboot failed!");
127 printk(
"PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n",
129 printk(
"PC: <%pS>\n", (
void *) r->
pc);
130 printk(
"%%G: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
133 printk(
"%%O: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
138 printk(
"%%L: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
141 printk(
"%%I: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
152 unsigned long pc,
fp;
153 unsigned long task_base;
162 fp = (
unsigned long) _ksp;
165 if (fp < (task_base +
sizeof(
struct thread_info)) ||
171 printk(
"%pS ] ", (
void *) pc);
173 }
while (++count < 16);
181 __asm__ __volatile__(
"mov %%fp, %0"
202 if(last_task_used_math ==
current) {
204 if (test_thread_flag(TIF_USEDFPU)) {
207 put_psr(get_psr() |
PSR_EF);
211 last_task_used_math =
NULL;
213 clear_thread_flag(TIF_USEDFPU);
223 if(last_task_used_math ==
current) {
225 if (test_thread_flag(TIF_USEDFPU)) {
228 put_psr(get_psr() |
PSR_EF);
232 last_task_used_math =
NULL;
234 clear_thread_flag(TIF_USEDFPU);
260 fp = (
unsigned long) tmp;
261 size = (fp - ((
unsigned long) src));
262 fp = (
unsigned long) dst;
280 unsigned long stack_size)
282 unsigned long parent_tid_ptr, child_tid_ptr;
289 ret =
do_fork(clone_flags, stack_start,
291 (
int __user *) parent_tid_ptr,
292 (
int __user *) child_tid_ptr);
329 if(last_task_used_math ==
current) {
331 if (test_thread_flag(TIF_USEDFPU)) {
333 put_psr(get_psr() |
PSR_EF);
358 ti->ksp = (
unsigned long) new_stack;
361 ti->kwim =
current->thread.fork_kwim;
364 extern struct pt_regs fake_swapper_regs;
374 p->
thread.kregs = childregs;
393 printk(
"clone: parent stack:\n");
394 show_stackframe(parentstack);
397 childstack = clone_stackframe(childstack, parentstack);
402 printk(
"clone: child stack:\n");
403 show_stackframe(childstack);
413 clear_tsk_thread_flag(p, TIF_USEDFPU);
435 memset(fpregs, 0,
sizeof(*fpregs));
440 if (test_thread_flag(TIF_USEDFPU)) {
441 put_psr(get_psr() |
PSR_EF);
446 clear_thread_flag(TIF_USEDFPU);
450 if (
current == last_task_used_math) {
451 put_psr(get_psr() |
PSR_EF);
456 last_task_used_math =
NULL;
461 &
current->thread.float_regs[0],
462 (
sizeof(
unsigned long) * 32));
470 sizeof(
struct fpq) * fpregs->
pr_qcnt);
474 sizeof(
struct fpq) * (32 - fpregs->
pr_qcnt));
492 error = PTR_ERR(filename);
496 (
const char __user *
const __user *)
498 (
const char __user *
const __user *)
518 __asm__ __volatile__(
"mov %4, %%g2\n\t"
527 "jmpl %%g2, %%o7\n\t"
528 " mov %%g3, %%o0\n\t"
532 "1: mov %%o0, %0\n\t" :
536 "g1",
"g2",
"g3",
"o0",
"o1",
"memory",
"cc");
543 unsigned long pc,
fp, bias = 0;
544 unsigned long task_base = (
unsigned long) task;
545 unsigned long ret = 0;
549 if (!task || task ==
current ||
556 if (fp < (task_base +
sizeof(
struct thread_info)) ||
565 fp = rw->
ins[6] + bias;
566 }
while (++count < 16);