hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/hexagon/kernel/process.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Process creation support for Hexagon
34 *
45 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 and
8
- * only version 2 as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18
- * 02110-1301, USA.
196 */
207
218 #include <linux/sched.h>
....@@ -57,14 +44,14 @@
5744 {
5845 __vmwait();
5946 /* interrupts wake us up, but irqs are still disabled */
60
- local_irq_enable();
47
+ raw_local_irq_enable();
6148 }
6249
6350 /*
6451 * Copy architecture-specific thread state
6552 */
66
-int copy_thread(unsigned long clone_flags, unsigned long usp,
67
- unsigned long arg, struct task_struct *p)
53
+int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,
54
+ struct task_struct *p, unsigned long tls)
6855 {
6956 struct thread_info *ti = task_thread_info(p);
7057 struct hexagon_switch_stack *ss;
....@@ -86,7 +73,7 @@
8673 sizeof(*ss));
8774 ss->lr = (unsigned long)ret_from_fork;
8875 p->thread.switch_sp = ss;
89
- if (unlikely(p->flags & PF_KTHREAD)) {
76
+ if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
9077 memset(childregs, 0, sizeof(struct pt_regs));
9178 /* r24 <- fn, r25 <- arg */
9279 ss->r24 = usp;
....@@ -113,7 +100,7 @@
113100 * ugp is used to provide TLS support.
114101 */
115102 if (clone_flags & CLONE_SETTLS)
116
- childregs->ugp = childregs->r04;
103
+ childregs->ugp = tls;
117104
118105 /*
119106 * Parent sees new pid -- not necessary, not even possible at
....@@ -167,15 +154,6 @@
167154 }
168155
169156 /*
170
- * Required placeholder.
171
- */
172
-int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
173
-{
174
- return 0;
175
-}
176
-
177
-
178
-/*
179157 * Called on the exit path of event entry; see vm_entry.S
180158 *
181159 * Interrupts will already be disabled.
....@@ -196,13 +174,12 @@
196174 return 1;
197175 }
198176
199
- if (thread_info_flags & _TIF_SIGPENDING) {
177
+ if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) {
200178 do_signal(regs);
201179 return 1;
202180 }
203181
204182 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
205
- clear_thread_flag(TIF_NOTIFY_RESUME);
206183 tracehook_notify_resume(regs);
207184 return 1;
208185 }