All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask generic
@ 2003-01-16  3:41 Stephen Rothwell
  2003-01-16  3:43 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask ppc64 Stephen Rothwell
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Stephen Rothwell @ 2003-01-16  3:41 UTC (permalink / raw)
  To: Linus; +Cc: LKML, anton, David S. Miller, ak, davidm, schwidefsky, ralf,
	matthew

Hi Linus,

This patch creates compat_sys_sigpending and compat_sys_sigprocmask
and removes all the arch specific versions.  It requires my previous
patch ("PATCH][COMPAT] compat_{old_}sigset_t").  The diffstat of
the entire patch is below, but here I have included only the generic
part.

 arch/ia64/ia32/ia32_entry.S       |    4 +-
 arch/ia64/ia32/ia32_signal.c      |    6 ----
 arch/ia64/ia32/sys_ia32.c         |    6 ----
 arch/mips64/kernel/scall_o32.S    |    4 +-
 arch/mips64/kernel/signal32.c     |   38 ----------------------------
 arch/parisc/kernel/signal32.c     |   51 --------------------------------------
 arch/parisc/kernel/syscall.S      |    4 +-
 arch/ppc64/kernel/misc.S          |    4 +-
 arch/ppc64/kernel/signal32.c      |   50 -------------------------------------
 arch/s390x/kernel/entry.S         |    4 +-
 arch/s390x/kernel/linux32.c       |   32 -----------------------
 arch/s390x/kernel/wrapper32.S     |   18 ++++++-------
 arch/sparc64/kernel/sys_sparc32.c |   32 -----------------------
 arch/sparc64/kernel/systbls.S     |    6 ++--
 arch/x86_64/ia32/ia32entry.S      |    4 +-
 arch/x86_64/ia32/sys_ia32.c       |   35 --------------------------
 kernel/compat.c                   |   44 ++++++++++++++++++++++++++++++++
 17 files changed, 67 insertions(+), 275 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.58-32bit.5/kernel/compat.c 2.5.58-32bit.6/kernel/compat.c
--- 2.5.58-32bit.5/kernel/compat.c	2003-01-09 16:24:07.000000000 +1100
+++ 2.5.58-32bit.6/kernel/compat.c	2003-01-16 11:26:43.000000000 +1100
@@ -4,7 +4,7 @@
  *  Kernel compatibililty routines for e.g. 32 bit syscall support
  *  on 64 bit kernels.
  *
- *  Copyright (C) 2002 Stephen Rothwell, IBM Corporation
+ *  Copyright (C) 2002-2003 Stephen Rothwell, IBM Corporation
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -15,6 +15,7 @@
 #include <linux/compat.h>
 #include <linux/errno.h>
 #include <linux/time.h>
+#include <linux/signal.h>
 
 #include <asm/uaccess.h>
 
@@ -166,3 +167,44 @@
 	}
 	return compat_jiffies_to_clock_t(jiffies);
 }
+
+/*
+ * Assumption: old_sigset_t and compat_old_sigset_t are both
+ * types that can be passed to put_user()/get_user().
+ */
+
+extern asmlinkage long sys_sigpending(old_sigset_t *);
+
+asmlinkage long compat_sys_sigpending(compat_old_sigset_t *set)
+{
+	old_sigset_t s;
+	long ret;
+	mm_segment_t old_fs = get_fs();
+
+	set_fs(KERNEL_DS);
+	ret = sys_sigpending(&s);
+	set_fs(old_fs);
+	if (ret == 0)
+		ret = put_user(s, set);
+	return ret;
+}
+
+extern asmlinkage long sys_sigprocmask(int, old_sigset_t *, old_sigset_t *);
+
+asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t *set,
+		compat_old_sigset_t *oset)
+{
+	old_sigset_t s;
+	long ret;
+	mm_segment_t old_fs;
+
+	if (set && get_user(s, set))
+		return -EFAULT;
+	old_fs = get_fs();
+	set_fs(KERNEL_DS);
+	ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL);
+	set_fs(old_fs);
+	if (ret == 0)
+		ret = put_user(s, oset);
+	return ret;
+}

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

end of thread, other threads:[~2003-01-16  3:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-16  3:41 [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask generic Stephen Rothwell
2003-01-16  3:43 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask ppc64 Stephen Rothwell
2003-01-16  3:45 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask sparc64 Stephen Rothwell
2003-01-16  3:46 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask x86_64 Stephen Rothwell
2003-01-16  3:47 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask ia64 Stephen Rothwell
2003-01-16  3:49 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask s390x Stephen Rothwell
2003-01-16  3:50 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask mips64 Stephen Rothwell
2003-01-16  3:53   ` Ralf Baechle
2003-01-16  3:51 ` [PATCH][COMPAT] compat_sys_sigpending and compat_sys_sigprocmask parisc Stephen Rothwell

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.