xref: /linux/arch/loongarch/include/asm/irq_regs.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
4  */
5 #ifndef __ASM_IRQ_REGS_H
6 #define __ASM_IRQ_REGS_H
7 
8 #define ARCH_HAS_OWN_IRQ_REGS
9 
10 #include <linux/thread_info.h>
11 
12 static inline struct pt_regs *get_irq_regs(void)
13 {
14 	return current_thread_info()->regs;
15 }
16 
17 static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
18 {
19 	struct pt_regs *old_regs;
20 
21 	old_regs = get_irq_regs();
22 	current_thread_info()->regs = new_regs;
23 
24 	return old_regs;
25 }
26 
27 #endif /* __ASM_IRQ_REGS_H */
28