aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/process_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/process_32.c')
-rw-r--r--arch/sh/kernel/process_32.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 3326a45749d9..b965f0282c7d 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -7,7 +7,11 @@
7 * 7 *
8 * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima 8 * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
9 * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC 9 * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC
10 * Copyright (C) 2002 - 2007 Paul Mundt 10 * Copyright (C) 2002 - 2008 Paul Mundt
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file "COPYING" in the main directory of this archive
14 * for more details.
11 */ 15 */
12#include <linux/module.h> 16#include <linux/module.h>
13#include <linux/mm.h> 17#include <linux/mm.h>
@@ -26,6 +30,7 @@
26#include <asm/system.h> 30#include <asm/system.h>
27#include <asm/ubc.h> 31#include <asm/ubc.h>
28#include <asm/fpu.h> 32#include <asm/fpu.h>
33#include <asm/syscalls.h>
29 34
30static int hlt_counter; 35static int hlt_counter;
31int ubc_usercnt = 0; 36int ubc_usercnt = 0;
@@ -111,15 +116,21 @@ void show_regs(struct pt_regs * regs)
111{ 116{
112 printk("\n"); 117 printk("\n");
113 printk("Pid : %d, Comm: %20s\n", task_pid_nr(current), current->comm); 118 printk("Pid : %d, Comm: %20s\n", task_pid_nr(current), current->comm);
119 printk("CPU : %d %s (%s %.*s)\n",
120 smp_processor_id(), print_tainted(), init_utsname()->release,
121 (int)strcspn(init_utsname()->version, " "),
122 init_utsname()->version);
123
114 print_symbol("PC is at %s\n", instruction_pointer(regs)); 124 print_symbol("PC is at %s\n", instruction_pointer(regs));
125 print_symbol("PR is at %s\n", regs->pr);
126
115 printk("PC : %08lx SP : %08lx SR : %08lx ", 127 printk("PC : %08lx SP : %08lx SR : %08lx ",
116 regs->pc, regs->regs[15], regs->sr); 128 regs->pc, regs->regs[15], regs->sr);
117#ifdef CONFIG_MMU 129#ifdef CONFIG_MMU
118 printk("TEA : %08x ", ctrl_inl(MMU_TEA)); 130 printk("TEA : %08x\n", ctrl_inl(MMU_TEA));
119#else 131#else
120 printk(" "); 132 printk("\n");
121#endif 133#endif
122 printk("%s\n", print_tainted());
123 134
124 printk("R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n", 135 printk("R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
125 regs->regs[0],regs->regs[1], 136 regs->regs[0],regs->regs[1],
@@ -162,6 +173,7 @@ __asm__(".align 5\n"
162int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 173int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
163{ 174{
164 struct pt_regs regs; 175 struct pt_regs regs;
176 int pid;
165 177
166 memset(&regs, 0, sizeof(regs)); 178 memset(&regs, 0, sizeof(regs));
167 regs.regs[4] = (unsigned long)arg; 179 regs.regs[4] = (unsigned long)arg;
@@ -171,8 +183,12 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
171 regs.sr = (1 << 30); 183 regs.sr = (1 << 30);
172 184
173 /* Ok, create the new process.. */ 185 /* Ok, create the new process.. */
174 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, 186 pid = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
175 &regs, 0, NULL, NULL); 187 &regs, 0, NULL, NULL);
188
189 trace_mark(kernel_arch_kthread_create, "pid %d fn %p", pid, fn);
190
191 return pid;
176} 192}
177 193
178/* 194/*
@@ -210,10 +226,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
210 struct task_struct *tsk = current; 226 struct task_struct *tsk = current;
211 227
212 fpvalid = !!tsk_used_math(tsk); 228 fpvalid = !!tsk_used_math(tsk);
213 if (fpvalid) { 229 if (fpvalid)
214 unlazy_fpu(tsk, regs); 230 fpvalid = !fpregs_get(tsk, NULL, 0,
215 memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); 231 sizeof(struct user_fpu_struct),
216 } 232 fpu, NULL);
217#endif 233#endif
218 234
219 return fpvalid; 235 return fpvalid;