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: [PATCH] Linux-streams registration 2.5.46
Date: Thu, 07 Nov 2002 15:00:31 -0600 [thread overview]
Message-ID: <5.1.0.14.2.20021107145447.027905c8@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 3564 bytes --]
All:
I finally have LiS running on a 2.5 kernel. Attached is the 2.5.46 version
of the syscall registration patch that was submitted for inclusion in the
2.4 kernel about a month ago. It has been tested on an Intel platform.
The patch follows inline for easy perusal and is attached as a file for
tab-preservation.
Comments welcome. If it looks good will someone tell me to whom to direct
it for inclusion in the kernel source?
Thanks,
-- Dave
--- arch/i386/kernel/entry.S.orig 2002-11-06 16:09:44.000000000 -0600
+++ arch/i386/kernel/entry.S 2002-11-06 16:28:23.000000000 -0600
@@ -671,8 +671,8 @@
.long sys_capset /* 185 */
.long sys_sigaltstack
.long sys_sendfile
- .long sys_ni_syscall /* reserved for streams1 */
- .long sys_ni_syscall /* reserved for streams2 */
+ .long sys_getpmsg /* streams1 */
+ .long sys_putpmsg /* streams2 */
.long sys_vfork /* 190 */
.long sys_getrlimit
.long sys_mmap2
--- kernel/sys.c.orig 2002-11-06 16:09:57.000000000 -0600
+++ kernel/sys.c 2002-11-06 16:30:46.000000000 -0600
@@ -195,6 +195,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;
@@ -1386,3 +1429,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-11-06 16:10:10.000000000 -0600
+++ include/linux/sys.h 2002-11-06 16:29:16.000000000 -0600
@@ -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
[-- Attachment #2: streams-patch-i386-2.5.46.txt --]
[-- Type: text/plain, Size: 2755 bytes --]
--- arch/i386/kernel/entry.S.orig 2002-11-06 16:09:44.000000000 -0600
+++ arch/i386/kernel/entry.S 2002-11-06 16:28:23.000000000 -0600
@@ -671,8 +671,8 @@
.long sys_capset /* 185 */
.long sys_sigaltstack
.long sys_sendfile
- .long sys_ni_syscall /* reserved for streams1 */
- .long sys_ni_syscall /* reserved for streams2 */
+ .long sys_getpmsg /* streams1 */
+ .long sys_putpmsg /* streams2 */
.long sys_vfork /* 190 */
.long sys_getrlimit
.long sys_mmap2
--- kernel/sys.c.orig 2002-11-06 16:09:57.000000000 -0600
+++ kernel/sys.c 2002-11-06 16:30:46.000000000 -0600
@@ -195,6 +195,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;
@@ -1386,3 +1429,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-11-06 16:10:10.000000000 -0600
+++ include/linux/sys.h 2002-11-06 16:29:16.000000000 -0600
@@ -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
next reply other threads:[~2002-11-07 20:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-07 21:00 David Grothe [this message]
2002-11-08 6:37 ` [PATCH] Linux-streams registration 2.5.46 Rob Landley
2002-11-08 14:51 ` David Grothe
2002-11-08 15:07 ` Nicholas Wourms
2002-11-08 17:59 ` Rob Landley
2002-11-11 16:06 ` David Grothe
2002-11-08 17:00 ` Alan Cox
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.20021107145447.027905c8@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.