Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /* Fallback per-CPU frame pointer holder
0003  *
0004  * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
0005  * Written by David Howells (dhowells@redhat.com)
0006  */
0007 
0008 #ifndef _ASM_GENERIC_IRQ_REGS_H
0009 #define _ASM_GENERIC_IRQ_REGS_H
0010 
0011 #include <linux/percpu.h>
0012 
0013 /*
0014  * Per-cpu current frame pointer - the location of the last exception frame on
0015  * the stack
0016  */
0017 DECLARE_PER_CPU(struct pt_regs *, __irq_regs);
0018 
0019 static inline struct pt_regs *get_irq_regs(void)
0020 {
0021     return __this_cpu_read(__irq_regs);
0022 }
0023 
0024 static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
0025 {
0026     struct pt_regs *old_regs;
0027 
0028     old_regs = __this_cpu_read(__irq_regs);
0029     __this_cpu_write(__irq_regs, new_regs);
0030     return old_regs;
0031 }
0032 
0033 #endif /* _ASM_GENERIC_IRQ_REGS_H */