1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include "qemu/osdep.h"
21#include "cpu.h"
22#include "exec/helper-proto.h"
23#include "exec/exec-all.h"
24#include "exec/cpu_ldst.h"
25
26
27#ifndef CONFIG_USER_ONLY
28void alpha_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
29 MMUAccessType access_type,
30 int mmu_idx, uintptr_t retaddr)
31{
32 AlphaCPU *cpu = ALPHA_CPU(cs);
33 CPUAlphaState *env = &cpu->env;
34 uint64_t pc;
35 uint32_t insn;
36
37 if (retaddr) {
38 cpu_restore_state(cs, retaddr);
39 }
40
41 pc = env->pc;
42 insn = cpu_ldl_code(env, pc);
43
44 env->trap_arg0 = addr;
45 env->trap_arg1 = insn >> 26;
46 env->trap_arg2 = (insn >> 21) & 31;
47 cs->exception_index = EXCP_UNALIGN;
48 env->error_code = 0;
49 cpu_loop_exit(cs);
50}
51
52void alpha_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
53 vaddr addr, unsigned size,
54 MMUAccessType access_type,
55 int mmu_idx, MemTxAttrs attrs,
56 MemTxResult response, uintptr_t retaddr)
57{
58 AlphaCPU *cpu = ALPHA_CPU(cs);
59 CPUAlphaState *env = &cpu->env;
60
61 if (retaddr) {
62 cpu_restore_state(cs, retaddr);
63 }
64
65 env->trap_arg0 = addr;
66 env->trap_arg1 = access_type == MMU_DATA_STORE ? 1 : 0;
67 cs->exception_index = EXCP_MCHK;
68 env->error_code = 0;
69 cpu_loop_exit(cs);
70}
71
72
73
74
75
76void tlb_fill(CPUState *cs, target_ulong addr, MMUAccessType access_type,
77 int mmu_idx, uintptr_t retaddr)
78{
79 int ret;
80
81 ret = alpha_cpu_handle_mmu_fault(cs, addr, access_type, mmu_idx);
82 if (unlikely(ret != 0)) {
83 if (retaddr) {
84 cpu_restore_state(cs, retaddr);
85 }
86
87 cpu_loop_exit(cs);
88 }
89}
90#endif
91