4 * Copyright (c) 2011-2012 Jia Liu <proljc@gmail.com>
5 * Feng Gao <gf91597@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
25 #include "qemu-common.h"
29 #define OPENRISC_DISAS
32 # define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
34 # define LOG_DIS(...) do { } while (0)
37 void openrisc_translate_init(void)
41 static inline void gen_intermediate_code_internal(OpenRISCCPU
*cpu
,
47 void gen_intermediate_code(CPUOpenRISCState
*env
, struct TranslationBlock
*tb
)
49 gen_intermediate_code_internal(openrisc_env_get_cpu(env
), tb
, 0);
52 void gen_intermediate_code_pc(CPUOpenRISCState
*env
,
53 struct TranslationBlock
*tb
)
55 gen_intermediate_code_internal(openrisc_env_get_cpu(env
), tb
, 1);
58 void cpu_dump_state(CPUOpenRISCState
*env
, FILE *f
,
59 fprintf_function cpu_fprintf
,
63 uint32_t *regs
= env
->gpr
;
64 cpu_fprintf(f
, "PC=%08x\n", env
->pc
);
65 for (i
= 0; i
< 32; ++i
) {
66 cpu_fprintf(f
, "R%02d=%08x%c", i
, regs
[i
],
67 (i
% 4) == 3 ? '\n' : ' ');
71 void restore_state_to_opc(CPUOpenRISCState
*env
, TranslationBlock
*tb
,
74 env
->pc
= gen_opc_pc
[pc_pos
];