hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/h8300/kernel/process.c
....@@ -45,7 +45,6 @@
4545 #include <linux/uaccess.h>
4646 #include <asm/traps.h>
4747 #include <asm/setup.h>
48
-#include <asm/pgtable.h>
4948
5049 void (*pm_power_off)(void) = NULL;
5150 EXPORT_SYMBOL(pm_power_off);
....@@ -58,7 +57,7 @@
5857 */
5958 void arch_cpu_idle(void)
6059 {
61
- local_irq_enable();
60
+ raw_local_irq_enable();
6261 __asm__("sleep");
6362 }
6463
....@@ -106,15 +105,14 @@
106105 {
107106 }
108107
109
-int copy_thread(unsigned long clone_flags,
110
- unsigned long usp, unsigned long topstk,
111
- struct task_struct *p)
108
+int copy_thread(unsigned long clone_flags, unsigned long usp,
109
+ unsigned long topstk, struct task_struct *p, unsigned long tls)
112110 {
113111 struct pt_regs *childregs;
114112
115113 childregs = (struct pt_regs *) (THREAD_SIZE + task_stack_page(p)) - 1;
116114
117
- if (unlikely(p->flags & PF_KTHREAD)) {
115
+ if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
118116 memset(childregs, 0, sizeof(struct pt_regs));
119117 childregs->retpc = (unsigned long) ret_from_kernel_thread;
120118 childregs->er4 = topstk; /* arg */
....@@ -160,11 +158,19 @@
160158 unsigned long newsp;
161159 uintptr_t parent_tidptr;
162160 uintptr_t child_tidptr;
161
+ struct kernel_clone_args kargs = {};
163162
164163 get_user(clone_flags, &args[0]);
165164 get_user(newsp, &args[1]);
166165 get_user(parent_tidptr, &args[2]);
167166 get_user(child_tidptr, &args[3]);
168
- return do_fork(clone_flags, newsp, 0,
169
- (int __user *)parent_tidptr, (int __user *)child_tidptr);
167
+
168
+ kargs.flags = (lower_32_bits(clone_flags) & ~CSIGNAL);
169
+ kargs.pidfd = (int __user *)parent_tidptr;
170
+ kargs.child_tid = (int __user *)child_tidptr;
171
+ kargs.parent_tid = (int __user *)parent_tidptr;
172
+ kargs.exit_signal = (lower_32_bits(clone_flags) & CSIGNAL);
173
+ kargs.stack = newsp;
174
+
175
+ return kernel_clone(&kargs);
170176 }