Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f22ab814 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds
Browse files

include/asm/ptrace.h userspace headers cleanup



This patch contains the following cleanups for the asm/ptrace.h
userspace headers:

- include/asm-generic/Kbuild.asm already lists ptrace.h, remove
  the superfluous listings in the Kbuild files of the following
  architectures:
  - cris
  - frv
  - powerpc
  - x86
- don't expose function prototypes and macros to userspace:
  - arm
  - blackfin
  - cris
  - mn10300
  - parisc
- remove #ifdef CONFIG_'s around #define's:
  - blackfin
  - m68knommu
- sh: AFAIK __SH5__ should work in both kernel and userspace,
      no need to leak CONFIG_SUPERH64 to userspace
- xtensa: cosmetical change to remove empty
            #ifndef __ASSEMBLY__ #else #endif
          from the userspace headers

Not changed by this patch is the fact that the following architectures
have a different struct pt_regs depending on CONFIG_ variables:
- h8300
- m68knommu
- mips

This does not work in userspace.

Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Cc: <linux-arch@vger.kernel.org>
Cc: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: default avatarGreg Ungerer <gerg@uclinux.org>
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
Acked-by: default avatarGrant Grundler <grundler@parisc-linux.org>
Acked-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
Acked-by: default avatarChris Zankel <chris@zankel.net>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bc64efd2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -139,8 +139,6 @@ static inline int valid_user_regs(struct pt_regs *regs)
	return 0;
}

#endif	/* __KERNEL__ */

#define pc_pointer(v) \
	((v) & ~PCMASK)

@@ -153,10 +151,10 @@ extern unsigned long profile_pc(struct pt_regs *regs);
#define profile_pc(regs) instruction_pointer(regs)
#endif

#ifdef __KERNEL__
#define predicate(x)		((x) & 0xf0000000)
#define PREDICATE_ALWAYS	0xe0000000
#endif

#endif /* __KERNEL__ */

#endif /* __ASSEMBLY__ */

+4 −2
Original line number Diff line number Diff line
@@ -83,14 +83,14 @@ struct pt_regs {
#define PTRACE_GETREGS            12
#define PTRACE_SETREGS            13	/* ptrace signal  */

#ifdef CONFIG_BINFMT_ELF_FDPIC
#define PTRACE_GETFDPIC           31
#define PTRACE_GETFDPIC_EXEC      0
#define PTRACE_GETFDPIC_INTERP    1
#endif

#define PS_S  (0x0002)

#ifdef __KERNEL__

/* user_mode returns true if only one bit is set in IPEND, other than the
   master interrupt enable.  */
#define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
@@ -98,6 +98,8 @@ struct pt_regs {
#define profile_pc(regs) instruction_pointer(regs)
extern void show_regs(struct pt_regs *);

#endif  /*  __KERNEL__  */

#endif				/* __ASSEMBLY__ */

/*
+0 −1
Original line number Diff line number Diff line
header-y += ptrace.h
header-y += user.h
header-y += svinto.h
header-y += sv_addr_ag.h
+4 −0
Original line number Diff line number Diff line
@@ -106,10 +106,14 @@ struct switch_stack {
	unsigned long return_ip; /* ip that _resume will return to */
};

#ifdef __KERNEL__

/* bit 8 is user-mode flag */
#define user_mode(regs) (((regs)->dccr & 0x100) != 0)
#define instruction_pointer(regs) ((regs)->irp)
#define profile_pc(regs) instruction_pointer(regs)
extern void show_regs(struct pt_regs *);

#endif  /*  __KERNEL__  */

#endif
+0 −1
Original line number Diff line number Diff line
header-y += ptrace.h
header-y += user.h
header-y += cryptocop.h
Loading