public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Linux-streams registration 2.5.46
@ 2002-11-07 21:00 David Grothe
  2002-11-08  6:37 ` Rob Landley
  0 siblings, 1 reply; 7+ messages in thread
From: David Grothe @ 2002-11-07 21:00 UTC (permalink / raw)
  To: Petr Vandrovec, Arjan van de Ven
  Cc: hch, linux-kernel, LiS, Dave Miller, bidulock

[-- 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-11-11 16:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-07 21:00 [PATCH] Linux-streams registration 2.5.46 David Grothe
2002-11-08  6:37 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox