.. | .. |
---|
45 | 45 | #include <linux/uaccess.h> |
---|
46 | 46 | #include <asm/traps.h> |
---|
47 | 47 | #include <asm/setup.h> |
---|
48 | | -#include <asm/pgtable.h> |
---|
49 | 48 | |
---|
50 | 49 | void (*pm_power_off)(void) = NULL; |
---|
51 | 50 | EXPORT_SYMBOL(pm_power_off); |
---|
.. | .. |
---|
58 | 57 | */ |
---|
59 | 58 | void arch_cpu_idle(void) |
---|
60 | 59 | { |
---|
61 | | - local_irq_enable(); |
---|
| 60 | + raw_local_irq_enable(); |
---|
62 | 61 | __asm__("sleep"); |
---|
63 | 62 | } |
---|
64 | 63 | |
---|
.. | .. |
---|
106 | 105 | { |
---|
107 | 106 | } |
---|
108 | 107 | |
---|
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) |
---|
112 | 110 | { |
---|
113 | 111 | struct pt_regs *childregs; |
---|
114 | 112 | |
---|
115 | 113 | childregs = (struct pt_regs *) (THREAD_SIZE + task_stack_page(p)) - 1; |
---|
116 | 114 | |
---|
117 | | - if (unlikely(p->flags & PF_KTHREAD)) { |
---|
| 115 | + if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) { |
---|
118 | 116 | memset(childregs, 0, sizeof(struct pt_regs)); |
---|
119 | 117 | childregs->retpc = (unsigned long) ret_from_kernel_thread; |
---|
120 | 118 | childregs->er4 = topstk; /* arg */ |
---|
.. | .. |
---|
160 | 158 | unsigned long newsp; |
---|
161 | 159 | uintptr_t parent_tidptr; |
---|
162 | 160 | uintptr_t child_tidptr; |
---|
| 161 | + struct kernel_clone_args kargs = {}; |
---|
163 | 162 | |
---|
164 | 163 | get_user(clone_flags, &args[0]); |
---|
165 | 164 | get_user(newsp, &args[1]); |
---|
166 | 165 | get_user(parent_tidptr, &args[2]); |
---|
167 | 166 | 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); |
---|
170 | 176 | } |
---|