cpu: Turn cpu_has_work() into a CPUClass hook

Default to false.

Tidy variable naming and inline cast uses while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Turn cpu_mmu_index() into a CPUClass hook

Default to 0.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Turn cpu_get_tb_cpu_state() into a CPUClass hook

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Turn cpu_handle_mmu_fault() into a CPUClass hook

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move mem_io_{pc,vaddr} fields from CPU_COMMON to CPUState

Reset them.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move can_do_io field from CPU_COMMON to CPUState

Rename can_do_io() to cpu_can_do_io() and change argument to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move icount_extra field from CPU_COMMON to CPUState

Reset it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move icount_decr field from CPU_COMMON to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move tb_jmp_cache field from CPU_COMMON to CPUState

Clear it on reset.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move jmp_env field from CPU_COMMON to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move exception_index field from CPU_COMMON to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move cpu_copy() into linux-user

It is only used there and is deemed very fragile if not incorrect in its
current memcpy() form. Moving it into linux-user will allow to move
parts into target_cpu.h headers and only copy what the ABI mandates.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Drop cpu_model_str from CPU_COMMON

Since this is only read in cpu_copy() and linux-user has a global
cpu_model, drop the field from generic code.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move opaque field from CPU_COMMON to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move watchpoint fields from CPU_COMMON to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move breakpoints field from CPU_COMMON to CPUState

Most targets were using offsetof(CPUFooState, breakpoints) to determine
how much of CPUFooState to clear on reset. Use the next field after
CPU_COMMON instead, if any, or sizeof(CPUFooState) otherwise.

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move tlb_flush_{addr,mask} fields from CPU_COMMON_TLB to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
exec: Change tlb_fill() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu-exec: Change cpu_loop_exit() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
translate-all: Change cpu_restore_state() argument to CPUState

This lets us drop some local variables in tlb_fill() functions.

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