]>
git.proxmox.com Git - mirror_qemu.git/blob - target-tricore/op_helper.c
2 * Copyright (c) 2012-2014 Bastian Koppelmann C-Lab/University Paderborn
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 #include "qemu/host-utils.h"
20 #include "exec/helper-proto.h"
21 #include "exec/cpu_ldst.h"
23 static inline void QEMU_NORETURN
do_raise_exception_err(CPUTriCoreState
*env
,
28 CPUState
*cs
= CPU(tricore_env_get_cpu(env
));
29 cs
->exception_index
= exception
;
30 env
->error_code
= error_code
;
33 /* now we have a real cpu fault */
34 cpu_restore_state(cs
, pc
);
40 static inline void QEMU_NORETURN
do_raise_exception(CPUTriCoreState
*env
,
44 do_raise_exception_err(env
, exception
, 0, pc
);
47 void tlb_fill(CPUState
*cs
, target_ulong addr
, int is_write
, int mmu_idx
,
51 ret
= cpu_tricore_handle_mmu_fault(cs
, addr
, is_write
, mmu_idx
);
53 TriCoreCPU
*cpu
= TRICORE_CPU(cs
);
54 CPUTriCoreState
*env
= &cpu
->env
;
55 do_raise_exception_err(env
, cs
->exception_index
,
56 env
->error_code
, retaddr
);