blob: 8f3bee821e6c9e7761dc8fdbe1011cf05683b2d4 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Brian Gerstd650a512009-01-21 17:26:06 +09002/*
3 * Per-cpu current frame pointer - the location of the last exception frame on
4 * the stack, stored in the per-cpu area.
5 *
6 * Jeremy Fitzhardinge <jeremy@goop.org>
7 */
8#ifndef _ASM_X86_IRQ_REGS_H
9#define _ASM_X86_IRQ_REGS_H
10
11#include <asm/percpu.h>
12
13#define ARCH_HAS_OWN_IRQ_REGS
14
15DECLARE_PER_CPU(struct pt_regs *, irq_regs);
16
17static inline struct pt_regs *get_irq_regs(void)
18{
Alex Shic6ae41e2012-05-11 15:35:27 +080019 return this_cpu_read(irq_regs);
Brian Gerstd650a512009-01-21 17:26:06 +090020}
21
22static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
23{
24 struct pt_regs *old_regs;
25
26 old_regs = get_irq_regs();
Alex Shic6ae41e2012-05-11 15:35:27 +080027 this_cpu_write(irq_regs, new_regs);
Brian Gerstd650a512009-01-21 17:26:06 +090028
29 return old_regs;
30}
31
32#endif /* _ASM_X86_IRQ_REGS_32_H */