Changeset 901122b in mainline
- Timestamp:
- 2006-03-09T17:40:30Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a2a46ba
- Parents:
- b994a60
- Location:
- arch/ia64
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/include/interrupt.h
rb994a60 r901122b 58 58 cr_isr_t cr_isr; 59 59 __address cr_iipa; 60 __u64 cr_ips;60 psr_t cr_ipsr; 61 61 __address cr_iip; 62 62 __u64 pr; 63 63 __address sp; 64 65 /* 66 * The following variables are defined only for break_instruction handler. 67 */ 68 __u64 in0; 69 __u64 in1; 70 __u64 in2; 71 __u64 in3; 64 72 } __attribute__ ((packed)); 65 73 … … 67 75 68 76 extern void general_exception(__u64 vector, struct exception_regdump *pstate); 69 extern voidbreak_instruction(__u64 vector, struct exception_regdump *pstate);77 extern int break_instruction(__u64 vector, struct exception_regdump *pstate); 70 78 extern void universal_handler(__u64 vector, struct exception_regdump *pstate); 71 79 extern void external_interrupt(__u64 vector, struct exception_regdump *pstate); -
arch/ia64/src/interrupt.c
rb994a60 r901122b 41 41 #include <symtab.h> 42 42 #include <debug.h> 43 #include <syscall/syscall.h> 44 #include <print.h> 43 45 44 46 #define VECTORS_64_BUNDLE 20 … … 132 134 printf("ar.rnat=%Q\tar.rsc=%Q\n", pstate->ar_rnat, pstate->ar_rsc); 133 135 printf("ar.ifs=%Q\tar.pfs=%Q\n", pstate->ar_ifs, pstate->ar_pfs); 134 printf("cr.isr=%Q\tcr.ips =%Q\t\n", pstate->cr_isr.value, pstate->cr_ips);136 printf("cr.isr=%Q\tcr.ipsr=%Q\t\n", pstate->cr_isr.value, pstate->cr_ipsr); 135 137 136 138 printf("cr.iip=%Q, #%d\t(%s)\n", pstate->cr_iip, pstate->cr_isr.ei ,iip ? iip : "?"); … … 172 174 } 173 175 174 void break_instruction(__u64 vector, struct exception_regdump *pstate) 175 { 176 dump_interrupted_context(pstate); 177 panic("Break Instruction\n"); 176 /** Handle syscall. */ 177 int break_instruction(__u64 vector, struct exception_regdump *pstate) 178 { 179 /* 180 * Move to next instruction after BREAK. 181 */ 182 if (pstate->cr_ipsr.ri == 2) { 183 pstate->cr_ipsr.ri = 0; 184 pstate->cr_iip += 16; 185 } else { 186 pstate->cr_ipsr.ri++; 187 } 188 189 if (pstate->in0 < SYSCALL_END) 190 return syscall_table[pstate->in0](pstate->in1, pstate->in2, pstate->in3); 191 else 192 panic("Undefined syscall %d", pstate->in0); 193 194 return -1; 178 195 } 179 196 -
arch/ia64/src/ivt.S
rb994a60 r901122b 33 33 #include <align.h> 34 34 35 #define STACK_ITEMS 1 435 #define STACK_ITEMS 18 36 36 #define STACK_FRAME_SIZE ALIGN_UP((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE, STACK_ALIGNMENT) 37 37 … … 46 46 #define R_HANDLER r17 47 47 #define R_RET r18 48 #define R_TMP r19 48 49 #define R_KSTACK_BSP r22 /* keep in sync with before_thread_runs_arch() */ 49 50 #define R_KSTACK r23 /* keep in sync with before_thread_runs_arch() */ … … 105 106 * Set p4 to false if the stack register doesn't reference kernel address space. 106 107 */ 107 (p3)cmp.eq p3, p4 = VRN_KERNEL, r31 ;;108 (p3) cmp.eq p3, p4 = VRN_KERNEL, r31 ;; 108 109 109 110 /* … … 111 112 */ 112 113 mov r30 = r12 113 (p4)mov r12 = R_KSTACK ;;114 (p4) mov r12 = R_KSTACK ;; 114 115 115 116 add r31 = -STACK_FRAME_BIAS, r12 ;; 116 117 add r12 = -STACK_FRAME_SIZE, r12 117 118 118 /* 4. save registers in bank 0 into memory stack */ 119 /* 4. save registers in bank 0 into memory stack */ 120 121 /* 122 * If this is break_instruction handler, 123 * copy input parameters to stack. 124 */ 125 mov R_TMP = 0x2c00 ;; 126 cmp.eq p6,p5 = R_OFFS, R_TMP ;; 127 128 /* 129 * From now on, if this is break_instruction handler, p6 is true and p5 is false. 130 * Otherwise p6 is false and p5 is true. 131 * Note that p5 is a preserved predicate register and we make use of it. 132 */ 133 134 (p6) st8 [r31] = r35, -8 ;; /* save in3 */ 135 (p6) st8 [r31] = r34, -8 ;; /* save in2 */ 136 (p6) st8 [r31] = r33, -8 ;; /* save in1 */ 137 (p6) st8 [r31] = r32, -8 ;; /* save in0 */ 138 (p5) add r31 = -32, r31 ;; 139 119 140 st8 [r31] = r30, -8 ;; /* save old stack pointer */ 120 141 … … 147 168 * Inspect BSPSTORE to figure out whether it is necessary to switch to kernel BSPSTORE. 148 169 */ 149 (p1)shr.u r30 = r28, VRN_SHIFT ;;150 (p1)cmp.eq p1, p2 = VRN_KERNEL, r30 ;;170 (p1) shr.u r30 = r28, VRN_SHIFT ;; 171 (p1) cmp.eq p1, p2 = VRN_KERNEL, r30 ;; 151 172 152 173 /* 153 174 * If BSPSTORE needs to be switched, p1 is false and p2 is true. 154 175 */ 155 (p1)mov r30 = r28156 (p2)mov r30 = R_KSTACK_BSP ;;157 (p2)mov ar.bspstore = r30 ;;176 (p1) mov r30 = r28 177 (p2) mov r30 = R_KSTACK_BSP ;; 178 (p2) mov ar.bspstore = r30 ;; 158 179 159 180 mov r29 = ar.bsp … … 269 290 mov loc22 = r6 270 291 mov loc23 = r7 271 mov loc24 = r8 292 (p5) mov loc24 = r8 /* only if not in break_instruction handler */ 272 293 mov loc25 = r9 273 294 mov loc26 = r10 … … 326 347 mov r6 = loc22 327 348 mov r7 = loc23 328 mov r8 = loc24 349 (p5) mov r8 = loc24 /* only if not in break_instruction handler */ 329 350 mov r9 = loc25 330 351 mov r10 = loc26
Note:
See TracChangeset
for help on using the changeset viewer.