--- zzzz-none-000/linux-2.4.17/kernel/exit.c 2001-11-21 22:42:27.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/kernel/exit.c 2004-11-24 13:21:27.000000000 +0000 @@ -16,6 +16,8 @@ #include #endif +#include + #include #include #include @@ -190,6 +192,8 @@ } i++; set >>= 1; + debug_lock_break(1); + conditional_schedule(); } } } @@ -273,6 +277,10 @@ struct mm_struct * start_lazy_tlb(void) { struct mm_struct *mm = current->mm; +#ifdef CONFIG_PREEMPT + if (preempt_is_disabled() == 0) + BUG(); +#endif current->mm = NULL; /* active_mm is still 'mm' */ atomic_inc(&mm->mm_count); @@ -284,6 +292,10 @@ { struct mm_struct *active_mm = current->active_mm; +#ifdef CONFIG_PREEMPT + if (preempt_is_disabled() == 0) + BUG(); +#endif current->mm = mm; if (mm != active_mm) { current->active_mm = mm; @@ -292,6 +304,21 @@ mmdrop(active_mm); } +static inline void __exit_itimers(struct task_struct *tsk) +{ + struct k_itimer *tmr; + + while (tsk->posix_timers.next != &tsk->posix_timers){ + tmr = list_entry(tsk->posix_timers.next,struct k_itimer,list); + itimer_delete(tmr); + } +} + +void exit_itimers(struct task_struct *tsk) +{ + __exit_itimers(tsk); +} + /* * Turn us into a lazy TLB process if we * aren't already.. @@ -307,8 +334,8 @@ /* more a memory barrier than a real lock */ task_lock(tsk); tsk->mm = NULL; - task_unlock(tsk); enter_lazy_tlb(mm, current, smp_processor_id()); + task_unlock(tsk); mmput(mm); } } @@ -337,7 +364,7 @@ * is about to become orphaned. */ - t = current->p_pptr; + t = current->p_opptr; if ((t->pgrp != current->pgrp) && (t->session == current->session) && @@ -435,10 +462,13 @@ #endif __exit_mm(tsk); + TRACE_PROCESS(TRACE_EV_PROCESS_EXIT, 0, 0); + lock_kernel(); sem_exit(); __exit_files(tsk); __exit_fs(tsk); + __exit_itimers(tsk); exit_sighand(tsk); exit_thread(); @@ -491,6 +521,8 @@ if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL)) return -EINVAL; + TRACE_PROCESS(TRACE_EV_PROCESS_WAIT, pid, 0); + add_wait_queue(¤t->wait_chldexit,&wait); repeat: flag = 0; @@ -549,7 +581,7 @@ REMOVE_LINKS(p); p->p_pptr = p->p_opptr; SET_LINKS(p); - do_notify_parent(p, SIGCHLD); + do_notify_parent(p, p->exit_signal); write_unlock_irq(&tasklist_lock); } else release_task(p); @@ -580,7 +612,7 @@ return retval; } -#if !defined(__alpha__) && !defined(__ia64__) +#if !defined(__alpha__) && !defined(__ia64__) && !defined(__arm__) /* * sys_waitpid() remains for compatibility. waitpid() should be