Merge tag 'bitmap-for-5.19-rc1' of https://github.com/norov/linux
[platform/kernel/linux-starfive.git] / arch / alpha / kernel / process.c
index 0d4bc60..e2e25f8 100644 (file)
@@ -233,10 +233,11 @@ release_thread(struct task_struct *dead_task)
 /*
  * Copy architecture-specific thread state
  */
-int copy_thread(unsigned long clone_flags, unsigned long usp,
-               unsigned long kthread_arg, struct task_struct *p,
-               unsigned long tls)
+int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
+       unsigned long clone_flags = args->flags;
+       unsigned long usp = args->stack;
+       unsigned long tls = args->tls;
        extern void ret_from_fork(void);
        extern void ret_from_kernel_thread(void);
 
@@ -249,13 +250,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        childti->pcb.ksp = (unsigned long) childstack;
        childti->pcb.flags = 1; /* set FEN, clear everything else */
 
-       if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
+       if (unlikely(args->fn)) {
                /* kernel thread */
                memset(childstack, 0,
                        sizeof(struct switch_stack) + sizeof(struct pt_regs));
                childstack->r26 = (unsigned long) ret_from_kernel_thread;
-               childstack->r9 = usp;   /* function */
-               childstack->r10 = kthread_arg;
+               childstack->r9 = (unsigned long) args->fn;
+               childstack->r10 = (unsigned long) args->fn_arg;
                childregs->hae = alpha_mv.hae_cache;
                childti->pcb.usp = 0;
                return 0;