[PATCH] powerpc: export validate_sp for oprofile calltrace
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / asm-powerpc / processor.h
index f6f186b56b0f57966733f945db65fd42525232d5..57643b5b782ff50a547338298a83dff61f970875 100644 (file)
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/reg.h>
 
 #ifndef __ASSEMBLY__
 #define _CHRP_IBM      0x05    /* IBM chrp, the longtrail and longtrail 2 */
 #define _CHRP_Pegasos  0x06    /* Genesi/bplan's Pegasos and Pegasos2 */
 
+#ifdef __KERNEL__
 #define platform_is_pseries()  (_machine == PLATFORM_PSERIES || \
                                 _machine == PLATFORM_PSERIES_LPAR)
-#define platform_is_lpar()     (!!(_machine & PLATFORM_LPAR))
 
-#if defined(CONFIG_PPC_MULTIPLATFORM)
-extern int _machine;
-
-#ifdef CONFIG_PPC32
+#ifdef CONFIG_PPC_PREP
 
 /* what kind of prep workstation we are */
 extern int _prep_type;
@@ -68,11 +64,13 @@ extern int _chrp_type;
  * vendor. Board revision is also made available. This will be moved
  * elsewhere soon
  */
-extern unsigned char ucSystemType;
 extern unsigned char ucBoardRev;
 extern unsigned char ucBoardRevMaj, ucBoardRevMin;
 
-#endif /* CONFIG_PPC32 */
+#endif /* CONFIG_PPC_PREP */
+
+#if defined(CONFIG_PPC_MULTIPLATFORM)
+extern int _machine;
 
 #elif defined(CONFIG_PPC_ISERIES)
 /*
@@ -82,7 +80,7 @@ extern unsigned char ucBoardRevMaj, ucBoardRevMin;
 #else
 #define _machine 0
 #endif /* CONFIG_PPC_MULTIPLATFORM */
-
+#endif /* __KERNEL__ */
 /*
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
@@ -177,8 +175,8 @@ struct thread_struct {
 #ifdef CONFIG_PPC64
        unsigned long   start_tb;       /* Start purr when proc switched in */
        unsigned long   accum_tb;       /* Total accumilated purr for process */
-       unsigned long   vdso_base;      /* base of the vDSO library */
 #endif
+       unsigned long   vdso_base;      /* base of the vDSO library */
        unsigned long   dabr;           /* Data address breakpoint register */
 #ifdef CONFIG_ALTIVEC
        /* Complete AltiVec register set */
@@ -253,6 +251,10 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
 #define cpu_relax()    barrier()
 #endif
 
+/* Check that a certain kernel stack pointer is valid in task_struct p */
+int validate_sp(unsigned long sp, struct task_struct *p,
+                       unsigned long nbytes);
+
 /*
  * Prefetch macros.
  */