summaryrefslogtreecommitdiff
path: root/target-cris/translate.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-13target-cris: Replace DisasContext::env field with CRISCPUAndreas Färber1-8/+8
This cleans up repeated cris_env_get_cpu() for cpu_abort(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13exec: Change cpu_abort() argument to CPUStateAndreas Färber1-2/+2
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move breakpoints field from CPU_COMMON to CPUStateAndreas Färber1-2/+3
Most targets were using offsetof(CPUFooState, breakpoints) to determine how much of CPUFooState to clear on reset. Use the next field after CPU_COMMON instead, if any, or sizeof(CPUFooState) otherwise. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-12-08target-cris: Use new qemu_ld/st opcodesRichard Henderson1-25/+4
Using the new opcodes we can reduce if/else trees to a single statement. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-10-10tcg: Move helper registration into tcg_context_initRichard Henderson1-3/+0
No longer needs to be done on a per-target basis. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-09-02tcg: Change tcg_gen_exit_tb argument to uintptr_tRichard Henderson1-1/+1
And update all users. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-07-23cpu: Move singlestep_enabled field from CPU_COMMON to CPUStateAndreas Färber1-3/+4
Prepares for changing cpu_single_step() argument to CPUState. Acked-by: Michael Walle <michael@walle.cc> (for lm32) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-cris: Change gen_intermediate_code_internal() argument to CRISCPUAndreas Färber1-4/+5
Also use bool type while at it. Prepares for moving singlestep_enabled field to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09target-cris: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28cpu: Turn cpu_dump_{state,statistics}() into CPUState hooksAndreas Färber1-2/+4
Make cpustats monitor command available unconditionally. Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec() arguments to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-12cpu: Move halted and interrupt_request fields to CPUStateAndreas Färber1-1/+2
Both fields are used in VMState, thus need to be moved together. Explicitly zero them on reset since they were located before breakpoints. Pass PowerPCCPU to kvmppc_handle_halt(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-03gen-icount.h: Rename gen_icount_start/end to gen_tb_start/endPeter Maydell1-2/+2
The gen_icount_start/end functions are now somewhat misnamed since they are useful for generic "start/end of TB" code, used for more than just icount. Rename them to gen_tb_start/end. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-23target-cris: Use mul*2 in mul* insnsRichard Henderson1-42/+2
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-23qemu-log: Remove qemu_log_try_set_file() and its usersPeter Maydell1-2/+0
Remove the function qemu_log_try_set_file() and its users (which are all in TCG code generation functions for various targets). This function was added to abstract out code which was originally written as "if (!logfile) logfile = stderr;" in order that BUG: case code which did an unguarded "fprintf(logfile, ...)" would not crash if debug logging was not enabled. Since those direct uses of logfile have also been abstracted away into qemu_log() calls which check for a NULL logfile, there is no need for the target-* files to mess with the user's chosen logging settings. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael Walle <michael@walle.cc> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-16target-cris: Introduce CRISCPU subclassesAndreas Färber1-48/+0
Use class_init functions to initialize the VR in preparation for overriding v32+ behavior there. Move cpu_cris_init() to cpu.c and hook up a class_by_name callback. This change leads to unknown -cpu model names no longer falling back to a CPU with VR 32 but instead returning NULL. Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-02-16target-cris: Move TCG initialization to CRISCPU initfnAndreas Färber1-14/+5
Split out TCG initialization from cpu_cris_init(). Avoid CPUCRISState dependency for v10-specific initialization and for non-v10 by inlining the decision into the initfn as well. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-02-16target-cris: Introduce QOM realizefn for CRISCPUAndreas Färber1-2/+1
Introduce realizefn and set realized = true from cpu_cris_init(). Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19exec: move include files to include/exec/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19build: kill libdis, move disassemblers to disas/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-08TCG: Use gen_opc_instr_start from context instead of global variable.Evgeny Voevodin1-3/+3
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-08TCG: Use gen_opc_icount from context instead of global variable.Evgeny Voevodin1-1/+1
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-12-08TCG: Use gen_opc_pc from context instead of global variable.Evgeny Voevodin1-3/+3
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-11-17TCG: Use gen_opc_buf from context instead of global variable.Evgeny Voevodin1-4/+4
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-11-17TCG: Use gen_opc_ptr from context instead of global variable.Evgeny Voevodin1-5/+5
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-11-17target-cris/translate.c: Code style clean-upEvgeny Voevodin1-2500/+2540
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-11-10disas: avoid using cpu_single_envBlue Swirl1-1/+1
Pass around CPUArchState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Richard Henderson <rth@twiddle.net> Acked-by: Aurelien Jarno <aurelien@aurel32.net> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
2012-09-27Emit debug_insn for CPU_LOG_TB_OP_OPT as well.Richard Henderson1-1/+2
For all targets that currently call tcg_gen_debug_insn_start, add CPU_LOG_TB_OP_OPT to the condition that gates it. This is useful for comparing optimization dumps, when the pre-optimization dump is merely noise. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-15target-cris: Switch to AREG0 free modeAurelien Jarno1-128/+128
Add an explicit CPUCRISState parameter instead of relying on AREG0, and use cpu_ld* in translation and interrupt handling. Remove AREG0 swapping in tlb_fill(). Switch to AREG0 free mode Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-15target-cris: Avoid AREG0 for helpersAurelien Jarno1-21/+23
Add an explicit CPUCRISState parameter instead of relying on AREG0. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-09-08target-cris: Fix buffer overflowStefan Weil1-1/+1
Report from smatch: target-cris/translate.c:3464 cpu_dump_state(32) error: buffer overflow 'env->sregs' 4 <= 255 sregs is declared 'uint32_t sregs[4][16]', so the first index must be less than 4 or ARRAY_SIZE(env->sregs). Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-06-04Kill off cpu_state_reset()Andreas Färber1-5/+0
In commit 1bba0dc932e8826a7d030df3767daf0bc339f9a2 cpu_reset() was renamed to cpu_state_reset(), to allow introducing a new cpu_reset() that would operate on QOM objects. All callers have been updated except for one in target-mips, so drop all implementations except for the one in target-mips and move the declaration there until MIPSCPU reset can be fully QOM'ified. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael Walle <michael@walle.cc> (for lm32) Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa) Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> (for mb + cris) Acked-by: Alexander Graf <agraf@suse.de> (for ppc) Acked-by: Blue Swirl <blauwirbel@gmail.com>
2012-06-04target-cris: Let cpu_cris_init() return CRISCPUAndreas Färber1-4/+4
Turn cpu_init macro into a static inline function returning CPUCRISState for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-04target-cris: Reindent cpu_cris_init()Andreas Färber1-52/+53
Judging by TCG variable initialization it used 8-char tabs; use 4 spaces instead. Also remove trailing whitespace. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-04-24target-cris: Start QOM'ifying CPU initAndreas Färber1-1/+1
Move VR-independent code from cpu_cris_init() into an initfn. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-04-24target-cris: QOM'ify CPU resetAndreas Färber1-20/+2
Move code from cpu_state_reset() into QOM cris_cpu_reset(). Let CPU init call cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-04-24target-cris: QOM'ify CPUAndreas Färber1-1/+3
Embed CPUCRISState as first member of QOM CRISCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-03-14target-cris: Don't overuse CPUStateAndreas Färber1-23/+23
Scripted conversion: sed -i "s/CPUState/CPUCRISState/g" target-cris/*.[hc] sed -i "s/#define CPUCRISState/#define CPUState/" target-cris/cpu.h Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14Rename cpu_reset() to cpu_state_reset()Andreas Färber1-2/+2
Frees the identifier cpu_reset for QOM CPUs (manual rename). Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-28target-cris: Clean includesStefan Weil1-7/+0
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-1/+1
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-26Remove exec-all.h include directivesBlue Swirl1-1/+0
Most exec-all.h include directives are now useless, remove them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-20Remove unused function parameters from gen_pc_load and rename the functionStefan Weil1-2/+1
Function gen_pc_load was introduced in commit d2856f1ad4c259e5766847c49acbb4e390731bd4. The only reason for parameter searched_pc was a debug statement in target-i386/translate.c. Parameter puc was needed by target-sparc until commit d7da2a10402f1644128b66414ca8f86bdea9ae7c. Remove searched_pc from the debug statement and remove both parameters from the parameter list of gen_pc_load. As the function name gen_pc_load was also misleading, it is now called restore_state_to_opc. This new name was suggested by Peter Maydell, thanks. v2: Remove last parameter, too, and rename the function. v3: Fix [] typo in target-arm/translate.c. Fix wrong SHA1 object name in commit message (copy+paste error). Cc: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
2011-04-10Fix conversions from pointer to tcg_target_longStefan Weil1-1/+1
tcg_gen_exit_tb takes a parameter of type tcg_target_long, so the type casts of pointer to long should be replaced by type casts of pointer to tcg_target_long (suggested by Blue Swirl). These changes are needed for build environments where sizeof(long) != sizeof(void *), especially for w64. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-25cris: Replace tcg branch sequence with setcondEdgar E. Iglesias1-9/+2
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-13cris: Set btaken when storing direct jumpsEdgar E. Iglesias1-0/+3
When storing a direct jmp from translation state into runtime state we should set the btaken flag. Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10cris: Remove unused orig_flagsEdgar E. Iglesias1-2/+2
Based on a patch by Blue Swirl <blauwirbel@gmail.com>. Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10cris: Allow more TB chaining for crisv10Edgar E. Iglesias1-10/+27
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-07cris: Allow more TB chaningEdgar E. Iglesias1-19/+22
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-07cris: Avoid useless tmp in t_gen_cc_jmp()Edgar E. Iglesias1-6/+1
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2010-10-30target-xxx: Use fprintf_function (format checking)Stefan Weil1-3/+2
fprintf_function uses format checking with GCC_FMT_ATTR. Format errors were fixed in * target-i386/helper.c * target-mips/translate.c * target-ppc/translate.c Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>