aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/process_64.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /arch/sh/kernel/process_64.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/sh/kernel/process_64.c')
-rw-r--r--arch/sh/kernel/process_64.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index 1192398ef582..d4ca6480e355 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -21,6 +21,7 @@
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/ptrace.h> 22#include <linux/ptrace.h>
23#include <linux/reboot.h> 23#include <linux/reboot.h>
24#include <linux/slab.h>
24#include <linux/init.h> 25#include <linux/init.h>
25#include <linux/module.h> 26#include <linux/module.h>
26#include <linux/io.h> 27#include <linux/io.h>
@@ -32,30 +33,7 @@
32 33
33struct task_struct *last_task_used_math = NULL; 34struct task_struct *last_task_used_math = NULL;
34 35
35void machine_restart(char * __unused) 36void show_regs(struct pt_regs *regs)
36{
37 extern void phys_stext(void);
38
39 phys_stext();
40}
41
42void machine_halt(void)
43{
44 for (;;);
45}
46
47void machine_power_off(void)
48{
49 __asm__ __volatile__ (
50 "sleep\n\t"
51 "synci\n\t"
52 "nop;nop;nop;nop\n\t"
53 );
54
55 panic("Unexpected wakeup!\n");
56}
57
58void show_regs(struct pt_regs * regs)
59{ 37{
60 unsigned long long ah, al, bh, bl, ch, cl; 38 unsigned long long ah, al, bh, bl, ch, cl;
61 39
@@ -335,6 +313,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
335 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, 313 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
336 &regs, 0, NULL, NULL); 314 &regs, 0, NULL, NULL);
337} 315}
316EXPORT_SYMBOL(kernel_thread);
338 317
339/* 318/*
340 * Free current thread data structures etc.. 319 * Free current thread data structures etc..
@@ -367,7 +346,7 @@ void exit_thread(void)
367void flush_thread(void) 346void flush_thread(void)
368{ 347{
369 348
370 /* Called by fs/exec.c (flush_old_exec) to remove traces of a 349 /* Called by fs/exec.c (setup_new_exec) to remove traces of a
371 * previously running executable. */ 350 * previously running executable. */
372#ifdef CONFIG_SH_FPU 351#ifdef CONFIG_SH_FPU
373 if (last_task_used_math == current) { 352 if (last_task_used_math == current) {
@@ -403,13 +382,13 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
403 if (fpvalid) { 382 if (fpvalid) {
404 if (current == last_task_used_math) { 383 if (current == last_task_used_math) {
405 enable_fpu(); 384 enable_fpu();
406 save_fpu(tsk, regs); 385 save_fpu(tsk);
407 disable_fpu(); 386 disable_fpu();
408 last_task_used_math = 0; 387 last_task_used_math = 0;
409 regs->sr |= SR_FD; 388 regs->sr |= SR_FD;
410 } 389 }
411 390
412 memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); 391 memcpy(fpu, &tsk->thread.xstate->hardfpu, sizeof(*fpu));
413 } 392 }
414 393
415 return fpvalid; 394 return fpvalid;
@@ -417,6 +396,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
417 return 0; /* Task didn't use the fpu at all. */ 396 return 0; /* Task didn't use the fpu at all. */
418#endif 397#endif
419} 398}
399EXPORT_SYMBOL(dump_fpu);
420 400
421asmlinkage void ret_from_fork(void); 401asmlinkage void ret_from_fork(void);
422 402
@@ -429,7 +409,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
429#ifdef CONFIG_SH_FPU 409#ifdef CONFIG_SH_FPU
430 if(last_task_used_math == current) { 410 if(last_task_used_math == current) {
431 enable_fpu(); 411 enable_fpu();
432 save_fpu(current, regs); 412 save_fpu(current);
433 disable_fpu(); 413 disable_fpu();
434 last_task_used_math = NULL; 414 last_task_used_math = NULL;
435 regs->sr |= SR_FD; 415 regs->sr |= SR_FD;
@@ -525,13 +505,6 @@ out:
525 return error; 505 return error;
526} 506}
527 507
528/*
529 * These bracket the sleeping functions..
530 */
531extern void interruptible_sleep_on(wait_queue_head_t *q);
532
533#define mid_sched ((unsigned long) interruptible_sleep_on)
534
535#ifdef CONFIG_FRAME_POINTER 508#ifdef CONFIG_FRAME_POINTER
536static int in_sh64_switch_to(unsigned long pc) 509static int in_sh64_switch_to(unsigned long pc)
537{ 510{