blob: 86afd7473457e4cff97b120cfcde5516125a1366 [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 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07007#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
Harvey Harrison19f47c62008-11-09 21:28:15 -080012#define ARCH_HAS_OWN_IRQ_REGS
13
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020014DECLARE_PER_CPU(struct pt_regs *, irq_regs);
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +010015
16static inline struct pt_regs *get_irq_regs(void)
17{
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020018 return x86_read_percpu(irq_regs);
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +010019}
20
21static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
22{
23 struct pt_regs *old_regs;
24
Jeremy Fitzhardinge7c3576d2007-05-02 19:27:16 +020025 old_regs = get_irq_regs();
26 x86_write_percpu(irq_regs, new_regs);
Jeremy Fitzhardinge70463da2006-12-07 02:14:03 +010027
28 return old_regs;
29}
30
H. Peter Anvin1965aae2008-10-22 22:26:29 -070031#endif /* _ASM_X86_IRQ_REGS_32_H */