Subversion Repositories HelenOS

Rev

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

Rev 4343 Rev 4346
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>
-
 
48
#include <symtab.h>
49
 
49
 
50
static void tlb_refill_fail(istate_t *);
50
static void tlb_refill_fail(istate_t *);
51
static void tlb_invalid_fail(istate_t *);
51
static void tlb_invalid_fail(istate_t *);
52
static void tlb_modified_fail(istate_t *);
52
static void tlb_modified_fail(istate_t *);
53
 
53
 
Line 318... Line 318...
318
    tlb_modified_fail(istate);
318
    tlb_modified_fail(istate);
319
}
319
}
320
 
320
 
321
void tlb_refill_fail(istate_t *istate)
321
void tlb_refill_fail(istate_t *istate)
322
{
322
{
323
    char *symbol = "";
323
    char *symbol, *sym2;
324
    char *sym2 = "";
-
 
325
 
-
 
326
    char *s = get_symtab_entry(istate->epc);
-
 
327
    if (s)
-
 
328
        symbol = s;
-
 
329
    s = get_symtab_entry(istate->ra);
-
 
330
    if (s)
-
 
331
        sym2 = s;
-
 
332
 
324
 
-
 
325
    symbol = symtab_fmt_name_lookup(istate->epc);
-
 
326
    sym2 = symtab_fmt_name_lookup(istate->ra);
-
 
327
   
333
    fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
328
    fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
334
        cp0_badvaddr_read());
329
        cp0_badvaddr_read());
335
    panic("%x: TLB Refill Exception at %x(%s<-%s).", cp0_badvaddr_read(),
330
    panic("%x: TLB Refill Exception at %x (%s<-%s).", cp0_badvaddr_read(),
336
        istate->epc, symbol, sym2);
331
        istate->epc, symbol, sym2);
337
}
332
}
338
 
333
 
339
 
334
 
340
void tlb_invalid_fail(istate_t *istate)
335
void tlb_invalid_fail(istate_t *istate)
341
{
336
{
342
    char *symbol = "";
337
    char *symbol;
-
 
338
 
-
 
339
    symbol = symtab_fmt_name_lookup(istate->epc);
343
 
340
 
344
    char *s = get_symtab_entry(istate->epc);
-
 
345
    if (s)
-
 
346
        symbol = s;
-
 
347
    fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
341
    fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
348
        cp0_badvaddr_read());
342
        cp0_badvaddr_read());
349
    panic("%x: TLB Invalid Exception at %x(%s).", cp0_badvaddr_read(),
343
    panic("%x: TLB Invalid Exception at %x (%s).", cp0_badvaddr_read(),
350
        istate->epc, symbol);
344
        istate->epc, symbol);
351
}
345
}
352
 
346
 
353
void tlb_modified_fail(istate_t *istate)
347
void tlb_modified_fail(istate_t *istate)
354
{
348
{
355
    char *symbol = "";
349
    char *symbol;
-
 
350
 
-
 
351
    symbol = symtab_fmt_name_lookup(istate->epc);
356
 
352
 
357
    char *s = get_symtab_entry(istate->epc);
-
 
358
    if (s)
-
 
359
        symbol = s;
-
 
360
    fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
353
    fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
361
        cp0_badvaddr_read());
354
        cp0_badvaddr_read());
362
    panic("%x: TLB Modified Exception at %x(%s).", cp0_badvaddr_read(),
355
    panic("%x: TLB Modified Exception at %x (%s).", cp0_badvaddr_read(),
363
        istate->epc, symbol);
356
        istate->epc, symbol);
364
}
357
}
365
 
358
 
366
/** Try to find PTE for faulting address.
359
/** Try to find PTE for faulting address.
367
 *
360
 *