Skip to content

Commit

Permalink
[PATCH] powerpc: Merge signal.h
Browse files Browse the repository at this point in the history
Having already merged the ppc and ppc64 versions of signal.c, this
patch finishes the job by merging signal.h.  The two versions were
almost identical already.  Notable changes:
	- We use BITS_PER_LONG to correctly size sigset_t
	- Remove some uneeded #includes and struct forward
declarations.  This does mean adding an include to signal_32.c which
relied on the indirect inclusion of sigcontext.h
	- As the ppc64 version, the merged signal.h has prototypes for
do_signal() and do_signal32().  Thus remove extra prototypes from
ppc_ksyms.c which had them directly.

Built and booted on POWER5 LPAR (ARCH=ppc64 and ARCH=powerpc).  Built
for 32-bit powermac (ARCH=ppc and ARCH=powerpc) and Walnut (ARCH=ppc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
David Gibson authored and Paul Mackerras committed Nov 10, 2005
1 parent 31e7f1f commit c5ff700
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 156 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/ppc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <asm/cputable.h>
#include <asm/btext.h>
#include <asm/div64.h>
#include <asm/signal.h>

#ifdef CONFIG_8xx
#include <asm/commproc.h>
Expand All @@ -56,7 +57,6 @@ extern void machine_check_exception(struct pt_regs *regs);
extern void alignment_exception(struct pt_regs *regs);
extern void program_check_exception(struct pt_regs *regs);
extern void single_step_exception(struct pt_regs *regs);
extern int do_signal(sigset_t *, struct pt_regs *);
extern int pmac_newworld;
extern int sys_sigreturn(struct pt_regs *regs);

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

#include <asm/uaccess.h>
#include <asm/cacheflush.h>
#include <asm/sigcontext.h>
#ifdef CONFIG_PPC64
#include "ppc32.h"
#include <asm/unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/ppc/kernel/ppc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <asm/btext.h>
#include <asm/div64.h>
#include <asm/xmon.h>
#include <asm/signal.h>

#ifdef CONFIG_8xx
#include <asm/commproc.h>
Expand All @@ -57,7 +58,6 @@ extern void machine_check_exception(struct pt_regs *regs);
extern void alignment_exception(struct pt_regs *regs);
extern void program_check_exception(struct pt_regs *regs);
extern void single_step_exception(struct pt_regs *regs);
extern int do_signal(sigset_t *, struct pt_regs *);
extern int pmac_newworld;
extern int sys_sigreturn(struct pt_regs *regs);

Expand Down
41 changes: 19 additions & 22 deletions include/asm-ppc/signal.h → include/asm-powerpc/signal.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#ifndef _ASMPPC_SIGNAL_H
#define _ASMPPC_SIGNAL_H
#ifndef _ASM_POWERPC_SIGNAL_H
#define _ASM_POWERPC_SIGNAL_H

#ifdef __KERNEL__
#include <linux/types.h>
#endif /* __KERNEL__ */

/* Avoid too many header ordering problems. */
struct siginfo;

/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
#include <linux/config.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 */
Expand Down Expand Up @@ -77,19 +70,19 @@ typedef struct {
* SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
* Unix names RESETHAND and NODEFER respectively.
*/
#define SA_NOCLDSTOP 0x00000001
#define SA_NOCLDWAIT 0x00000002
#define SA_SIGINFO 0x00000004
#define SA_ONSTACK 0x08000000
#define SA_RESTART 0x10000000
#define SA_NODEFER 0x40000000
#define SA_RESETHAND 0x80000000
#define SA_NOCLDSTOP 0x00000001U
#define SA_NOCLDWAIT 0x00000002U
#define SA_SIGINFO 0x00000004U
#define SA_ONSTACK 0x08000000U
#define SA_RESTART 0x10000000U
#define SA_NODEFER 0x40000000U
#define SA_RESETHAND 0x80000000U

#define SA_NOMASK SA_NODEFER
#define SA_ONESHOT SA_RESETHAND
#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
#define SA_INTERRUPT 0x20000000u /* dummy -- ignored */

#define SA_RESTORER 0x04000000
#define SA_RESTORER 0x04000000U

/*
* sigaltstack controls
Expand Down Expand Up @@ -127,10 +120,13 @@ typedef struct sigaltstack {
} stack_t;

#ifdef __KERNEL__
#include <asm/sigcontext.h>
struct pt_regs;
extern int do_signal(sigset_t *oldset, struct pt_regs *regs);
extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
#endif /* __KERNEL__ */

#ifndef __powerpc64__
/*
* These are parameters to dbg_sigreturn syscall. They enable or
* disable certain debugging things that can be done from signal
Expand All @@ -149,5 +145,6 @@ struct sig_dbg_op {

/* Enable or disable branch tracing. The value sets the state. */
#define SIG_DBG_BRANCH_TRACING 2
#endif /* ! __powerpc64__ */

#endif
#endif /* _ASM_POWERPC_SIGNAL_H */
132 changes: 0 additions & 132 deletions include/asm-ppc64/signal.h

This file was deleted.

0 comments on commit c5ff700

Please sign in to comment.