Commit Graph

279 Commits

Author SHA1 Message Date
Evgeny Voevodin 92414b31e7 TCG: Use gen_opc_buf from context instead of global variable.
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-17 13:53:36 +00:00
Evgeny Voevodin efd7f48600 TCG: Use gen_opc_ptr from context instead of global variable.
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-17 13:53:27 +00:00
Evgeny Voevodin 7b5eff4daa target-cris/translate.c: Code style clean-up
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-17 13:53:24 +00:00
Blue Swirl f4359b9ffe disas: avoid using cpu_single_env
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-11-10 13:49:20 +00:00
Andreas Färber 3993c6bddf cpus: Pass CPUState to [qemu_]cpu_has_work()
For target-mips also change the return type to bool.

Make include paths for cpu-qom.h consistent for alpha and unicore32.

Signed-off-by: Andreas Färber <afaerber@suse.de>
[AF: Updated new target-openrisc function accordingly]
Acked-by: Richard Henderson <rth@twiddle.net> (for alpha)
2012-10-31 04:11:37 +01:00
Aurelien Jarno 3e2bed86a2 target-cris: rename helper flags
Rename helper flags to the new ones. This is purely a mechanical change,
it's possible to use better flags by looking at the helpers.

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-28 14:54:23 +01:00
Avi Kivity a8170e5e97 Rename target_phys_addr_t to hwaddr
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific).  Replace it with a finger-friendly,
standards conformant hwaddr.

Outstanding patchsets can be fixed up with the command

  git rebase -i --exec 'find -name "*.[ch]"
                        | xargs s/target_phys_addr_t/hwaddr/g' origin

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-23 08:58:25 -05:00
Richard Henderson fdefe51c28 Emit debug_insn for CPU_LOG_TB_OP_OPT as well.
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-27 21:38:50 +02:00
Aurelien Jarno cf7e0c80aa target-cris: Switch to AREG0 free mode
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-15 17:44:33 +00:00
Aurelien Jarno febc9920c6 target-cris: Avoid AREG0 for helpers
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-15 17:44:33 +00:00
Stefan Weil c001ed15f7 target-cris: Fix buffer overflow
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-09-08 06:30:25 +02:00
Lars Persson 8219314be6 cris: Fix NMI-flag handling on crisv10.
- The M-flag is encoded in different bits on cris v10 and cris v32.

Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15 13:21:32 +02:00
Edgar E. Iglesias f756c7a723 cris: Add break support for v10.
Still no retb

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2012-06-14 15:29:11 +02:00
Paolo Bonzini fbe37ef3e1 build: move other target-*/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:11 +02:00
Paolo Bonzini 9cdc8df314 build: move libobj-y variable to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 07:19:23 +02:00
Paolo Bonzini 5e8861a036 build: move obj-TARGET-y variables to nested Makefile.objs
Also drop duplicate occurrence of device-hotplug.o.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 07:17:36 +02:00
Andreas Färber b7e516ce04 Kill off cpu_state_reset()
In commit 1bba0dc932 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-04 23:00:45 +02:00
Andreas Färber 9fca5636e1 target-cris: Let cpu_cris_init() return CRISCPU
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-04 23:00:42 +02:00
Andreas Färber dd10ce6d8a target-cris: Reindent cpu_cris_init()
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-06-04 23:00:42 +02:00
Andreas Färber aa0d1267b3 target-cris: Start QOM'ifying CPU init
Move VR-independent code from cpu_cris_init() into an initfn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-04-24 16:04:56 +02:00
Andreas Färber 1c3b52fb1a target-cris: QOM'ify CPU reset
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-24 16:04:56 +02:00
Andreas Färber e739a48e58 target-cris: QOM'ify CPU
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-04-24 16:04:56 +02:00
Blue Swirl 2050396801 Use uintptr_t for various op related functions
Use uintptr_t instead of void * or unsigned long in
several op related functions, env->mem_io_pc and
GETPC() macro.

Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-14 14:23:37 +00:00
Andreas Färber 9349b4f9fd Rename CPUState -> CPUArchState
Scripted conversion:
  for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
    sed -i "s/CPUState/CPUArchState/g" $file
  done

All occurrences of CPUArchState are expected to be replaced by QOM CPUState,
once all targets are QOM'ified and common fields have been extracted.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14 22:20:27 +01:00
Andreas Färber a1170bfd19 target-cris: Don't overuse CPUState
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-14 22:20:25 +01:00
Andreas Färber 1bba0dc932 Rename cpu_reset() to cpu_state_reset()
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-03-14 22:20:24 +01:00
Stefan Weil 7ad757b29b target-cris: Clean includes
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>
2012-02-28 22:33:42 +01:00
Stefan Sandstrom 774d5c5b16 cris: Handle conditional stores on CRISv10
Signed-off-by: Stefan Sandstrom <Stefan.Sandstrom@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-12-12 11:38:31 +01:00
Blue Swirl bccd9ec5f0 softmmu_header: pass CPUState to tlb_fill
Pass CPUState pointer to tlb_fill() instead of architecture local
cpu_single_env hacks.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-01 09:31:26 +00:00
Anthony Liguori 7267c0947d Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:08 -05:00
Peter Maydell 871708bf39 target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SP
The REG_PC constant used in opcode-cris.h can clash with a
similar define in system include files. In particular the
Ubuntu Lucid SPARC signal.h will define REG_PC, and since
qemu-common.h now includes signal.h this was causing compile
failures. Rename the constants to avoid this issue.
(NB that REG_SP is not actually used within QEMU.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-20 01:41:01 +02:00
Blue Swirl 97b348e7d2 Remove unused is_softmmu parameter from cpu_handle_mmu_fault
Parameter is_softmmu (and its evil mutant twin brother is_softmuu)
is not used in cpu_*_handle_mmu_fault() functions, remove them
and adjust callers.

Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-07 09:32:01 +00:00
Blue Swirl 3e4571724f exec.h cleanup
Move softmmu_exec.h include directives from target-*/exec.h to
target-*/op_helper.c. Move also various other stuff only used in
op_helper.c there.

Define global env in dyngen-exec.h.

For i386, move wrappers for segment and FPU helpers from user-exec.c
to op_helper.c. Implement raise_exception_err_env() to handle dynamic
CPUState. Move the function declarations to cpu.h since they can be
used outside of op_helper.c context.

LM32, s390x, UniCore32: remove unused cpu_halted(), regs_to_env() and
env_to_regs().

ARM: make raise_exception() static.

Convert
#include "exec.h"
to
#include "cpu.h"
#include "dyngen-exec.h"
and remove now unused target-*/exec.h.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-30 09:41:14 +00:00
Edgar E. Iglesias 3ab20e206c cris: Handle opcode zero
It's a valid branch pc + 2.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-06-28 20:52:37 +02:00
Blue Swirl 2b41f10e18 Remove exec-all.h include directives
Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:35 +00:00
Blue Swirl f081c76ccf Move cpu_has_work and cpu_pc_from_tb to cpu.h
Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is
needed by later patches.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:31 +00:00
Blue Swirl f3e270377a exec.h: fix coding style and change cpu_has_work to return bool
Before the next patch, fix coding style of the areas affected.

Change the type of the return value from cpu_has_work() and
qemu_cpu_has_work() to bool.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:26 +00:00
Blue Swirl 1162c041c1 cpu_loop_exit: avoid using AREG0
Make cpu_loop_exit() take a parameter for CPUState instead of relying
on global env.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:13 +00:00
Anthony Liguori 711c21280b Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Conflicts:
	cpu-all.h
2011-05-12 08:08:12 -05:00
Richard Henderson 85097db695 irq: Privatize CPU_INTERRUPT_NMI.
This interrupt name is used by i386, CRIS, and MicroBlaze.
Copy the name into each target.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-05-08 16:55:24 +00:00
Stefan Weil 8186e78311 Fix typo in comment (truely -> truly)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-05-08 10:02:18 +01:00
Stefan Weil 64c7b9d8e0 Fix typos in comments (accessable -> accessible, priveleged -> privileged)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-05-08 10:02:16 +01:00
Stefan Weil 618ba8e6a1 Remove unused function parameter from cpu_restore_state
The previous patch removed the need for parameter puc.
Is is now unused, so remove it.

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-20 10:37:03 +02:00
Stefan Weil e87b7cb0f0 Remove unused function parameters from gen_pc_load and rename the function
Function gen_pc_load was introduced in commit
d2856f1ad4.
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 d7da2a1040.

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-20 10:33:59 +02:00
Stefan Weil 4b4a72e556 Fix conversions from pointer to tcg_target_long
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-04-10 00:45:16 +02:00
Paolo Bonzini eda48c344f inline cpu_halted into sole caller
All implementations are now the same, and there is only one caller,
so inline the function there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-13 14:44:21 +00:00
Paolo Bonzini c0c1dc9925 cris, microblaze: use cpu_has_work
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-02-08 20:37:39 +01:00
Edgar E. Iglesias 5a30b7f6f1 cris: Replace tcg branch sequence with setcond
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-01-25 19:47:06 +01:00
Edgar E. Iglesias d03d11260e cris: Set btaken when storing direct jumps
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-13 15:14:04 +01:00
Edgar E. Iglesias 05bf441eb6 cris: Remove unused orig_flags
Based on a patch by Blue Swirl <blauwirbel@gmail.com>.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10 23:28:08 +01:00
Edgar E. Iglesias 5cabc5ccfe cris: Allow more TB chaining for crisv10
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-10 23:24:36 +01:00
Edgar E. Iglesias cb752a608c cris: Allow more TB chaning
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-07 16:18:13 +01:00
Edgar E. Iglesias 2a704b137f cris: Avoid useless tmp in t_gen_cc_jmp()
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2011-01-07 12:50:38 +01:00
Stefan Weil 9a78eead0c target-xxx: Use fprintf_function (format checking)
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>
2010-10-30 08:01:59 +00:00
Blue Swirl 03e654c083 cris: avoid a write only variable
Compiling with GCC 4.6.0 20100925 produced a warning:
In file included from /src/qemu/target-cris/translate.c:3154:0:
/src/qemu/target-cris/translate_v10.c: In function 'dec10_prep_move_m':
/src/qemu/target-cris/translate_v10.c:111:22: error: variable 'rd' set but not used [-Werror=unused-but-set-variable]

Fix by deleting rd, adjust the only user.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-13 18:42:35 +00:00
Edgar E. Iglesias 3e18c6bf77 cris: Consider the TLB valid bit on writes to the TLB
When updating the guest TLB we only need to flush previous
mappings from the entry written if the entry was valid.

Also fixes a compiler warning reported by Blue Swirl.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-10-07 21:20:52 +02:00
Stefan Weil 211ecdc0e4 target-cris: Use %td for ptrdiff_t arguments in debug message
According to ISO/IEC 9899:1999 7.19.6.1,
the correct length modifier for ptrdiff_t is 't', not 'z'.

Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-10-02 13:12:21 +02:00
Edgar E. Iglesias ebab1720f6 cris: Fix watchdog resets
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-19 00:30:25 +02:00
Edgar E. Iglesias 58aebb946a cris: Fix TLB exec bit protection
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-18 12:34:59 +02:00
Blue Swirl 3ffd710e12 Use gcc warning flag -Wempty-body
If the compiler supports the warning flag -Wempty-body, use it.

Adjust the code to avoid the warnings.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18 07:01:48 +00:00
Edgar E. Iglesias abdfd9500e cris: Avoid spurios hw_abort on recursive bus faults
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-16 15:40:27 +02:00
Edgar E. Iglesias 9f5a1fae7e cris: Avoid debug clobbering for both I & D MMU state.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-07-05 11:39:04 +02:00
Edgar E. Iglesias 3c4fe427ed cris: Dont clobber the MMU state across calls to cpu_get_phys_page_debug.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-07-05 10:24:56 +02:00
Edgar E. Iglesias 253248a3be cris: Break out rand LFSR update into a separate func.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-07-05 10:15:10 +02:00
Paolo Bonzini a88790a14f remove exec-all.h inclusion from cpu.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03 09:48:24 +03:00
Paolo Bonzini 10eb0cc03c move cpu_pc_from_tb to target-*/exec.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03 09:48:12 +03:00
Paolo Bonzini 83dae09588 remove unused stuff from */exec.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03 06:47:13 +00:00
Edgar E. Iglesias 1884533c74 cris: Move sign extension.
Move it in preparation for further changes.
No functional change.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-06-16 13:46:15 +02:00
Edgar E. Iglesias 7de141cb82 cris: Centralize fetching
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-06-16 11:49:30 +02:00
Edgar E. Iglesias a699a7be90 cris: Make the CRISv32 insn decoders return signed int.
Prepare to return error from the individual decoders.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-06-16 11:28:53 +02:00
Edgar E. Iglesias 77d4f95e11 cris: Break out image loading to hw/cris-boot.c.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-06-10 14:45:46 +02:00
Blue Swirl 0bfcd599e3 Fix %lld or %llx printf format use
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-22 08:02:12 +00:00
Riccardo Magliocchetti 02021c3f3e Fix __VA__ARGS__ typo in cris mmu.c
Fix compilation with DEBUG defined

Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-05-19 19:29:24 +02:00
Blue Swirl 0d84be5bd0 cris: remove dead assignments, spotted by clang analyzer
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25 19:46:46 +00:00
Blue Swirl 43dc2a645e Replace assert(0) with abort() or cpu_abort()
When building with -DNDEBUG, assert(0) will not stop execution
so it must not be used for abnormal termination.

Use cpu_abort() when in CPU context, abort() otherwise.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-18 18:41:57 +00:00
Paul Brook d4c430a80f Large page TLB flush
QEMU uses a fixed page size for the CPU TLB.  If the guest uses large
pages then we effectively split these into multiple smaller pages, and
populate the corresponding TLB entries on demand.

When the guest invalidates the TLB by virtual address we must invalidate
all entries covered by the large page.  However the address used to
invalidate the entry may not be present in the QEMU TLB, so we do not
know which regions to clear.

Implementing a full vaiable size TLB is hard and slow, so just keep a
simple address/mask pair to record which addresses may have been mapped by
large pages.  If the guest invalidates this region then flush the
whole TLB.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-17 02:44:41 +00:00
Paul Brook 4fcc562bff Remove cpu_get_phys_page_debug from userspace emulation
cpu_get_phys_page_debug makes no sense for userspace emulation, so remove it.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-12 18:34:25 +00:00
Richard Henderson 5270589032 Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.
Removes a set of ifdefs from exec.c.

Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other
than Alpha.  This will be used for page_find_alloc, which is
supposed to be using virtual addresses in the first place.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-03-12 16:28:24 +00:00
Blue Swirl 70539e1850 Update to a hopefully more future proof FSF address
See also 8167ee8839,
530e7615ce and
fad6cb1a56.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-07 15:48:43 +00:00
Edgar E. Iglesias 4ffb9ae2e1 cris: Mask interrupts on dslots for CRISv10.
CRISv10 cores (unlike v32) do not take any interrupts while delayed
jumps are pending (delay slots).

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-20 19:17:29 +01:00
Edgar E. Iglesias bf76bafa5a crisv10: Prettify.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-15 23:39:48 +01:00
Edgar E. Iglesias 40e9eddd38 cris: Add support for CRISv10 translation.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-15 12:18:57 +01:00
Edgar E. Iglesias 46e246c911 cris: Use tcg_gen_movi_tl.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-15 12:15:07 +01:00
Edgar E. Iglesias 7a9773563c cris: Add v10 style interrupts.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-15 11:47:34 +01:00
Edgar E. Iglesias 95475216f2 crisv10: Always clear the V and C flags on btst.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-15 11:20:30 +01:00
Edgar E. Iglesias fb9fb69231 cris: Prepare for CRISv10.
* Add prefix flag and special reg.
* Add interrupt lockout.
* Add CC_OP_MSTEP.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-02-15 11:17:33 +01:00
Edgar E. Iglesias 416c60602f cris: Prettify register dumps.
Use friendly names for registers in the dumps.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-01-31 11:26:54 +01:00
Paolo Bonzini 49a945a3c0 kill regs_to_env and env_to_regs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19 16:31:02 -06:00
Edgar E. Iglesias 218951ef4d CRIS: Segmented addressing only for kernel mode.
Segmented translation through the CRIS MMU is only done for
accesses in kernel mode. In user-mode, all accesses are treated
as paged regardless of the mode config in RW_MM_CFG.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-10-10 17:34:27 +02:00
Edgar E. Iglesias be9f2ded53 CRIS: Update PR_EDA on TLB faults.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-10-08 12:07:11 +02:00
Anthony Liguori c227f0995e Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem.  Something
like this _must_ be presented on the list first so people can provide input
and cope with it.

This reverts commit 99a0949b72.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01 16:12:16 -05:00
malc 99a0949b72 Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <av1474@comtv.ru>
2009-10-01 22:45:02 +04:00
Blue Swirl 72cf2d4f0e Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc923584,
f40d753718,
96555a96d7 and
3990d09adf but the fixes were fragile.

Solution: Avoid the conflict entirely by renaming the functions and the
file. Revert the previous hacks.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-12 07:36:22 +00:00
Nathan Froyd 0b5c1ce846 cleanup cpu-exec.c, part 0/N: consolidate handle_cpu_signal
handle_cpu_signal is very nearly copy-paste code for each target, with a
few minor variations.  This patch sets up appropriate defaults for a
generic handle_cpu_signal and provides overrides for particular targets
that did things differently.  Fixing things like the persistent (XXX:
use sigsetjmp) should now become somewhat easier.

Previous comments on this patch suggest that the "activate soft MMU for
this block" comments refer to defunct functionality.  I have removed
such blocks for the appropriate targets in this patch.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:21:42 -05:00
Blue Swirl 8167ee8839 Update to a hopefully more future proof FSF address
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-16 20:47:01 +00:00
Edgar E. Iglesias 913bbbca4e cris: Remove unused internal flag.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-06-23 10:27:00 +02:00
Edgar E. Iglesias ce24e07b7d CRIS: Prettify sizes for the internal disasm.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-06-12 15:55:36 +02:00
Edgar E. Iglesias 4548eaea13 CRIS: Remove duplicated flag defines.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-06-03 22:48:05 +02:00
Anthony Liguori f80f9ec9a6 Convert machine registration to use module init functions
This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21 08:47:55 -05:00
Paul Brook 5561650587 Include assert.h from qemu-common.h
Include assert.h from qemu-common.h and remove other direct uses.
cpu-all.h still need to include it because of the dyngen-exec.h hacks

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-13 20:54:26 +01:00