2006-12-06 20:14:03 -05:00
|
|
|
/*
|
|
|
|
* Per-cpu current frame pointer - the location of the last exception frame on
|
2007-05-02 13:27:16 -04:00
|
|
|
* the stack, stored in the per-cpu area.
|
2006-12-06 20:14:03 -05:00
|
|
|
*
|
|
|
|
* Jeremy Fitzhardinge <jeremy@goop.org>
|
|
|
|
*/
|
2008-06-18 11:08:48 -04:00
|
|
|
#ifndef ASM_X86__IRQ_REGS_32_H
|
|
|
|
#define ASM_X86__IRQ_REGS_32_H
|
2006-12-06 20:14:03 -05:00
|
|
|
|
2007-05-02 13:27:16 -04:00
|
|
|
#include <asm/percpu.h>
|
|
|
|
|
|
|
|
DECLARE_PER_CPU(struct pt_regs *, irq_regs);
|
2006-12-06 20:14:03 -05:00
|
|
|
|
|
|
|
static inline struct pt_regs *get_irq_regs(void)
|
|
|
|
{
|
2007-05-02 13:27:16 -04:00
|
|
|
return x86_read_percpu(irq_regs);
|
2006-12-06 20:14:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
|
|
|
|
{
|
|
|
|
struct pt_regs *old_regs;
|
|
|
|
|
2007-05-02 13:27:16 -04:00
|
|
|
old_regs = get_irq_regs();
|
|
|
|
x86_write_percpu(irq_regs, new_regs);
|
2006-12-06 20:14:03 -05:00
|
|
|
|
|
|
|
return old_regs;
|
|
|
|
}
|
|
|
|
|
2008-06-18 11:08:48 -04:00
|
|
|
#endif /* ASM_X86__IRQ_REGS_32_H */
|