Changeset e2bf639 in mainline


Ignore:
Timestamp:
2006-09-05T21:06:59Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d7e3f1ad
Parents:
5035eeb7
Message:

Handle more sparc64 traps and improve handling of already handled traps.

Location:
kernel
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/trap/exception.h

    r5035eeb7 re2bf639  
    3838
    3939#define TT_INSTRUCTION_ACCESS_EXCEPTION         0x08
     40#define TT_INSTRUCTION_ACCESS_ERROR             0x0a
    4041#define TT_ILLEGAL_INSTRUCTION                  0x10
     42#define TT_PRIVILEGED_OPCODE                    0x11
     43#define TT_DIVISION_BY_ZERO                     0x28
     44#define TT_DATA_ACCESS_EXCEPTION                0x30
    4145#define TT_DATA_ACCESS_ERROR                    0x32
    4246#define TT_MEM_ADDRESS_NOT_ALIGNED              0x34
     47#define TT_PRIVILEGED_ACTION                    0x38
    4348
    4449#ifndef __ASM__
     
    4651#include <typedefs.h>
    4752
    48 extern void do_instruction_access_exc(int n, istate_t *istate);
    49 extern void do_mem_address_not_aligned(int n, istate_t *istate);
    50 extern void do_data_access_error(int n, istate_t *istate);
    51 extern void do_illegal_instruction(int n, istate_t *istate);
     53extern void instruction_access_exception(int n, istate_t *istate);
     54extern void instruction_access_error(int n, istate_t *istate);
     55extern void illegal_instruction(int n, istate_t *istate);
     56extern void privileged_opcode(int n, istate_t *istate);
     57extern void division_by_zero(int n, istate_t *istate);
     58extern void data_access_exception(int n, istate_t *istate);
     59extern void data_access_error(int n, istate_t *istate);
     60extern void mem_address_not_aligned(int n, istate_t *istate);
     61extern void privileged_action(int n, istate_t *istate);
     62
    5263
    5364#endif /* !__ASM__ */
  • kernel/arch/sparc64/include/trap/mmu.h

    r5035eeb7 re2bf639  
    6363.endm
    6464
    65 .macro FAST_DATA_ACCESS_MMU_MISS_HANDLER
     65.macro FAST_DATA_ACCESS_MMU_MISS_HANDLER tl
    6666        /*
    6767         * First, try to refill TLB from TSB.
     
    101101         */
    1021020:
    103         HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL
     103.if (\tl > 0)
     104        wrpr %g0, 1, %tl
     105.endif
    104106
    105107        wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate
     
    107109.endm
    108110
    109 .macro FAST_DATA_ACCESS_PROTECTION_HANDLER
     111.macro FAST_DATA_ACCESS_PROTECTION_HANDLER tl
    110112        /*
    111113         * First, try to refill TLB from TSB.
     
    116118         * The same special case as in FAST_DATA_ACCESS_MMU_MISS_HANDLER.
    117119         */
    118         HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL
     120.if (\tl > 0)
     121        wrpr %g0, 1, %tl
     122.endif
    119123
    120124        wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate
    121125        PREEMPTIBLE_HANDLER fast_data_access_protection
    122 .endm
    123 
    124 .macro MEM_ADDRESS_NOT_ALIGNED_HANDLER
    125         ba mem_address_not_aligned_handler
    126         nop
    127 .endm
    128 
    129 /*
    130  * Macro used to lower TL when a MMU trap is caused by
    131  * the userspace register window spill or fill handler.
    132  */
    133 .macro HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL
    134         rdpr %tl, %g1
    135         sub %g1, 1, %g2
    136         brz %g2, 0f                     ! if TL was 1, skip
    137         nop
    138         wrpr %g2, 0, %tl                ! TL--
    139         rdpr %tt, %g3
    140         cmp %g3, TT_SPILL_1_NORMAL
    141         be 0f                           ! trap from spill_1_normal?
    142         cmp %g3, TT_FILL_1_NORMAL
    143         bne,a 0f                        ! trap from fill_1_normal? (negated condition)
    144         wrpr %g1, 0, %tl                ! TL++
    145 0:
    146126.endm
    147127
  • kernel/arch/sparc64/src/mm/tlb.c

    r5035eeb7 re2bf639  
    4141#include <arch/mm/mmu.h>
    4242#include <arch/interrupt.h>
     43#include <interrupt.h>
    4344#include <arch.h>
    4445#include <print.h>
     
    309310        char *tpc_str = get_symtab_entry(istate->tpc);
    310311
     312        fault_if_from_uspace(istate, "%s\n", str);
    311313        printf("TPC=%p, (%s)\n", istate->tpc, tpc_str);
    312314        panic("%s\n", str);
     
    320322        va = tag.vpn << PAGE_WIDTH;
    321323
     324        fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, tag.context);
    322325        printf("Faulting page: %p, ASID=%d\n", va, tag.context);
    323326        printf("TPC=%p, (%s)\n", istate->tpc, tpc_str);
     
    332335        va = tag.vpn << PAGE_WIDTH;
    333336
     337        fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, va, tag.context);
    334338        printf("Faulting page: %p, ASID=%d\n", va, tag.context);
    335339        printf("TPC=%p, (%s)\n", istate->tpc, tpc_str);
  • kernel/arch/sparc64/src/trap/exception.c

    r5035eeb7 re2bf639  
    3636#include <arch/trap/exception.h>
    3737#include <arch/interrupt.h>
     38#include <interrupt.h>
    3839#include <arch/asm.h>
    3940#include <debug.h>
    4041#include <typedefs.h>
    4142
    42 /** Handle instruction_access_exception. */
    43 void do_instruction_access_exc(int n, istate_t *istate)
     43/** Handle instruction_access_exception. (0x8) */
     44void instruction_access_exception(int n, istate_t *istate)
    4445{
    45         panic("Instruction Access Exception at %p.\n", istate->tpc);
     46        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     47        panic("%s at %p.\n", __FUNCTION__, istate->tpc);
    4648}
    4749
    48 /** Handle mem_address_not_aligned. */
    49 void do_mem_address_not_aligned(int n, istate_t *istate)
     50/** Handle instruction_access_error. (0xa) */
     51void instruction_access_error(int n, istate_t *istate)
    5052{
    51         panic("Memory Address Not Aligned from %p.\n", istate->tpc);
     53        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     54        panic("%s at %p.\n", __FUNCTION__, istate->tpc);
    5255}
    5356
    54 /** Handle data_access_error. */
    55 void do_data_access_error(int n, istate_t *istate)
     57/** Handle illegal_instruction. (0x10) */
     58void illegal_instruction(int n, istate_t *istate)
    5659{
    57         panic("Data Access Error from %p.\n", istate->tpc);
     60        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     61        panic("%s at %p.\n", __FUNCTION__, istate->tpc);
    5862}
    5963
    60 /** Handle mem_address_not_aligned. */
    61 void do_illegal_instruction(int n, istate_t *istate)
     64/** Handle privileged_opcode. (0x11) */
     65void privileged_opcode(int n, istate_t *istate)
    6266{
    63         panic("Illegal Instruction at %p.\n", istate->tpc);
     67        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     68        panic("%s at %p.\n", __FUNCTION__, istate->tpc);
     69}
     70
     71/** Handle division_by_zero. (0x28) */
     72void division_by_zero(int n, istate_t *istate)
     73{
     74        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     75        panic("%s at %p.\n", __FUNCTION__, istate->tpc);
     76}
     77
     78/** Handle data_access_exception. (0x30) */
     79void data_access_exception(int n, istate_t *istate)
     80{
     81        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     82        panic("%s from %p.\n", __FUNCTION__, istate->tpc);
     83}
     84
     85/** Handle data_access_error. (0x32) */
     86void data_access_error(int n, istate_t *istate)
     87{
     88        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     89        panic("%s from %p.\n", __FUNCTION__, istate->tpc);
     90}
     91
     92/** Handle mem_address_not_aligned. (0x34) */
     93void mem_address_not_aligned(int n, istate_t *istate)
     94{
     95        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     96        panic("%s from %p.\n", __FUNCTION__, istate->tpc);
     97}
     98
     99/** Handle privileged_action. (0x37) */
     100void privileged_action(int n, istate_t *istate)
     101{
     102        fault_if_from_uspace(istate, "%s\n", __FUNCTION__);
     103        panic("%s at %p.\n", __FUNCTION__, istate->tpc);
    64104}
    65105
    66106/** @}
    67107 */
    68 
  • kernel/arch/sparc64/src/trap/interrupt.c

    r5035eeb7 re2bf639  
    6262void irq_ipc_bind_arch(unative_t irq)
    6363{
    64         panic("not implemented\n");
    6564        /* TODO */
    6665}
  • kernel/arch/sparc64/src/trap/mmu.S

    r5035eeb7 re2bf639  
    4141#include <arch/regdef.h>
    4242
    43 .global mem_address_not_aligned_handler
    44 mem_address_not_aligned_handler:
    45         HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL
    46         PREEMPTIBLE_HANDLER do_mem_address_not_aligned
  • kernel/arch/sparc64/src/trap/trap_table.S

    r5035eeb7 re2bf639  
    6060/* TT = 0x08, TL = 0, instruction_access_exception */
    6161.org trap_table + TT_INSTRUCTION_ACCESS_EXCEPTION*ENTRY_SIZE
    62 .global instruction_access_exception
    63 instruction_access_exception:
    64         PREEMPTIBLE_HANDLER do_instruction_access_exc
     62.global instruction_access_exception_tl0
     63instruction_access_exception_tl0:
     64        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
     65        PREEMPTIBLE_HANDLER instruction_access_exception
     66
     67/* TT = 0x0a, TL = 0, instruction_access_error */
     68.org trap_table + TT_INSTRUCTION_ACCESS_ERROR*ENTRY_SIZE
     69.global instruction_access_error_tl0
     70instruction_access_error_tl0:
     71        PREEMPTIBLE_HANDLER instruction_access_error
    6572
    6673/* TT = 0x10, TL = 0, illegal_instruction */
    6774.org trap_table + TT_ILLEGAL_INSTRUCTION*ENTRY_SIZE
    68 .global illegal_instruction
    69 illegal_instruction:
    70         PREEMPTIBLE_HANDLER do_illegal_instruction
     75.global illegal_instruction_tl0
     76illegal_instruction_tl0:
     77        PREEMPTIBLE_HANDLER illegal_instruction
     78
     79/* TT = 0x11, TL = 0, privileged_opcode */
     80.org trap_table + TT_PRIVILEGED_OPCODE*ENTRY_SIZE
     81.global privileged_opcode_tl0
     82privileged_opcode_tl0:
     83        PREEMPTIBLE_HANDLER privileged_opcode
    7184
    7285/* TT = 0x24, TL = 0, clean_window handler */
    7386.org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE
    74 .global clean_window_handler
    75 clean_window_handler:
     87.global clean_window_handler_tl0
     88clean_window_handler_tl0:
    7689        CLEAN_WINDOW_HANDLER
     90
     91/* TT = 0x28, TL = 0, division_by_zero */
     92.org trap_table + TT_DIVISION_BY_ZERO*ENTRY_SIZE
     93.global division_by_zero_tl0
     94division_by_zero_tl0:
     95        PREEMPTIBLE_HANDLER division_by_zero
     96
     97/* TT = 0x30, TL = 0, data_access_exception */
     98.org trap_table + TT_DATA_ACCESS_EXCEPTION*ENTRY_SIZE
     99.global data_access_exception_tl0
     100data_access_exception_tl0:
     101        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
     102        PREEMPTIBLE_HANDLER data_access_exception
    77103
    78104/* TT = 0x32, TL = 0, data_access_error */
    79105.org trap_table + TT_DATA_ACCESS_ERROR*ENTRY_SIZE
    80 .global data_access_error
    81 data_access_error:
    82         PREEMPTIBLE_HANDLER do_data_access_error
     106.global data_access_error_tl0
     107data_access_error_tl0:
     108        PREEMPTIBLE_HANDLER data_access_error
    83109
    84110/* TT = 0x34, TL = 0, mem_address_not_aligned */
    85111.org trap_table + TT_MEM_ADDRESS_NOT_ALIGNED*ENTRY_SIZE
    86 .global mem_address_not_aligned
    87 mem_address_not_aligned:
    88         MEM_ADDRESS_NOT_ALIGNED_HANDLER
     112.global mem_address_not_aligned_tl0
     113mem_address_not_aligned_tl0:
     114        PREEMPTIBLE_HANDLER mem_address_not_aligned
     115
     116/* TT = 0x38, TL = 0, privileged_action */
     117.org trap_table + TT_PRIVILEGED_ACTION*ENTRY_SIZE
     118.global privileged_action_tl0
     119privileged_action_tl0:
     120        PREEMPTIBLE_HANDLER privileged_action
    89121
    90122/* TT = 0x41, TL = 0, interrupt_level_1 handler */
    91123.org trap_table + TT_INTERRUPT_LEVEL_1*ENTRY_SIZE
    92 .global interrupt_level_1_handler
    93 interrupt_level_1_handler:
     124.global interrupt_level_1_handler_tl0
     125interrupt_level_1_handler_tl0:
    94126        INTERRUPT_LEVEL_N_HANDLER 1
    95127
    96128/* TT = 0x42, TL = 0, interrupt_level_2 handler */
    97129.org trap_table + TT_INTERRUPT_LEVEL_2*ENTRY_SIZE
    98 .global interrupt_level_2_handler
    99 interrupt_level_2_handler:
     130.global interrupt_level_2_handler_tl0
     131interrupt_level_2_handler_tl0:
    100132        INTERRUPT_LEVEL_N_HANDLER 2
    101133
    102134/* TT = 0x43, TL = 0, interrupt_level_3 handler */
    103135.org trap_table + TT_INTERRUPT_LEVEL_3*ENTRY_SIZE
    104 .global interrupt_level_3_handler
    105 interrupt_level_3_handler:
     136.global interrupt_level_3_handler_tl0
     137interrupt_level_3_handler_tl0:
    106138        INTERRUPT_LEVEL_N_HANDLER 3
    107139
    108140/* TT = 0x44, TL = 0, interrupt_level_4 handler */
    109141.org trap_table + TT_INTERRUPT_LEVEL_4*ENTRY_SIZE
    110 .global interrupt_level_4_handler
    111 interrupt_level_4_handler:
     142.global interrupt_level_4_handler_tl0
     143interrupt_level_4_handler_tl0:
    112144        INTERRUPT_LEVEL_N_HANDLER 4
    113145
    114146/* TT = 0x45, TL = 0, interrupt_level_5 handler */
    115147.org trap_table + TT_INTERRUPT_LEVEL_5*ENTRY_SIZE
    116 .global interrupt_level_5_handler
    117 interrupt_level_5_handler:
     148.global interrupt_level_5_handler_tl0
     149interrupt_level_5_handler_tl0:
    118150        INTERRUPT_LEVEL_N_HANDLER 5
    119151
    120152/* TT = 0x46, TL = 0, interrupt_level_6 handler */
    121153.org trap_table + TT_INTERRUPT_LEVEL_6*ENTRY_SIZE
    122 .global interrupt_level_6_handler
    123 interrupt_level_6_handler:
     154.global interrupt_level_6_handler_tl0
     155interrupt_level_6_handler_tl0:
    124156        INTERRUPT_LEVEL_N_HANDLER 6
    125157
    126158/* TT = 0x47, TL = 0, interrupt_level_7 handler */
    127159.org trap_table + TT_INTERRUPT_LEVEL_7*ENTRY_SIZE
    128 .global interrupt_level_7_handler
    129 interrupt_level_7_handler:
     160.global interrupt_level_7_handler_tl0
     161interrupt_level_7_handler_tl0:
    130162        INTERRUPT_LEVEL_N_HANDLER 7
    131163
    132164/* TT = 0x48, TL = 0, interrupt_level_8 handler */
    133165.org trap_table + TT_INTERRUPT_LEVEL_8*ENTRY_SIZE
    134 .global interrupt_level_8_handler
    135 interrupt_level_8_handler:
     166.global interrupt_level_8_handler_tl0
     167interrupt_level_8_handler_tl0:
    136168        INTERRUPT_LEVEL_N_HANDLER 8
    137169
    138170/* TT = 0x49, TL = 0, interrupt_level_9 handler */
    139171.org trap_table + TT_INTERRUPT_LEVEL_9*ENTRY_SIZE
    140 .global interrupt_level_9_handler
    141 interrupt_level_9_handler:
     172.global interrupt_level_9_handler_tl0
     173interrupt_level_9_handler_tl0:
    142174        INTERRUPT_LEVEL_N_HANDLER 9
    143175
    144176/* TT = 0x4a, TL = 0, interrupt_level_10 handler */
    145177.org trap_table + TT_INTERRUPT_LEVEL_10*ENTRY_SIZE
    146 .global interrupt_level_10_handler
    147 interrupt_level_10_handler:
     178.global interrupt_level_10_handler_tl0
     179interrupt_level_10_handler_tl0:
    148180        INTERRUPT_LEVEL_N_HANDLER 10
    149181
    150182/* TT = 0x4b, TL = 0, interrupt_level_11 handler */
    151183.org trap_table + TT_INTERRUPT_LEVEL_11*ENTRY_SIZE
    152 .global interrupt_level_11_handler
    153 interrupt_level_11_handler:
     184.global interrupt_level_11_handler_tl0
     185interrupt_level_11_handler_tl0:
    154186        INTERRUPT_LEVEL_N_HANDLER 11
    155187
    156188/* TT = 0x4c, TL = 0, interrupt_level_12 handler */
    157189.org trap_table + TT_INTERRUPT_LEVEL_12*ENTRY_SIZE
    158 .global interrupt_level_12_handler
    159 interrupt_level_12_handler:
     190.global interrupt_level_12_handler_tl0
     191interrupt_level_12_handler_tl0:
    160192        INTERRUPT_LEVEL_N_HANDLER 12
    161193
    162194/* TT = 0x4d, TL = 0, interrupt_level_13 handler */
    163195.org trap_table + TT_INTERRUPT_LEVEL_13*ENTRY_SIZE
    164 .global interrupt_level_13_handler
    165 interrupt_level_13_handler:
     196.global interrupt_level_13_handler_tl0
     197interrupt_level_13_handler_tl0:
    166198        INTERRUPT_LEVEL_N_HANDLER 13
    167199
    168200/* TT = 0x4e, TL = 0, interrupt_level_14 handler */
    169201.org trap_table + TT_INTERRUPT_LEVEL_14*ENTRY_SIZE
    170 .global interrupt_level_14_handler
    171 interrupt_level_14_handler:
     202.global interrupt_level_14_handler_tl0
     203interrupt_level_14_handler_tl0:
    172204        INTERRUPT_LEVEL_N_HANDLER 14
    173205
    174206/* TT = 0x4f, TL = 0, interrupt_level_15 handler */
    175207.org trap_table + TT_INTERRUPT_LEVEL_15*ENTRY_SIZE
    176 .global interrupt_level_15_handler
    177 interrupt_level_15_handler:
     208.global interrupt_level_15_handler_tl0
     209interrupt_level_15_handler_tl0:
    178210        INTERRUPT_LEVEL_N_HANDLER 15
    179211
    180212/* TT = 0x60, TL = 0, interrupt_vector_trap handler */
    181213.org trap_table + TT_INTERRUPT_VECTOR_TRAP*ENTRY_SIZE
    182 .global interrupt_vector_trap_handler
    183 interrupt_vector_trap_handler:
     214.global interrupt_vector_trap_handler_tl0
     215interrupt_vector_trap_handler_tl0:
    184216        INTERRUPT_VECTOR_TRAP_HANDLER
    185217
    186218/* TT = 0x64, TL = 0, fast_instruction_access_MMU_miss */
    187219.org trap_table + TT_FAST_INSTRUCTION_ACCESS_MMU_MISS*ENTRY_SIZE
    188 .global fast_instruction_access_mmu_miss_handler
    189 fast_instruction_access_mmu_miss_handler:
     220.global fast_instruction_access_mmu_miss_handler_tl0
     221fast_instruction_access_mmu_miss_handler_tl0:
    190222        FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
    191223
    192224/* TT = 0x68, TL = 0, fast_data_access_MMU_miss */
    193225.org trap_table + TT_FAST_DATA_ACCESS_MMU_MISS*ENTRY_SIZE
    194 .global fast_data_access_mmu_miss_handler
    195 fast_data_access_mmu_miss_handler:
    196         FAST_DATA_ACCESS_MMU_MISS_HANDLER
     226.global fast_data_access_mmu_miss_handler_tl0
     227fast_data_access_mmu_miss_handler_tl0:
     228        FAST_DATA_ACCESS_MMU_MISS_HANDLER 0
    197229
    198230/* TT = 0x6c, TL = 0, fast_data_access_protection */
    199231.org trap_table + TT_FAST_DATA_ACCESS_PROTECTION*ENTRY_SIZE
    200 .global fast_data_access_protection_handler
    201 fast_data_access_protection_handler:
    202         FAST_DATA_ACCESS_PROTECTION_HANDLER
     232.global fast_data_access_protection_handler_tl0
     233fast_data_access_protection_handler_tl0:
     234        FAST_DATA_ACCESS_PROTECTION_HANDLER 0
    203235
    204236/* TT = 0x80, TL = 0, spill_0_normal handler */
    205237.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
    206 .global spill_0_normal
    207 spill_0_normal:
     238.global spill_0_normal_tl0
     239spill_0_normal_tl0:
    208240        SPILL_NORMAL_HANDLER_KERNEL
    209241
    210242/* TT = 0x84, TL = 0, spill_1_normal handler */
    211243.org trap_table + TT_SPILL_1_NORMAL*ENTRY_SIZE
    212 .global spill_1_normal
    213 spill_1_normal:
     244.global spill_1_normal_tl0
     245spill_1_normal_tl0:
    214246        SPILL_NORMAL_HANDLER_USERSPACE
    215247
    216248/* TT = 0x88, TL = 0, spill_2_normal handler */
    217249.org trap_table + TT_SPILL_2_NORMAL*ENTRY_SIZE
    218 .global spill_2_normal
    219 spill_2_normal:
     250.global spill_2_normal_tl0
     251spill_2_normal_tl0:
    220252        SPILL_TO_USPACE_WINDOW_BUFFER
    221253
    222254/* TT = 0xa0, TL = 0, spill_0_other handler */
    223255.org trap_table + TT_SPILL_0_OTHER*ENTRY_SIZE
    224 .global spill_0_other
    225 spill_0_other:
     256.global spill_0_other_tl0
     257spill_0_other_tl0:
    226258        SPILL_TO_USPACE_WINDOW_BUFFER
    227259
    228260/* TT = 0xc0, TL = 0, fill_0_normal handler */
    229261.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
    230 .global fill_0_normal
    231 fill_0_normal:
     262.global fill_0_normal_tl0
     263fill_0_normal_tl0:
    232264        FILL_NORMAL_HANDLER_KERNEL
    233265
    234266/* TT = 0xc4, TL = 0, fill_1_normal handler */
    235267.org trap_table + TT_FILL_1_NORMAL*ENTRY_SIZE
    236 .global fill_1_normal
    237 fill_1_normal:
     268.global fill_1_normal_tl0
     269fill_1_normal_tl0:
    238270        FILL_NORMAL_HANDLER_USERSPACE
    239271
    240272/* TT = 0x100, TL = 0, trap_instruction_0 */
    241273.org trap_table + TT_TRAP_INSTRUCTION(0)*ENTRY_SIZE
    242 .global trap_instruction_0
    243 trap_instruction_0:
     274.global trap_instruction_0_tl0
     275trap_instruction_0_tl0:
    244276        TRAP_INSTRUCTION 0
    245277
    246278/* TT = 0x101, TL = 0, trap_instruction_1 */
    247279.org trap_table + TT_TRAP_INSTRUCTION(1)*ENTRY_SIZE
    248 .global trap_instruction_1
    249 trap_instruction_1:
     280.global trap_instruction_1_tl0
     281trap_instruction_1_tl0:
    250282        TRAP_INSTRUCTION 1
    251283
    252284/* TT = 0x102, TL = 0, trap_instruction_2 */
    253285.org trap_table + TT_TRAP_INSTRUCTION(2)*ENTRY_SIZE
    254 .global trap_instruction_2
    255 trap_instruction_2:
     286.global trap_instruction_2_tl0
     287trap_instruction_2_tl0:
    256288        TRAP_INSTRUCTION 2
    257289
    258290/* TT = 0x103, TL = 0, trap_instruction_3 */
    259291.org trap_table + TT_TRAP_INSTRUCTION(3)*ENTRY_SIZE
    260 .global trap_instruction_3
    261 trap_instruction_3:
     292.global trap_instruction_3_tl0
     293trap_instruction_3_tl0:
    262294        TRAP_INSTRUCTION 3
    263295
    264296/* TT = 0x104, TL = 0, trap_instruction_4 */
    265297.org trap_table + TT_TRAP_INSTRUCTION(4)*ENTRY_SIZE
    266 .global trap_instruction_4
    267 trap_instruction_4:
     298.global trap_instruction_4_tl0
     299trap_instruction_4_tl0:
    268300        TRAP_INSTRUCTION 4
    269301
    270302/* TT = 0x105, TL = 0, trap_instruction_5 */
    271303.org trap_table + TT_TRAP_INSTRUCTION(5)*ENTRY_SIZE
    272 .global trap_instruction_5
    273 trap_instruction_5:
     304.global trap_instruction_5_tl0
     305trap_instruction_5_tl0:
    274306        TRAP_INSTRUCTION 5
    275307
    276308/* TT = 0x106, TL = 0, trap_instruction_6 */
    277309.org trap_table + TT_TRAP_INSTRUCTION(6)*ENTRY_SIZE
    278 .global trap_instruction_6
    279 trap_instruction_6:
     310.global trap_instruction_6_tl0
     311trap_instruction_6_tl0:
    280312        TRAP_INSTRUCTION 6
    281313
    282314/* TT = 0x107, TL = 0, trap_instruction_7 */
    283315.org trap_table + TT_TRAP_INSTRUCTION(7)*ENTRY_SIZE
    284 .global trap_instruction_7
    285 trap_instruction_7:
     316.global trap_instruction_7_tl0
     317trap_instruction_7_tl0:
    286318        TRAP_INSTRUCTION 7
    287319
    288320/* TT = 0x108, TL = 0, trap_instruction_8 */
    289321.org trap_table + TT_TRAP_INSTRUCTION(8)*ENTRY_SIZE
    290 .global trap_instruction_8
    291 trap_instruction_8:
     322.global trap_instruction_8_tl0
     323trap_instruction_8_tl0:
    292324        TRAP_INSTRUCTION 8
    293325
    294326/* TT = 0x109, TL = 0, trap_instruction_9 */
    295327.org trap_table + TT_TRAP_INSTRUCTION(9)*ENTRY_SIZE
    296 .global trap_instruction_9
    297 trap_instruction_9:
     328.global trap_instruction_9_tl0
     329trap_instruction_9_tl0:
    298330        TRAP_INSTRUCTION 9
    299331
    300332/* TT = 0x10a, TL = 0, trap_instruction_10 */
    301333.org trap_table + TT_TRAP_INSTRUCTION(10)*ENTRY_SIZE
    302 .global trap_instruction_10
    303 trap_instruction_10:
     334.global trap_instruction_10_tl0
     335trap_instruction_10_tl0:
    304336        TRAP_INSTRUCTION 10
    305337
    306338/* TT = 0x10b, TL = 0, trap_instruction_11 */
    307339.org trap_table + TT_TRAP_INSTRUCTION(11)*ENTRY_SIZE
    308 .global trap_instruction_11
    309 trap_instruction_11:
     340.global trap_instruction_11_tl0
     341trap_instruction_11_tl0:
    310342        TRAP_INSTRUCTION 11
    311343
    312344/* TT = 0x10c, TL = 0, trap_instruction_12 */
    313345.org trap_table + TT_TRAP_INSTRUCTION(12)*ENTRY_SIZE
    314 .global trap_instruction_12
    315 trap_instruction_12:
     346.global trap_instruction_12_tl0
     347trap_instruction_12_tl0:
    316348        TRAP_INSTRUCTION 12
    317349
    318350/* TT = 0x10d, TL = 0, trap_instruction_13 */
    319351.org trap_table + TT_TRAP_INSTRUCTION(13)*ENTRY_SIZE
    320 .global trap_instruction_13
    321 trap_instruction_13:
     352.global trap_instruction_13_tl0
     353trap_instruction_13_tl0:
    322354        TRAP_INSTRUCTION 13
    323355
    324356/* TT = 0x10e, TL = 0, trap_instruction_14 */
    325357.org trap_table + TT_TRAP_INSTRUCTION(14)*ENTRY_SIZE
    326 .global trap_instruction_14
    327 trap_instruction_14:
     358.global trap_instruction_14_tl0
     359trap_instruction_14_tl0:
    328360        TRAP_INSTRUCTION 14
    329361
    330362/* TT = 0x10f, TL = 0, trap_instruction_15 */
    331363.org trap_table + TT_TRAP_INSTRUCTION(15)*ENTRY_SIZE
    332 .global trap_instruction_15
    333 trap_instruction_15:
     364.global trap_instruction_15_tl0
     365trap_instruction_15_tl0:
    334366        TRAP_INSTRUCTION 15
    335367
    336368/* TT = 0x110, TL = 0, trap_instruction_16 */
    337369.org trap_table + TT_TRAP_INSTRUCTION(16)*ENTRY_SIZE
    338 .global trap_instruction_16
    339 trap_instruction_16:
     370.global trap_instruction_16_tl0
     371trap_instruction_16_tl0:
    340372        TRAP_INSTRUCTION 16
    341373
    342374/* TT = 0x111, TL = 0, trap_instruction_17 */
    343375.org trap_table + TT_TRAP_INSTRUCTION(17)*ENTRY_SIZE
    344 .global trap_instruction_17
    345 trap_instruction_17:
     376.global trap_instruction_17_tl0
     377trap_instruction_17_tl0:
    346378        TRAP_INSTRUCTION 17
    347379
    348380/* TT = 0x112, TL = 0, trap_instruction_18 */
    349381.org trap_table + TT_TRAP_INSTRUCTION(18)*ENTRY_SIZE
    350 .global trap_instruction_18
    351 trap_instruction_18:
     382.global trap_instruction_18_tl0
     383trap_instruction_18_tl0:
    352384        TRAP_INSTRUCTION 18
    353385
    354386/* TT = 0x113, TL = 0, trap_instruction_19 */
    355387.org trap_table + TT_TRAP_INSTRUCTION(19)*ENTRY_SIZE
    356 .global trap_instruction_19
    357 trap_instruction_19:
     388.global trap_instruction_19_tl0
     389trap_instruction_19_tl0:
    358390        TRAP_INSTRUCTION 19
    359391
    360392/* TT = 0x114, TL = 0, trap_instruction_20 */
    361393.org trap_table + TT_TRAP_INSTRUCTION(20)*ENTRY_SIZE
    362 .global trap_instruction_20
    363 trap_instruction_20:
     394.global trap_instruction_20_tl0
     395trap_instruction_20_tl0:
    364396        TRAP_INSTRUCTION 20
    365397
    366398/* TT = 0x115, TL = 0, trap_instruction_21 */
    367399.org trap_table + TT_TRAP_INSTRUCTION(21)*ENTRY_SIZE
    368 .global trap_instruction_21
    369 trap_instruction_21:
     400.global trap_instruction_21_tl0
     401trap_instruction_21_tl0:
    370402        TRAP_INSTRUCTION 21
    371403
    372404/* TT = 0x116, TL = 0, trap_instruction_22 */
    373405.org trap_table + TT_TRAP_INSTRUCTION(22)*ENTRY_SIZE
    374 .global trap_instruction_22
    375 trap_instruction_22:
     406.global trap_instruction_22_tl0
     407trap_instruction_22_tl0:
    376408        TRAP_INSTRUCTION 22
    377409
    378410/* TT = 0x117, TL = 0, trap_instruction_23 */
    379411.org trap_table + TT_TRAP_INSTRUCTION(23)*ENTRY_SIZE
    380 .global trap_instruction_23
    381 trap_instruction_23:
     412.global trap_instruction_23_tl0
     413trap_instruction_23_tl0:
    382414        TRAP_INSTRUCTION 23
    383415
    384416/* TT = 0x118, TL = 0, trap_instruction_24 */
    385417.org trap_table + TT_TRAP_INSTRUCTION(24)*ENTRY_SIZE
    386 .global trap_instruction_24
    387 trap_instruction_24:
     418.global trap_instruction_24_tl0
     419trap_instruction_24_tl0:
    388420        TRAP_INSTRUCTION 24
    389421
    390422/* TT = 0x119, TL = 0, trap_instruction_25 */
    391423.org trap_table + TT_TRAP_INSTRUCTION(25)*ENTRY_SIZE
    392 .global trap_instruction_25
    393 trap_instruction_25:
     424.global trap_instruction_25_tl0
     425trap_instruction_25_tl0:
    394426        TRAP_INSTRUCTION 25
    395427
    396428/* TT = 0x11a, TL = 0, trap_instruction_26 */
    397429.org trap_table + TT_TRAP_INSTRUCTION(26)*ENTRY_SIZE
    398 .global trap_instruction_26
    399 trap_instruction_26:
     430.global trap_instruction_26_tl0
     431trap_instruction_26_tl0:
    400432        TRAP_INSTRUCTION 26
    401433
    402434/* TT = 0x11b, TL = 0, trap_instruction_27 */
    403435.org trap_table + TT_TRAP_INSTRUCTION(27)*ENTRY_SIZE
    404 .global trap_instruction_27
    405 trap_instruction_27:
     436.global trap_instruction_27_tl0
     437trap_instruction_27_tl0:
    406438        TRAP_INSTRUCTION 27
    407439
    408440/* TT = 0x11c, TL = 0, trap_instruction_28 */
    409441.org trap_table + TT_TRAP_INSTRUCTION(28)*ENTRY_SIZE
    410 .global trap_instruction_28
    411 trap_instruction_28:
     442.global trap_instruction_28_tl0
     443trap_instruction_28_tl0:
    412444        TRAP_INSTRUCTION 28
    413445
    414446/* TT = 0x11d, TL = 0, trap_instruction_29 */
    415447.org trap_table + TT_TRAP_INSTRUCTION(29)*ENTRY_SIZE
    416 .global trap_instruction_29
    417 trap_instruction_29:
     448.global trap_instruction_29_tl0
     449trap_instruction_29_tl0:
    418450        TRAP_INSTRUCTION 29
    419451
    420452/* TT = 0x11e, TL = 0, trap_instruction_30 */
    421453.org trap_table + TT_TRAP_INSTRUCTION(30)*ENTRY_SIZE
    422 .global trap_instruction_30
    423 trap_instruction_30:
     454.global trap_instruction_30_tl0
     455trap_instruction_30_tl0:
    424456        TRAP_INSTRUCTION 30
    425457
    426458/* TT = 0x11f, TL = 0, trap_instruction_31 */
    427459.org trap_table + TT_TRAP_INSTRUCTION(31)*ENTRY_SIZE
    428 .global trap_instruction_31
    429 trap_instruction_31:
     460.global trap_instruction_31_tl0
     461trap_instruction_31_tl0:
    430462        TRAP_INSTRUCTION 31
    431463
     
    436468/* TT = 0x08, TL > 0, instruction_access_exception */
    437469.org trap_table + (TT_INSTRUCTION_ACCESS_EXCEPTION+512)*ENTRY_SIZE
    438 .global instruction_access_exception_high
    439 instruction_access_exception_high:
    440         PREEMPTIBLE_HANDLER do_instruction_access_exc
     470.global instruction_access_exception_tl1
     471instruction_access_exception_tl1:
     472        wrpr %g0, 1, %tl
     473        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
     474        PREEMPTIBLE_HANDLER instruction_access_exception
     475
     476/* TT = 0x0a, TL > 0, instruction_access_error */
     477.org trap_table + (TT_INSTRUCTION_ACCESS_ERROR+512)*ENTRY_SIZE
     478.global instruction_access_error_tl1
     479instruction_access_error_tl1:
     480        wrpr %g0, 1, %tl
     481        PREEMPTIBLE_HANDLER instruction_access_error
    441482
    442483/* TT = 0x10, TL > 0, illegal_instruction */
    443484.org trap_table + (TT_ILLEGAL_INSTRUCTION+512)*ENTRY_SIZE
    444 .global illegal_instruction_high
    445 illegal_instruction_high:
    446         PREEMPTIBLE_HANDLER do_illegal_instruction
     485.global illegal_instruction_tl1
     486illegal_instruction_tl1:
     487        wrpr %g0, 1, %tl
     488        PREEMPTIBLE_HANDLER illegal_instruction
    447489
    448490/* TT = 0x24, TL > 0, clean_window handler */
    449491.org trap_table + (TT_CLEAN_WINDOW+512)*ENTRY_SIZE
    450 .global clean_window_handler_high
    451 clean_window_handler_high:
     492.global clean_window_handler_tl1
     493clean_window_handler_tl1:
    452494        CLEAN_WINDOW_HANDLER
     495
     496/* TT = 0x28, TL > 0, division_by_zero */
     497.org trap_table + (TT_DIVISION_BY_ZERO+512)*ENTRY_SIZE
     498.global division_by_zero_tl1
     499division_by_zero_tl1:
     500        wrpr %g0, 1, %tl
     501        PREEMPTIBLE_HANDLER division_by_zero
     502
     503/* TT = 0x30, TL > 0, data_access_exception */
     504.org trap_table + (TT_DATA_ACCESS_EXCEPTION+512)*ENTRY_SIZE
     505.global data_access_exception_tl1
     506data_access_exception_tl1:
     507        wrpr %g0, 1, %tl
     508        wrpr %g0, PSTATE_AG_BIT | PSTATE_PRIV_BIT, %pstate
     509        PREEMPTIBLE_HANDLER data_access_exception
    453510
    454511/* TT = 0x32, TL > 0, data_access_error */
    455512.org trap_table + (TT_DATA_ACCESS_ERROR+512)*ENTRY_SIZE
    456 .global data_access_error_high
    457 data_access_error_high:
    458         PREEMPTIBLE_HANDLER do_data_access_error
     513.global data_access_error_tl1
     514data_access_error_tl1:
     515        wrpr %g0, 1, %tl
     516        PREEMPTIBLE_HANDLER data_access_error
    459517
    460518/* TT = 0x34, TL > 0, mem_address_not_aligned */
    461519.org trap_table + (TT_MEM_ADDRESS_NOT_ALIGNED+512)*ENTRY_SIZE
    462 .global mem_address_not_aligned_high
    463 mem_address_not_aligned_high:
    464         MEM_ADDRESS_NOT_ALIGNED_HANDLER
    465 
    466 /* TT = 0x64, TL > 0, fast_instruction_access_MMU_miss */
    467 .org trap_table + (TT_FAST_INSTRUCTION_ACCESS_MMU_MISS+512)*ENTRY_SIZE
    468 .global fast_instruction_access_mmu_miss_handler_high
    469 fast_instruction_access_mmu_miss_handler_high:
    470         FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
     520.global mem_address_not_aligned_tl1
     521mem_address_not_aligned_tl1:
     522        wrpr %g0, 1, %tl
     523        PREEMPTIBLE_HANDLER mem_address_not_aligned
    471524
    472525/* TT = 0x68, TL > 0, fast_data_access_MMU_miss */
    473526.org trap_table + (TT_FAST_DATA_ACCESS_MMU_MISS+512)*ENTRY_SIZE
    474 .global fast_data_access_mmu_miss_handler_high
    475 fast_data_access_mmu_miss_handler_high:
    476         FAST_DATA_ACCESS_MMU_MISS_HANDLER
     527.global fast_data_access_mmu_miss_handler_tl1
     528fast_data_access_mmu_miss_handler_tl1:
     529        FAST_DATA_ACCESS_MMU_MISS_HANDLER 1
    477530
    478531/* TT = 0x6c, TL > 0, fast_data_access_protection */
    479532.org trap_table + (TT_FAST_DATA_ACCESS_PROTECTION+512)*ENTRY_SIZE
    480 .global fast_data_access_protection_handler_high
    481 fast_data_access_protection_handler_high:
    482         FAST_DATA_ACCESS_PROTECTION_HANDLER
     533.global fast_data_access_protection_handler_tl1
     534fast_data_access_protection_handler_tl1:
     535        FAST_DATA_ACCESS_PROTECTION_HANDLER 1
    483536
    484537/* TT = 0x80, TL > 0, spill_0_normal handler */
    485538.org trap_table + (TT_SPILL_0_NORMAL+512)*ENTRY_SIZE
    486 .global spill_0_normal_high
    487 spill_0_normal_high:
     539.global spill_0_normal_tl1
     540spill_0_normal_tl1:
    488541        SPILL_NORMAL_HANDLER_KERNEL
    489542
    490543/* TT = 0x88, TL > 0, spill_2_normal handler */
    491544.org trap_table + (TT_SPILL_2_NORMAL+512)*ENTRY_SIZE
    492 .global spill_2_normal_high
    493 spill_2_normal_high:
     545.global spill_2_normal_tl1
     546spill_2_normal_tl1:
    494547        SPILL_TO_USPACE_WINDOW_BUFFER
    495548
    496549/* TT = 0xa0, TL > 0, spill_0_other handler */
    497550.org trap_table + (TT_SPILL_0_OTHER+512)*ENTRY_SIZE
    498 .global spill_0_other_high
    499 spill_0_other_high:
     551.global spill_0_other_tl1
     552spill_0_other_tl1:
    500553        SPILL_TO_USPACE_WINDOW_BUFFER
    501554
    502555/* TT = 0xc0, TL > 0, fill_0_normal handler */
    503556.org trap_table + (TT_FILL_0_NORMAL+512)*ENTRY_SIZE
    504 .global fill_0_normal_high
    505 fill_0_normal_high:
     557.global fill_0_normal_tl1
     558fill_0_normal_tl1:
    506559        FILL_NORMAL_HANDLER_KERNEL
    507560
  • kernel/generic/include/interrupt.h

    r5035eeb7 re2bf639  
    5656{ \
    5757        if (istate_from_uspace(istate)) { \
    58                 klog_printf(cmd, ##__VA_ARGS__); \
    59                 klog_printf("Task %lld got exception at PC:%p. Task killed.", TASK->taskid, istate_get_pc(istate)); \
     58                klog_printf("Task %lld killed due to an exception at %p.", TASK->taskid, istate_get_pc(istate)); \
     59                klog_printf("  " cmd, ##__VA_ARGS__); \
    6060                task_kill(TASK->taskid); \
    6161                thread_exit(); \
Note: See TracChangeset for help on using the changeset viewer.