From owner-freebsd-emulation@FreeBSD.ORG Fri Jun 4 18:10:06 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C705216A4CE for ; Fri, 4 Jun 2004 18:10:06 -0700 (PDT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAEA443D4C for ; Fri, 4 Jun 2004 18:10:04 -0700 (PDT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (uucp@gwyn [127.0.0.1]) i54INVsY017687 for ; Fri, 4 Jun 2004 20:23:31 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)i54INVvM017685 for freebsd-emulation@freebsd.org; Fri, 4 Jun 2004 20:23:31 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id i54IWGR95745 for freebsd-emulation@freebsd.org; Fri, 4 Jun 2004 20:32:16 +0200 (CEST) From: Juergen Lock Date: Fri, 4 Jun 2004 20:32:12 +0200 To: freebsd-emulation@freebsd.org Message-ID: <20040604203211.A95031@saturn.kn-bremen.de> Mail-Followup-To: freebsd-emulation@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i Subject: [repost:] qemu; emulators/rtc doesnt send SIGIO, is this patch right? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2004 01:10:06 -0000 [reposting from -hackers as i found this to be the place where emulators/rtc has been discussed previously] Hi! Is the following patch to the emulators/rtc port right? qemu (ports/emulators/qemu) 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-message 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