Port-mips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: netbsd32 syscalls sy_flags



In article <20161028202458.GA15006%SDF.ORG@localhost>,  <coypu%SDF.ORG@localhost> wrote:
>Hi,
>I've been trying to run code meant for MIPS o32 ABI on MIPS n32.
>
>Background:
>Both of them run under netbsd32 compat (when running mips64).
>MIPS o32 ABI calling convention says there are 4 registers meant for
>passing arguments, the rest go onto the stack.
>Also, o32 has 32bit registers.
>
>So a syscall with 64bit parameters has to be split up to using two
>arguments/stack slots.
>
>The code within sys/arch/mips/mips/syscall.c expects to know which
>arguments are 64bit through callp->sy_flags for its own logic.
>
>However, when making an lseek call, it seems to have sy_flags=0, so it
>treats all the arguments as being 32bit, and grabs the upper half of the
>offset as "whence" (usually zero), which is broken.
>
>(The relevant code is in lines 205 onwards...
>
>It tells a given argument is 64bit using:

cvs update, I fixed it.

christos



Home | Main Index | Thread Index | Old Index