diff options
| author | FUJITA Tomonori <[email protected]> | 2008-07-24 04:26:53 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2008-07-24 17:47:14 +0000 |
| commit | 8b05c7e6e159d2f33c9275281b8b909a89eb7c5d (patch) | |
| tree | 646edb14c42d6404e36f1602d47c639c72a8300a /lib/debugobjects.c | |
| parent | mm: print out the zonelists on request for manual verification (diff) | |
| download | kernel-8b05c7e6e159d2f33c9275281b8b909a89eb7c5d.tar.gz kernel-8b05c7e6e159d2f33c9275281b8b909a89eb7c5d.zip | |
add a helper function to test if an object is on the stack
lib/debugobjects.c has a function to test if an object is on the stack.
The block layer and ide needs it (they need to avoid DMA from/to stack
buffers). This patch moves the function to include/linux/sched.h so that
everyone can use it.
lib/debugobjects.c uses current->stack but this patch uses a
task_stack_page() accessor, which is a preferable way to access the stack.
Signed-off-by: FUJITA Tomonori <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/debugobjects.c')
| -rw-r--r-- | lib/debugobjects.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 85b18d79be89..f86196390cfd 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -226,15 +226,13 @@ debug_object_fixup(int (*fixup)(void *addr, enum debug_obj_state state), static void debug_object_is_on_stack(void *addr, int onstack) { - void *stack = current->stack; int is_on_stack; static int limit; if (limit > 4) return; - is_on_stack = (addr >= stack && addr < (stack + THREAD_SIZE)); - + is_on_stack = object_is_on_stack(addr); if (is_on_stack == onstack) return; |
