Subversion Repositories HelenOS

Rev

Rev 2071 | Rev 3657 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2608
Line 124... Line 124...
124
char *vector_to_string(uint16_t vector)
124
char *vector_to_string(uint16_t vector)
125
{
125
{
126
    ASSERT(vector <= VECTOR_MAX);
126
    ASSERT(vector <= VECTOR_MAX);
127
   
127
   
128
    if (vector >= VECTORS_16_BUNDLE_START)
128
    if (vector >= VECTORS_16_BUNDLE_START)
-
 
129
        return vector_names_16_bundle[(vector -
129
        return vector_names_16_bundle[(vector-VECTORS_16_BUNDLE_START)/(16*BUNDLE_SIZE)];
130
            VECTORS_16_BUNDLE_START) / (16 * BUNDLE_SIZE)];
130
    else
131
    else
131
        return vector_names_64_bundle[vector/(64*BUNDLE_SIZE)];
132
        return vector_names_64_bundle[vector / (64 * BUNDLE_SIZE)];
132
}
133
}
133
 
134
 
134
void dump_interrupted_context(istate_t *istate)
135
void dump_interrupted_context(istate_t *istate)
135
{
136
{
136
    char *ifa, *iipa, *iip;
137
    char *ifa, *iipa, *iip;
Line 139... Line 140...
139
    iipa = get_symtab_entry(istate->cr_iipa);
140
    iipa = get_symtab_entry(istate->cr_iipa);
140
    iip = get_symtab_entry(istate->cr_iip);
141
    iip = get_symtab_entry(istate->cr_iip);
141
 
142
 
142
    putchar('\n');
143
    putchar('\n');
143
    printf("Interrupted context dump:\n");
144
    printf("Interrupted context dump:\n");
144
    printf("ar.bsp=%p\tar.bspstore=%p\n", istate->ar_bsp, istate->ar_bspstore);
145
    printf("ar.bsp=%p\tar.bspstore=%p\n", istate->ar_bsp,
-
 
146
        istate->ar_bspstore);
145
    printf("ar.rnat=%#018llx\tar.rsc=%#018llx\n", istate->ar_rnat, istate->ar_rsc);
147
    printf("ar.rnat=%#018llx\tar.rsc=%#018llx\n", istate->ar_rnat,
-
 
148
        istate->ar_rsc);
146
    printf("ar.ifs=%#018llx\tar.pfs=%#018llx\n", istate->ar_ifs, istate->ar_pfs);
149
    printf("ar.ifs=%#018llx\tar.pfs=%#018llx\n", istate->ar_ifs,
-
 
150
        istate->ar_pfs);
147
    printf("cr.isr=%#018llx\tcr.ipsr=%#018llx\t\n", istate->cr_isr.value, istate->cr_ipsr);
151
    printf("cr.isr=%#018llx\tcr.ipsr=%#018llx\t\n", istate->cr_isr.value,
-
 
152
        istate->cr_ipsr);
148
   
153
   
149
    printf("cr.iip=%#018llx, #%d\t(%s)\n", istate->cr_iip, istate->cr_isr.ei, iip);
154
    printf("cr.iip=%#018llx, #%d\t(%s)\n", istate->cr_iip,
-
 
155
        istate->cr_isr.ei, iip);
150
    printf("cr.iipa=%#018llx\t(%s)\n", istate->cr_iipa, iipa);
156
    printf("cr.iipa=%#018llx\t(%s)\n", istate->cr_iipa, iipa);
151
    printf("cr.ifa=%#018llx\t(%s)\n", istate->cr_ifa, ifa);
157
    printf("cr.ifa=%#018llx\t(%s)\n", istate->cr_ifa, ifa);
152
}
158
}
153
 
159
 
154
void general_exception(uint64_t vector, istate_t *istate)
160
void general_exception(uint64_t vector, istate_t *istate)
Line 188... Line 194...
188
void disabled_fp_register(uint64_t vector, istate_t *istate)
194
void disabled_fp_register(uint64_t vector, istate_t *istate)
189
{
195
{
190
#ifdef CONFIG_FPU_LAZY 
196
#ifdef CONFIG_FPU_LAZY 
191
    scheduler_fpu_lazy_request();  
197
    scheduler_fpu_lazy_request();  
192
#else
198
#else
193
    fault_if_from_uspace(istate, "Interruption: %#hx (%s)", (uint16_t) vector, vector_to_string(vector));
199
    fault_if_from_uspace(istate, "Interruption: %#hx (%s)",
-
 
200
        (uint16_t) vector, vector_to_string(vector));
194
    dump_interrupted_context(istate);
201
    dump_interrupted_context(istate);
195
    panic("Interruption: %#hx (%s)\n", (uint16_t) vector, vector_to_string(vector));
202
    panic("Interruption: %#hx (%s)\n", (uint16_t) vector,
-
 
203
        vector_to_string(vector));
196
#endif
204
#endif
197
}
205
}
198
 
206
 
199
void nop_handler(uint64_t vector, istate_t *istate)
207
void nop_handler(uint64_t vector, istate_t *istate)
200
{
208
{
Line 211... Line 219...
211
        istate->cr_iip += 16;
219
        istate->cr_iip += 16;
212
    } else {
220
    } else {
213
        istate->cr_ipsr.ri++;
221
        istate->cr_ipsr.ri++;
214
    }
222
    }
215
 
223
 
216
    return syscall_handler(istate->in0, istate->in1, istate->in2, istate->in3, istate->in4);
224
    return syscall_handler(istate->in0, istate->in1, istate->in2,
-
 
225
        istate->in3, istate->in4, istate->in5, istate->in6);
217
}
226
}
218
 
227
 
219
void universal_handler(uint64_t vector, istate_t *istate)
228
void universal_handler(uint64_t vector, istate_t *istate)
220
{
229
{
221
    fault_if_from_uspace(istate,"Interruption: %#hx (%s)\n",(uint16_t) vector, vector_to_string(vector));
230
    fault_if_from_uspace(istate, "Interruption: %#hx (%s)\n",
-
 
231
        (uint16_t) vector, vector_to_string(vector));
222
    dump_interrupted_context(istate);
232
    dump_interrupted_context(istate);
223
    panic("Interruption: %#hx (%s)\n", (uint16_t) vector, vector_to_string(vector));
233
    panic("Interruption: %#hx (%s)\n", (uint16_t) vector,
-
 
234
        vector_to_string(vector));
224
}
235
}
225
 
236
 
226
void external_interrupt(uint64_t vector, istate_t *istate)
237
void external_interrupt(uint64_t vector, istate_t *istate)
227
{
238
{
228
    irq_t *irq;
239
    irq_t *irq;
Line 242... Line 253...
242
            printf("cpu%d: spurious interrupt\n", CPU->id);
253
            printf("cpu%d: spurious interrupt\n", CPU->id);
243
#endif
254
#endif
244
            break;
255
            break;
245
 
256
 
246
        default:
257
        default:
247
            panic("\nUnhandled External Interrupt Vector %d\n", ivr.vector);
258
            panic("\nUnhandled External Interrupt Vector %d\n",
-
 
259
                ivr.vector);
248
            break;
260
            break;
249
        }
261
        }
250
    }
262
    }
251
}
263
}
252
 
264