irq_regs_32.h 619 字节
Newer Older
1 2
/*
 * Per-cpu current frame pointer - the location of the last exception frame on
3
 * the stack, stored in the per-cpu area.
4 5 6
 *
 * Jeremy Fitzhardinge <jeremy@goop.org>
 */
H
H. Peter Anvin 已提交
7 8
#ifndef _ASM_X86_IRQ_REGS_32_H
#define _ASM_X86_IRQ_REGS_32_H
9

10 11 12
#include <asm/percpu.h>

DECLARE_PER_CPU(struct pt_regs *, irq_regs);
13 14 15

static inline struct pt_regs *get_irq_regs(void)
{
16
	return x86_read_percpu(irq_regs);
17 18 19 20 21 22
}

static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
{
	struct pt_regs *old_regs;

23 24
	old_regs = get_irq_regs();
	x86_write_percpu(irq_regs, new_regs);
25 26 27 28

	return old_regs;
}

H
H. Peter Anvin 已提交
29
#endif /* _ASM_X86_IRQ_REGS_32_H */