| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Process creation support for Hexagon |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 19 | 6 | */ |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | #include <linux/sched.h> |
|---|
| .. | .. |
|---|
| 57 | 44 | { |
|---|
| 58 | 45 | __vmwait(); |
|---|
| 59 | 46 | /* interrupts wake us up, but irqs are still disabled */ |
|---|
| 60 | | - local_irq_enable(); |
|---|
| 47 | + raw_local_irq_enable(); |
|---|
| 61 | 48 | } |
|---|
| 62 | 49 | |
|---|
| 63 | 50 | /* |
|---|
| 64 | 51 | * Copy architecture-specific thread state |
|---|
| 65 | 52 | */ |
|---|
| 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) |
|---|
| 68 | 55 | { |
|---|
| 69 | 56 | struct thread_info *ti = task_thread_info(p); |
|---|
| 70 | 57 | struct hexagon_switch_stack *ss; |
|---|
| .. | .. |
|---|
| 86 | 73 | sizeof(*ss)); |
|---|
| 87 | 74 | ss->lr = (unsigned long)ret_from_fork; |
|---|
| 88 | 75 | p->thread.switch_sp = ss; |
|---|
| 89 | | - if (unlikely(p->flags & PF_KTHREAD)) { |
|---|
| 76 | + if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) { |
|---|
| 90 | 77 | memset(childregs, 0, sizeof(struct pt_regs)); |
|---|
| 91 | 78 | /* r24 <- fn, r25 <- arg */ |
|---|
| 92 | 79 | ss->r24 = usp; |
|---|
| .. | .. |
|---|
| 113 | 100 | * ugp is used to provide TLS support. |
|---|
| 114 | 101 | */ |
|---|
| 115 | 102 | if (clone_flags & CLONE_SETTLS) |
|---|
| 116 | | - childregs->ugp = childregs->r04; |
|---|
| 103 | + childregs->ugp = tls; |
|---|
| 117 | 104 | |
|---|
| 118 | 105 | /* |
|---|
| 119 | 106 | * Parent sees new pid -- not necessary, not even possible at |
|---|
| .. | .. |
|---|
| 167 | 154 | } |
|---|
| 168 | 155 | |
|---|
| 169 | 156 | /* |
|---|
| 170 | | - * Required placeholder. |
|---|
| 171 | | - */ |
|---|
| 172 | | -int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) |
|---|
| 173 | | -{ |
|---|
| 174 | | - return 0; |
|---|
| 175 | | -} |
|---|
| 176 | | - |
|---|
| 177 | | - |
|---|
| 178 | | -/* |
|---|
| 179 | 157 | * Called on the exit path of event entry; see vm_entry.S |
|---|
| 180 | 158 | * |
|---|
| 181 | 159 | * Interrupts will already be disabled. |
|---|
| .. | .. |
|---|
| 196 | 174 | return 1; |
|---|
| 197 | 175 | } |
|---|
| 198 | 176 | |
|---|
| 199 | | - if (thread_info_flags & _TIF_SIGPENDING) { |
|---|
| 177 | + if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) { |
|---|
| 200 | 178 | do_signal(regs); |
|---|
| 201 | 179 | return 1; |
|---|
| 202 | 180 | } |
|---|
| 203 | 181 | |
|---|
| 204 | 182 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
|---|
| 205 | | - clear_thread_flag(TIF_NOTIFY_RESUME); |
|---|
| 206 | 183 | tracehook_notify_resume(regs); |
|---|
| 207 | 184 | return 1; |
|---|
| 208 | 185 | } |
|---|