aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/kstack.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-04-29 03:36:24 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-04-29 03:36:24 -0400
commit7407cf355fdf5500430be966dbbde84a27293bad (patch)
tree922861288ff38558ed721a79653f52b17b13bb95 /arch/sparc/kernel/kstack.h
parent6a47dc1418682c83d603b491df1d048f73aa973e (diff)
parent79dba2eaa771c3173957eccfd288e0e0d12e4d3f (diff)
Merge branch 'master' into for-2.6.35
Conflicts: fs/block_dev.c Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch/sparc/kernel/kstack.h')
-rw-r--r--arch/sparc/kernel/kstack.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h
index 5247283d1c03..53dfb92e09fb 100644
--- a/arch/sparc/kernel/kstack.h
+++ b/arch/sparc/kernel/kstack.h
@@ -61,4 +61,23 @@ check_magic:
61 61
62} 62}
63 63
64static inline __attribute__((always_inline)) void *set_hardirq_stack(void)
65{
66 void *orig_sp, *sp = hardirq_stack[smp_processor_id()];
67
68 __asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp));
69 if (orig_sp < sp ||
70 orig_sp > (sp + THREAD_SIZE)) {
71 sp += THREAD_SIZE - 192 - STACK_BIAS;
72 __asm__ __volatile__("mov %0, %%sp" : : "r" (sp));
73 }
74
75 return orig_sp;
76}
77
78static inline __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp)
79{
80 __asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp));
81}
82
64#endif /* _KSTACK_H */ 83#endif /* _KSTACK_H */