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