OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [kernel/] [fork.c] - Diff between revs 199 and 582

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 199 Rev 582
Line 304... Line 304...
        int nr;
        int nr;
        int i;
        int i;
        int error = -ENOMEM;
        int error = -ENOMEM;
        unsigned long new_stack;
        unsigned long new_stack;
        struct task_struct *p;
        struct task_struct *p;
printk("do_fork1\n");
 
        p = (struct task_struct *) kmalloc(sizeof(*p), GFP_KERNEL);
        p = (struct task_struct *) kmalloc(sizeof(*p), GFP_KERNEL);
        if (!p)
        if (!p)
                goto bad_fork;
                goto bad_fork;
printk("do_fork2\n");
 
        new_stack = alloc_kernel_stack();
        new_stack = alloc_kernel_stack();
        if (!new_stack)
        if (!new_stack)
                goto bad_fork_free_p;
                goto bad_fork_free_p;
printk("do_fork3\n");
 
        error = -EAGAIN;
        error = -EAGAIN;
        nr = find_empty_process();
        nr = find_empty_process();
        if (nr < 0)
        if (nr < 0)
                goto bad_fork_free_stack;
                goto bad_fork_free_stack;
 
 
printk("do_fork4\n");
 
        *p = *current;
        *p = *current;
 
 
        if (p->exec_domain && p->exec_domain->use_count)
        if (p->exec_domain && p->exec_domain->use_count)
                (*p->exec_domain->use_count)++;
                (*p->exec_domain->use_count)++;
        if (p->binfmt && p->binfmt->use_count)
        if (p->binfmt && p->binfmt->use_count)
Line 363... Line 362...
 
 
        error = -ENOMEM;
        error = -ENOMEM;
        /* copy all the process information */
        /* copy all the process information */
        if (copy_files(clone_flags, p))
        if (copy_files(clone_flags, p))
                goto bad_fork_cleanup;
                goto bad_fork_cleanup;
printk("do_fork5\n");
 
        if (copy_fs(clone_flags, p))
        if (copy_fs(clone_flags, p))
                goto bad_fork_cleanup_files;
                goto bad_fork_cleanup_files;
printk("do_fork6\n");
 
        if (copy_sighand(clone_flags, p))
        if (copy_sighand(clone_flags, p))
                goto bad_fork_cleanup_fs;
                goto bad_fork_cleanup_fs;
printk("do_fork7\n");
 
        if (copy_mm(clone_flags, p))
        if (copy_mm(clone_flags, p))
                goto bad_fork_cleanup_sighand;
                goto bad_fork_cleanup_sighand;
printk("do_fork8\n");
 
        copy_thread(nr, clone_flags, usp, p, regs);
        copy_thread(nr, clone_flags, usp, p, regs);
        p->semundo = NULL;
        p->semundo = NULL;
 
 
        /* ok, now we should be set up.. */
        /* ok, now we should be set up.. */
        p->swappable = 1;
        p->swappable = 1;
Line 387... Line 386...
#ifdef NO_MM    
#ifdef NO_MM    
        if (clone_flags & CLONE_WAIT) {
        if (clone_flags & CLONE_WAIT) {
                sleep_on(&current->mm->vforkwait);
                sleep_on(&current->mm->vforkwait);
        }
        }
#endif /*NO_MM*/
#endif /*NO_MM*/
printk("do_fork9\n");
 
        return p->pid;
        return p->pid;
 
 
bad_fork_cleanup_sighand:
bad_fork_cleanup_sighand:
        exit_sighand(p);
        exit_sighand(p);
bad_fork_cleanup_fs:
bad_fork_cleanup_fs:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.