2006-12-06 18:14:03 -07:00
|
|
|
/*
|
|
|
|
* Per-cpu current frame pointer - the location of the last exception frame on
|
2007-05-02 10:27:16 -07:00
|
|
|
* the stack, stored in the per-cpu area.
|
2006-12-06 18:14:03 -07:00
|
|
|
*
|
|
|
|
* Jeremy Fitzhardinge <jeremy@goop.org>
|
|
|
|
*/
|
|
|
|
#ifndef _ASM_I386_IRQ_REGS_H
|
|
|
|
#define _ASM_I386_IRQ_REGS_H
|
|
|
|
|
2007-05-02 10:27:16 -07: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 10:27:16 -07: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 10:27:16 -07:00
|
|
|
old_regs = get_irq_regs();
|
|
|
|
x86_write_percpu(irq_regs, new_regs);
|
2006-12-06 18:14:03 -07:00
|
|
|
|
|
|
|
return old_regs;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _ASM_I386_IRQ_REGS_H */
|