[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] linux-user:Signal handling for MIPS64
From: |
Khansa Butt |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] linux-user:Signal handling for MIPS64 |
Date: |
Wed, 28 Dec 2011 16:09:36 +0500 |
On Wed, Dec 14, 2011 at 9:20 PM, Richard Henderson <address@hidden> wrote:
> On 12/07/2011 09:25 PM, address@hidden wrote:
>> +#if defined(TARGET_MIPS64)
>> + /* tswapal() do 64 bit swap in case of MIPS64 but
>> + we need 32 bit swap as sa_flags is 32 bit */
>> + k->sa_flags = bswap32(act->sa_flags);
>> +#else
>> k->sa_flags = tswapal(act->sa_flags);
>> +#endif
>
> The condition in syscall_defs.h is TARGET_MIPS, not TARGET_MIPS64.
> They should match, despite the fact that it doesn't actually matter
> for the 32-bit abis.
>
actually sa_flags is 32 bit for MIPS64 but tswapal calls tswap64() as
TARGET_LONG_SIZE != 4
in case of MIPS64( see cpu-all.h) hence sa_flags has wrong value at
the end so I used above hunk
>> #elif defined(TARGET_ABI_MIPSN64)
>>
>> -# warning signal handling not implemented
>> +struct target_sigcontext {
>> + uint32_t sc_regmask; /* Unused */
>> + uint32_t sc_status;
>
> There's no reason to duplicate all this code. Yes, when someone wrote
> this in the first place, they wrote separate sectons for each mips abi.
> However, as you can see that huge portions of this block are identical,
> this was obviously a mistake.
>
> Start by changing the original section to #elif defined(TARGET_MIPS)
> and see what needs changing specifically for the ABIs. I'm not even
> sure there are any differences at all.
>
>
> r~