diff options
Diffstat (limited to 'arch/x86/kernel/irq_32.c')
-rw-r--r-- | arch/x86/kernel/irq_32.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index 63ce838e5a54..28d28f5eb8f4 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c | |||
@@ -69,16 +69,9 @@ static void call_on_stack(void *func, void *stack) | |||
69 | : "memory", "cc", "edx", "ecx", "eax"); | 69 | : "memory", "cc", "edx", "ecx", "eax"); |
70 | } | 70 | } |
71 | 71 | ||
72 | /* how to get the current stack pointer from C */ | ||
73 | #define current_stack_pointer ({ \ | ||
74 | unsigned long sp; \ | ||
75 | asm("mov %%esp,%0" : "=g" (sp)); \ | ||
76 | sp; \ | ||
77 | }) | ||
78 | |||
79 | static inline void *current_stack(void) | 72 | static inline void *current_stack(void) |
80 | { | 73 | { |
81 | return (void *)(current_stack_pointer & ~(THREAD_SIZE - 1)); | 74 | return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); |
82 | } | 75 | } |
83 | 76 | ||
84 | static inline int | 77 | static inline int |
@@ -103,7 +96,7 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | |||
103 | 96 | ||
104 | /* Save the next esp at the bottom of the stack */ | 97 | /* Save the next esp at the bottom of the stack */ |
105 | prev_esp = (u32 *)irqstk; | 98 | prev_esp = (u32 *)irqstk; |
106 | *prev_esp = current_stack_pointer; | 99 | *prev_esp = current_stack_pointer(); |
107 | 100 | ||
108 | if (unlikely(overflow)) | 101 | if (unlikely(overflow)) |
109 | call_on_stack(print_stack_overflow, isp); | 102 | call_on_stack(print_stack_overflow, isp); |
@@ -156,7 +149,7 @@ void do_softirq_own_stack(void) | |||
156 | 149 | ||
157 | /* Push the previous esp onto the stack */ | 150 | /* Push the previous esp onto the stack */ |
158 | prev_esp = (u32 *)irqstk; | 151 | prev_esp = (u32 *)irqstk; |
159 | *prev_esp = current_stack_pointer; | 152 | *prev_esp = current_stack_pointer(); |
160 | 153 | ||
161 | call_on_stack(__do_softirq, isp); | 154 | call_on_stack(__do_softirq, isp); |
162 | } | 155 | } |