accel/tcg: Split out adjust_signal_pc

Split out a function to adjust the raw signal pc into a
value that could be passed to cpu_restore_state.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
v2: Adjust pc in place; return MMUAccessType.
This commit is contained in:
Richard Henderson
2021-09-12 19:25:22 -07:00
parent dd61b91c08
commit 0fdbb7d2c1
2 changed files with 35 additions and 16 deletions

View File

@@ -663,6 +663,16 @@ static inline tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env,
return addr;
}
/**
* adjust_signal_pc:
* @pc: raw pc from the host signal ucontext_t.
* @is_write: host memory operation was write, or read-modify-write.
*
* Alter @pc as required for unwinding. Return the type of the
* guest memory access -- host reads may be for guest execution.
*/
MMUAccessType adjust_signal_pc(uintptr_t *pc, bool is_write);
/**
* cpu_signal_handler
* @signum: host signal number