Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jun 2004 20:32:12 +0200
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        freebsd-emulation@freebsd.org
Subject:   [repost:] qemu; emulators/rtc doesnt send SIGIO, is this patch right?
Message-ID:  <20040604203211.A95031@saturn.kn-bremen.de>

next in thread | raw e-mail | index | archive | help
[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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040604203211.A95031>