1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * This program is free software; you can redistribute it and/or 4 * modify it under the terms of the GNU General Public License 5 * as published by the Free Software Foundation; either version 6 * 2 of the License, or (at your option) any later version. 7 * 8 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 9 * Copyright (C) 2020 Loongson Technology Corporation Limited 10 */ 11 #ifndef __ASM_IRQ_REGS_H 12 #define __ASM_IRQ_REGS_H 13 14 #define ARCH_HAS_OWN_IRQ_REGS 15 16 #include <linux/thread_info.h> 17 get_irq_regs(void)18static inline struct pt_regs *get_irq_regs(void) 19 { 20 return current_thread_info()->regs; 21 } 22 set_irq_regs(struct pt_regs *new_regs)23static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) 24 { 25 struct pt_regs *old_regs; 26 27 old_regs = get_irq_regs(); 28 current_thread_info()->regs = new_regs; 29 30 return old_regs; 31 } 32 33 #endif /* __ASM_IRQ_REGS_H */ 34