Re: netbsd32 emulation in driver open() or read()

2011-08-31 Thread David Brownlee
On 30 August 2011 16:05, Manuel Bouyer wrote: > On Tue, Aug 30, 2011 at 10:19:20AM -0400, Christos Zoulas wrote: > > On Aug 30, 3:18pm, bou...@antioche.eu.org (Manuel Bouyer) wrote: > > -- Subject: Re: netbsd32 emulation in driver open() or read() > > > > | > Yes

Re: netbsd32 emulation in driver open() or read()

2011-08-30 Thread Manuel Bouyer
On Tue, Aug 30, 2011 at 03:41:25PM +, Eduardo Horvath wrote: > On Tue, 30 Aug 2011, Manuel Bouyer wrote: > > > That may be nice to have, but won't help with my problem which is > > getting a N32 mips binary to talk to a N64 kernel. > > Hm, MIPS. In this case you may need to check the struct

Re: netbsd32 emulation in driver open() or read()

2011-08-30 Thread Manuel Bouyer
On Tue, Aug 30, 2011 at 04:51:51PM +0100, David Brownlee wrote: > If the structure was versioned to have 64 bit fixed sized timestamps, then > the problem goes away for new code, though it does leave a COMPAT50 issue > for older code... For new code that uses bpf_xhdr. If you don't change userland

Re: netbsd32 emulation in driver open() or read()

2011-08-30 Thread Eduardo Horvath
On Tue, 30 Aug 2011, Manuel Bouyer wrote: > That may be nice to have, but won't help with my problem which is > getting a N32 mips binary to talk to a N64 kernel. Hm, MIPS. In this case you may need to check the struct emul to differentiate o32 and n32. Or do they have the exact same structure

Re: netbsd32 emulation in driver open() or read()

2011-08-30 Thread Manuel Bouyer
On Tue, Aug 30, 2011 at 10:19:20AM -0400, Christos Zoulas wrote: > On Aug 30, 3:18pm, bou...@antioche.eu.org (Manuel Bouyer) wrote: > -- Subject: Re: netbsd32 emulation in driver open() or read() > > | > Yes, look at PK_32 in the process flags. If you are going to do this, >

Re: netbsd32 emulation in driver open() or read()

2011-08-30 Thread Christos Zoulas
On Aug 30, 3:18pm, bou...@antioche.eu.org (Manuel Bouyer) wrote: -- Subject: Re: netbsd32 emulation in driver open() or read() | > Yes, look at PK_32 in the process flags. If you are going to do this, please | > look at what FreeBSD did with bpf_ts/bpf_xhdr and the time format changes | &g

Re: netbsd32 emulation in driver open() or read()

2011-08-30 Thread Manuel Bouyer
On Mon, Aug 29, 2011 at 04:28:00PM +, Christos Zoulas wrote: > In article <20110829151339.ga24...@asim.lip6.fr>, > Manuel Bouyer wrote: > >Hello, > >I'm working on getting bpf(4) in a 64bit kernel play with a 32bit userland. > >I've translated the ioctls, but I'm now stuck with read(). > >rea

Re: netbsd32 emulation in driver open() or read()

2011-08-29 Thread Christos Zoulas
In article <20110829151339.ga24...@asim.lip6.fr>, Manuel Bouyer wrote: >Hello, >I'm working on getting bpf(4) in a 64bit kernel play with a 32bit userland. >I've translated the ioctls, but I'm now stuck with read(). >read(2) on a bpf device returns wire packets (no problems with this) >with a bpf

Re: netbsd32 emulation in driver open() or read()

2011-08-29 Thread Eduardo Horvath
On Mon, 29 Aug 2011, Manuel Bouyer wrote: > So: is there a way to know if the emulation used by a userland program > doing an open() is 32 or 64bit ? sys/proc.h: 1.233 ad343: /* 1.273 ad344: * These flags are kept in p_flag and are protected by p_lock. Access from 1.23

netbsd32 emulation in driver open() or read()

2011-08-29 Thread Manuel Bouyer
Hello, I'm working on getting bpf(4) in a 64bit kernel play with a 32bit userland. I've translated the ioctls, but I'm now stuck with read(). read(2) on a bpf device returns wire packets (no problems with this) with a bpf-specific header in front of each packet. This bpf header is: struct bpf_hdr {