Subject: Re: stacked syscall args on N32 kernel + O32 userland
To: None <port-mips@NetBSD.org>
From: Masao Uebayashi <uebayasi@gmail.com>
List: port-mips
Date: 08/09/2007 13:57:59
> O32 programs put arguments, that can't be put on argument registers
> (a[0-3] for O32), on stack, where 64-bit values are aligned to 64-bit
> and 32-bit and smaller values are aligned to 32-bit.
> 
> The new syscall entry code Matt Thomas has just added (thanks!) to
> matt-mips64 doesn't work if register_t is 64-bit.  The right code I
> think would be
> 
> 	* copyin() the whole arguments (sy_argsize) into kernel, and
> 	* copy each argument into register_t array.
> 
> But but we can't know sizes of each argument at this point.  Some may
> be 64-bit, like off_t.  So we can't rearrange arguments into
> register_t array.

I get to understand that this is what compat netbsd32 is for.  That
is, reading 32-bit stack with 32-bit register and convert values into
64-bit register_t arguments.

Masao