Subversion Repositories HelenOS

Rev

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

Rev 4132 Rev 4137
Line 43... Line 43...
43
#include <synch/mutex.h>
43
#include <synch/mutex.h>
44
#include <print.h>
44
#include <print.h>
45
#include <debug.h>
45
#include <debug.h>
46
#include <align.h>
46
#include <align.h>
47
#include <interrupt.h>
47
#include <interrupt.h>
48
 
-
 
49
#ifdef CONFIG_SYMTAB
-
 
50
#include <symtab.h>
48
#include <symtab.h>
51
#endif
-
 
52
 
49
 
53
static void tlb_refill_fail(istate_t *);
50
static void tlb_refill_fail(istate_t *);
54
static void tlb_invalid_fail(istate_t *);
51
static void tlb_invalid_fail(istate_t *);
55
static void tlb_modified_fail(istate_t *);
52
static void tlb_modified_fail(istate_t *);
56
 
53
 
Line 321... Line 318...
321
    tlb_modified_fail(istate);
318
    tlb_modified_fail(istate);
322
}
319
}
323
 
320
 
324
void tlb_refill_fail(istate_t *istate)
321
void tlb_refill_fail(istate_t *istate)
325
{
322
{
326
    char *symbol = "";
323
    char *symbol, *sym2;
327
    char *sym2 = "";
-
 
328
 
-
 
329
#ifdef CONFIG_SYMTAB
-
 
330
    char *s = get_symtab_entry(istate->epc);
-
 
331
    if (s)
-
 
332
        symbol = s;
-
 
333
    s = get_symtab_entry(istate->ra);
-
 
334
    if (s)
-
 
335
        sym2 = s;
-
 
336
#endif
-
 
337
 
324
 
-
 
325
    symbol = symtab_fmt_name_lookup(istate->epc);
-
 
326
    sym2 = symtab_fmt_name_lookup(istate->ra);
-
 
327
   
338
    fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
328
    fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
339
        cp0_badvaddr_read());
329
        cp0_badvaddr_read());
340
    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(),
341
        istate->epc, symbol, sym2);
331
        istate->epc, symbol, sym2);
342
}
332
}
343
 
333
 
344
 
334
 
345
void tlb_invalid_fail(istate_t *istate)
335
void tlb_invalid_fail(istate_t *istate)
346
{
336
{
347
    char *symbol = "";
337
    char *symbol;
348
 
338
 
349
#ifdef CONFIG_SYMTAB
-
 
350
    char *s = get_symtab_entry(istate->epc);
339
    symbol = symtab_fmt_name_lookup(istate->epc);
351
    if (s)
-
 
352
        symbol = s;
-
 
353
#endif
-
 
354
 
340
 
355
    fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
341
    fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
356
        cp0_badvaddr_read());
342
        cp0_badvaddr_read());
357
    panic("%x: TLB Invalid Exception at %x(%s).", cp0_badvaddr_read(),
343
    panic("%x: TLB Invalid Exception at %x (%s).", cp0_badvaddr_read(),
358
        istate->epc, symbol);
344
        istate->epc, symbol);
359
}
345
}
360
 
346
 
361
void tlb_modified_fail(istate_t *istate)
347
void tlb_modified_fail(istate_t *istate)
362
{
348
{
363
    char *symbol = "";
349
    char *symbol;
364
 
350
 
365
#ifdef CONFIG_SYMTAB
-
 
366
    char *s = get_symtab_entry(istate->epc);
351
    symbol = symtab_fmt_name_lookup(istate->epc);
367
    if (s)
-
 
368
        symbol = s;
-
 
369
#endif
-
 
370
 
352
 
371
    fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
353
    fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
372
        cp0_badvaddr_read());
354
        cp0_badvaddr_read());
373
    panic("%x: TLB Modified Exception at %x(%s).", cp0_badvaddr_read(),
355
    panic("%x: TLB Modified Exception at %x (%s).", cp0_badvaddr_read(),
374
        istate->epc, symbol);
356
        istate->epc, symbol);
375
}
357
}
376
 
358
 
377
/** Try to find PTE for faulting address.
359
/** Try to find PTE for faulting address.
378
 *
360
 *