blob: 316a3b2588715cd0cec869c51eaa4f6774972c64 [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 */
Vegard Nossum77ef50a2008-06-18 17:08:48 +02007#ifndef ASM_X86__IRQ_REGS_32_H
8#define ASM_X86__IRQ_REGS_32_H
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +01009
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
Vegard Nossum77ef50a2008-06-18 17:08:48 +020029#endif /* ASM_X86__IRQ_REGS_32_H */