Changeset 3ff2b54 in mainline


Ignore:
Timestamp:
2008-11-22T11:26:53Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e6c9eb
Parents:
6571b78
Message:

Merge feature from tracing: correct stopping of CPU-intensive tasks in udebug.

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/udebug/udebug.h

    r6571b78 r3ff2b54  
    176176        call_t *go_call;
    177177        unative_t syscall_args[6];
     178        istate_t *uspace_state;
    178179
    179180        /** What type of event are we stopped in or 0 if none. */
  • kernel/generic/src/interrupt/interrupt.c

    r6571b78 r3ff2b54  
    8787{
    8888        ASSERT(n < IVT_ITEMS);
     89
     90#ifdef CONFIG_UDEBUG
     91        if (THREAD) THREAD->udebug.uspace_state = istate;
     92#endif
    8993       
    9094        exc_table[n].f(n + IVT_FIRST, istate);
     95
     96#ifdef CONFIG_UDEBUG
     97        if (THREAD) THREAD->udebug.uspace_state = NULL;
     98#endif
     99
    91100        /* This is a safe place to exit exiting thread */
    92101        if (THREAD && THREAD->interrupted && istate_from_uspace(istate))
  • kernel/generic/src/time/clock.c

    r6571b78 r3ff2b54  
    191191                if (!ticks && !PREEMPTION_DISABLED) {
    192192                        scheduler();
     193#ifdef CONFIG_UDEBUG
     194                        /*
     195                         * Give udebug chance to stop the thread
     196                         * before it begins executing.
     197                         */
     198                        if (istate_from_uspace(THREAD->udebug.uspace_state))
     199                                udebug_before_thread_runs();
     200#endif
    193201                }
    194202        }
  • kernel/generic/src/udebug/udebug.c

    r6571b78 r3ff2b54  
    7070
    7171        ut->go_call = NULL;
     72        ut->uspace_state = NULL;
    7273        ut->go = false;
    7374        ut->stoppable = true;
     
    232233/** Upon being scheduled to run, check if the current thread should stop.
    233234 *
    234  * This function is called from clock(). Preemption is enabled.
    235  * interrupts are disabled, but since this is called after
    236  * being scheduled-in, we can enable them, if we're careful enough
    237  * not to allow arbitrary recursion or deadlock with the thread context.
     235 * This function is called from clock().
    238236 */
    239237void udebug_before_thread_runs(void)
    240238{
    241         ipl_t ipl;
    242 
    243         return;
    244 
    245         ipl = interrupts_enable();
    246 
    247         /* Now we're free to do whatever we need (lock mutexes, sleep, etc.) */
    248 
    249239        /* Check if we're supposed to stop */
    250240        udebug_stoppable_begin();
    251241        udebug_stoppable_end();
    252 
    253         interrupts_restore(ipl);
    254242}
    255243
Note: See TracChangeset for help on using the changeset viewer.