summaryrefslogtreecommitdiff
path: root/target-alpha/translate.c
AgeCommit message (Collapse)AuthorFilesLines
2011-10-08target-alpha: Add high-resolution access to wall clock and an alarm.Richard Henderson1-4/+25
The alarm is a fully general one-shot time comparator, which will be usable under Linux as a hrtimer source. It's much more flexible than the RTC source available on real hardware. The wall clock allows the guest access to the host timekeeping. Much like the KVM wall clock source for other guests. Both are accessed via the PALcode Cserve entry point. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-10-08target-alpha: Implement HALT IPR.Richard Henderson1-0/+5
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-10-08target-alpha: Implement WAIT IPR.Richard Henderson1-10/+21
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-10-08target-alpha: Honor icount for RPCC instruction.Richard Henderson1-2/+10
Signed-off-by: Richard Henderson <rth@twiddle.net>
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-06-16alpha: remove unused variableMichael S. Tsirkin1-1/+6
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Richard Henderson <rth@twiddle.net>
2011-06-16alpha/translate: remve unused variablesMichael S. Tsirkin1-2/+1
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Implement TLB flush primitives.Richard Henderson1-11/+21
Expose these via MTPR, more or less like the real HW does. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Implement more CALL_PAL values inline.Richard Henderson1-32/+108
In particular, SWPIPL is used quite a lot by the Linux kernel. Doing this inline makes it significantly easier to step through without the debugger getting confused by the mode switch. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: All ISA checks to use TB->FLAGS.Richard Henderson1-179/+199
We had two different methods in use, both of which referenced ENV, and neither of which indicated to the generic code when different compilation modes are not compatible. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Add IPRs to be used by the emulation PALcode.Richard Henderson1-0/+96
These aren't actually used yet, but we can at least access them via the HW_MFPR and HW_MTPR instructions. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Use kernel mmu_idx for pal_mode.Richard Henderson1-4/+2
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Add various symbolic constants.Richard Henderson1-1/+1
The EXC_M_* constants were being set for the EV6, not as set for the Unix kernel entry point. Use PS_USER_MODE instead of hard-coding access to the PS register. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Tidy exception constants.Richard Henderson1-2/+2
There's no need to attempt to match EXCP_* values with PALcode entry point offsets. Instead, compress all the values to make for more efficient switch statements within QEMU. We will be doing TLB fill within QEMU proper, not within the PALcode, so all of the ITB/DTB miss, double fault, and access exceptions can be compressed to EXCP_MMFAULT. Compress all of the EXCP_CALL_PAL exceptions into one. Use env->error_code to store the specific entry point. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Rationalize internal processor registers.Richard Henderson1-61/+3
Delete all the code that tried to emulate the real IPRs of some unnamed CPU. Replace those with just 3 slots that we can use to communicate trap information between the helper functions that signal exceptions and the OS trap handler. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Merge HW_REI and HW_RET implementations.Richard Henderson1-11/+8
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Cleanup MMU modes.Richard Henderson1-3/+4
Don't bother including executive and supervisor modes. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Fix system store_conditionalRichard Henderson1-3/+3
This code contained typos, as it had never been compiled. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Fix translation of PALmode memory insns.Richard Henderson1-53/+22
All of the "raw" memory accesses should be "phys" instead. Fix some confusion about argument ordering of the store routines. Fix the implementation of store-conditional. Delete the "alt-mode" helpers. Because we only implement two mmu modes, let /a imply user-mode unconditionally. Leave some combinations of virt access without permission checks as unimplemented. There are too many hoops through which to jump, and these insns will not be needed in the emulation palcode. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Remove partial support for palcode emulation.Richard Henderson1-2/+0
This code does not work, and will be replaced by a bios image. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Single-step properly across branches.Richard Henderson1-15/+20
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, but on the instruction afterward. Signed-off-by: Richard Henderson <rth@twiddle.net>
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-3/+3
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>
2010-04-27target-alpha: Fix load-locked/store-conditional.Richard Henderson1-76/+126
Use an exception plus start_exclusive to implement the compare-and-swap. This follows the example set by the MIPS and PPC ports. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Indicate NORETURN status when raising exception.Richard Henderson1-11/+14
When (indirectly) calling raise_exception, don't emit cleanup code at the end of the TB, as it is unused. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Update commentary for opcode 0x1A.Richard Henderson1-4/+7
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Emit goto_tb opcodes.Richard Henderson1-145/+191
Use an ExitStatus enumeration instead of magic numbers as the return value from translate_one. Emit goto_tb opcodes when ending a TB via a direct branch. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Implement cvtlq inline.Richard Henderson1-1/+22
It's a simple shift and mask sequence. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Implement rs/rc properly.Richard Henderson1-4/+15
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 reg and failing to clear the flag on execution of a return-from-interrupt instruction. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Implement cpys{, n, e} inline.Richard Henderson1-4/+75
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-25alpha: remove dead assignments, spotted by clang analyzerBlue Swirl1-7/+4
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-10target-alpha: Use non-inverted arguments to gen_{f}cmov.Richard Henderson1-18/+19
The inverted conditions as argument to the function looks wrong at a glance inside translate_one. Since we have an easy function to produce the inversion now, use it. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-10target-alpha: Use setcond for int comparisons.Richard Henderson1-21/+22
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-10target-alpha: Implement cvtql inline.Richard Henderson1-6/+39
It's a simple mask and shift sequence. Also, fix a typo in the actual masks used. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-28alpha-linux-user: Implement signals.Richard Henderson1-1/+2
Move userland PALcode handling into linux-user main loop so that we can send signals from there. This also makes alpha_palcode.c system-level only, so don't build it for userland. Add defines for GENTRAP PALcall mapping to signals. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-28target-alpha: Implement IEEE FP qualifiers.Richard Henderson1-88/+433
IEEE FP instructions are split up so that the rounding mode coming from the instruction and exceptions (both masking and delivery) are handled external to the base FP operation. FP exceptions are properly raised for non-finite inputs to instructions that do not indicate software completion. A shortcut is applied if CONFIG_SOFTFLOAT_INLINE is defined at the top of translate.c: data is loaded and stored into FP_STATUS directly instead of using the functional interface defined by "softfloat.h". Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-23target-alpha: Reduce internal processor registers for user-mode.Richard Henderson1-18/+27
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 no one will ever attempt. Reducing the set of processor registers reduces the size of the CPU state. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-23target-alpha: Initialize fpcrRichard Henderson1-0/+2
Linux, at least, disables exceptions by default. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-21target-alpha: Emit tcg debug_insn_start.Richard Henderson1-0/+5
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-17target-alpha: Implement fp branch/cmov inline.Richard Henderson1-87/+110
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. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Fix double log_cpu_state.Richard Henderson1-1/+0
The proper logging is handled by generic code. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Fix FMOV.Richard Henderson1-3/+7
Properly handle move from the zero register. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Expand ins*h inline.Richard Henderson1-6/+45
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Expand msk*h inline.Richard Henderson1-14/+49
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Expand msk*l inline.Richard Henderson1-8/+30
Similar in difficulty to ext*l, already expanded. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Expand ins*l inline.Richard Henderson1-28/+59
Similar in difficulty to ext*l, already expanded. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Implement RD/WRUNIQUE in the translatorRichard Henderson1-10/+29
When emulating user-mode only, there's no reason to exit the translation block to effect a call_pal. We can generate a move to/from the unique slot directly. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Fix fbcond branch offset.Richard Henderson1-5/+4
The instructions use a disp21 like all other branch insns, not the disp16 that was being passed. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-13target-alpha: Rewrite gen_ext_[hl] in terms of zapnot.Richard Henderson1-32/+25
The architecture manual specifies the EXT instructions in terms of the ZAPNOT operation; writing it that way in the translator makes things a bit clearer. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>