aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/mtpcr.h
blob: 59f864fd20895558a8b7ce0572137c94cfc4b8f3 (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
require_supervisor;

switch(insn.rtype.rs2)
{
  case 0:
    set_sr(RS1);
    break;
  case 1:
    epc = RS1;
    break;
  case 3:
    evec = RS1;
    break;
  case 4:
    count = RS1;
    break;
  case 5:
    cause &= ~(1 << (TIMER_IRQ+CAUSE_IP_SHIFT));
    compare = RS1;
    break;

  case 7:
    sim.send_ipi(RS1);
    break;

  case 9:
    mmu.set_ptbr(RS1);
    break;

  case 11:
    vecbanks = RS1 & 0xff;
    vecbanks_count = __builtin_popcountll(vecbanks);
    break;

  case 16:
    sim.set_tohost(RS1);
    break;

  case 24:
    pcr_k0 = RS1;
    break;
  case 25:
    pcr_k1 = RS1;
    break;
}