aboutsummaryrefslogtreecommitdiff
path: root/handlers.c
blob: 6cc595812bc074c87ea0d25c67e9ff357317b871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "pcr.h"
#include "pk.h"

void handle_breakpoint(trapframe_t* tf)
{
  printk("Breakpoint\n");
  dump_tf(tf);
  tf->epc += 4;
  pop_tf(tf);
}

void handle_fp_disabled(trapframe_t* tf)
{
  tf->sr |= SR_EF;
  pop_tf(tf);
}

void handle_badtrap(trapframe_t* tf)
{
  dump_tf(tf);
  panic("Bad trap vector!");
}

void handle_privileged_instruction(trapframe_t* tf)
{
  dump_tf(tf);
  panic("A privileged instruction was executed!");
}

void handle_illegal_instruction(trapframe_t* tf)
{
  dump_tf(tf);
  panic("An illegal instruction was executed!");
}

void handle_misaligned_fetch(trapframe_t* tf)
{
  dump_tf(tf);
  panic("Misaligned instruction access!");
}

void handle_misaligned_ldst(trapframe_t* tf)
{
  dump_tf(tf);
  panic("Misaligned data access!");
}

void handle_fault_fetch(trapframe_t* tf)
{
  dump_tf(tf);
  panic("Faulting instruction access!");
}

void handle_fault_ldst(trapframe_t* tf)
{
  dump_tf(tf);
  panic("Faulting data access!");
}