Subversion Repositories HelenOS-historic

Rev

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

Rev 327 Rev 330
Line 34... Line 34...
34
#include <arch.h>
34
#include <arch.h>
35
#include <debug.h>
35
#include <debug.h>
36
 
36
 
37
void exception(struct exception_regdump *pstate)
37
void exception(struct exception_regdump *pstate)
38
{
38
{
-
 
39
    int cause;
39
    int excno;
40
    int excno;
40
    __u32 epc_shift = 0;
41
    __u32 epc_shift = 0;
41
 
42
 
42
    ASSERT(CPU != NULL);
43
    ASSERT(CPU != NULL);
43
 
44
 
Line 57... Line 58...
57
     * do not rewrite it
58
     * do not rewrite it
58
     */
59
     */
59
    if (THREAD && !THREAD->pstate)
60
    if (THREAD && !THREAD->pstate)
60
        THREAD->pstate = pstate;
61
        THREAD->pstate = pstate;
61
 
62
 
-
 
63
    cause = cp0_cause_read();
-
 
64
    excno = cp0_cause_excno(cause);
62
    /* decode exception number and process the exception */
65
    /* decode exception number and process the exception */
63
    switch (excno = (cp0_cause_read() >> 2) & 0x1f) {
66
    switch (excno) {
64
        case EXC_Int:
67
        case EXC_Int:
65
            interrupt();
68
            interrupt();
66
            break;
69
            break;
67
        case EXC_TLBL:
70
        case EXC_TLBL:
68
        case EXC_TLBS:
71
        case EXC_TLBS:
69
            tlb_invalid(pstate);
72
            tlb_invalid(pstate);
70
            break;
73
            break;
71
        case EXC_CpU:
74
        case EXC_CpU:
72
#ifdef FPU_LAZY     
75
#ifdef FPU_LAZY     
-
 
76
            if (cp0_cause_coperr(cause) == fpu_cop_id)
73
            scheduler_fpu_lazy_request();
77
                scheduler_fpu_lazy_request();
74
#else
78
            else
75
            panic("unhandled Coprocessor Unusable Exception\n");
-
 
76
#endif
79
#endif
-
 
80
                panic("unhandled Coprocessor Unusable Exception\n");
77
            break;
81
            break;
78
        case EXC_Mod:
82
        case EXC_Mod:
79
            panic("unhandled TLB Modification Exception\n");
83
            panic("unhandled TLB Modification Exception\n");
80
            break;
84
            break;
81
        case EXC_AdEL:
85
        case EXC_AdEL: