Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r04e3d9f rd0c82c5  
    5555#include <arch/cycle.h>
    5656#include <str.h>
    57 #include <trace.h>
    5857
    5958exc_table_t exc_table[IVT_ITEMS];
     
    9897 *
    9998 */
    100 NO_TRACE void exc_dispatch(unsigned int n, istate_t *istate)
    101 {
     99void exc_dispatch(unsigned int n, istate_t *istate)
     100{
     101        ASSERT(CPU);
     102       
    102103#if (IVT_ITEMS > 0)
    103104        ASSERT(n < IVT_ITEMS);
     
    112113       
    113114        /* Account CPU usage if it has waked up from sleep */
    114         if (CPU) {
    115                 irq_spinlock_lock(&CPU->lock, false);
    116                 if (CPU->idle) {
    117                         uint64_t now = get_cycle();
    118                         CPU->idle_cycles += now - CPU->last_cycle;
    119                         CPU->last_cycle = now;
    120                         CPU->idle = false;
    121                 }
    122                 irq_spinlock_unlock(&CPU->lock, false);
    123         }
     115        irq_spinlock_lock(&CPU->lock, false);
     116        if (CPU->idle) {
     117                uint64_t now = get_cycle();
     118                CPU->idle_cycles += now - CPU->last_cycle;
     119                CPU->last_cycle = now;
     120                CPU->idle = false;
     121        }
     122        irq_spinlock_unlock(&CPU->lock, false);
    124123       
    125124        uint64_t begin_cycle = get_cycle();
     
    144143        uint64_t end_cycle = get_cycle();
    145144       
    146         irq_spinlock_lock(&exctbl_lock, false);
    147145        exc_table[n].cycles += end_cycle - begin_cycle;
    148146        exc_table[n].count++;
    149         irq_spinlock_unlock(&exctbl_lock, false);
    150147       
    151148        /* Do not charge THREAD for exception cycles */
     
    160157 *
    161158 */
    162 NO_TRACE static void exc_undef(unsigned int n, istate_t *istate)
     159static void exc_undef(unsigned int n, istate_t *istate)
    163160{
    164161        fault_if_from_uspace(istate, "Unhandled exception %u.", n);
     
    169166 *
    170167 */
    171 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
     168void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
    172169{
    173170        if (!istate_from_uspace(istate))
     
    216213 *
    217214 */
    218 NO_TRACE static int cmd_exc_print(cmd_arg_t *argv)
     215static int cmd_exc_print(cmd_arg_t *argv)
    219216{
    220217        bool excs_all;
Note: See TracChangeset for help on using the changeset viewer.