hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/nios2/kernel/process.c
....@@ -33,7 +33,7 @@
3333
3434 void arch_cpu_idle(void)
3535 {
36
- local_irq_enable();
36
+ raw_local_irq_enable();
3737 }
3838
3939 /*
....@@ -100,8 +100,8 @@
100100 {
101101 }
102102
103
-int copy_thread(unsigned long clone_flags,
104
- unsigned long usp, unsigned long arg, struct task_struct *p)
103
+int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,
104
+ struct task_struct *p, unsigned long tls)
105105 {
106106 struct pt_regs *childregs = task_pt_regs(p);
107107 struct pt_regs *regs;
....@@ -109,7 +109,7 @@
109109 struct switch_stack *childstack =
110110 ((struct switch_stack *)childregs) - 1;
111111
112
- if (unlikely(p->flags & PF_KTHREAD)) {
112
+ if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
113113 memset(childstack, 0,
114114 sizeof(struct switch_stack) + sizeof(struct pt_regs));
115115
....@@ -140,7 +140,7 @@
140140
141141 /* Initialize tls register. */
142142 if (clone_flags & CLONE_SETTLS)
143
- childstack->r23 = regs->r8;
143
+ childstack->r23 = tls;
144144
145145 return 0;
146146 }
....@@ -252,10 +252,19 @@
252252 regs->sp = sp;
253253 }
254254
255
-#include <linux/elfcore.h>
256
-
257
-/* Fill in the FPU structure for a core dump. */
258
-int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
255
+asmlinkage int nios2_clone(unsigned long clone_flags, unsigned long newsp,
256
+ int __user *parent_tidptr, int __user *child_tidptr,
257
+ unsigned long tls)
259258 {
260
- return 0; /* Nios2 has no FPU and thus no FPU registers */
259
+ struct kernel_clone_args args = {
260
+ .flags = (lower_32_bits(clone_flags) & ~CSIGNAL),
261
+ .pidfd = parent_tidptr,
262
+ .child_tid = child_tidptr,
263
+ .parent_tid = parent_tidptr,
264
+ .exit_signal = (lower_32_bits(clone_flags) & CSIGNAL),
265
+ .stack = newsp,
266
+ .tls = tls,
267
+ };
268
+
269
+ return kernel_clone(&args);
261270 }