mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
linux-user: Add cpu_loop_exit_sigbus
This is a new interface to be provided by the os emulator for raising SIGBUS on fault. Use the new record_sigbus target hook. Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
644a9fece4
commit
12ed56407e
2 changed files with 28 additions and 0 deletions
|
@ -706,6 +706,20 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
|
|||
cpu_loop_exit_restore(cpu, ra);
|
||||
}
|
||||
|
||||
void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
|
||||
MMUAccessType access_type, uintptr_t ra)
|
||||
{
|
||||
const struct TCGCPUOps *tcg_ops = CPU_GET_CLASS(cpu)->tcg_ops;
|
||||
|
||||
if (tcg_ops->record_sigbus) {
|
||||
tcg_ops->record_sigbus(cpu, addr, access_type, ra);
|
||||
}
|
||||
|
||||
force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN, addr);
|
||||
cpu->exception_index = EXCP_INTERRUPT;
|
||||
cpu_loop_exit_restore(cpu, ra);
|
||||
}
|
||||
|
||||
/* abort execution with signal */
|
||||
static void QEMU_NORETURN dump_core_and_abort(int target_sig)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue