2 * Copyright (c) 2003,2004 Marcel Moolenaar
3 * Copyright (c) 2000 Doug Rabson
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <machine/asm.h>
29 __FBSDID("$FreeBSD$");
31 #include <opt_xtrace.h>
33 #include <machine/pte.h>
37 * ar.k7 = kernel memory stack
38 * ar.k6 = kernel register stack
39 * ar.k5 = EPC gateway page
43 #ifdef EXCEPTION_TRACING
47 xtrace: .space 1024*5*8
50 #define XTRACE(offset) \
80 cmp.eq p15,p0=r27,r28 ; \
81 addl r29=1024*5*8,r0 ;; \
82 (p15) sub r27=r28,r29 ;; \
86 mov pr=r25,0x1ffff ; \
92 #define XTRACE(offset)
99 * exception_save: save interrupted state
102 * r16 address of bundle that contains the branch. The
103 * return address will be the next bundle.
104 * r17 the value to save as ifa in the trapframe. This
105 * normally is cr.ifa, but some interruptions set
106 * set cr.iim and not cr.ifa.
109 * p15 interrupted from user stack
110 * p14 interrupted from kernel stack
111 * p13 interrupted from user backing store
112 * p12 interrupted from kernel backing store
113 * p11 interrupts were enabled
114 * p10 interrupts were disabled
116 ENTRY_NOPROFILE(exception_save, 0)
126 (p15) mov r23=ar.k7 // kernel memory stack
132 add r30=-SIZEOF_TRAPFRAME,r23
145 movl r26=exception_save_restart
150 * We have a 1KB aligned trapframe, pointed to by sp. If we write
151 * to the trapframe, we may trigger a data nested TLB fault. By
152 * aligning the trapframe on a 1KB boundary, we guarantee that if
153 * we get a data nested TLB fault, it will be on the very first
154 * write. Since the data nested TLB fault does not preserve any
155 * state, we have to be careful what we clobber. Consequently, we
156 * have to be careful what we use here. Below a list of registers
157 * that are currently alive:
159 * r18=pr, r19=length, r20=unat, r21=rsc, r22=iip, r23=TOS
161 * r30,r31=trapframe pointers
162 * p14,p15=memory stack switch
164 exception_save_restart:
166 st8 [r30]=r19,16 // length
167 st8 [r31]=r0,16 // flags
172 st8.spill [r30]=sp,16 // sp
173 st8 [r31]=r20,16 // unat
183 // r18=pr, r19=rnat, r20=bspstore, r21=rsc, r22=iip, r23=rp
185 st8 [r30]=r23,16 // rp
186 st8 [r31]=r18,16 // pr
191 st8 [r30]=r24,16 // pfs
192 st8 [r31]=r20,16 // bspstore
202 // r18=fpsr, r19=rnat, r20=bspstore, r21=rsc, r22=iip, r23=ipsr
204 st8 [r30]=r19,16 // rnat
205 st8 [r31]=r0,16 // __spare
210 st8.spill [r30]=r13,16 // tp
211 st8 [r31]=r21,16 // rsc
212 tbit.nz p11,p10=r23,14 // p11=interrupts enabled
216 (p13) mov r21=ar.k6 // kernel register stack
218 st8 [r30]=r18,16 // fpsr
219 (p13) dep r20=r20,r21,0,9 // align dirty registers
222 // r19=rnat, r20=bspstore, r22=iip, r23=ipsr
224 st8 [r31]=r23,16 // psr
225 (p13) mov ar.bspstore=r20
230 (p13) mov ar.rnat=r19
237 st8.spill [r30]=gp,16 // gp
243 st8 [r31]=r18,16 // ndirty
244 st8 [r30]=r19,16 // cfm
250 st8 [r31]=r22,16 // iip
255 st8 [r30]=r17,24 // ifa
256 st8 [r31]=r18,24 // isr
262 st8.spill [r30]=r2,16 // r2
264 st8.spill [r31]=r3,16 // r3
270 st8.spill [r30]=r8,16 // r8
272 st8.spill [r31]=r9,16 // r9
278 st8.spill [r30]=r10,16 // r10
280 st8.spill [r31]=r11,16 // r11
286 st8.spill [r30]=r14 // r14
288 st8.spill [r31]=r15 // r15
299 st8.spill [r2]=r16,16 // r16
301 st8.spill [r3]=r17,16 // r17
307 st8.spill [r2]=r18,16 // r18
309 st8.spill [r3]=r19,16 // r19
315 st8.spill [r2]=r20,16 // r20
317 st8.spill [r3]=r21,16 // r21
323 st8.spill [r2]=r22,16 // r22
325 st8.spill [r3]=r23,16 // r23
330 st8.spill [r2]=r24,16 // r24
332 st8.spill [r3]=r25,16 // r25
335 st8.spill [r2]=r26,16 // r26
337 st8.spill [r3]=r27,16 // r27
340 st8.spill [r2]=r28,16 // r28
342 st8.spill [r3]=r29,16 // r29
345 st8.spill [r2]=r30,16 // r30
347 st8.spill [r3]=r31,16 // r31
351 st8 [r2]=r14,16 // b6
357 st8 [r3]=r15,16 // b7
363 st8 [r2]=r16,16 // ccv
364 st8 [r3]=r10,16 // csd
369 st8 [r2]=r11,24 // ssd
375 stf.spill [r3]=f6,32 // f6
376 stf.spill [r2]=f7,32 // f7
378 stf.spill [r3]=f8,32 // f8
379 stf.spill [r2]=f9,32 // f9
381 stf.spill [r3]=f10,32 // f10
382 stf.spill [r2]=f11,32 // f11
384 stf.spill [r3]=f12,32 // f12
385 stf.spill [r2]=f13,32 // f13
387 stf.spill [r3]=f14 // f14
388 stf.spill [r2]=f15 // f15
410 * exception_restore: restore interrupted state
413 * sp+16 trapframe pointer
415 ENTRY_NOPROFILE(exception_restore, 0)
418 add r3=SIZEOF_TRAPFRAME-16,sp
419 add r2=SIZEOF_TRAPFRAME,sp
424 add r8=SIZEOF_SPECIAL+32,sp
428 // The next load can trap. Let it be...
429 ldf.fill f15=[r2],-32 // f15
430 ldf.fill f14=[r3],-32 // f14
433 ldf.fill f13=[r2],-32 // f13
434 ldf.fill f12=[r3],-32 // f12
436 ldf.fill f11=[r2],-32 // f11
437 ldf.fill f10=[r3],-32 // f10
439 ldf.fill f9=[r2],-32 // f9
440 ldf.fill f8=[r3],-32 // f8
442 ldf.fill f7=[r2],-24 // f7
443 ldf.fill f6=[r3],-16 // f6
447 ld8 r8=[r8] // unat (after)
454 ld8 r10=[r2],-16 // ssd
455 ld8 r11=[r3],-16 // csd
460 ld8 r14=[r2],-16 // ccv
461 ld8 r15=[r3],-16 // b7
466 ld8 r8=[r2],-16 // b6
471 ld8.fill r31=[r3],-16 // r31
472 ld8.fill r30=[r2],-16 // r30
477 ld8.fill r29=[r3],-16 // r29
478 ld8.fill r28=[r2],-16 // r28
480 ld8.fill r27=[r3],-16 // r27
481 ld8.fill r26=[r2],-16 // r26
483 ld8.fill r25=[r3],-16 // r25
484 ld8.fill r24=[r2],-16 // r24
486 ld8.fill r23=[r3],-16 // r23
487 ld8.fill r22=[r2],-16 // r22
489 ld8.fill r21=[r3],-16 // r21
490 ld8.fill r20=[r2],-16 // r20
492 ld8.fill r19=[r3],-16 // r19
493 ld8.fill r18=[r2],-16 // r18
497 ld8.fill r17=[r3],-16 // r17
498 ld8.fill r16=[r2],-16 // r16
503 ld8.fill r15=[r3],-16 // r15
504 ld8.fill r14=[r2],-16 // r14
509 ld8 r16=[sp] // tf_length
510 ld8.fill r11=[r3],-16 // r11
515 ld8.fill r10=[r2],-16 // r10
516 ld8.fill r9=[r3],-16 // r9
517 add r16=r16,sp // ar.k7
521 ld8.fill r8=[r2],-16 // r8
522 ld8.fill r3=[r3] // r3
525 // We want nested TLB faults from here on...
527 ld8.fill r2=[r2] // r2
531 ld8.fill sp=[r31],16 // sp
535 ld8 r17=[r30],16 // unat
536 ld8 r29=[r31],16 // rp
538 ld8 r18=[r30],16 // pr
539 ld8 r28=[r31],16 // pfs
542 ld8 r20=[r30],24 // bspstore
543 ld8 r21=[r31],24 // rnat
546 ld8.fill r29=[r30],16 // tp
547 ld8 r22=[r31],16 // rsc
550 ld8 r23=[r30],16 // fpsr
551 ld8 r24=[r31],16 // psr
556 ld8.fill r1=[r30],16 // gp
557 ld8 r25=[r31],16 // ndirty
568 // Switch register stack
569 alloc r30=ar.pfs,0,0,0,0 // discard current frame
570 shl r31=r25,16 // value for ar.rsc
574 // The loadrs can fault if the backing store is not currently
575 // mapped. We assured forward progress by getting everything we
576 // need from the trapframe so that we don't care if the CPU
577 // purges that translation when it needs to insert a new one for
578 // the backing store.
580 mov ar.rsc=r31 // setup for loadrs
585 exception_restore_restart:
589 loadrs // load user regs
597 dep r31=0,r31,0,13 // 8KB aligned
623 END(exception_restore)
626 * Call exception_save_regs to preserve the interrupted state in a
627 * trapframe. Note that we don't use a call instruction because we
628 * must be careful not to lose track of the RSE state. We then call
629 * trap() with the value of _n_ as an argument to handle the
630 * exception. We arrange for trap() to return to exception_restore
631 * which will restore the interrupted state before executing an rfi to
634 #define CALL(_func_, _n_, _ifa_) \
638 br.sptk exception_save ;; \
641 alloc r15=ar.pfs,0,0,2,0 ;; \
648 br.call.sptk rp=_func_ ;; \
653 br.sptk exception_restore ;; \
656 #define IVT_ENTRY(name, offset) \
657 .org ia64_vector_table + offset; \
658 .global ivt_##name; \
661 .unwabi @svr4, 'I'; \
667 #define IVT_END(name) \
671 #define IA32_TRAP ia32_trap
673 #define IA32_TRAP trap
677 * The IA64 Interrupt Vector Table (IVT) contains 20 slots with 64
678 * bundles per vector and 48 slots with 16 bundles per vector.
681 .section .text.ivt,"ax"
684 .global ia64_vector_table
685 .size ia64_vector_table, 32768
688 IVT_ENTRY(VHPT_Translation, 0x0000)
689 CALL(trap, 0, cr.ifa)
690 IVT_END(VHPT_Translation)
692 IVT_ENTRY(Instruction_TLB, 0x0400)
699 add r21=16,r18 // tag
700 add r20=24,r18 // collision chain
702 ld8 r21=[r21] // check VHPT tag
703 ld8 r20=[r20] // bucket head
705 cmp.ne p15,p0=r21,r19
708 ld8 r21=[r18] // read pte
710 itc.i r21 // insert pte
715 1: rsm psr.dt // turn off data translations
716 dep r20=0,r20,61,3 // convert vhpt ptr to physical
719 ld8 r20=[r20] // first entry
721 2: cmp.eq p15,p0=r0,r20 // done?
722 (p15) br.cond.spnt.few 9f // bail if done
724 add r21=16,r20 // tag location
726 ld8 r21=[r21] // read tag
728 cmp.ne p15,p0=r21,r19 // compare tags
729 (p15) br.cond.sptk.few 3f // if not, read next in chain
731 ld8 r21=[r20] // read pte
738 ld8 r22=[r20] // read rest of pte
740 dep r18=0,r18,61,3 // convert vhpt ptr to physical
742 add r20=16,r18 // address of tag
744 ld8.acq r23=[r20] // read old tag
746 dep r23=-1,r23,63,1 // set ti bit
748 st8.rel [r20]=r23 // store old tag + ti
750 mf // make sure everyone sees
752 st8 [r18]=r21,8 // store pte
756 st8.rel [r18]=r19 // store new tag
758 itc.i r21 // and place in TLB
762 mov pr=r17,0x1ffff // restore predicates
765 3: add r20=24,r20 // next in chain
767 ld8 r20=[r20] // read chain
768 br.cond.sptk.few 2b // loop
771 mov pr=r17,0x1ffff // restore predicates
775 CALL(trap, 20, cr.ifa) // Page Not Present trap
776 IVT_END(Instruction_TLB)
778 IVT_ENTRY(Data_TLB, 0x0800)
785 add r21=16,r18 // tag
786 add r20=24,r18 // collision chain
788 ld8 r21=[r21] // check VHPT tag
789 ld8 r20=[r20] // bucket head
791 cmp.ne p15,p0=r21,r19
794 ld8 r21=[r18] // read pte
796 itc.d r21 // insert pte
801 1: rsm psr.dt // turn off data translations
802 dep r20=0,r20,61,3 // convert vhpt ptr to physical
805 ld8 r20=[r20] // first entry
807 2: cmp.eq p15,p0=r0,r20 // done?
808 (p15) br.cond.spnt.few 9f // bail if done
810 add r21=16,r20 // tag location
812 ld8 r21=[r21] // read tag
814 cmp.ne p15,p0=r21,r19 // compare tags
815 (p15) br.cond.sptk.few 3f // if not, read next in chain
817 ld8 r21=[r20] // read pte
824 ld8 r22=[r20] // read rest of pte
826 dep r18=0,r18,61,3 // convert vhpt ptr to physical
828 add r20=16,r18 // address of tag
830 ld8.acq r23=[r20] // read old tag
832 dep r23=-1,r23,63,1 // set ti bit
834 st8.rel [r20]=r23 // store old tag + ti
836 mf // make sure everyone sees
838 st8 [r18]=r21,8 // store pte
842 st8.rel [r18]=r19 // store new tag
844 itc.d r21 // and place in TLB
848 mov pr=r17,0x1ffff // restore predicates
851 3: add r20=24,r20 // next in chain
853 ld8 r20=[r20] // read chain
854 br.cond.sptk.few 2b // loop
857 mov pr=r17,0x1ffff // restore predicates
861 CALL(trap, 20, cr.ifa) // Page Not Present trap
864 IVT_ENTRY(Alternate_Instruction_TLB, 0x0c00)
865 mov r16=cr.ifa // where did it happen
866 mov r18=pr // save predicates
868 extr.u r17=r16,61,3 // get region number
870 cmp.ge p13,p0=5,r17 // RR0-RR5?
871 cmp.eq p15,p14=7,r17 // RR7->p15, RR6->p14
874 (p15) movl r17=PTE_PRESENT+PTE_MA_WB+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
876 (p14) movl r17=PTE_PRESENT+PTE_MA_UC+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
879 dep r16=0,r16,50,14 // clear bits above PPN
881 dep r16=r17,r16,0,12 // put pte bits in 0..11
884 mov pr=r18,0x1ffff // restore predicates
888 9: mov pr=r18,0x1ffff // restore predicates
889 CALL(trap, 3, cr.ifa)
890 IVT_END(Alternate_Instruction_TLB)
892 IVT_ENTRY(Alternate_Data_TLB, 0x1000)
893 mov r16=cr.ifa // where did it happen
894 mov r18=pr // save predicates
896 extr.u r17=r16,61,3 // get region number
898 cmp.ge p13,p0=5,r17 // RR0-RR5?
899 cmp.eq p15,p14=7,r17 // RR7->p15, RR6->p14
902 (p15) movl r17=PTE_PRESENT+PTE_MA_WB+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
904 (p14) movl r17=PTE_PRESENT+PTE_MA_UC+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+ \
907 dep r16=0,r16,50,14 // clear bits above PPN
909 dep r16=r17,r16,0,12 // put pte bits in 0..11
912 mov pr=r18,0x1ffff // restore predicates
916 9: mov pr=r18,0x1ffff // restore predicates
917 CALL(trap, 4, cr.ifa)
918 IVT_END(Alternate_Data_TLB)
920 IVT_ENTRY(Data_Nested_TLB, 0x1400)
921 // See exception_save_restart and exception_restore_restart for the
922 // contexts that may cause a data nested TLB. We can only use the
923 // banked general registers and predicates, but don't use:
924 // p14 & p15 - Set in exception save
925 // r16 & r17 - Arguments to exception save
926 // r30 - Faulting address (modulo page size)
927 // We assume r30 has the virtual addresses that relate to the data
928 // nested TLB fault. The address does not have to be exact, as long
929 // as it's in the same page. We use physical addressing to avoid
930 // double nested faults. Since all virtual addresses we encounter
931 // here are direct mapped region 7 addresses, we have no problem
932 // constructing physical addresses.
942 extr.u r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3 // dir L0 index
945 ld8 r27=[r27] // dir L0 page
946 extr.u r29=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3 // dir L1 index
954 ld8 r27=[r27] // dir L1 page
955 extr.u r28=r30,PAGE_SHIFT,PAGE_SHIFT-5 // pte index
966 ld8 r27=[r27] // pte page
982 or r28=PTE_DIRTY+PTE_ACCESSED,r28
987 movl r29=exception_save_restart
994 cmp.eq p12,p13=r26,r29
999 (p12) br.sptk exception_save_restart
1000 (p13) br.sptk exception_restore_restart
1003 IVT_END(Data_Nested_TLB)
1005 IVT_ENTRY(Instruction_Key_Miss, 0x1800)
1006 CALL(trap, 6, cr.ifa)
1007 IVT_END(Instruction_Key_Miss)
1009 IVT_ENTRY(Data_Key_Miss, 0x1c00)
1010 CALL(trap, 7, cr.ifa)
1011 IVT_END(Data_Key_Miss)
1013 IVT_ENTRY(Dirty_Bit, 0x2000)
1020 add r20=24,r18 // collision chain
1022 ld8 r20=[r20] // bucket head
1024 rsm psr.dt // turn off data translations
1025 dep r20=0,r20,61,3 // convert vhpt ptr to physical
1028 ld8 r20=[r20] // first entry
1030 1: cmp.eq p15,p0=r0,r20 // done?
1031 (p15) br.cond.spnt.few 9f // bail if done
1033 add r21=16,r20 // tag location
1035 ld8 r21=[r21] // read tag
1037 cmp.ne p15,p0=r21,r19 // compare tags
1038 (p15) br.cond.sptk.few 2f // if not, read next in chain
1040 ld8 r21=[r20] // read pte
1041 mov r22=PTE_DIRTY+PTE_ACCESSED
1043 or r21=r22,r21 // set dirty & access bit
1045 st8 [r20]=r21,8 // store back
1047 ld8 r22=[r20] // read rest of pte
1049 dep r18=0,r18,61,3 // convert vhpt ptr to physical
1051 add r20=16,r18 // address of tag
1053 ld8.acq r23=[r20] // read old tag
1055 dep r23=-1,r23,63,1 // set ti bit
1057 st8.rel [r20]=r23 // store old tag + ti
1059 mf // make sure everyone sees
1061 st8 [r18]=r21,8 // store pte
1065 st8.rel [r18]=r19 // store new tag
1067 itc.d r21 // and place in TLB
1071 mov pr=r17,0x1ffff // restore predicates
1074 2: add r20=24,r20 // next in chain
1076 ld8 r20=[r20] // read chain
1077 br.cond.sptk.few 1b // loop
1080 mov pr=r17,0x1ffff // restore predicates
1084 CALL(trap, 8, cr.ifa) // die horribly
1087 IVT_ENTRY(Instruction_Access_Bit, 0x2400)
1094 add r20=24,r18 // collision chain
1096 ld8 r20=[r20] // bucket head
1098 rsm psr.dt // turn off data translations
1099 dep r20=0,r20,61,3 // convert vhpt ptr to physical
1102 ld8 r20=[r20] // first entry
1104 1: cmp.eq p15,p0=r0,r20 // done?
1105 (p15) br.cond.spnt.few 9f // bail if done
1107 add r21=16,r20 // tag location
1109 ld8 r21=[r21] // read tag
1111 cmp.ne p15,p0=r21,r19 // compare tags
1112 (p15) br.cond.sptk.few 2f // if not, read next in chain
1114 ld8 r21=[r20] // read pte
1115 mov r22=PTE_ACCESSED
1117 or r21=r22,r21 // set accessed bit
1119 st8 [r20]=r21,8 // store back
1121 ld8 r22=[r20] // read rest of pte
1123 dep r18=0,r18,61,3 // convert vhpt ptr to physical
1125 add r20=16,r18 // address of tag
1127 ld8.acq r23=[r20] // read old tag
1129 dep r23=-1,r23,63,1 // set ti bit
1131 st8.rel [r20]=r23 // store old tag + ti
1133 mf // make sure everyone sees
1135 st8 [r18]=r21,8 // store pte
1139 st8.rel [r18]=r19 // store new tag
1141 itc.i r21 // and place in TLB
1145 mov pr=r17,0x1ffff // restore predicates
1146 rfi // walker will retry the access
1148 2: add r20=24,r20 // next in chain
1150 ld8 r20=[r20] // read chain
1151 br.cond.sptk.few 1b // loop
1154 mov pr=r17,0x1ffff // restore predicates
1158 CALL(trap, 9, cr.ifa)
1159 IVT_END(Instruction_Access_Bit)
1161 IVT_ENTRY(Data_Access_Bit, 0x2800)
1168 add r20=24,r18 // collision chain
1170 ld8 r20=[r20] // bucket head
1172 rsm psr.dt // turn off data translations
1173 dep r20=0,r20,61,3 // convert vhpt ptr to physical
1176 ld8 r20=[r20] // first entry
1178 1: cmp.eq p15,p0=r0,r20 // done?
1179 (p15) br.cond.spnt.few 9f // bail if done
1181 add r21=16,r20 // tag location
1183 ld8 r21=[r21] // read tag
1185 cmp.ne p15,p0=r21,r19 // compare tags
1186 (p15) br.cond.sptk.few 2f // if not, read next in chain
1188 ld8 r21=[r20] // read pte
1189 mov r22=PTE_ACCESSED
1191 or r21=r22,r21 // set accessed bit
1193 st8 [r20]=r21,8 // store back
1195 ld8 r22=[r20] // read rest of pte
1197 dep r18=0,r18,61,3 // convert vhpt ptr to physical
1199 add r20=16,r18 // address of tag
1201 ld8.acq r23=[r20] // read old tag
1203 dep r23=-1,r23,63,1 // set ti bit
1205 st8.rel [r20]=r23 // store old tag + ti
1207 mf // make sure everyone sees
1209 st8 [r18]=r21,8 // store pte
1213 st8.rel [r18]=r19 // store new tag
1215 itc.d r21 // and place in TLB
1219 mov pr=r17,0x1ffff // restore predicates
1220 rfi // walker will retry the access
1222 2: add r20=24,r20 // next in chain
1224 ld8 r20=[r20] // read chain
1225 br.cond.sptk.few 1b // loop
1228 mov pr=r17,0x1ffff // restore predicates
1232 CALL(trap, 10, cr.ifa)
1233 IVT_END(Data_Access_Bit)
1235 IVT_ENTRY(Break_Instruction, 0x2c00)
1239 br.sptk exception_save
1243 alloc r15=ar.pfs,0,0,2,0
1258 br.call.sptk rp=trap
1264 br.sptk exception_restore
1267 IVT_END(Break_Instruction)
1269 IVT_ENTRY(External_Interrupt, 0x3000)
1271 mov r17=cr.ivr // Put the vector in the trap frame.
1273 br.sptk exception_save
1277 alloc r15=ar.pfs,0,0,1,0
1285 br.call.sptk rp=interrupt
1291 br.sptk exception_restore
1294 IVT_END(External_Interrupt)
1296 IVT_ENTRY(Reserved_3400, 0x3400)
1297 CALL(trap, 13, cr.ifa)
1298 IVT_END(Reserved_3400)
1300 IVT_ENTRY(Reserved_3800, 0x3800)
1301 CALL(trap, 14, cr.ifa)
1302 IVT_END(Reserved_3800)
1304 IVT_ENTRY(Reserved_3c00, 0x3c00)
1305 CALL(trap, 15, cr.ifa)
1306 IVT_END(Reserved_3c00)
1308 IVT_ENTRY(Reserved_4000, 0x4000)
1309 CALL(trap, 16, cr.ifa)
1310 IVT_END(Reserved_4000)
1312 IVT_ENTRY(Reserved_4400, 0x4400)
1313 CALL(trap, 17, cr.ifa)
1314 IVT_END(Reserved_4400)
1316 IVT_ENTRY(Reserved_4800, 0x4800)
1317 CALL(trap, 18, cr.ifa)
1318 IVT_END(Reserved_4800)
1320 IVT_ENTRY(Reserved_4c00, 0x4c00)
1321 CALL(trap, 19, cr.ifa)
1322 IVT_END(Reserved_4c00)
1324 IVT_ENTRY(Page_Not_Present, 0x5000)
1325 CALL(trap, 20, cr.ifa)
1326 IVT_END(Page_Not_Present)
1328 IVT_ENTRY(Key_Permission, 0x5100)
1329 CALL(trap, 21, cr.ifa)
1330 IVT_END(Key_Permission)
1332 IVT_ENTRY(Instruction_Access_Rights, 0x5200)
1333 CALL(trap, 22, cr.ifa)
1334 IVT_END(Instruction_Access_Rights)
1336 IVT_ENTRY(Data_Access_Rights, 0x5300)
1337 CALL(trap, 23, cr.ifa)
1338 IVT_END(Data_Access_Rights)
1340 IVT_ENTRY(General_Exception, 0x5400)
1341 CALL(trap, 24, cr.ifa)
1342 IVT_END(General_Exception)
1344 IVT_ENTRY(Disabled_FP_Register, 0x5500)
1345 CALL(trap, 25, cr.ifa)
1346 IVT_END(Disabled_FP_Register)
1348 IVT_ENTRY(NaT_Consumption, 0x5600)
1349 CALL(trap, 26, cr.ifa)
1350 IVT_END(NaT_Consumption)
1352 IVT_ENTRY(Speculation, 0x5700)
1353 CALL(trap, 27, cr.iim)
1354 IVT_END(Speculation)
1356 IVT_ENTRY(Reserved_5800, 0x5800)
1357 CALL(trap, 28, cr.ifa)
1358 IVT_END(Reserved_5800)
1360 IVT_ENTRY(Debug, 0x5900)
1361 CALL(trap, 29, cr.ifa)
1364 IVT_ENTRY(Unaligned_Reference, 0x5a00)
1365 CALL(trap, 30, cr.ifa)
1366 IVT_END(Unaligned_Reference)
1368 IVT_ENTRY(Unsupported_Data_Reference, 0x5b00)
1369 CALL(trap, 31, cr.ifa)
1370 IVT_END(Unsupported_Data_Reference)
1372 IVT_ENTRY(Floating_Point_Fault, 0x5c00)
1373 CALL(trap, 32, cr.ifa)
1374 IVT_END(Floating_Point_Fault)
1376 IVT_ENTRY(Floating_Point_Trap, 0x5d00)
1377 CALL(trap, 33, cr.ifa)
1378 IVT_END(Floating_Point_Trap)
1380 IVT_ENTRY(Lower_Privilege_Transfer_Trap, 0x5e00)
1381 CALL(trap, 34, cr.ifa)
1382 IVT_END(Lower_Privilege_Transfer_Trap)
1384 IVT_ENTRY(Taken_Branch_Trap, 0x5f00)
1385 CALL(trap, 35, cr.ifa)
1386 IVT_END(Taken_Branch_Trap)
1388 IVT_ENTRY(Single_Step_Trap, 0x6000)
1389 CALL(trap, 36, cr.ifa)
1390 IVT_END(Single_Step_Trap)
1392 IVT_ENTRY(Reserved_6100, 0x6100)
1393 CALL(trap, 37, cr.ifa)
1394 IVT_END(Reserved_6100)
1396 IVT_ENTRY(Reserved_6200, 0x6200)
1397 CALL(trap, 38, cr.ifa)
1398 IVT_END(Reserved_6200)
1400 IVT_ENTRY(Reserved_6300, 0x6300)
1401 CALL(trap, 39, cr.ifa)
1402 IVT_END(Reserved_6300)
1404 IVT_ENTRY(Reserved_6400, 0x6400)
1405 CALL(trap, 40, cr.ifa)
1406 IVT_END(Reserved_6400)
1408 IVT_ENTRY(Reserved_6500, 0x6500)
1409 CALL(trap, 41, cr.ifa)
1410 IVT_END(Reserved_6500)
1412 IVT_ENTRY(Reserved_6600, 0x6600)
1413 CALL(trap, 42, cr.ifa)
1414 IVT_END(Reserved_6600)
1416 IVT_ENTRY(Reserved_6700, 0x6700)
1417 CALL(trap, 43, cr.ifa)
1418 IVT_END(Reserved_6700)
1420 IVT_ENTRY(Reserved_6800, 0x6800)
1421 CALL(trap, 44, cr.ifa)
1422 IVT_END(Reserved_6800)
1424 IVT_ENTRY(IA_32_Exception, 0x6900)
1425 CALL(IA32_TRAP, 45, cr.ifa)
1426 IVT_END(IA_32_Exception)
1428 IVT_ENTRY(IA_32_Intercept, 0x6a00)
1429 CALL(IA32_TRAP, 46, cr.iim)
1430 IVT_END(IA_32_Intercept)
1432 IVT_ENTRY(IA_32_Interrupt, 0x6b00)
1433 CALL(IA32_TRAP, 47, cr.ifa)
1434 IVT_END(IA_32_Interrupt)
1436 IVT_ENTRY(Reserved_6c00, 0x6c00)
1437 CALL(trap, 48, cr.ifa)
1438 IVT_END(Reserved_6c00)
1440 IVT_ENTRY(Reserved_6d00, 0x6d00)
1441 CALL(trap, 49, cr.ifa)
1442 IVT_END(Reserved_6d00)
1444 IVT_ENTRY(Reserved_6e00, 0x6e00)
1445 CALL(trap, 50, cr.ifa)
1446 IVT_END(Reserved_6e00)
1448 IVT_ENTRY(Reserved_6f00, 0x6f00)
1449 CALL(trap, 51, cr.ifa)
1450 IVT_END(Reserved_6f00)
1452 IVT_ENTRY(Reserved_7000, 0x7000)
1453 CALL(trap, 52, cr.ifa)
1454 IVT_END(Reserved_7000)
1456 IVT_ENTRY(Reserved_7100, 0x7100)
1457 CALL(trap, 53, cr.ifa)
1458 IVT_END(Reserved_7100)
1460 IVT_ENTRY(Reserved_7200, 0x7200)
1461 CALL(trap, 54, cr.ifa)
1462 IVT_END(Reserved_7200)
1464 IVT_ENTRY(Reserved_7300, 0x7300)
1465 CALL(trap, 55, cr.ifa)
1466 IVT_END(Reserved_7300)
1468 IVT_ENTRY(Reserved_7400, 0x7400)
1469 CALL(trap, 56, cr.ifa)
1470 IVT_END(Reserved_7400)
1472 IVT_ENTRY(Reserved_7500, 0x7500)
1473 CALL(trap, 57, cr.ifa)
1474 IVT_END(Reserved_7500)
1476 IVT_ENTRY(Reserved_7600, 0x7600)
1477 CALL(trap, 58, cr.ifa)
1478 IVT_END(Reserved_7600)
1480 IVT_ENTRY(Reserved_7700, 0x7700)
1481 CALL(trap, 59, cr.ifa)
1482 IVT_END(Reserved_7700)
1484 IVT_ENTRY(Reserved_7800, 0x7800)
1485 CALL(trap, 60, cr.ifa)
1486 IVT_END(Reserved_7800)
1488 IVT_ENTRY(Reserved_7900, 0x7900)
1489 CALL(trap, 61, cr.ifa)
1490 IVT_END(Reserved_7900)
1492 IVT_ENTRY(Reserved_7a00, 0x7a00)
1493 CALL(trap, 62, cr.ifa)
1494 IVT_END(Reserved_7a00)
1496 IVT_ENTRY(Reserved_7b00, 0x7b00)
1497 CALL(trap, 63, cr.ifa)
1498 IVT_END(Reserved_7b00)
1500 IVT_ENTRY(Reserved_7c00, 0x7c00)
1501 CALL(trap, 64, cr.ifa)
1502 IVT_END(Reserved_7c00)
1504 IVT_ENTRY(Reserved_7d00, 0x7d00)
1505 CALL(trap, 65, cr.ifa)
1506 IVT_END(Reserved_7d00)
1508 IVT_ENTRY(Reserved_7e00, 0x7e00)
1509 CALL(trap, 66, cr.ifa)
1510 IVT_END(Reserved_7e00)
1512 IVT_ENTRY(Reserved_7f00, 0x7f00)
1513 CALL(trap, 67, cr.ifa)
1514 IVT_END(Reserved_7f00)