process.c (585a78c1f77be305b1f6adad392f16047fb66ffd) process.c (edffa33c7bb5a73e90c754c7a497162b77d7c55f)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Author: Huacai Chen <chenhuacai@loongson.cn>
4 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
5 *
6 * Derived from MIPS:
7 * Copyright (C) 1994 - 1999, 2000 by Ralf Baechle and others.
8 * Copyright (C) 2005, 2006 by Ralf Baechle (ralf@linux-mips.org)

--- 4 unchanged lines hidden (view full) ---

13#include <linux/cpu.h>
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/sched.h>
18#include <linux/sched/debug.h>
19#include <linux/sched/task.h>
20#include <linux/sched/task_stack.h>
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Author: Huacai Chen <chenhuacai@loongson.cn>
4 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
5 *
6 * Derived from MIPS:
7 * Copyright (C) 1994 - 1999, 2000 by Ralf Baechle and others.
8 * Copyright (C) 2005, 2006 by Ralf Baechle (ralf@linux-mips.org)

--- 4 unchanged lines hidden (view full) ---

13#include <linux/cpu.h>
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/sched.h>
18#include <linux/sched/debug.h>
19#include <linux/sched/task.h>
20#include <linux/sched/task_stack.h>
21#include <linux/hw_breakpoint.h>
21#include <linux/mm.h>
22#include <linux/stddef.h>
23#include <linux/unistd.h>
24#include <linux/export.h>
25#include <linux/ptrace.h>
26#include <linux/mman.h>
27#include <linux/personality.h>
28#include <linux/sys.h>

--- 62 unchanged lines hidden (view full) ---

91
92 clear_thread_flag(TIF_LSX_CTX_LIVE);
93 clear_thread_flag(TIF_LASX_CTX_LIVE);
94 clear_used_math();
95 regs->csr_era = pc;
96 regs->regs[3] = sp;
97}
98
22#include <linux/mm.h>
23#include <linux/stddef.h>
24#include <linux/unistd.h>
25#include <linux/export.h>
26#include <linux/ptrace.h>
27#include <linux/mman.h>
28#include <linux/personality.h>
29#include <linux/sys.h>

--- 62 unchanged lines hidden (view full) ---

92
93 clear_thread_flag(TIF_LSX_CTX_LIVE);
94 clear_thread_flag(TIF_LASX_CTX_LIVE);
95 clear_used_math();
96 regs->csr_era = pc;
97 regs->regs[3] = sp;
98}
99
100void flush_thread(void)
101{
102 flush_ptrace_hw_breakpoint(current);
103}
104
99void exit_thread(struct task_struct *tsk)
100{
101}
102
103int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
104{
105 /*
106 * Save any process state which is live in hardware registers to the

--- 69 unchanged lines hidden (view full) ---

176 * switching for most programs since they don't use the fpu.
177 */
178 childregs->csr_euen = 0;
179
180 if (clone_flags & CLONE_SETTLS)
181 childregs->regs[2] = tls;
182
183out:
105void exit_thread(struct task_struct *tsk)
106{
107}
108
109int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
110{
111 /*
112 * Save any process state which is live in hardware registers to the

--- 69 unchanged lines hidden (view full) ---

182 * switching for most programs since they don't use the fpu.
183 */
184 childregs->csr_euen = 0;
185
186 if (clone_flags & CLONE_SETTLS)
187 childregs->regs[2] = tls;
188
189out:
190 ptrace_hw_copy_thread(p);
184 clear_tsk_thread_flag(p, TIF_USEDFPU);
185 clear_tsk_thread_flag(p, TIF_USEDSIMD);
186 clear_tsk_thread_flag(p, TIF_LSX_CTX_LIVE);
187 clear_tsk_thread_flag(p, TIF_LASX_CTX_LIVE);
188
189 return 0;
190}
191

--- 167 unchanged lines hidden ---
191 clear_tsk_thread_flag(p, TIF_USEDFPU);
192 clear_tsk_thread_flag(p, TIF_USEDSIMD);
193 clear_tsk_thread_flag(p, TIF_LSX_CTX_LIVE);
194 clear_tsk_thread_flag(p, TIF_LASX_CTX_LIVE);
195
196 return 0;
197}
198

--- 167 unchanged lines hidden ---