irq_regs.h 613 字节
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 7 8 9
 *
 * Jeremy Fitzhardinge <jeremy@goop.org>
 */
#ifndef _ASM_I386_IRQ_REGS_H
#define _ASM_I386_IRQ_REGS_H

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 29

	return old_regs;
}

#endif /* _ASM_I386_IRQ_REGS_H */