Ignore:
Timestamp:
2023-12-28T13:59:23Z (2 years ago)
Author:
GitHub <noreply@…>
Children:
6b66de6b
Parents:
42c2e65 (diff), f87ff8e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2023-12-28 13:59:23)
git-committer:
GitHub <noreply@…> (2023-12-28 13:59:23)
Message:

Merge branch 'master' into topic/packet-capture

File:
1 edited

Legend:

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

    r42c2e65 rdc5c303  
    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
    6067exc_table_t exc_table[IVT_ITEMS];
    6168IRQ_SPINLOCK_INITIALIZE(exctbl_lock);
     
    7784#if (IVT_ITEMS > 0)
    7885        assert(n < IVT_ITEMS);
    79 #endif
    8086
    8187        irq_spinlock_lock(&exctbl_lock, true);
     
    9197
    9298        return old;
     99#else
     100        panic("No space for any exception handler, cannot register.");
     101#endif
    93102}
    94103
     
    103112#if (IVT_ITEMS > 0)
    104113        assert(n < IVT_ITEMS);
    105 #endif
    106114
    107115        /* Account user cycles */
     
    114122        /* Account CPU usage if it woke up from sleep */
    115123        if (CPU && CPU->idle) {
    116                 irq_spinlock_lock(&CPU->lock, false);
    117124                uint64_t now = get_cycle();
    118                 CPU->idle_cycles += now - CPU->last_cycle;
     125                atomic_time_increment(&CPU->idle_cycles, now - CPU->last_cycle);
    119126                CPU->last_cycle = now;
    120127                CPU->idle = false;
    121                 irq_spinlock_unlock(&CPU->lock, false);
    122128        }
    123129
     
    154160                irq_spinlock_unlock(&THREAD->lock, false);
    155161        }
     162#else
     163        panic("No space for any exception handler, yet we want to handle some exception.");
     164#endif
    156165}
    157166
Note: See TracChangeset for help on using the changeset viewer.