hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/sh/kernel/process_32.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * arch/sh/kernel/process.c
34 *
....@@ -8,10 +9,6 @@
89 * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
910 * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC
1011 * 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.
1512 */
1613 #include <linux/module.h>
1714 #include <linux/mm.h>
....@@ -33,36 +30,32 @@
3330
3431 void show_regs(struct pt_regs * regs)
3532 {
36
- printk("\n");
33
+ pr_info("\n");
3734 show_regs_print_info(KERN_DEFAULT);
3835
39
- printk("PC is at %pS\n", (void *)instruction_pointer(regs));
40
- printk("PR is at %pS\n", (void *)regs->pr);
36
+ pr_info("PC is at %pS\n", (void *)instruction_pointer(regs));
37
+ pr_info("PR is at %pS\n", (void *)regs->pr);
4138
42
- printk("PC : %08lx SP : %08lx SR : %08lx ",
43
- regs->pc, regs->regs[15], regs->sr);
39
+ pr_info("PC : %08lx SP : %08lx SR : %08lx ", regs->pc,
40
+ regs->regs[15], regs->sr);
4441 #ifdef CONFIG_MMU
45
- printk("TEA : %08x\n", __raw_readl(MMU_TEA));
42
+ pr_cont("TEA : %08x\n", __raw_readl(MMU_TEA));
4643 #else
47
- printk("\n");
44
+ pr_cont("\n");
4845 #endif
4946
50
- printk("R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
51
- regs->regs[0],regs->regs[1],
52
- regs->regs[2],regs->regs[3]);
53
- printk("R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n",
54
- regs->regs[4],regs->regs[5],
55
- regs->regs[6],regs->regs[7]);
56
- printk("R8 : %08lx R9 : %08lx R10 : %08lx R11 : %08lx\n",
57
- regs->regs[8],regs->regs[9],
58
- regs->regs[10],regs->regs[11]);
59
- printk("R12 : %08lx R13 : %08lx R14 : %08lx\n",
60
- regs->regs[12],regs->regs[13],
61
- regs->regs[14]);
62
- printk("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n",
63
- regs->mach, regs->macl, regs->gbr, regs->pr);
47
+ pr_info("R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
48
+ regs->regs[0], regs->regs[1], regs->regs[2], regs->regs[3]);
49
+ pr_info("R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n",
50
+ regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]);
51
+ pr_info("R8 : %08lx R9 : %08lx R10 : %08lx R11 : %08lx\n",
52
+ regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11]);
53
+ pr_info("R12 : %08lx R13 : %08lx R14 : %08lx\n",
54
+ regs->regs[12], regs->regs[13], regs->regs[14]);
55
+ pr_info("MACH: %08lx MACL: %08lx GBR : %08lx PR : %08lx\n",
56
+ regs->mach, regs->macl, regs->gbr, regs->pr);
6457
65
- show_trace(NULL, (unsigned long *)regs->regs[15], regs);
58
+ show_trace(NULL, (unsigned long *)regs->regs[15], regs, KERN_DEFAULT);
6659 show_code(regs);
6760 }
6861
....@@ -96,30 +89,11 @@
9689 /* do nothing */
9790 }
9891
99
-/* Fill in the fpu structure for a core dump.. */
100
-int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
101
-{
102
- int fpvalid = 0;
103
-
104
-#if defined(CONFIG_SH_FPU)
105
- struct task_struct *tsk = current;
106
-
107
- fpvalid = !!tsk_used_math(tsk);
108
- if (fpvalid)
109
- fpvalid = !fpregs_get(tsk, NULL, 0,
110
- sizeof(struct user_fpu_struct),
111
- fpu, NULL);
112
-#endif
113
-
114
- return fpvalid;
115
-}
116
-EXPORT_SYMBOL(dump_fpu);
117
-
11892 asmlinkage void ret_from_fork(void);
11993 asmlinkage void ret_from_kernel_thread(void);
12094
121
-int copy_thread(unsigned long clone_flags, unsigned long usp,
122
- unsigned long arg, struct task_struct *p)
95
+int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,
96
+ struct task_struct *p, unsigned long tls)
12397 {
12498 struct thread_info *ti = task_thread_info(p);
12599 struct pt_regs *childregs;
....@@ -140,7 +114,7 @@
140114
141115 childregs = task_pt_regs(p);
142116 p->thread.sp = (unsigned long) childregs;
143
- if (unlikely(p->flags & PF_KTHREAD)) {
117
+ if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
144118 memset(childregs, 0, sizeof(struct pt_regs));
145119 p->thread.pc = (unsigned long) ret_from_kernel_thread;
146120 childregs->regs[4] = arg;
....@@ -161,7 +135,7 @@
161135 ti->addr_limit = USER_DS;
162136
163137 if (clone_flags & CLONE_SETTLS)
164
- childregs->gbr = childregs->regs[0];
138
+ childregs->gbr = tls;
165139
166140 childregs->regs[0] = 0; /* Set return value for child */
167141 p->thread.pc = (unsigned long) ret_from_fork;