[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: [rtl] FIFOs



Hello,

On Sun, 19 Jul 1998 omill@mail.ewu.edu wrote:

> Is there any limitations on the number of FIFOs you can have opened at
> the same time?

>From fs/rt_fifo_new.c, line 19:

#define RTF_NO 64

so I think the current limit is 64.  Make sure to create /dev/rtf0 until
/dev/rtf63 first, to be able to use them from user programs.

The kernel module code at the bottom of this e-mail opens 64 RT FIFOs, and
doesn't produce any error messages on my system.

This makes me wonder about the difference between the rt_fifo.c and the
rt_fifo_new.c file.  The rt_fifo.c file is compiled into the kernel, where
the rt_fifo_new.c file is compiled as a module.  As far as I can tell the
functions from rt_fifo.c aren't used.  Am I right?  If so, is rt_fifo.c
retained for backward compatibility, or should rt_fifo.c be removed? 

Regards,

Ferdy T.Y. Hanssen, Student at Dept. of Computer Science, University of Twente
E-mail: hanssen@cs.utwente.nl

--- Start of code ---
/*
 * Compile with something like this:
 *   gcc -I<rt-linux/path>/include -D__KERNEL__ -DMODULE -D__RT__ \
 *   -Wall -O -o rt_maxfifo_test.o -c rt_maxfifo_test.c
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/malloc.h>
#include <linux/cons.h>
#include <linux/rtf.h>

int init_module(void)
{
	int rt_fifo;
	int err;

	for (rt_fifo = 0; rt_fifo < 64; rt_fifo++) {
		err = rtf_create(rt_fifo, 16384);
		if (err) {
			printk("rt_maxfifo_test: rtf_create(%d, 16384) FAILED: %d\n", rt_fifo, -err);
		}
	}
	return 0;
}

void cleanup_module(void)
{
	int rt_fifo;
	int err;

	for (rt_fifo = 0; rt_fifo < 64; rt_fifo++) {
		err = rtf_destroy(rt_fifo);
		if (err) {
			printk("rt_maxfifo_test: rtf_destroy(%d) FAILED: %d\n", rt_fifo, -err);
		}
	}
}
--- End of code ---

--- [rtl] ---
For more information on Real-Time Linux see:
http://www.rtlinux.org/