| 1 | /*
|
|---|
| 2 | * Copyright (c) 2005 Jakub Jermar
|
|---|
| 3 | * Copyright (c) 2009 Pavel Rimsky
|
|---|
| 4 | * All rights reserved.
|
|---|
| 5 | *
|
|---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | * modification, are permitted provided that the following conditions
|
|---|
| 8 | * are met:
|
|---|
| 9 | *
|
|---|
| 10 | * - Redistributions of source code must retain the above copyright
|
|---|
| 11 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 12 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 13 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 14 | * documentation and/or other materials provided with the distribution.
|
|---|
| 15 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 16 | * derived from this software without specific prior written permission.
|
|---|
| 17 | *
|
|---|
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 28 | */
|
|---|
| 29 |
|
|---|
| 30 | /** @addtogroup sparc64interrupt
|
|---|
| 31 | * @{
|
|---|
| 32 | */
|
|---|
| 33 | /** @file
|
|---|
| 34 | */
|
|---|
| 35 |
|
|---|
| 36 | #include <arch/interrupt.h>
|
|---|
| 37 | #include <arch/trap/interrupt.h>
|
|---|
| 38 | #include <arch/trap/exception.h>
|
|---|
| 39 | #include <arch/sparc64.h>
|
|---|
| 40 | #include <interrupt.h>
|
|---|
| 41 | #include <ddi/irq.h>
|
|---|
| 42 | #include <typedefs.h>
|
|---|
| 43 | #include <debug.h>
|
|---|
| 44 | #include <arch/asm.h>
|
|---|
| 45 | #include <arch/barrier.h>
|
|---|
| 46 | #include <arch/drivers/tick.h>
|
|---|
| 47 | #include <print.h>
|
|---|
| 48 | #include <arch.h>
|
|---|
| 49 | #include <mm/tlb.h>
|
|---|
| 50 | #include <config.h>
|
|---|
| 51 | #include <synch/spinlock.h>
|
|---|
| 52 |
|
|---|
| 53 | void exc_arch_init(void)
|
|---|
| 54 | {
|
|---|
| 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
|
|---|
| 122 |
|
|---|
| 123 | }
|
|---|
| 124 |
|
|---|
| 125 | /** @}
|
|---|
| 126 | */
|
|---|