public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Grothe <dave@gcom.com>
To: "Petr Vandrovec" <VANDROVE@vc.cvut.cz>,
	Arjan van de Ven <arjanv@fenrus.demon.nl>
Cc: hch@infradead.org, linux-kernel@vger.kernel.org,
	LiS <linux-streams@gsyc.escet.urjc.es>,
	Dave Miller <davem@redhat.com>,
	bidulock@openss7.org
Subject: Re: [Linux-streams] Re: [PATCH] Re: export of sys_call_tabl
Date: Fri, 11 Oct 2002 09:22:09 -0500	[thread overview]
Message-ID: <5.1.0.14.2.20021011091840.02695808@localhost> (raw)
In-Reply-To: <43B789B00E8@vcnet.vc.cvut.cz>

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Here is a proposed "final" patch for the streams hooks.  I think that it 
takes into account all suggestions.  I put the prototype in linux/sys.h.

This is for stock 2.4.19, and has been tested.

-- Dave

[-- Attachment #2: stock-i386-2.4.19.txt --]
[-- Type: text/plain, Size: 2883 bytes --]

--- arch/i386/kernel/entry.S.orig	2002-08-02 19:39:42.000000000 -0500
+++ arch/i386/kernel/entry.S	2002-10-08 15:43:08.000000000 -0500
@@ -584,8 +584,8 @@
 	.long SYMBOL_NAME(sys_capset)           /* 185 */
 	.long SYMBOL_NAME(sys_sigaltstack)
 	.long SYMBOL_NAME(sys_sendfile)
-	.long SYMBOL_NAME(sys_ni_syscall)		/* streams1 */
-	.long SYMBOL_NAME(sys_ni_syscall)		/* streams2 */
+	.long SYMBOL_NAME(sys_getpmsg)		/* streams1 */
+	.long SYMBOL_NAME(sys_putpmsg)		/* streams2 */
 	.long SYMBOL_NAME(sys_vfork)            /* 190 */
 	.long SYMBOL_NAME(sys_getrlimit)
 	.long SYMBOL_NAME(sys_mmap2)
--- kernel/sys.c.orig	2002-08-02 19:39:46.000000000 -0500
+++ kernel/sys.c	2002-10-10 15:00:45.000000000 -0500
@@ -167,6 +167,49 @@
 	return notifier_chain_unregister(&reboot_notifier_list, nb);
 }
 
+static int (*do_putpmsg) (int, void *, void *, int, int) = NULL;
+static int (*do_getpmsg) (int, void *, void *, int, int) = NULL;
+
+static DECLARE_RWSEM(streams_call_sem);
+
+long asmlinkage
+sys_putpmsg(int fd, void *ctlptr, void *datptr, int band, int flags)
+{
+	int ret = -ENOSYS;
+	down_read(&streams_call_sem);	/* should return int, but doesn't */
+	if (do_putpmsg)
+		ret = (*do_putpmsg) (fd, ctlptr, datptr, band, flags);
+	up_read(&streams_call_sem);
+	return ret;
+}
+
+long asmlinkage
+sys_getpmsg(int fd, void *ctlptr, void *datptr, int band, int flags)
+{
+	int ret = -ENOSYS;
+	down_read(&streams_call_sem);	/* should return int, but doesn't */
+	if (do_getpmsg)
+		ret = (*do_getpmsg) (fd, ctlptr, datptr, band, flags);
+	up_read(&streams_call_sem);
+	return ret;
+}
+
+int
+register_streams_calls(int (*putpmsg) (int, void *, void *, int, int),
+		       int (*getpmsg) (int, void *, void *, int, int))
+{
+	int ret = -EBUSY;
+	down_write(&streams_call_sem);	/* should return int, but doesn't */
+	if (   (putpmsg == NULL || do_putpmsg == NULL)
+	    && (getpmsg == NULL || do_getpmsg == NULL)) {
+		do_putpmsg = putpmsg;
+		do_getpmsg = getpmsg;
+		ret = 0;
+	}
+	up_write(&streams_call_sem);
+	return ret;
+}
+
 asmlinkage long sys_ni_syscall(void)
 {
 	return -ENOSYS;
@@ -1286,3 +1329,4 @@
 EXPORT_SYMBOL(unregister_reboot_notifier);
 EXPORT_SYMBOL(in_group_p);
 EXPORT_SYMBOL(in_egroup_p);
+EXPORT_SYMBOL_GPL(register_streams_calls);
--- include/linux/sys.h.orig	2002-10-11 08:59:10.000000000 -0500
+++ include/linux/sys.h	2002-10-11 09:15:04.000000000 -0500
@@ -27,4 +27,16 @@
  * These are system calls that haven't been implemented yet
  * but have an entry in the table for future expansion..
  */
+
+/*
+ * These are registration routines for system calls that are
+ * implemented by loadable modules outside of the kernel
+ * source tree.
+ */
+#if !defined(__ASSEMBLY__)
+extern int
+register_streams_calls(int (*putpmsg) (int, void *, void *, int, int),
+		       int (*getpmsg) (int, void *, void *, int, int)) ;
+
+#endif			/* __ASSEMBLY__ */
 #endif

  reply	other threads:[~2002-10-11 14:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 19:41 [Linux-streams] Re: [PATCH] Re: export of sys_call_tabl Petr Vandrovec
2002-10-11 14:22 ` David Grothe [this message]
2002-10-11 14:49   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-10-10 16:38 Petr Vandrovec
2002-10-10 16:57 ` David Grothe
2002-10-10 17:27   ` Christoph Hellwig
2002-10-10 19:07     ` David Grothe
2002-10-10 19:33       ` Arjan van de Ven
2002-10-10 20:31       ` David Grothe
     [not found]       ` <20021011180209.A30671@infradead.org>
     [not found]         ` <20021011142657.B32421@openss7.org>
2002-10-12  2:29           ` Ole Husgaard
2002-10-12  9:32             ` Arjan van de Ven
2002-10-12  9:54               ` Brian F. G. Bidulock
2002-10-12  9:56             ` Brian F. G. Bidulock
2002-10-12 11:51               ` Alan Cox
2002-10-12 15:29               ` Ole Husgaard
2002-10-10 16:32 David Grothe
2002-10-10 16:25 Petr Vandrovec
2002-10-10 16:30 ` David Grothe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.2.20021011091840.02695808@localhost \
    --to=dave@gcom.com \
    --cc=VANDROVE@vc.cvut.cz \
    --cc=arjanv@fenrus.demon.nl \
    --cc=bidulock@openss7.org \
    --cc=davem@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-streams@gsyc.escet.urjc.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox