summaryrefslogtreecommitdiff
path: root/target-alpha/cpu.h
AgeCommit message (Collapse)AuthorFilesLines
2014-03-13cpu: Turn cpu_handle_mmu_fault() into a CPUClass hookAndreas Färber1-3/+2
Note that while such functions may exist both for *-user and softmmu, only *-user uses the CPUState hook, while softmmu reuses the prototype for calling it directly. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Turn cpu_has_work() into a CPUClass hookAndreas Färber1-15/+0
Default to false. Tidy variable naming and inline cast uses while at it. Tested-by: Jia Liu <proljc@gmail.com> (or32) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()Andreas Färber1-5/+0
Where no extra implementation is needed, fall back to CPUClass::set_pc(). Acked-by: Michael Walle <michael@walle.cc> (for lm32) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09linux-user: Move cpu_clone_regs() and cpu_set_tls() into linux-userPeter Maydell1-16/+0
The functions cpu_clone_regs() and cpu_set_tls() are not purely CPU related -- they are specific to the TLS ABI for a a particular OS. Move them into the linux-user/ tree where they belong. target-lm32 had entirely unused implementations, since it has no linux-user target; just drop them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28cpu: Turn cpu_unassigned_access() into a CPUState hookAndreas Färber1-3/+3
Use it for all targets, but be careful not to pass invalid CPUState. cpu_single_env can be NULL, e.g. on Xen. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-12cpu: Replace do_interrupt() by CPUClass::do_interrupt methodAndreas Färber1-1/+0
This removes a global per-target function and thus takes us one step closer to compiling multiple targets into one executable. It will also allow to override the interrupt handling for certain CPU families. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-12cpu: Move halted and interrupt_request fields to CPUStateAndreas Färber1-3/+1
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>
2012-12-23Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber1-4/+4
Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19fpu: move public header file to include/fpuPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19exec: move include files to include/exec/Paolo Bonzini1-3/+3
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19target-alpha: Add support for -cpu ?Andreas Färber1-0/+2
Implement alphabetical listing of CPU subclasses. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-12-19target-alpha: Turn CPU definitions into subclassesAndreas Färber1-0/+2
Make TYPE_ALPHA_CPU abstract and add types <name>-alpha-cpu. Use type inheritence, and turn "2*" models into aliases. Move cpu_alpha_init() to cpu.c and split out CPU realization. Default to creating type "ev67-alpha-cpu" as before. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-12-19target-alpha: Avoid leaking the alarm timer over resetAndreas Färber1-1/+0
Move the timer from CPUAlphaState to AlphaCPU to avoid the pointer being zero'ed once we implement reset. Would cause a segfault in sys_helper.c:helper_set_alarm(). This also simplifies timer initialization in Typhoon. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-12-19target-alpha: Let cpu_alpha_init() return AlphaCPUAndreas Färber1-2/+11
Replace cpu_init() macro with inline function for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-12-07target-alpha: Remove t0, t1 from CPUAlphaStateRichard Henderson1-7/+0
These fields are no longer (or were never?) used. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-10-31cpus: Pass CPUState to [qemu_]cpu_has_work()Andreas Färber1-1/+3
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-23Rename target_phys_addr_t to hwaddrAvi Kivity1-1/+1
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-08-04alpha-linux-user: Work around hosted mmap allocation problemsRichard Henderson1-2/+13
Signed-off-by: Richard Henderson <rth@twiddle.net>
2012-04-15target-alpha: QOM'ify CPUAndreas Färber1-0/+1
Embed CPUAlphaState as first member of AlphaCPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Richard Henderson <rth@twiddle.net>
2012-04-14Use uintptr_t for various op related functionsBlue Swirl1-3/+3
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-07Replace Qemu by QEMU in commentsStefan Weil1-1/+1
The official spelling is QEMU. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> [blauwirbel@gmail.com: fixed comment style in hw/sun4m.c] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-24target-alpha: Make use of fp_status.flush_inputs_to_zero.Richard Henderson1-1/+0
This softfp feature post-dates the last major update to the Alpha fpu translation. We can make use of this to eliminate at least one helper function that was performing this operation by hand. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-24target-alpha: Move exception helpers to helper.c.Richard Henderson1-0/+3
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-14Rename CPUState -> CPUArchStateAndreas Färber1-1/+1
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-14target-alpha: Don't overuse CPUStateAndreas Färber1-12/+12
Scripted conversion: sed -i "s/CPUState/CPUAlphaState/g" target-alpha/*.[hc] sed -i "s/#define CPUAlphaState/#define CPUState/" target-alpha/cpu.h Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-28target-alpha: Clean includesStefan Weil1-0/+1
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h. Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2011-10-08target-alpha: Add high-resolution access to wall clock and an alarm.Richard Henderson1-0/+4
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-08-07Remove unused is_softmmu parameter from cpu_handle_mmu_faultBlue Swirl1-1/+1
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-07-20Fix unassigned memory access handlingBlue Swirl1-2/+3
cea5f9a28faa528b6b1b117c9ab2d8828f473fef exposed bugs in unassigned memory access handling. Fix them by always passing CPUState to the handlers. Reported-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12target-alpha, target-ppc: Remove unnecessary setjmp.h includePeter Maydell1-2/+0
Remove the include of setjmp.h from the cpu.h of target-alpha and target-ppc. This is unnecessary because cpu-defs.h already includes this header; this change brings these two targets into line with all the rest. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26Move cpu_has_work and cpu_pc_from_tb to cpu.hBlue Swirl1-0/+22
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-05-31target-alpha: Trap for unassigned and unaligned addresses.Richard Henderson1-1/+5
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Implement cpu_alpha_handle_mmu_fault for system mode.Richard Henderson1-0/+13
Reads the page table how PALcode would, except that the virtual page table base register is not used. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Disable interrupts properly.Richard Henderson1-0/+5
Interrupts are disabled in PALmode, and when the PS IL is high enough. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: All ISA checks to use TB->FLAGS.Richard Henderson1-2/+30
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: Swap shadow registers moving to/from PALmode.Richard Henderson1-0/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Add IPRs to be used by the emulation PALcode.Richard Henderson1-0/+15
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-1/+7
Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Add various symbolic constants.Richard Henderson1-13/+43
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-20/+14
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-134/+11
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: Cleanup MMU modes.Richard Henderson1-9/+28
Don't bother including executive and supervisor modes. Signed-off-by: Richard Henderson <rth@twiddle.net>
2011-05-31target-alpha: Remove partial support for palcode emulation.Richard Henderson1-35/+0
This code does not work, and will be replaced by a bios image. Signed-off-by: Richard Henderson <rth@twiddle.net>
2010-07-03remove exec-all.h inclusion from cpu.hPaolo Bonzini1-1/+0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-03move cpu_pc_from_tb to target-*/exec.hPaolo Bonzini1-5/+0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-27target-alpha: Implement RPCC.Richard Henderson1-1/+0
A minimal implementation that more or less corresponds to the user-level version used by target-i386. More hoops will want to be jumped through when alpha gets system-level emulation. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-27target-alpha: Fix load-locked/store-conditional.Richard Henderson1-1/+5
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: Enable NPTL.Richard Henderson1-11/+18
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-12Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.Richard Henderson1-1/+3
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-02-28alpha-linux-user: Implement signals.Richard Henderson1-3/+1
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>