Changeset 7509ddc in mainline for generic/src/syscall/syscall.c


Ignore:
Timestamp:
2006-06-04T21:54:49Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
34dcd3f
Parents:
2cb5e64
Message:

Framework for task_kill().
Some pieces (e.g. implementation of ktask_cleanup() kernel thread and
task_destroy() function) are missing.
Changed locking order for task lock, threads_lock and thread lock from
threads_lock, thread lock, task lock to task lock, threads_lock, thread lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/syscall/syscall.c

    r2cb5e64 r7509ddc  
    9191                         __native a4, __native id)
    9292{
     93        __native rc;
     94        ipl_t ipl;
     95        bool exit = false;
     96
    9397        if (id < SYSCALL_END)
    94                 return syscall_table[id](a1,a2,a3,a4);
     98                rc = syscall_table[id](a1,a2,a3,a4);
    9599        else
    96100                panic("Undefined syscall %d", id);
     101               
     102        ipl = interrupts_disable();
     103        spinlock_lock(&THREAD->lock);
     104        if (THREAD->interrupted)
     105                exit = true;
     106        spinlock_unlock(&THREAD->lock);
     107        interrupts_restore(ipl);
     108       
     109        if (exit)
     110                thread_exit();
     111       
     112        return rc;
    97113}
    98114
Note: See TracChangeset for help on using the changeset viewer.