mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
linux-user: Pass CPUArchState to target_restore_altstack
In most cases we were already passing get_sp_from_cpustate directly to the function. In other cases, we were passing a local variable which already contained the same value. In the rest of the cases, we were passing the stack pointer out of env directly. Reviewed by: Warner Losh <imp@bsdimp.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210426025334.1168495-5-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
6b20875503
commit
ddc3e74d9c
18 changed files with 21 additions and 21 deletions
|
@ -297,7 +297,7 @@ void target_save_altstack(target_stack_t *uss, CPUArchState *env)
|
|||
__put_user(ts->sigaltstack_used.ss_size, &uss->ss_size);
|
||||
}
|
||||
|
||||
abi_long target_restore_altstack(target_stack_t *uss, abi_ulong sp)
|
||||
abi_long target_restore_altstack(target_stack_t *uss, CPUArchState *env)
|
||||
{
|
||||
TaskState *ts = (TaskState *)thread_cpu->opaque;
|
||||
size_t minstacksize = TARGET_MINSIGSTKSZ;
|
||||
|
@ -315,7 +315,7 @@ abi_long target_restore_altstack(target_stack_t *uss, abi_ulong sp)
|
|||
__get_user(ss.ss_size, &uss->ss_size);
|
||||
__get_user(ss.ss_flags, &uss->ss_flags);
|
||||
|
||||
if (on_sig_stack(sp)) {
|
||||
if (on_sig_stack(get_sp_from_cpustate(env))) {
|
||||
return -TARGET_EPERM;
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr,
|
|||
if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1)) {
|
||||
goto out;
|
||||
}
|
||||
ret = target_restore_altstack(uss, get_sp_from_cpustate(env));
|
||||
ret = target_restore_altstack(uss, env);
|
||||
if (ret) {
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue