log: Change log_cpu_state[_mask]() argument to CPUState

Since commit 878096eeb278a8ac1ccd6667af73e026f29b4cf5 (cpu: Turn
cpu_dump_{state,statistics}() into CPUState hooks) CPUArchState is no
longer needed.

Add documentation and make the functions available through qemu/log.h
outside NEED_CPU_H to allow use in qom/cpu.c. Moving them to qom/cpu.h
was not yet possible due to convoluted include paths, so that some
devices grow an implicit and unneeded dependency on qom/cpu.h for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move reset logging to CPUState

x86 was using additional CPU_DUMP_* flags, so make that configurable in
CPUClass::reset_dump_flags.

This adds reset logging for alpha, unicore32 and xtensa.

Signed-off-by: Andreas Färber <afaerber@suse.de>
gdbstub: Change GDBState::query_cpu to CPUState

Since first_cpu/next_cpu are CPUState, CPUArchState is no longer needed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc()

This moves setting the Program Counter from gdbstub into target code.
Use uint64_t type as maximum replacement for target_ulong.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-m68k: Implement CPUClass::set_pc()

This adds support for GDB's c addr (Continue) and s addr (Single Step).

Prepares for dropping cpu_pc_from_tb().

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-moxie: Implement CPUClass::set_pc()

This adds support for GDB's c addr (Continue) and s addr (Single Step).

Prepares for dropping cpu_pc_from_tb().

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-unicore32: Implement CPUClass::set_pc()

This adds support for GDB's c addr (Continue) and s addr (Single Step).

Prepares for dropping cpu_pc_from_tb().

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Introduce CPUClass::synchronize_from_tb() to drop cpu_pc_from_tb()

Where no extra implementation is needed, fall back to CPUClass::set_pc().

Signed-off-by: Andreas Färber <afaerber@suse.de>
gdbstub: Replace two find_cpu() with qemu_get_cpu()

Since commit cb446ecab714b2444a270be209e0533bcd2ee534 (kvm: Change
cpu_synchronize_state() argument to CPUState), one was no longer
accessing CPUArchState, the other was just checking existence.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-alpha: Change gen_intermediate_code_internal() argument to AlphaCPU

Also use bool argument while at it.

Prepares for replacing DisasContext::env with CPUState and for moving
singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-arm: Change gen_intermediate_code_internal() argument to ARMCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-cris: Change gen_intermediate_code_internal() argument to CRISCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Change gen_intermediate_code_internal() argument to X86CPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-lm32: Change gen_intermediate_code_internal() argument to LM32CPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-m68k: Change gen_intermediate_code_internal() argument to M68kCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-microblaze: Change gen_intermediate_code_internal() argument types

Use MicroBlazeCPU and bool.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-mips: Change gen_intermediate_code_internal() argument to MIPSCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-ppc: Change gen_intermediate_code_internal() argument to PowerPCCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-s390x: Change gen_intermediate_code_internal() argument to S390CPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-sh4: Change gen_intermediate_code_internal() argument to SuperHCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>