Subversion Repositories HelenOS

Rev

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

Rev 3913 Rev 4132
Line 38... Line 38...
38
#include <mm/page.h>
38
#include <mm/page.h>
39
#include <mm/as.h>
39
#include <mm/as.h>
40
#include <arch/cp0.h>
40
#include <arch/cp0.h>
41
#include <panic.h>
41
#include <panic.h>
42
#include <arch.h>
42
#include <arch.h>
43
#include <symtab.h>
-
 
44
#include <synch/mutex.h>
43
#include <synch/mutex.h>
45
#include <print.h>
44
#include <print.h>
46
#include <debug.h>
45
#include <debug.h>
47
#include <align.h>
46
#include <align.h>
48
#include <interrupt.h>
47
#include <interrupt.h>
49
 
48
 
-
 
49
#ifdef CONFIG_SYMTAB
-
 
50
#include <symtab.h>
-
 
51
#endif
-
 
52
 
50
static void tlb_refill_fail(istate_t *);
53
static void tlb_refill_fail(istate_t *);
51
static void tlb_invalid_fail(istate_t *);
54
static void tlb_invalid_fail(istate_t *);
52
static void tlb_modified_fail(istate_t *);
55
static void tlb_modified_fail(istate_t *);
53
 
56
 
54
static pte_t *find_mapping_and_check(uintptr_t, int, istate_t *, int *);
57
static pte_t *find_mapping_and_check(uintptr_t, int, istate_t *, int *);
Line 321... Line 324...
321
void tlb_refill_fail(istate_t *istate)
324
void tlb_refill_fail(istate_t *istate)
322
{
325
{
323
    char *symbol = "";
326
    char *symbol = "";
324
    char *sym2 = "";
327
    char *sym2 = "";
325
 
328
 
-
 
329
#ifdef CONFIG_SYMTAB
326
    char *s = get_symtab_entry(istate->epc);
330
    char *s = get_symtab_entry(istate->epc);
327
    if (s)
331
    if (s)
328
        symbol = s;
332
        symbol = s;
329
    s = get_symtab_entry(istate->ra);
333
    s = get_symtab_entry(istate->ra);
330
    if (s)
334
    if (s)
331
        sym2 = s;
335
        sym2 = s;
-
 
336
#endif
332
 
337
 
333
    fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
338
    fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
334
        cp0_badvaddr_read());
339
        cp0_badvaddr_read());
335
    panic("%x: TLB Refill Exception at %x(%s<-%s).", cp0_badvaddr_read(),
340
    panic("%x: TLB Refill Exception at %x(%s<-%s).", cp0_badvaddr_read(),
336
        istate->epc, symbol, sym2);
341
        istate->epc, symbol, sym2);
Line 339... Line 344...
339
 
344
 
340
void tlb_invalid_fail(istate_t *istate)
345
void tlb_invalid_fail(istate_t *istate)
341
{
346
{
342
    char *symbol = "";
347
    char *symbol = "";
343
 
348
 
-
 
349
#ifdef CONFIG_SYMTAB
344
    char *s = get_symtab_entry(istate->epc);
350
    char *s = get_symtab_entry(istate->epc);
345
    if (s)
351
    if (s)
346
        symbol = s;
352
        symbol = s;
-
 
353
#endif
-
 
354
 
347
    fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
355
    fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
348
        cp0_badvaddr_read());
356
        cp0_badvaddr_read());
349
    panic("%x: TLB Invalid Exception at %x(%s).", cp0_badvaddr_read(),
357
    panic("%x: TLB Invalid Exception at %x(%s).", cp0_badvaddr_read(),
350
        istate->epc, symbol);
358
        istate->epc, symbol);
351
}
359
}
352
 
360
 
353
void tlb_modified_fail(istate_t *istate)
361
void tlb_modified_fail(istate_t *istate)
354
{
362
{
355
    char *symbol = "";
363
    char *symbol = "";
356
 
364
 
-
 
365
#ifdef CONFIG_SYMTAB
357
    char *s = get_symtab_entry(istate->epc);
366
    char *s = get_symtab_entry(istate->epc);
358
    if (s)
367
    if (s)
359
        symbol = s;
368
        symbol = s;
-
 
369
#endif
-
 
370
 
360
    fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
371
    fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
361
        cp0_badvaddr_read());
372
        cp0_badvaddr_read());
362
    panic("%x: TLB Modified Exception at %x(%s).", cp0_badvaddr_read(),
373
    panic("%x: TLB Modified Exception at %x(%s).", cp0_badvaddr_read(),
363
        istate->epc, symbol);
374
        istate->epc, symbol);
364
}
375
}