[Linux-streams] [PATCH] Linux-streams registration 2.5.46

From: David Grothe (dave@gcom.com)
Date: Wed Nov 20 2002 - 12:58:57 EST


Resend:

I just checked the source for 2.5.48 and did not see this patch. Is
someone going to put it in soon?

Thanks,
Dave

----------------------------

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



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:32 EST