Ignore:
Timestamp:
2010-07-12T10:53:30Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd11d3e
Parents:
c40e6ef (diff), bee2d4c (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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rc40e6ef rbd48f4c  
    5555#include <arch/cycle.h>
    5656#include <str.h>
     57#include <trace.h>
    5758
    5859exc_table_t exc_table[IVT_ITEMS];
     
    9798 *
    9899 */
    99 void exc_dispatch(unsigned int n, istate_t *istate)
    100 {
    101         ASSERT(CPU);
    102        
     100NO_TRACE void exc_dispatch(unsigned int n, istate_t *istate)
     101{
    103102#if (IVT_ITEMS > 0)
    104103        ASSERT(n < IVT_ITEMS);
     
    113112       
    114113        /* Account CPU usage if it has waked up from sleep */
    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);
     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        }
    123124       
    124125        uint64_t begin_cycle = get_cycle();
     
    143144        uint64_t end_cycle = get_cycle();
    144145       
     146        irq_spinlock_lock(&exctbl_lock, false);
    145147        exc_table[n].cycles += end_cycle - begin_cycle;
    146148        exc_table[n].count++;
     149        irq_spinlock_unlock(&exctbl_lock, false);
    147150       
    148151        /* Do not charge THREAD for exception cycles */
     
    157160 *
    158161 */
    159 static void exc_undef(unsigned int n, istate_t *istate)
     162NO_TRACE static void exc_undef(unsigned int n, istate_t *istate)
    160163{
    161164        fault_if_from_uspace(istate, "Unhandled exception %u.", n);
    162         panic("Unhandled exception %u.", n);
     165        panic_badtrap(istate, n, "Unhandled exception %u.", n);
    163166}
    164167
     
    166169 *
    167170 */
    168 void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
     171NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
    169172{
    170173        if (!istate_from_uspace(istate))
     
    213216 *
    214217 */
    215 static int cmd_exc_print(cmd_arg_t *argv)
     218NO_TRACE static int cmd_exc_print(cmd_arg_t *argv)
    216219{
    217220        bool excs_all;
Note: See TracChangeset for help on using the changeset viewer.