From owner-freebsd-alpha Mon Mar 26 10:59:11 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 8FE8C37B71A; Mon, 26 Mar 2001 10:59:08 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.2/8.11.2) with ESMTP id f2QIwKG21801; Mon, 26 Mar 2001 10:58:28 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010326103622.H40349@wantadilla.lemis.com> Date: Mon, 26 Mar 2001 10:57:55 -0800 (PST) From: John Baldwin To: Greg Lehey Subject: Re: dev_t size mismatch kernel / userland Cc: leclercn@videotron.ca, freebsd-alpha@FreeBSD.org, Mike Smith , phk@FreeBSD.org Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 26-Mar-01 Greg Lehey wrote: > On Friday, 23 March 2001 at 21:45:12 -0800, John Baldwin wrote: >> >> On 24-Mar-01 Mike Smith wrote: >>>> Already tried vinum, works fine after modification of dev_t to >>>> u_int64_t. I'll change it to uintptr_t tough (cleaner). Hope this gets >>>> fixed! >>> >>> This is wrong. In the kernel or in a module, dev_t is an opaque type. >>> In userspace, you use udev_t, not dev_t. >>> >>> It sounds like vinum is failing to perform the required conversions when >>> exchanging a dev_t with userland, and the correct fix is going to be to >>> add these. >> >> struct drive, struct plex, etc. are shared between userland and the kernel. >> It >> looks like they need to use a udev_t, and the kernel will always have to do >> udev2dev() before using them. Either that or don't export the structures to >> userland. > > I already had code under way to export expurgated versions of these > structs. But that's a separate issue. It seems to me that if dev_t > is even visible in userland header files, it should be correct. We > should either fix it or remove it. This will probably make Poul's head spin, but one idea might be to have a kdev_t type. :-P In the kernel kdev_t == dev_t, and in userland, kdev_t is a void *. This would work in this case I think because you never use the dev_t's while in userland. I do like exporting trimmed down structures, however. Please don't export mutexes while you are at it. :-P -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message