tech-kern archive

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

Re: compat_netbsd32 swapctl



On Wed, Jan 29, 2014 at 11:54:29AM +0100, Martin Husemann wrote:
> On Wed, Jan 29, 2014 at 10:42:14AM +0000, Emmanuel Dreyfus wrote:
> > The solution is for netbsd32_swapctl() to call sys_swapctl() for
> > each individual record, but it needs to know the i386 size for 
> > struct swapent. I suspect there is a macro for that. Someone knows?
> 
> Tricky.
> 
> You could define swapent32 with se_dev split into two 32bit halves and
> do full conversion back and forth, but better check what alignment
> mips and sparc would require here first.

Look at what is done elsewhere in the i386 compat code.

There is a 64bit integer type that has an alignment requirement of 8.
If that is used instead of a normal 64bit type then the structure
alignement under amd64 matches that of i386.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index