Date: Thu, 15 Aug 2002 08:47:38 -0500 From: dmk <gh@over-yonder.net> To: freebsd-current@freebsd.org Subject: Re: emulators/rtc and vmware2 Message-ID: <20020815134738.GB35400@over-yonder.net> In-Reply-To: <20020815121105.GA35400@over-yonder.net> References: <20020815121105.GA35400@over-yonder.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thu, Aug 15, 2002 at 07:11:05AM -0500 I heard the voice of
dmk, and lo! it spake thus:
>
> Is anybody successfully using the port emulators/rtc with vmware2 on
> -current?
[...]
Replying to myself...
I have since hacked rtc so it works with vmware2 on my -CURRENT system
dated February 4, 2002.
In the shocking case that anyone is interested, I have attached the
diff. (I would appreciate anybody looking at the diff as it is my first
kernel hack.)
> Thanks loads,
dan
--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rtc.diff"
--- rtc.c.bk Thu Aug 15 03:50:21 2002
+++ rtc.c Thu Aug 15 03:51:30 2002
@@ -177,9 +177,8 @@
rtc_open(dev_t dev, int oflag, int otyp, struct proc *p)
#endif
{
- struct rtc_softc *sc;
+ struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1;
- sc = rtc_attach(dev);
if (sc==NULL)
return (EAGAIN);
@@ -264,7 +263,21 @@
static int
init_module(void)
{
-int error;
+ int error;
+ struct rtc_softc *sc;
+ dev_t dev;
+
+ dev = make_dev(&rtc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, DEVICE_NAME);
+ if(dev==NULL)
+ return (NULL);
+
+ MALLOC(sc, struct rtc_softc*, sizeof(*sc), M_DEVBUF, M_WAITOK);
+ if(sc==NULL)
+ return NULL;
+
+ bzero(sc, sizeof(*sc));
+ rtc_sc = sc;
+ dev->si_drv1 = sc; /* Link together */
error = cdevsw_add(&rtc_cdevsw);
if (error)
--RnlQjJ0d97Da+TV1--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020815134738.GB35400>
