Ignore:
File:
1 edited

Legend:

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

    rdfb16c4 r8df5f20  
    5858#include <trace.h>
    5959
    60 /*
    61  * If IVT_ITEMS is zero (e.g. for special/abs32le) we hide completely any
    62  * access to the exception table array and panic if the function is called
    63  * at all. It also silences (correct) compiler warnings about possible
    64  * out-of-bound array access.
    65  */
    66 
    6760exc_table_t exc_table[IVT_ITEMS];
    6861IRQ_SPINLOCK_INITIALIZE(exctbl_lock);
     
    8477#if (IVT_ITEMS > 0)
    8578        assert(n < IVT_ITEMS);
     79#endif
    8680
    8781        irq_spinlock_lock(&exctbl_lock, true);
     
    9791
    9892        return old;
    99 #else
    100         panic("No space for any exception handler, cannot register.");
    101 #endif
    10293}
    10394
     
    112103#if (IVT_ITEMS > 0)
    113104        assert(n < IVT_ITEMS);
     105#endif
    114106
    115107        /* Account user cycles */
     
    122114        /* Account CPU usage if it woke up from sleep */
    123115        if (CPU && CPU->idle) {
     116                irq_spinlock_lock(&CPU->lock, false);
    124117                uint64_t now = get_cycle();
    125                 atomic_time_increment(&CPU->idle_cycles, now - CPU->last_cycle);
     118                CPU->idle_cycles += now - CPU->last_cycle;
    126119                CPU->last_cycle = now;
    127120                CPU->idle = false;
     121                irq_spinlock_unlock(&CPU->lock, false);
    128122        }
    129123
     
    160154                irq_spinlock_unlock(&THREAD->lock, false);
    161155        }
    162 #else
    163         panic("No space for any exception handler, yet we want to handle some exception.");
    164 #endif
    165156}
    166157
Note: See TracChangeset for help on using the changeset viewer.