diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-20 16:20:55 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-20 16:20:55 (GMT) |
commit | ac8bf564307962a763a52b34e771205c58b76ec8 (patch) | |
tree | 851fe4ebd22cca979744dace54a8d628143bbc4b /arch/sparc/kernel/kstack.h | |
parent | 34388d1c4feae50d61d6f4ec7594b9076d6d24db (diff) | |
parent | 28a1f533ae8606020238b840b82ae70a3f87609e (diff) | |
download | linux-ac8bf564307962a763a52b34e771205c58b76ec8.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: Fix hardirq tracing in trap return path.
sparc64: Use correct pt_regs in decode_access_size() error paths.
sparc64: Fix PREEMPT_ACTIVE value.
sparc64: Run NMIs on the hardirq stack.
sparc64: Allocate sufficient stack space in ftrace stubs.
sparc: Fix forgotten kmemleak headers inclusion
Diffstat (limited to 'arch/sparc/kernel/kstack.h')
-rw-r--r-- | arch/sparc/kernel/kstack.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h index 5247283..53dfb92 100644 --- a/arch/sparc/kernel/kstack.h +++ b/arch/sparc/kernel/kstack.h @@ -61,4 +61,23 @@ check_magic: } +static inline __attribute__((always_inline)) void *set_hardirq_stack(void) +{ + void *orig_sp, *sp = hardirq_stack[smp_processor_id()]; + + __asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp)); + if (orig_sp < sp || + orig_sp > (sp + THREAD_SIZE)) { + sp += THREAD_SIZE - 192 - STACK_BIAS; + __asm__ __volatile__("mov %0, %%sp" : : "r" (sp)); + } + + return orig_sp; +} + +static inline __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp) +{ + __asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp)); +} + #endif /* _KSTACK_H */ |