blob: 3368b20c0b489fa04b46070d53aecaaeb8dc01e0 [file] [log] [blame]
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +01001/*
2 * Per-cpu current frame pointer - the location of the last exception frame on
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +02003 * the stack, stored in the per-cpu area.
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +01004 *
5 * Jeremy Fitzhardinge <jeremy@goop.org>
6 */
7#ifndef _ASM_I386_IRQ_REGS_H
8#define _ASM_I386_IRQ_REGS_H
9
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020010#include <asm/percpu.h>
11
12DECLARE_PER_CPU(struct pt_regs *, irq_regs);
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +010013
14static inline struct pt_regs *get_irq_regs(void)
15{
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020016 return x86_read_percpu(irq_regs);
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +010017}
18
19static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
20{
21 struct pt_regs *old_regs;
22
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020023 old_regs = get_irq_regs();
24 x86_write_percpu(irq_regs, new_regs);
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +010025
26 return old_regs;
27}
28
29#endif /* _ASM_I386_IRQ_REGS_H */