Browse Source

[PATCH] powerpc: export validate_sp for oprofile calltrace

Export validate_sp so we can use it in the oprofile calltrace code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Anton Blanchard 19 years ago
parent
commit
2f25194dbe
2 changed files with 7 additions and 1 deletions
  1. 3 1
      arch/powerpc/kernel/process.c
  2. 4 0
      include/asm-powerpc/processor.h

+ 3 - 1
arch/powerpc/kernel/process.c

@@ -770,7 +770,7 @@ out:
 	return error;
 	return error;
 }
 }
 
 
-static int validate_sp(unsigned long sp, struct task_struct *p,
+int validate_sp(unsigned long sp, struct task_struct *p,
 		       unsigned long nbytes)
 		       unsigned long nbytes)
 {
 {
 	unsigned long stack_page = (unsigned long)task_stack_page(p);
 	unsigned long stack_page = (unsigned long)task_stack_page(p);
@@ -808,6 +808,8 @@ static int validate_sp(unsigned long sp, struct task_struct *p,
 #define FRAME_MARKER	2
 #define FRAME_MARKER	2
 #endif
 #endif
 
 
+EXPORT_SYMBOL(validate_sp);
+
 unsigned long get_wchan(struct task_struct *p)
 unsigned long get_wchan(struct task_struct *p)
 {
 {
 	unsigned long ip, sp;
 	unsigned long ip, sp;

+ 4 - 0
include/asm-powerpc/processor.h

@@ -251,6 +251,10 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
 #define cpu_relax()	barrier()
 #define cpu_relax()	barrier()
 #endif
 #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.
  * Prefetch macros.
  */
  */