[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: (fwd)



>From owner-rtl Thu Jun 21 04:35:42 2001
Received: from hq.fsmlabs.com (localhost [[UNIX: localhost]])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f5LAZe408887
	for <rtl@rtlinux.org>; Thu, 21 Jun 2001 04:35:41 -0600
Received: (qmail 4162 invoked by uid 1000); 21 Jun 2001 10:26:59 -0000
Date: Thu, 21 Jun 2001 14:26:59 +0400
From: Michael Barabanov <baraban@fsmlabs.com>
To: Ken Ramey <kramey@as.arizona.edu>
Cc: rtl@rtlinux.org
Subject: Re: [Fwd: [rtl] RT FIFOs and FIFO handlers]
Message-ID: <20010621142659.A4111@fsmlabs.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3B30B0C4.9A757AE4@as.arizona.edu>
User-Agent: Mutt/1.3.18i
Organization: FSMLabs

Ken,

It should be possible with this patch to fifos/rtl_fifo.c.
The handler installed via rtf_create_handler is now called
at the beginning of the Linux read call. I think this behaviour
makes more sense.

Michael.

--- rtl_fifo.c.ori	Thu Jun 21 14:21:27 2001
+++ rtl_fifo.c	Thu Jun 21 14:23:14 2001
@@ -509,6 +509,9 @@
 
 	minor = minor + RTF_BI(minor);
 
+	if ((result = (*RTF_HANDLER(minor)) (minor)) < 0) {
+		return result;
+	}
 	if (filp->f_flags & O_NONBLOCK) {
 		/*      if (RTF_LOCK(minor))
 		   return -EAGAIN;
@@ -542,15 +545,11 @@
 		rtl_spin_unlock_irqrestore(&RTF_SPIN(minor), interrupt_state);
 		buf += chars;
 	}
-/*      RTF_LOCK(minor)--; */
 	if (read) {
 		inode->i_atime = CURRENT_TIME;
-		if ((result = (*RTF_HANDLER(minor)) (minor)) < 0) {
-			return result;
-		}
-		return read;
 	}
-	return 0;
+/*      RTF_LOCK(minor)--; */
+	return read;
 }
 
 
> Reading the document more closely, however, reveals an explanation that says this facility is used in conjunction with rtf_get() to read data from the FIFO, after it is put there
> with a write().  My problem is the opposite.  I want to put data into the FIFO, _from the rt side_ only when the Linux process is ready to read it.  In other words... when it
> executes a read().
> 
> It appears that what I am trying to do is not supported by RTLinux.  If anyone can either confirm that or show me the error of my ways and explain how it _can_ be done, I'd
> appreciate it.
> 
> Thanks.
> 
> Ken
> 

----- End of forwarded message from owner-rtl@fsmlabs.com -----