target-alpha, target-ppc: Remove unnecessary setjmp.h include
Remove the include of setjmp.h from the cpu.h of target-alphaand target-ppc. This is unnecessary because cpu-defs.h alreadyincludes this header; this change brings these two targetsinto line with all the rest....
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>
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 isneeded by later patches.
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() andqemu_cpu_has_work() to bool.
cpu_loop_exit: avoid using AREG0
Make cpu_loop_exit() take a parameter for CPUState instead of relyingon global env.
alpha/translate: remve unused variables
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Richard Henderson <rth@twiddle.net>
alpha: remove unused variable
target-alpha: Implement more CALL_PAL values inline.
In particular, SWPIPL is used quite a lot by the Linux kernel.Doing this inline makes it significantly easier to step throughwithout the debugger getting confused by the mode switch.
Signed-off-by: Richard Henderson <rth@twiddle.net>
target-alpha: Implement cpu_alpha_handle_mmu_fault for system mode.
Reads the page table how PALcode would, except that the virtualpage table base register is not used.
target-alpha: Remap PIO space for 43-bit KSEG for EV6.
target-alpha: Trap for unassigned and unaligned addresses.
target-alpha: Use a fixed frequency for the RPCC in system mode.
Also include the PCC_OFS in the return value. For user mode wecan pretend the PCC_OFS value is always zero.
target-alpha: Implement TLB flush primitives.
Expose these via MTPR, more or less like the real HW does.
target-alpha: Fix system store_conditional
This code contained typos, as it had never been compiled.
target-alpha: Cleanup MMU modes.
Don't bother including executive and supervisor modes.
target-alpha: Merge HW_REI and HW_RET implementations.
target-alpha: Rationalize internal processor registers.
Delete all the code that tried to emulate the real IPRs of someunnamed CPU. Replace those with just 3 slots that we can use tocommunicate trap information between the helper functions thatsignal exceptions and the OS trap handler....
target-alpha: Enable the alpha-softmmu target.
With all of the pre-existing code that would not compile gone,this is the earliest point at which the target can be enabled.
There is no machine defined yet, so this will crash on startup.Enable the target anyway, to make sure that further compilation...
target-alpha: Tidy exception constants.
There's no need to attempt to match EXCP_* values with PALcode entrypoint offsets. Instead, compress all the values to make for moreefficient switch statements within QEMU.
We will be doing TLB fill within QEMU proper, not within the PALcode,...
target-alpha: Tidy up arithmetic exceptions.
Introduce and use arith_excp, filling in the trap_arg01 IPRs.
target-alpha: Use do_restore_state for arithmetic exceptions.
This gets the PC right after an arithmetic exception. Also tidiesthe code in the TLB fault handlers to use common code.
target-alpha: Add various symbolic constants.
The EXC_M_* constants were being set for the EV6, not as set forthe Unix kernel entry point.
Use PS_USER_MODE instead of hard-coding access to the PS register.
target-alpha: Use kernel mmu_idx for pal_mode.
target-alpha: Add IPRs to be used by the emulation PALcode.
These aren't actually used yet, but we can at least accessthem via the HW_MFPR and HW_MTPR instructions.
target-alpha: Implement do_interrupt for system mode.
target-alpha: Swap shadow registers moving to/from PALmode.
target-alpha: All ISA checks to use TB->FLAGS.
We had two different methods in use, both of which referenced ENV,and neither of which indicated to the generic code when differentcompilation modes are not compatible.
target-alpha: Disable interrupts properly.
Interrupts are disabled in PALmode, and when the PS IL is high enough.
target-alpha: Single-step properly across branches.
We were failing to generate EXC_DEBUG in the EXIT_PC_UPDATED path.This caused us not to stop at the instruction after a branch, buton the instruction afterward.
target-alpha: Remove partial support for palcode emulation.
This code does not work, and will be replaced by a bios image.
target-alpha: Fix translation of PALmode memory insns.
All of the "raw" memory accesses should be "phys" instead. Fixsome confusion about argument ordering of the store routines.Fix the implementation of store-conditional.
Delete the "alt-mode" helpers. Because we only implement two...
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>
Remove unused function parameters from gen_pc_load and rename the function
Function gen_pc_load was introduced in commitd2856f1ad4c259e5766847c49acbb4e390731bd4.The only reason for parameter searched_pc wasa debug statement in target-i386/translate.c....
target-alpha: use new float64_unordered_quiet() function
Use float64_unordered_quiet() in helper_cmptun() instead of doing thethe comparison manually.
According to the "Alpha Compiler Writer's Guide", we should use the_quiet version here, as CMPTUN and CMPTEQ should generate InvalidOp...
softfloat: rename float*_eq() into float*_eq_quiet()
float*_eq functions have a different semantics than other comparisonfunctions. Fix that by first renaming float*_quiet() into float*_eq_quiet().
Note that it is purely mechanical, and the behaviour should be unchanged....
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 bytype casts of pointer to tcg_target_long (suggested by Blue Swirl).
These changes are needed for build environments where...
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>
softfloat: Rename float*_is_nan() functions to float*_is_quiet_nan()
The softfloat functions float*_is_nan() were badly misnamed,because they return true only for quiet NaNs, not for all NaNs.Rename them to float*_is_quiet_nan() to more accurately reflect...
target-xxx: Use fprintf_function (format checking)
fprintf_function uses format checking with GCC_FMT_ATTR.
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
remove exec-all.h inclusion from cpu.h
move cpu_pc_from_tb to target-*/exec.h
remove unused stuff from */exec.h
target-alpha: Implement RPCC.
A minimal implementation that more or less corresponds to theuser-level version used by target-i386. More hoops will wantto be jumped through when alpha gets system-level emulation.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
target-alpha: Implement cpys{, n, e} inline.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-alpha: Implement rs/rc properly.
This is a per-cpu flag; there's no need for a spinlock of any kind.
We were also failing to manipulate the flag with $31 as a target regand failing to clear the flag on execution of a return-from-interruptinstruction....
target-alpha: Implement cvtlq inline.
It's a simple shift and mask sequence.
target-alpha: Emit goto_tb opcodes.
Use an ExitStatus enumeration instead of magic numbers as the returnvalue from translate_one. Emit goto_tb opcodes when ending a TB viaa direct branch.
target-alpha: Update commentary for opcode 0x1A.
target-alpha: Enable NPTL.
target-alpha: Indicate NORETURN status when raising exception.
When (indirectly) calling raise_exception, don't emit cleanupcode at the end of the TB, as it is unused.
target-alpha: Fix load-locked/store-conditional.
Use an exception plus start_exclusive to implement the compare-and-swap.This follows the example set by the MIPS and PPC ports.
alpha: add missing 'break', spotted by clang analyzer
alpha: remove dead assignments, spotted by clang analyzer
Value stored is never read.
target-alpha: Use setcond for int comparisons.
target-alpha: Use non-inverted arguments to gen_{f}cmov.
The inverted conditions as argument to the function looks wrongat a glance inside translate_one. Since we have an easy functionto produce the inversion now, use it.
target-alpha: Implement cvtql inline.
It's a simple mask and shift sequence.Also, fix a typo in the actual masks used.
target-alpha: Add flags markups to helpers.h.
Almost all alpha helpers are at least TCG_CALL_CONSTand a fair few are also TCG_CALL_PURE.
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>
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 otherthan Alpha. This will be used for page_find_alloc, which issupposed to be using virtual addresses in the first place....
alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so thatwe can send signals from there. This also makes alpha_palcode.csystem-level only, so don't build it for userland. Add definesfor GENTRAP PALcall mapping to signals....
target-alpha: Implement IEEE FP qualifiers.
IEEE FP instructions are split up so that the rounding modecoming from the instruction and exceptions (both masking anddelivery) are handled external to the base FP operation.FP exceptions are properly raised for non-finite inputs to...
target-alpha: Split up FPCR value into separate fields.
The fpcr_exc_status, fpcr_exc_mask, and fpcr_dyn_round fieldsare stored in <softfloat.h> format for convenience duringregular execution.
Revert the addition of float_exception_mask to float_status,...
target-alpha: Reduce internal processor registers for user-mode.
The existing set of IPRs is totally irrelevant to user-mode emulation.Indeed, they most are irrelevant to implementing kernel-mode emulation,and would only be relevant to PAL-mode emulation, which I suspect that...
target-alpha: Clean up arithmetic traps.
Replace the EXCP_ARITH_OVERFLOW placeholder with the completeset of bits from the EXC_SUM IPR. Use them in the existingplaces where we raise arithmetic exceptions.
target-alpha: Mark helper_excp as NORETURN.
Fix incorrect exception_index use
env->exception_index should be cleared with -1, not 0.
See also 821b19fe923ac49a24cdb4af902584fdd019cee6.
Spotted by Igor Kovalenko.
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>
target-alpha: Initialize fpcr
Linux, at least, disables exceptions by default.
target-alpha: Emit tcg debug_insn_start.
target-alpha: Fix cvtlq.
We were missing the 0xc0000000 mask, leading to incorrect results.
target-alpha: Fix float32_to_s vs zero exponent.
There was a bug in float32_to_s that incorrectly mapped a zero exponentto 0x38. This meant 0.0f != 0. At the same time, fix a generic typepunning bug in helper_memory_to_s and helper_s_to_memory.
target-alpha: Implement fp branch/cmov inline.
The old fcmov implementation had a typo:- tcg_gen_mov_i64(cpu_fir[rc], cpu_fir[ra]);which moved the condition, not the second source, to the destination.
But it's also easy to implement the simplified fp comparison inline....
target-alpha: Fix compiler warning for gcc-4.3 (and older)
"Old" compilers obviously are not able to recognisethat all cases are handled here:
qemu/target-alpha/helper.c:70: error: ‘round_mode’ may be used uninitialized in this function
A small modification helps the compiler to do its jobs....
target-alpha: Expand ins*l inline.
Similar in difficulty to ext*l, already expanded.
target-alpha: Expand msk*l inline.
target-alpha: Expand msk*h inline.
target-alpha: Expand ins*h inline.
target-alpha: Fix FMOV.
Properly handle move from the zero register.
target-alpha: Fix double log_cpu_state.
The proper logging is handled by generic code.
target-alpha: Implement RD/WRUNIQUE in the translator
When emulating user-mode only, there's no reason to exitthe translation block to effect a call_pal. We can generatea move to/from the unique slot directly.
target-alpha: Implement missing MVI instructions.
target-alpha: Fix -d in_asm
Generic disassembly was incorrectly keyed on ALPHA_DEBUG_DISASrather than the generic DEBUG_DISAS. Use qemu_log_mask foradditional LOG_DISAS output. Delete some random insn_countlogging noise from gen_intermediate_code_internal....
target-alpha: Expand zap/zapnot with immediate inline.
The vast majority of zap instructions have an immediate operand,since zapnot is the canonical method to zero-extend from u16 or u32.
target-alpha: Rewrite gen_ext_[hl] in terms of zapnot.
The architecture manual specifies the EXT instructionsin terms of the ZAPNOT operation; writing it that way inthe translator makes things a bit clearer.
target-alpha: Fix fbcond branch offset.
The instructions use a disp21 like all other branch insns,not the disp16 that was being passed.
target-alpha: Remove bogus DO_TB_FLUSH code from translator.
target-alpha: Honor the -cpu command line argument.
Also change the default cpu to ev67.
target-alpha: Fixes for alpha-linux syscalls.
1. Add correct definitions of error numbers.2. Implement SYS_osf_sigprocmask3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL.
This last requires exposing the FPCR value to do_syscall.Since this value is actually split up into the float_status,...
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. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Add 'static' to please Sparse
target-alpha: fix extlh instruction
The extlh instruction on Alpha currently doesn't work properly.It's a combination of a cut/paste bug (16 where it should be 32) as wellas a "shift by 64" bug.
Signed-off-by: Vince Weaver <vince@csl.cornell.edu>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
cleanup cpu-exec.c, part 0/N: consolidate handle_cpu_signal
handle_cpu_signal is very nearly copy-paste code for each target, with afew minor variations. This patch sets up appropriate defaults for ageneric handle_cpu_signal and provides overrides for particular targets...
Replace always_inline with inline
We define inline as always_inline.
Update to a hopefully more future proof FSF address
qemu: introduce qemu_init_vcpu (Marcelo Tosatti)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7242 c046a42c-6fe2-441c-8c8c-71466251a162
qemu: per-arch cpu_has_work (Marcelo Tosatti)
Blue Swirl: fix Sparc32 breakage
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7238 c046a42c-6fe2-441c-8c8c-71466251a162
target-alpha: fix emulation of ecb
As ECB is a hint, it can be safely emulated as a nop.
This change is necessary to boot Tru64.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7111 c046a42c-6fe2-441c-8c8c-71466251a162
target-alpha: remove amask helper
The direct use of helper_amask in translate.c was bogus (as env is notassigned). Directly code amask in tcg and remove the helper.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...