* [Qemu-devel] microblaze stack pointer?
@ 2018-04-04 12:30 Laurent Vivier
2018-04-04 13:34 ` Edgar E. Iglesias
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2018-04-04 12:30 UTC (permalink / raw)
To: Edgar E. Iglesias; +Cc: QEMU Developers
Hi,
cleaning up linux-user signal handling functions, I found something weird.
In get_sp_from_cpustate(), SP is regs[14]:
linux-user/microblaze/target_signal.h
24) static inline abi_ulong get_sp_from_cpustate(CPUMBState *state)
25) {
26) return state->regs[14];
27) }
But in get_sigframe(), SP is regs[1];
4128) static abi_ulong get_sigframe(struct target_sigaction *ka,
4129) CPUMBState *env, int frame_size)
4130) {
4131) abi_ulong sp = env->regs[1];
4132)
4133) if ((ka->sa_flags & TARGET_SA_ONSTACK) != 0 &&
!on_sig_stack(sp)) {
4134) sp = target_sigaltstack_used.ss_sp +
target_sigaltstack_used.ss
4135) }
4136)
4137) return ((sp - frame_size) & -8UL);
4138) }
Is this correct?
Thanks,
Laurent
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] microblaze stack pointer?
2018-04-04 12:30 [Qemu-devel] microblaze stack pointer? Laurent Vivier
@ 2018-04-04 13:34 ` Edgar E. Iglesias
0 siblings, 0 replies; 2+ messages in thread
From: Edgar E. Iglesias @ 2018-04-04 13:34 UTC (permalink / raw)
To: Laurent Vivier; +Cc: QEMU Developers
On Wed, Apr 04, 2018 at 02:30:26PM +0200, Laurent Vivier wrote:
> Hi,
Hi Laurent,
>
> cleaning up linux-user signal handling functions, I found something weird.
>
> In get_sp_from_cpustate(), SP is regs[14]:
>
> linux-user/microblaze/target_signal.h
>
> 24) static inline abi_ulong get_sp_from_cpustate(CPUMBState *state)
> 25) {
> 26) return state->regs[14];
> 27) }
>
> But in get_sigframe(), SP is regs[1];
>
> 4128) static abi_ulong get_sigframe(struct target_sigaction *ka,
> 4129) CPUMBState *env, int frame_size)
> 4130) {
> 4131) abi_ulong sp = env->regs[1];
> 4132)
> 4133) if ((ka->sa_flags & TARGET_SA_ONSTACK) != 0 &&
> !on_sig_stack(sp)) {
> 4134) sp = target_sigaltstack_used.ss_sp +
> target_sigaltstack_used.ss
> 4135) }
> 4136)
> 4137) return ((sp - frame_size) & -8UL);
> 4138) }
>
> Is this correct?
get_sp_from_cpustate() is wrong, it should be regs[1]...
Cheers,
Edgar
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-04 13:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 12:30 [Qemu-devel] microblaze stack pointer? Laurent Vivier
2018-04-04 13:34 ` Edgar E. Iglesias
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).