From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 2 16:26:51 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5575316A4CF for ; Wed, 2 Jun 2004 16:26:51 -0700 (PDT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D81A43D3F for ; Wed, 2 Jun 2004 16:26:47 -0700 (PDT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (uucp@gwyn [127.0.0.1]) i52NQi5Y009597 for ; Thu, 3 Jun 2004 01:26:44 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)i52NQiaY009595 for freebsd-hackers@freebsd.org; Thu, 3 Jun 2004 01:26:44 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id i52NZ7U41185 for freebsd-hackers@freebsd.org; Thu, 3 Jun 2004 01:35:07 +0200 (CEST) From: Juergen Lock Date: Thu, 3 Jun 2004 01:34:59 +0200 To: freebsd-hackers@freebsd.org Message-ID: <20040603013459.A40942@saturn.kn-bremen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i X-Mailman-Approved-At: Thu, 03 Jun 2004 05:09:33 -0700 Subject: qemu; emulators/rtc doesnt send SIGIO, is this patch right? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2004 23:26:51 -0000 Hi! Is the following patch to the emulators/rtc port right? qemu (see http://www.freebsd.org/cgi/query-pr.cgi?pr=67506) expects it to send SIGIO and i'm not that good at kernel hacking to know if the following is correct... it seems to work for me tho. (Anyone interested in helping fixing the other problems mentioned in the pkg-descr is welcome also. This looks like a coool project...) Index: files/rtc.c =================================================================== RCS file: /home/ncvs/ports/emulators/rtc/files/rtc.c,v retrieving revision 1.15 diff -u -r1.15 rtc.c --- files/rtc.c 13 Mar 2004 21:20:03 -0000 1.15 +++ files/rtc.c 1 Jun 2004 15:46:19 -0000 @@ -74,6 +74,11 @@ int opened:1; int enabled:1; } flags; +#if __FreeBSD_version >= 500023 + struct thread *sproc; +#else + struct proc *sproc; +#endif struct callout rtc_handle; struct timespec lasttime; struct selinfo sip; @@ -207,6 +212,7 @@ if (sc->var.flags.opened) return (EBUSY); + sc->var.sproc = NULL; sc->var.flags.opened = 1; return 0; @@ -222,6 +228,7 @@ struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1; rtc_detach(dev, sc); + sc->var.sproc = NULL; sc->var.flags.opened = 0; return 0; } @@ -261,6 +268,7 @@ break; case RTCIO_PIE_ON: sc->var.flags.enabled = 1; + sc->var.sproc = p; DLog(Linfo, "Enable interrupts"); break; default: @@ -394,6 +402,7 @@ return; /* Wakeup sleepers */ sc->var.woken++; + psignal(sc->var.sproc, SIGIO); selwakeup(&sc->var.sip); wakeup(&sc->var.rtc_ident); Thanks, Juergen