mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
linux-user: Pass si_type information to queue_signal() explicitly
Instead of assuming in queue_signal() that all callers are passing a siginfo structure which uses the _sifields._sigfault part of the union (and thus a si_type of QEMU_SI_FAULT), make callers pass the si_type they require in as an argument. [RV adjusted to apply] Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
parent
8bd3773cce
commit
9d2803f720
4 changed files with 71 additions and 72 deletions
|
@ -569,19 +569,15 @@ static void QEMU_NORETURN force_sig(int target_sig)
|
|||
|
||||
/* queue a signal so that it will be send to the virtual CPU as soon
|
||||
as possible */
|
||||
int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info)
|
||||
int queue_signal(CPUArchState *env, int sig, int si_type,
|
||||
target_siginfo_t *info)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
TaskState *ts = cpu->opaque;
|
||||
|
||||
trace_user_queue_signal(env, sig);
|
||||
|
||||
/* Currently all callers define siginfo structures which
|
||||
* use the _sifields._sigfault union member, so we can
|
||||
* set the type here. If that changes we should push this
|
||||
* out so the si_type is passed in by callers.
|
||||
*/
|
||||
info->si_code = deposit32(info->si_code, 16, 16, QEMU_SI_FAULT);
|
||||
info->si_code = deposit32(info->si_code, 16, 16, si_type);
|
||||
|
||||
ts->sync_signal.info = *info;
|
||||
ts->sync_signal.pending = sig;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue