linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] asm/ptrace.h userspace headers cleanup
@ 2008-06-23 17:48 Adrian Bunk
  2008-06-23 20:08 ` Roland McGrath
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Adrian Bunk @ 2008-06-23 17:48 UTC (permalink / raw)
  To: Roland McGrath
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, linux-mips,
	cooloney, linux-kernel, linuxppc-dev, paulus, gerg, Andrew Morton,
	yasutake.koichi, rmk

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

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

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.


 include/asm-arm/ptrace.h           |    6 ++----
 include/asm-blackfin/ptrace.h      |    6 ++++--
 include/asm-cris/arch-v10/Kbuild   |    1 -
 include/asm-cris/arch-v10/ptrace.h |    4 ++++
 include/asm-cris/arch-v32/Kbuild   |    1 -
 include/asm-cris/arch-v32/ptrace.h |    4 ++++
 include/asm-cris/ptrace.h          |    4 +++-
 include/asm-frv/Kbuild             |    1 -
 include/asm-m68knommu/ptrace.h     |    2 --
 include/asm-mn10300/ptrace.h       |    8 ++++++--
 include/asm-parisc/ptrace.h        |    4 +++-
 include/asm-powerpc/Kbuild         |    1 -
 include/asm-sh/ptrace.h            |    2 +-
 include/asm-x86/Kbuild             |    1 -
 include/asm-xtensa/ptrace.h        |   10 +++++-----
 15 files changed, 32 insertions(+), 23 deletions(-)

fc14755b77cff7af5ff00e938a4c493a669e25cd diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 7aaa206..8382b75 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -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__ */
 
diff --git a/include/asm-blackfin/ptrace.h b/include/asm-blackfin/ptrace.h
index b8346cd..a45a80e 100644
--- a/include/asm-blackfin/ptrace.h
+++ b/include/asm-blackfin/ptrace.h
@@ -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__ */
 
 /*
diff --git a/include/asm-cris/arch-v10/Kbuild b/include/asm-cris/arch-v10/Kbuild
index 60e7e1b..7a192e1 100644
--- a/include/asm-cris/arch-v10/Kbuild
+++ b/include/asm-cris/arch-v10/Kbuild
@@ -1,4 +1,3 @@
-header-y += ptrace.h
 header-y += user.h
 header-y += svinto.h
 header-y += sv_addr_ag.h
diff --git a/include/asm-cris/arch-v10/ptrace.h b/include/asm-cris/arch-v10/ptrace.h
index fb14c5e..2f464ea 100644
--- a/include/asm-cris/arch-v10/ptrace.h
+++ b/include/asm-cris/arch-v10/ptrace.h
@@ -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
diff --git a/include/asm-cris/arch-v32/Kbuild b/include/asm-cris/arch-v32/Kbuild
index a0ec545..35f2fc4 100644
--- a/include/asm-cris/arch-v32/Kbuild
+++ b/include/asm-cris/arch-v32/Kbuild
@@ -1,3 +1,2 @@
-header-y += ptrace.h
 header-y += user.h
 header-y += cryptocop.h
diff --git a/include/asm-cris/arch-v32/ptrace.h b/include/asm-cris/arch-v32/ptrace.h
index 516cc70..41f4e86 100644
--- a/include/asm-cris/arch-v32/ptrace.h
+++ b/include/asm-cris/arch-v32/ptrace.h
@@ -106,9 +106,13 @@ struct switch_stack {
 	unsigned long return_ip; /* ip that _resume will return to */
 };
 
+#ifdef __KERNEL__
+
 #define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
 #define instruction_pointer(regs) ((regs)->erp)
 extern void show_regs(struct pt_regs *);
 #define profile_pc(regs) instruction_pointer(regs)
 
+#endif  /*  __KERNEL__  */
+
 #endif
diff --git a/include/asm-cris/ptrace.h b/include/asm-cris/ptrace.h
index 1ec69a7..d910925 100644
--- a/include/asm-cris/ptrace.h
+++ b/include/asm-cris/ptrace.h
@@ -4,11 +4,13 @@
 #include <asm/arch/ptrace.h>
 
 #ifdef __KERNEL__
+
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 #define PTRACE_GETREGS            12
 #define PTRACE_SETREGS            13
-#endif
 
 #define profile_pc(regs) instruction_pointer(regs)
 
+#endif /* __KERNEL__ */
+
 #endif /* _CRIS_PTRACE_H */
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild
index bc3f12c..0f8956d 100644
--- a/include/asm-frv/Kbuild
+++ b/include/asm-frv/Kbuild
@@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm
 header-y += registers.h
 
 unifdef-y += termios.h
-unifdef-y += ptrace.h
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h
index 47258e8..8c9194b 100644
--- a/include/asm-m68knommu/ptrace.h
+++ b/include/asm-m68knommu/ptrace.h
@@ -68,10 +68,8 @@ struct switch_stack {
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 #define PTRACE_GETREGS            12
 #define PTRACE_SETREGS            13
-#ifdef CONFIG_FPU
 #define PTRACE_GETFPREGS          14
 #define PTRACE_SETFPREGS          15
-#endif
 
 #ifdef __KERNEL__
 
diff --git a/include/asm-mn10300/ptrace.h b/include/asm-mn10300/ptrace.h
index b368468..7b06cc6 100644
--- a/include/asm-mn10300/ptrace.h
+++ b/include/asm-mn10300/ptrace.h
@@ -88,12 +88,16 @@ extern struct pt_regs *__frame; /* current frame pointer */
 /* options set using PTRACE_SETOPTIONS */
 #define PTRACE_O_TRACESYSGOOD     0x00000001
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__KERNEL__)
+
+#if !defined(__ASSEMBLY__)
 #define user_mode(regs)			(((regs)->epsw & EPSW_nSL) == EPSW_nSL)
 #define instruction_pointer(regs)	((regs)->pc)
 extern void show_regs(struct pt_regs *);
-#endif
+#endif  /*  !__ASSEMBLY  */
 
 #define profile_pc(regs) ((regs)->pc)
 
+#endif  /*  __KERNEL__  */
+
 #endif /* _ASM_PTRACE_H */
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h
index 93f990e..3e94c5d 100644
--- a/include/asm-parisc/ptrace.h
+++ b/include/asm-parisc/ptrace.h
@@ -33,7 +33,6 @@ struct pt_regs {
 	unsigned long ipsw;	/* CR22 */
 };
 
-#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
 /*
  * The numbers chosen here are somewhat arbitrary but absolutely MUST
  * not overlap with any of the number assigned in <linux/ptrace.h>.
@@ -43,8 +42,11 @@ struct pt_regs {
  * since we have taken branch traps too)
  */
 #define PTRACE_SINGLEBLOCK	12	/* resume execution until next branch */
+
 #ifdef __KERNEL__
 
+#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
+
 /* XXX should we use iaoq[1] or iaoq[0] ? */
 #define user_mode(regs)			(((regs)->iaoq[0] & 3) ? 1 : 0)
 #define user_space(regs)		(((regs)->iasq[1] != 0) ? 1 : 0)
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 7381916..6920904 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -32,7 +32,6 @@ unifdef-y += elf.h
 unifdef-y += nvram.h
 unifdef-y += param.h
 unifdef-y += posix_types.h
-unifdef-y += ptrace.h
 unifdef-y += seccomp.h
 unifdef-y += signal.h
 unifdef-y += spu_info.h
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
index 8d6c92b..7d36dc3 100644
--- a/include/asm-sh/ptrace.h
+++ b/include/asm-sh/ptrace.h
@@ -5,7 +5,7 @@
  * Copyright (C) 1999, 2000  Niibe Yutaka
  *
  */
-#if defined(__SH5__) || defined(CONFIG_SUPERH64)
+#if defined(__SH5__)
 struct pt_regs {
 	unsigned long long pc;
 	unsigned long long sr;
diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild
index 1e35545..00473f7 100644
--- a/include/asm-x86/Kbuild
+++ b/include/asm-x86/Kbuild
@@ -19,7 +19,6 @@ unifdef-y += msr.h
 unifdef-y += mtrr.h
 unifdef-y += posix_types_32.h
 unifdef-y += posix_types_64.h
-unifdef-y += ptrace.h
 unifdef-y += unistd_32.h
 unifdef-y += unistd_64.h
 unifdef-y += vm86.h
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
index 422c73e..089b0db 100644
--- a/include/asm-xtensa/ptrace.h
+++ b/include/asm-xtensa/ptrace.h
@@ -73,10 +73,10 @@
 #define PTRACE_GETXTREGS	18
 #define PTRACE_SETXTREGS	19
 
-#ifndef __ASSEMBLY__
-
 #ifdef __KERNEL__
 
+#ifndef __ASSEMBLY__
+
 /*
  * This struct defines the way the registers are stored on the
  * kernel stack during a system call or other kernel entry.
@@ -122,14 +122,14 @@ extern void show_regs(struct pt_regs *);
 # ifndef CONFIG_SMP
 #  define profile_pc(regs) instruction_pointer(regs)
 # endif
-#endif /* __KERNEL__ */
 
 #else	/* __ASSEMBLY__ */
 
-#ifdef __KERNEL__
 # include <asm/asm-offsets.h>
 #define PT_REGS_OFFSET	  (KERNEL_STACK_SIZE - PT_USER_SIZE)
-#endif
 
 #endif	/* !__ASSEMBLY__ */
+
+#endif  /* __KERNEL__ */
+
 #endif	/* _XTENSA_PTRACE_H */

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
@ 2008-06-23 20:08 ` Roland McGrath
  2008-06-24  0:15 ` Greg Ungerer
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Roland McGrath @ 2008-06-23 20:08 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, linux-mips,
	cooloney, linux-kernel, linuxppc-dev, paulus, gerg, Andrew Morton,
	yasutake.koichi, rmk

That all looks fine to me, though I won't claim to have paid close
attention to the nits in the various odd archs' files.

Thanks,
Roland

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
  2008-06-23 20:08 ` Roland McGrath
@ 2008-06-24  0:15 ` Greg Ungerer
  2008-06-24  4:08 ` Paul Mundt
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Greg Ungerer @ 2008-06-24  0:15 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, linux-mips,
	cooloney, linux-kernel, linuxppc-dev, paulus, Roland McGrath,
	gerg, Andrew Morton, yasutake.koichi, rmk

Hi Adrian,

Adrian Bunk wrote:
> 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
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

The m68knommu looks ok.

Acked-by: Greg Ungerer <gerg@uclinux.org>


> ---
> 
> 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.

Let me do something about that for m68knommu.

Regards
Greg



>  include/asm-arm/ptrace.h           |    6 ++----
>  include/asm-blackfin/ptrace.h      |    6 ++++--
>  include/asm-cris/arch-v10/Kbuild   |    1 -
>  include/asm-cris/arch-v10/ptrace.h |    4 ++++
>  include/asm-cris/arch-v32/Kbuild   |    1 -
>  include/asm-cris/arch-v32/ptrace.h |    4 ++++
>  include/asm-cris/ptrace.h          |    4 +++-
>  include/asm-frv/Kbuild             |    1 -
>  include/asm-m68knommu/ptrace.h     |    2 --
>  include/asm-mn10300/ptrace.h       |    8 ++++++--
>  include/asm-parisc/ptrace.h        |    4 +++-
>  include/asm-powerpc/Kbuild         |    1 -
>  include/asm-sh/ptrace.h            |    2 +-
>  include/asm-x86/Kbuild             |    1 -
>  include/asm-xtensa/ptrace.h        |   10 +++++-----
>  15 files changed, 32 insertions(+), 23 deletions(-)
> 
> fc14755b77cff7af5ff00e938a4c493a669e25cd diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
> index 7aaa206..8382b75 100644
> --- a/include/asm-arm/ptrace.h
> +++ b/include/asm-arm/ptrace.h
> @@ -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__ */
>  
> diff --git a/include/asm-blackfin/ptrace.h b/include/asm-blackfin/ptrace.h
> index b8346cd..a45a80e 100644
> --- a/include/asm-blackfin/ptrace.h
> +++ b/include/asm-blackfin/ptrace.h
> @@ -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__ */
>  
>  /*
> diff --git a/include/asm-cris/arch-v10/Kbuild b/include/asm-cris/arch-v10/Kbuild
> index 60e7e1b..7a192e1 100644
> --- a/include/asm-cris/arch-v10/Kbuild
> +++ b/include/asm-cris/arch-v10/Kbuild
> @@ -1,4 +1,3 @@
> -header-y += ptrace.h
>  header-y += user.h
>  header-y += svinto.h
>  header-y += sv_addr_ag.h
> diff --git a/include/asm-cris/arch-v10/ptrace.h b/include/asm-cris/arch-v10/ptrace.h
> index fb14c5e..2f464ea 100644
> --- a/include/asm-cris/arch-v10/ptrace.h
> +++ b/include/asm-cris/arch-v10/ptrace.h
> @@ -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
> diff --git a/include/asm-cris/arch-v32/Kbuild b/include/asm-cris/arch-v32/Kbuild
> index a0ec545..35f2fc4 100644
> --- a/include/asm-cris/arch-v32/Kbuild
> +++ b/include/asm-cris/arch-v32/Kbuild
> @@ -1,3 +1,2 @@
> -header-y += ptrace.h
>  header-y += user.h
>  header-y += cryptocop.h
> diff --git a/include/asm-cris/arch-v32/ptrace.h b/include/asm-cris/arch-v32/ptrace.h
> index 516cc70..41f4e86 100644
> --- a/include/asm-cris/arch-v32/ptrace.h
> +++ b/include/asm-cris/arch-v32/ptrace.h
> @@ -106,9 +106,13 @@ struct switch_stack {
>  	unsigned long return_ip; /* ip that _resume will return to */
>  };
>  
> +#ifdef __KERNEL__
> +
>  #define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
>  #define instruction_pointer(regs) ((regs)->erp)
>  extern void show_regs(struct pt_regs *);
>  #define profile_pc(regs) instruction_pointer(regs)
>  
> +#endif  /*  __KERNEL__  */
> +
>  #endif
> diff --git a/include/asm-cris/ptrace.h b/include/asm-cris/ptrace.h
> index 1ec69a7..d910925 100644
> --- a/include/asm-cris/ptrace.h
> +++ b/include/asm-cris/ptrace.h
> @@ -4,11 +4,13 @@
>  #include <asm/arch/ptrace.h>
>  
>  #ifdef __KERNEL__
> +
>  /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
>  #define PTRACE_GETREGS            12
>  #define PTRACE_SETREGS            13
> -#endif
>  
>  #define profile_pc(regs) instruction_pointer(regs)
>  
> +#endif /* __KERNEL__ */
> +
>  #endif /* _CRIS_PTRACE_H */
> diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild
> index bc3f12c..0f8956d 100644
> --- a/include/asm-frv/Kbuild
> +++ b/include/asm-frv/Kbuild
> @@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm
>  header-y += registers.h
>  
>  unifdef-y += termios.h
> -unifdef-y += ptrace.h
> diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h
> index 47258e8..8c9194b 100644
> --- a/include/asm-m68knommu/ptrace.h
> +++ b/include/asm-m68knommu/ptrace.h
> @@ -68,10 +68,8 @@ struct switch_stack {
>  /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
>  #define PTRACE_GETREGS            12
>  #define PTRACE_SETREGS            13
> -#ifdef CONFIG_FPU
>  #define PTRACE_GETFPREGS          14
>  #define PTRACE_SETFPREGS          15
> -#endif
>  
>  #ifdef __KERNEL__
>  
> diff --git a/include/asm-mn10300/ptrace.h b/include/asm-mn10300/ptrace.h
> index b368468..7b06cc6 100644
> --- a/include/asm-mn10300/ptrace.h
> +++ b/include/asm-mn10300/ptrace.h
> @@ -88,12 +88,16 @@ extern struct pt_regs *__frame; /* current frame pointer */
>  /* options set using PTRACE_SETOPTIONS */
>  #define PTRACE_O_TRACESYSGOOD     0x00000001
>  
> -#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
> +#if defined(__KERNEL__)
> +
> +#if !defined(__ASSEMBLY__)
>  #define user_mode(regs)			(((regs)->epsw & EPSW_nSL) == EPSW_nSL)
>  #define instruction_pointer(regs)	((regs)->pc)
>  extern void show_regs(struct pt_regs *);
> -#endif
> +#endif  /*  !__ASSEMBLY  */
>  
>  #define profile_pc(regs) ((regs)->pc)
>  
> +#endif  /*  __KERNEL__  */
> +
>  #endif /* _ASM_PTRACE_H */
> diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h
> index 93f990e..3e94c5d 100644
> --- a/include/asm-parisc/ptrace.h
> +++ b/include/asm-parisc/ptrace.h
> @@ -33,7 +33,6 @@ struct pt_regs {
>  	unsigned long ipsw;	/* CR22 */
>  };
>  
> -#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
>  /*
>   * The numbers chosen here are somewhat arbitrary but absolutely MUST
>   * not overlap with any of the number assigned in <linux/ptrace.h>.
> @@ -43,8 +42,11 @@ struct pt_regs {
>   * since we have taken branch traps too)
>   */
>  #define PTRACE_SINGLEBLOCK	12	/* resume execution until next branch */
> +
>  #ifdef __KERNEL__
>  
> +#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
> +
>  /* XXX should we use iaoq[1] or iaoq[0] ? */
>  #define user_mode(regs)			(((regs)->iaoq[0] & 3) ? 1 : 0)
>  #define user_space(regs)		(((regs)->iasq[1] != 0) ? 1 : 0)
> diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
> index 7381916..6920904 100644
> --- a/include/asm-powerpc/Kbuild
> +++ b/include/asm-powerpc/Kbuild
> @@ -32,7 +32,6 @@ unifdef-y += elf.h
>  unifdef-y += nvram.h
>  unifdef-y += param.h
>  unifdef-y += posix_types.h
> -unifdef-y += ptrace.h
>  unifdef-y += seccomp.h
>  unifdef-y += signal.h
>  unifdef-y += spu_info.h
> diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
> index 8d6c92b..7d36dc3 100644
> --- a/include/asm-sh/ptrace.h
> +++ b/include/asm-sh/ptrace.h
> @@ -5,7 +5,7 @@
>   * Copyright (C) 1999, 2000  Niibe Yutaka
>   *
>   */
> -#if defined(__SH5__) || defined(CONFIG_SUPERH64)
> +#if defined(__SH5__)
>  struct pt_regs {
>  	unsigned long long pc;
>  	unsigned long long sr;
> diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild
> index 1e35545..00473f7 100644
> --- a/include/asm-x86/Kbuild
> +++ b/include/asm-x86/Kbuild
> @@ -19,7 +19,6 @@ unifdef-y += msr.h
>  unifdef-y += mtrr.h
>  unifdef-y += posix_types_32.h
>  unifdef-y += posix_types_64.h
> -unifdef-y += ptrace.h
>  unifdef-y += unistd_32.h
>  unifdef-y += unistd_64.h
>  unifdef-y += vm86.h
> diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
> index 422c73e..089b0db 100644
> --- a/include/asm-xtensa/ptrace.h
> +++ b/include/asm-xtensa/ptrace.h
> @@ -73,10 +73,10 @@
>  #define PTRACE_GETXTREGS	18
>  #define PTRACE_SETXTREGS	19
>  
> -#ifndef __ASSEMBLY__
> -
>  #ifdef __KERNEL__
>  
> +#ifndef __ASSEMBLY__
> +
>  /*
>   * This struct defines the way the registers are stored on the
>   * kernel stack during a system call or other kernel entry.
> @@ -122,14 +122,14 @@ extern void show_regs(struct pt_regs *);
>  # ifndef CONFIG_SMP
>  #  define profile_pc(regs) instruction_pointer(regs)
>  # endif
> -#endif /* __KERNEL__ */
>  
>  #else	/* __ASSEMBLY__ */
>  
> -#ifdef __KERNEL__
>  # include <asm/asm-offsets.h>
>  #define PT_REGS_OFFSET	  (KERNEL_STACK_SIZE - PT_USER_SIZE)
> -#endif
>  
>  #endif	/* !__ASSEMBLY__ */
> +
> +#endif  /* __KERNEL__ */
> +
>  #endif	/* _XTENSA_PTRACE_H */
> 
> 

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg@snapgear.com
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
  2008-06-23 20:08 ` Roland McGrath
  2008-06-24  0:15 ` Greg Ungerer
@ 2008-06-24  4:08 ` Paul Mundt
  2008-06-24  5:18 ` Grant Grundler
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Paul Mundt @ 2008-06-24  4:08 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, linux-mips,
	cooloney, linux-kernel, linuxppc-dev, paulus, Roland McGrath,
	gerg, Andrew Morton, yasutake.koichi, rmk

On Mon, Jun 23, 2008 at 08:48:09PM +0300, Adrian Bunk wrote:
> 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

Yes, that's fine. We've generally avoided relying entirely on the gcc
builtin definitions due to the rampant stupidity surrounding
__SH4_NOFPU__, but it is true that __SH5__ is always defined at least.

Acked-by: Paul Mundt <lethal@linux-sh.org>

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
                   ` (2 preceding siblings ...)
  2008-06-24  4:08 ` Paul Mundt
@ 2008-06-24  5:18 ` Grant Grundler
  2008-06-24  8:15 ` Jesper Nilsson
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Grant Grundler @ 2008-06-24  5:18 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, linux-mips,
	cooloney, linux-kernel, linuxppc-dev, paulus, Roland McGrath,
	gerg, Andrew Morton, yasutake.koichi, rmk

On Mon, Jun 23, 2008 at 08:48:09PM +0300, Adrian Bunk wrote:
> 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
...
> diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h
> index 93f990e..3e94c5d 100644
> --- a/include/asm-parisc/ptrace.h
> +++ b/include/asm-parisc/ptrace.h
> @@ -33,7 +33,6 @@ struct pt_regs {
>  	unsigned long ipsw;	/* CR22 */
>  };
>  
> -#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
>  /*
>   * The numbers chosen here are somewhat arbitrary but absolutely MUST
>   * not overlap with any of the number assigned in <linux/ptrace.h>.
> @@ -43,8 +42,11 @@ struct pt_regs {
>   * since we have taken branch traps too)
>   */
>  #define PTRACE_SINGLEBLOCK	12	/* resume execution until next branch */
> +
>  #ifdef __KERNEL__
>  
> +#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
> +
>  /* XXX should we use iaoq[1] or iaoq[0] ? */
>  #define user_mode(regs)			(((regs)->iaoq[0] & 3) ? 1 : 0)
>  #define user_space(regs)		(((regs)->iasq[1] != 0) ? 1 : 0)

Looks fine to me.
Acked-by: Grant Grundler <grundler@parisc-linux.org>

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
                   ` (3 preceding siblings ...)
  2008-06-24  5:18 ` Grant Grundler
@ 2008-06-24  8:15 ` Jesper Nilsson
  2008-06-24  8:25 ` Chris Zankel
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jesper Nilsson @ 2008-06-24  8:15 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris@zankel.net, dev-etrax, ysato@users.sourceforge.jp,
	linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-mips@linux-mips.org, cooloney@kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	paulus@samba.org, Roland McGrath, gerg@uclinux.org, Andrew Morton,
	yasutake.koichi@jp.panasonic.com, rmk@arm.linux.org.uk

Hi,

On Mon, Jun 23, 2008 at 07:48:09PM +0200, Adrian Bunk wrote:
> 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
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

The CRIS parts look ok.

Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
                   ` (4 preceding siblings ...)
  2008-06-24  8:15 ` Jesper Nilsson
@ 2008-06-24  8:25 ` Chris Zankel
  2008-06-24 10:23 ` David Howells
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Chris Zankel @ 2008-06-24  8:25 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: linux-mips, dev-etrax, ysato, linux-parisc, linux-sh, cooloney,
	linux-kernel, linuxppc-dev, paulus, Roland McGrath, gerg,
	Andrew Morton, yasutake.koichi, rmk

Adrian Bunk wrote:
> This patch contains the following cleanups for the asm/ptrace.h 
> userspace headers:
> - xtensa: cosmetical change to remove empty
>             #ifndef __ASSEMBLY__ #else #endif
>           from the userspace headers
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

The Xtensa part also looks ok.

Acked-by: Chris Zankel <chris@zankel.net>


Regards,
-Chris

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
                   ` (5 preceding siblings ...)
  2008-06-24  8:25 ` Chris Zankel
@ 2008-06-24 10:23 ` David Howells
  2008-06-24 22:17 ` Paul Mackerras
  2008-06-25  7:46 ` Russell King
  8 siblings, 0 replies; 10+ messages in thread
From: David Howells @ 2008-06-24 10:23 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, cooloney, ysato, linux-parisc, linux-sh, dev-etrax,
	linux-mips, linux-kernel, linuxppc-dev, paulus, Roland McGrath,
	gerg, Andrew Morton, yasutake.koichi, rmk

Adrian Bunk <bunk@kernel.org> wrote:

> 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:
> ...
>   - frv
> ...
> - don't expose function prototypes and macros to userspace:
> ...
>   - mn10300

Acked-by: David Howells <dhowells@redhat.com> (FRV and MN10300)

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
                   ` (6 preceding siblings ...)
  2008-06-24 10:23 ` David Howells
@ 2008-06-24 22:17 ` Paul Mackerras
  2008-06-25  7:46 ` Russell King
  8 siblings, 0 replies; 10+ messages in thread
From: Paul Mackerras @ 2008-06-24 22:17 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, cooloney,
	linux-kernel, linuxppc-dev, linux-mips, Roland McGrath, gerg,
	Andrew Morton, yasutake.koichi, rmk

Adrian Bunk writes:

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

Acked-by: Paul Mackerras <paulus@samba.org>

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

* Re: [2.6 patch] asm/ptrace.h userspace headers cleanup
  2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
                   ` (7 preceding siblings ...)
  2008-06-24 22:17 ` Paul Mackerras
@ 2008-06-25  7:46 ` Russell King
  8 siblings, 0 replies; 10+ messages in thread
From: Russell King @ 2008-06-25  7:46 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: chris, dev-etrax, ysato, linux-parisc, linux-sh, linux-mips,
	cooloney, linux-kernel, linuxppc-dev, paulus, gerg, Andrew Morton,
	yasutake.koichi, Roland McGrath

On Mon, Jun 23, 2008 at 08:48:09PM +0300, Adrian Bunk wrote:
> diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
> index 7aaa206..8382b75 100644
> --- a/include/asm-arm/ptrace.h
> +++ b/include/asm-arm/ptrace.h
> @@ -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__ */
>  

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

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

end of thread, other threads:[~2008-06-27 20:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-23 17:48 [2.6 patch] asm/ptrace.h userspace headers cleanup Adrian Bunk
2008-06-23 20:08 ` Roland McGrath
2008-06-24  0:15 ` Greg Ungerer
2008-06-24  4:08 ` Paul Mundt
2008-06-24  5:18 ` Grant Grundler
2008-06-24  8:15 ` Jesper Nilsson
2008-06-24  8:25 ` Chris Zankel
2008-06-24 10:23 ` David Howells
2008-06-24 22:17 ` Paul Mackerras
2008-06-25  7:46 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).