Subversion Repositories HelenOS

Rev

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

Rev 3788 Rev 3790
Line 87... Line 87...
87
static void trap_virtual_eoi(void)
87
static void trap_virtual_eoi(void)
88
{
88
{
89
    if (eoi_function)
89
    if (eoi_function)
90
        eoi_function();
90
        eoi_function();
91
    else
91
    else
92
        panic("no eoi_function\n");
92
        panic("No eoi_function.");
93
 
93
 
94
}
94
}
95
 
95
 
96
static void null_interrupt(int n, istate_t *istate)
96
static void null_interrupt(int n, istate_t *istate)
97
{
97
{
98
    fault_if_from_uspace(istate, "Unserviced interrupt: %d", n);
98
    fault_if_from_uspace(istate, "Unserviced interrupt: %d.", n);
99
 
99
 
100
    decode_istate(istate);
100
    decode_istate(istate);
101
    panic("Unserviced interrupt: %d\n", n);
101
    panic("Unserviced interrupt: %d.", n);
102
}
102
}
103
 
103
 
104
/** General Protection Fault. */
104
/** General Protection Fault. */
105
static void gp_fault(int n __attribute__((unused)), istate_t *istate)
105
static void gp_fault(int n __attribute__((unused)), istate_t *istate)
106
{
106
{
Line 120... Line 120...
120
             * the instruction.
120
             * the instruction.
121
             */
121
             */
122
            io_perm_bitmap_install();
122
            io_perm_bitmap_install();
123
            return;
123
            return;
124
        }
124
        }
125
        fault_if_from_uspace(istate, "General protection fault");
125
        fault_if_from_uspace(istate, "General protection fault.");
126
    }
126
    }
127
 
127
 
128
    decode_istate(istate);
128
    decode_istate(istate);
129
    panic("General protection fault\n");
129
    panic("General protection fault.");
130
}
130
}
131
 
131
 
132
static void ss_fault(int n __attribute__((unused)), istate_t *istate)
132
static void ss_fault(int n __attribute__((unused)), istate_t *istate)
133
{
133
{
134
    fault_if_from_uspace(istate, "Stack fault");
134
    fault_if_from_uspace(istate, "Stack fault.");
135
 
135
 
136
    decode_istate(istate);
136
    decode_istate(istate);
137
    panic("Stack fault\n");
137
    panic("Stack fault.");
138
}
138
}
139
 
139
 
140
static void simd_fp_exception(int n __attribute__((unused)), istate_t *istate)
140
static void simd_fp_exception(int n __attribute__((unused)), istate_t *istate)
141
{
141
{
142
    uint32_t mxcsr;
142
    uint32_t mxcsr;
143
    asm (
143
    asm (
144
        "stmxcsr %0;\n"
144
        "stmxcsr %0;\n"
145
        : "=m" (mxcsr)
145
        : "=m" (mxcsr)
146
    );
146
    );
147
    fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zx",
147
    fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR: %#zx.",
148
        (unative_t) mxcsr);
148
        (unative_t) mxcsr);
149
 
149
 
150
    decode_istate(istate);
150
    decode_istate(istate);
151
    printf("MXCSR: %#lx\n", mxcsr);
151
    printf("MXCSR: %#lx\n", mxcsr);
152
    panic("SIMD FP exception(19)\n");
152
    panic("SIMD FP exception(19).");
153
}
153
}
154
 
154
 
155
static void nm_fault(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
155
static void nm_fault(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
156
{
156
{
157
#ifdef CONFIG_FPU_LAZY     
157
#ifdef CONFIG_FPU_LAZY     
158
    scheduler_fpu_lazy_request();
158
    scheduler_fpu_lazy_request();
159
#else
159
#else
160
    fault_if_from_uspace(istate, "FPU fault");
160
    fault_if_from_uspace(istate, "FPU fault.");
161
    panic("FPU fault");
161
    panic("FPU fault.");
162
#endif
162
#endif
163
}
163
}
164
 
164
 
165
#ifdef CONFIG_SMP
165
#ifdef CONFIG_SMP
166
static void tlb_shootdown_ipi(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
166
static void tlb_shootdown_ipi(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
Line 231... Line 231...
231
void trap_virtual_enable_irqs(uint16_t irqmask)
231
void trap_virtual_enable_irqs(uint16_t irqmask)
232
{
232
{
233
    if (enable_irqs_function)
233
    if (enable_irqs_function)
234
        enable_irqs_function(irqmask);
234
        enable_irqs_function(irqmask);
235
    else
235
    else
236
        panic("no enable_irqs_function\n");
236
        panic("No enable_irqs_function.");
237
}
237
}
238
 
238
 
239
void trap_virtual_disable_irqs(uint16_t irqmask)
239
void trap_virtual_disable_irqs(uint16_t irqmask)
240
{
240
{
241
    if (disable_irqs_function)
241
    if (disable_irqs_function)
242
        disable_irqs_function(irqmask);
242
        disable_irqs_function(irqmask);
243
    else
243
    else
244
        panic("no disable_irqs_function\n");
244
        panic("No disable_irqs_function.");
245
}
245
}
246
 
246
 
247
/** @}
247
/** @}
248
 */
248
 */