From owner-freebsd-current Fri Aug 16 16:31:54 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C66037B400 for ; Fri, 16 Aug 2002 16:31:49 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id AD03443E72 for ; Fri, 16 Aug 2002 16:31:48 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 43984 invoked by uid 1000); 16 Aug 2002 23:31:49 -0000 Date: Fri, 16 Aug 2002 16:31:49 -0700 (PDT) From: Nate Lawson To: dmk Cc: Robert Watson , freebsd-current@freebsd.org Subject: Re: emulators/rtc and vmware2 In-Reply-To: <20020816230831.GD35400@over-yonder.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 16 Aug 2002, dmk wrote: > On Thu, 15 Aug 2002, dmk wrote: > > > > Is anybody successfully using the port emulators/rtc with vmware2 on > > -current? > [...] > > On Thu, Aug 15, 2002 at 01:36:46PM -0400 Robert Watson wrote: > > My recollection is that the problem relates to calling make_dev() from the > > attach routine, and attach from the open call, and of course you can't > > open before you make_dev with devfs. Someone needs to restructure the > > driver to match some our other pseudo-device drivers where the device is > > properly created as part of module initialization. > [...] > > Robert N M Watson FreeBSD Core Team, TrustedBSD Projects > > robert@fledge.watson.org Network Associates Laboratories > > The attached diff effectively restructures the rtc device driver to > perform the make_dev() at module load. The driver may have problems, but > it does work, and, unlike the first diff, doesn't segfault on unload. ;-) > > (I don't claim to write C or hack kernels, so this presented as-is in Generally it's more appropriate to do cdevsw_add() in module init and then make_dev() in each open. That's the ONLY way to do it if you have multiple instances of a device (e.g. BPF). -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message