Ignore:
Timestamp:
2014-10-20T20:38:13Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d70ebffe
Parents:
416ef49
Message:

Let most of the sparc64 traps go through exc_dispatch().

  • All interrupts (level and vector_trap) now use exc_dispatch().
  • Fast MMU traps still don't use it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/trap/interrupt.c

    r416ef49 rec443d5  
    3636#include <arch/interrupt.h>
    3737#include <arch/trap/interrupt.h>
     38#include <arch/trap/exception.h>
    3839#include <arch/sparc64.h>
    3940#include <interrupt.h>
     
    4344#include <arch/asm.h>
    4445#include <arch/barrier.h>
     46#include <arch/drivers/tick.h>
    4547#include <print.h>
    4648#include <arch.h>
     
    4951#include <synch/spinlock.h>
    5052
    51 /** Register Interrupt Level Handler.
    52  *
    53  * @param n       Interrupt Level (1 - 15).
    54  * @param name    Short descriptive string.
    55  * @param handler Handler.
    56  *
    57  */
    58 void interrupt_register(unsigned int n, const char *name, iroutine_t handler)
     53void exc_arch_init(void)
    5954{
    60         ASSERT(n >= IVT_FIRST);
    61         ASSERT(n <= IVT_ITEMS);
     55        exc_register(TT_INSTRUCTION_ACCESS_EXCEPTION,
     56            "instruction_access_exception", false,
     57            instruction_access_exception);
     58        exc_register(TT_INSTRUCTION_ACCESS_ERROR,
     59            "instruction_access_error", false,
     60            instruction_access_error);
     61        exc_register(TT_ILLEGAL_INSTRUCTION,
     62            "illegal_instruction", false,
     63            illegal_instruction);
     64        exc_register(TT_PRIVILEGED_OPCODE,
     65            "privileged_opcode", false,
     66            privileged_opcode);
     67        exc_register(TT_UNIMPLEMENTED_LDD,
     68            "unimplemented_LDD", false,
     69            unimplemented_LDD);
     70        exc_register(TT_UNIMPLEMENTED_STD,
     71            "unimplemented_STD", false,
     72            unimplemented_STD);
     73        exc_register(TT_FP_DISABLED,
     74            "fp_disabled", true,
     75            fp_disabled);
     76        exc_register(TT_FP_EXCEPTION_IEEE_754,
     77            "fp_exception_ieee_754", false,
     78            fp_exception_ieee_754);
     79        exc_register(TT_FP_EXCEPTION_OTHER,
     80            "fp_exception_other", false,
     81            fp_exception_other);
     82        exc_register(TT_TAG_OVERFLOW,
     83            "tag_overflow", false,
     84            tag_overflow);     
     85        exc_register(TT_DIVISION_BY_ZERO,
     86            "division_by_zero", false,
     87            division_by_zero);
     88        exc_register(TT_DATA_ACCESS_EXCEPTION,
     89            "data_access_exception", false,
     90            data_access_exception);
     91        exc_register(TT_DATA_ACCESS_ERROR,
     92            "data_access_error", false,
     93            data_access_error);
     94        exc_register(TT_MEM_ADDRESS_NOT_ALIGNED,
     95            "mem_address_not_aligned", false,
     96            mem_address_not_aligned);
     97        exc_register(TT_LDDF_MEM_ADDRESS_NOT_ALIGNED,
     98            "LDDF_mem_address_not_aligned", false,
     99            LDDF_mem_address_not_aligned);
     100        exc_register(TT_STDF_MEM_ADDRESS_NOT_ALIGNED,
     101            "STDF_mem_address_not_aligned", false,
     102            STDF_mem_address_not_aligned);
     103        exc_register(TT_PRIVILEGED_ACTION,
     104            "privileged_action", false,
     105            privileged_action);
     106        exc_register(TT_LDQF_MEM_ADDRESS_NOT_ALIGNED,
     107            "LDQF_mem_address_not_aligned", false,
     108            LDQF_mem_address_not_aligned);
     109        exc_register(TT_STQF_MEM_ADDRESS_NOT_ALIGNED,
     110            "STQF_mem_address_not_aligned", false,
     111            STQF_mem_address_not_aligned);
     112
     113        exc_register(TT_INTERRUPT_LEVEL_14,
     114            "interrupt_level_14", true,
     115            tick_interrupt);
     116
     117#ifdef SUN4u
     118        exc_register(TT_INTERRUPT_VECTOR_TRAP,
     119            "interrupt_vector_trap", true,
     120            interrupt);
     121#endif
    62122       
    63         exc_register(n - IVT_FIRST, name, true, handler);
    64123}
    65124
Note: See TracChangeset for help on using the changeset viewer.