mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Russell King <linux@arm.linux.org.uk>, linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 6/8] arm: generalize asm/signal.h
Date: Wed,  6 Oct 2010 20:06:18 +0200	[thread overview]
Message-ID: <1286388380-20646-7-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1286388380-20646-1-git-send-email-arnd@arndb.de>

The signal.h implementation in arm is mostly generic, this
makes it look like the version in include/asm-generic/.

In addition to the definitions from the generic file, arm
needs two SA_FLAGS values (SA_THIRTYTWO and SA_RESTORER)
and a nonstandard signal (SIGSWI) as well as the definition
of the legacy struct old_sigaction.

We do however drop support for libc5 and older using the
header in user space. This was done on other architectures
before because libc5 header compatibility has been broken
elsewhere for a long time already.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/include/asm/signal.h |  119 +++++++++++++++++++----------------------
 1 files changed, 56 insertions(+), 63 deletions(-)

diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h
index 43ba0fb..6c67030 100644
--- a/arch/arm/include/asm/signal.h
+++ b/arch/arm/include/asm/signal.h
@@ -1,33 +1,27 @@
 #ifndef _ASMARM_SIGNAL_H
 #define _ASMARM_SIGNAL_H
 
-#include <linux/types.h>
+/*
+ * ARM specific SA_FLAGS values:
+ * SA_THIRTYTWO		delivers the signal in 32-bit mode, even if the task 
+ *			is running in 26-bit.
+ * SA_RESTART		flag to get restarting signals (which were the default long ago)
+ */
+#define SA_THIRTYTWO	0x02000000
+#define SA_RESTORER	0x04000000
 
-/* Avoid too many header ordering problems.  */
-struct siginfo;
+/*
+ * ARM specific signals
+ */
+#define SIGSWI		32
 
-#ifdef __KERNEL__
-/* Most things should be clean enough to redefine this at will, if care
-   is taken to make libc match.  */
+/* Generic stuff below */
+#include <linux/types.h>
 
 #define _NSIG		64
-#define _NSIG_BPW	32
+#define _NSIG_BPW	__BITS_PER_LONG
 #define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
 
-typedef unsigned long old_sigset_t;		/* at least 32 bits */
-
-typedef struct {
-	unsigned long sig[_NSIG_WORDS];
-} sigset_t;
-
-#else
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-#define NSIG		32
-typedef unsigned long sigset_t;
-
-#endif /* __KERNEL__ */
-
 #define SIGHUP		 1
 #define SIGINT		 2
 #define SIGQUIT		 3
@@ -68,22 +62,20 @@ typedef unsigned long sigset_t;
 
 /* These should not be considered constants from userland.  */
 #define SIGRTMIN	32
+#ifndef SIGRTMAX
 #define SIGRTMAX	_NSIG
-
-#define SIGSWI		32
+#endif
 
 /*
  * SA_FLAGS values:
  *
- * SA_NOCLDSTOP		flag to turn off SIGCHLD when children stop.
- * SA_NOCLDWAIT		flag on SIGCHLD to inhibit zombies.
- * SA_SIGINFO		deliver the signal with SIGINFO structs
- * SA_THIRTYTWO		delivers the signal in 32-bit mode, even if the task 
- *			is running in 26-bit.
- * SA_ONSTACK		allows alternate signal stacks (see sigaltstack(2)).
- * SA_RESTART		flag to get restarting signals (which were the default long ago)
- * SA_NODEFER		prevents the current signal from being masked in the handler.
- * SA_RESETHAND		clears the handler when the signal is delivered.
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_SIGINFO deliver the signal with SIGINFO structs
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
  *
  * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  * Unix names RESETHAND and NODEFER respectively.
@@ -91,8 +83,6 @@ typedef unsigned long sigset_t;
 #define SA_NOCLDSTOP	0x00000001
 #define SA_NOCLDWAIT	0x00000002
 #define SA_SIGINFO	0x00000004
-#define SA_THIRTYTWO	0x02000000
-#define SA_RESTORER	0x04000000
 #define SA_ONSTACK	0x08000000
 #define SA_RESTART	0x10000000
 #define SA_NODEFER	0x40000000
@@ -101,8 +91,12 @@ typedef unsigned long sigset_t;
 #define SA_NOMASK	SA_NODEFER
 #define SA_ONESHOT	SA_RESETHAND
 
+/*
+ * New architectures should not define the obsolete
+ *	SA_RESTORER	0x04000000
+ */
 
-/* 
+/*
  * sigaltstack controls
  */
 #define SS_ONSTACK	1
@@ -111,20 +105,22 @@ typedef unsigned long sigset_t;
 #define MINSIGSTKSZ	2048
 #define SIGSTKSZ	8192
 
-#include <asm-generic/signal-defs.h>
+#ifndef __ASSEMBLY__
+typedef struct {
+	unsigned long sig[_NSIG_WORDS];
+} sigset_t;
 
-#ifdef __KERNEL__
-struct old_sigaction {
-	__sighandler_t sa_handler;
-	old_sigset_t sa_mask;
-	unsigned long sa_flags;
-	__sigrestore_t sa_restorer;
-};
+/* not actually used, but required for linux/syscalls.h */
+typedef unsigned long old_sigset_t;
+
+#include <asm-generic/signal-defs.h>
 
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
+#ifdef SA_RESTORER
 	__sigrestore_t sa_restorer;
+#endif
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -132,24 +128,6 @@ struct k_sigaction {
 	struct sigaction sa;
 };
 
-#else
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-struct sigaction {
-	union {
-	  __sighandler_t _sa_handler;
-	  void (*_sa_sigaction)(int, struct siginfo *, void *);
-	} _u;
-	sigset_t sa_mask;
-	unsigned long sa_flags;
-	void (*sa_restorer)(void);
-};
-
-#define sa_handler	_u._sa_handler
-#define sa_sigaction	_u._sa_sigaction
-
-#endif /* __KERNEL__ */
-
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
@@ -157,8 +135,23 @@ typedef struct sigaltstack {
 } stack_t;
 
 #ifdef __KERNEL__
+
 #include <asm/sigcontext.h>
+#undef __HAVE_ARCH_SIG_BITOPS
+
 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
-#endif
 
-#endif
+#endif /* __KERNEL__ */
+#endif /* __ASSEMBLY__ */
+
+/* End generic stuff */
+#ifdef __KERNEL__
+struct old_sigaction {
+	__sighandler_t sa_handler;
+	old_sigset_t sa_mask;
+	unsigned long sa_flags;
+	__sigrestore_t sa_restorer;
+};
+#endif /* __KERNEL__ */
+
+#endif /* _ASMARM_SIGNAL_H */
-- 
1.7.1


  parent reply	other threads:[~2010-10-06 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06 18:06 [PATCH 0/8] arm: use generic header files where possible Arnd Bergmann
2010-10-06 18:06 ` [PATCH 1/8] arm: generalize IPC header files Arnd Bergmann
2010-10-06 18:06 ` [PATCH 2/8] arm: trivial changes to make headers more generic Arnd Bergmann
2010-10-06 18:06 ` [PATCH 3/8] arm: remove unused asm/segment.h contents Arnd Bergmann
2010-10-06 18:06 ` [PATCH 4/8] arm: make asm/ioctls.h mostly generic Arnd Bergmann
2010-10-06 18:06 ` [PATCH 5/8] arm: generalize asm/posix_types.h Arnd Bergmann
2010-10-06 18:06 ` Arnd Bergmann [this message]
2010-10-06 18:06 ` [PATCH 7/8] arm: generalize asm/termios.h Arnd Bergmann
2010-10-06 18:06 ` [PATCH 8/8] arm: remove generic asm header file contents Arnd Bergmann

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=1286388380-20646-7-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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

all inboxes | Powered by JetHome®