+2021-06-23 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-syscall.c (sim_syscall_multi): Handle CB_SYS_kill.
+
2021-06-23 Mike Frysinger <vapier@gentoo.org>
* callback.c (os_kill): New function.
TRACE_SYSCALL (cpu, "%s[%i](%#lx, %#lx, %#lx) = %li",
syscall, func, arg1, arg2, arg3, sc.result);
- if (cb_target_to_host_syscall (cb, func) == CB_SYS_exit)
- sim_engine_halt (sd, cpu, NULL, sim_pc_get (cpu), sim_exited, arg1);
+ /* Handle syscalls that affect engine behavior. */
+ switch (cb_target_to_host_syscall (cb, func))
+ {
+ case CB_SYS_exit:
+ sim_engine_halt (sd, cpu, NULL, sim_pc_get (cpu), sim_exited, arg1);
+ break;
+
+ case CB_SYS_kill:
+ /* TODO: Need to translate target signal to sim signal, but the sim
+ doesn't yet have such a mapping layer. */
+ if (arg1 == (*cb->getpid) (cb))
+ sim_engine_halt (sd, cpu, NULL, sim_pc_get (cpu), sim_signalled, arg2);
+ break;
+ }
*result = sc.result;
*result2 = sc.result2;