00001 /* 00002 * Copyright (C) 2005 Jakub Jermar 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * - Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * - Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * - The name of the author may not be used to endorse or promote products 00015 * derived from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00020 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 */ 00028 00035 #ifndef __ia64_INTERRUPT_H__ 00036 #define __ia64_INTERRUPT_H__ 00037 00038 #include <typedefs.h> 00039 #include <arch/types.h> 00040 #include <arch/register.h> 00041 00042 #define IRQ_COUNT 257 /* 256 NOT suppotred IRQS*//* TODO */ 00043 #define IRQ_KBD 256 /* One simulated interrupt for ski simulator keyboard*/ 00044 00046 #define INTERRUPT_TIMER 0 00047 #define INTERRUPT_SPURIOUS 15 00048 00050 #define GE_ILLEGALOP 0 00051 #define GE_PRIVOP 1 00052 #define GE_PRIVREG 2 00053 #define GE_RESREGFLD 3 00054 #define GE_DISBLDISTRAN 4 00055 #define GE_ILLEGALDEP 8 00056 00057 #define EOI 0 00059 struct istate { 00060 __r128 f2; 00061 __r128 f3; 00062 __r128 f4; 00063 __r128 f5; 00064 __r128 f6; 00065 __r128 f7; 00066 __r128 f8; 00067 __r128 f9; 00068 __r128 f10; 00069 __r128 f11; 00070 __r128 f12; 00071 __r128 f13; 00072 __r128 f14; 00073 __r128 f15; 00074 __r128 f16; 00075 __r128 f17; 00076 __r128 f18; 00077 __r128 f19; 00078 __r128 f20; 00079 __r128 f21; 00080 __r128 f22; 00081 __r128 f23; 00082 __r128 f24; 00083 __r128 f25; 00084 __r128 f26; 00085 __r128 f27; 00086 __r128 f28; 00087 __r128 f29; 00088 __r128 f30; 00089 __r128 f31; 00090 00091 __address ar_bsp; 00092 __address ar_bspstore; 00093 __address ar_bspstore_new; 00094 __u64 ar_rnat; 00095 __u64 ar_ifs; 00096 __u64 ar_pfs; 00097 __u64 ar_rsc; 00098 __address cr_ifa; 00099 cr_isr_t cr_isr; 00100 __address cr_iipa; 00101 psr_t cr_ipsr; 00102 __address cr_iip; 00103 __u64 pr; 00104 __address sp; 00105 00106 /* 00107 * The following variables are defined only for break_instruction handler. 00108 */ 00109 __u64 in0; 00110 __u64 in1; 00111 __u64 in2; 00112 __u64 in3; 00113 __u64 in4; 00114 }; 00115 00116 static inline void istate_set_retaddr(istate_t *istate, __address retaddr) 00117 { 00118 istate->cr_iip = retaddr; 00119 istate->cr_ipsr.ri = 0; /* return to instruction slot #0 */ 00120 } 00121 00122 static inline __native istate_get_pc(istate_t *istate) 00123 { 00124 return istate->cr_iip; 00125 } 00126 #include <panic.h> 00127 static inline int istate_from_uspace(istate_t *istate) 00128 { 00129 return (istate->cr_iip)<0xe000000000000000ULL; 00130 } 00131 00132 extern void *ivt; 00133 00134 extern void general_exception(__u64 vector, istate_t *istate); 00135 extern int break_instruction(__u64 vector, istate_t *istate); 00136 extern void universal_handler(__u64 vector, istate_t *istate); 00137 extern void nop_handler(__u64 vector, istate_t *istate); 00138 extern void external_interrupt(__u64 vector, istate_t *istate); 00139 extern void virtual_interrupt(__u64 irq, void *param); 00140 extern void disabled_fp_register(__u64 vector, istate_t *istate); 00141 00142 00143 00144 #endif 00145