Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: merge irq_regs.h

Impact: cleanup, better irq_regs code generation for x86_64

Make 64-bit use the same optimizations as 32-bit.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Brian Gerst and committed by
Tejun Heo
d650a514 6826c8ff

+34 -37
+31 -5
arch/x86/include/asm/irq_regs.h
··· 1 - #ifdef CONFIG_X86_32 2 - # include "irq_regs_32.h" 3 - #else 4 - # include "irq_regs_64.h" 5 - #endif 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 + * Jeremy Fitzhardinge <jeremy@goop.org> 6 + */ 7 + #ifndef _ASM_X86_IRQ_REGS_H 8 + #define _ASM_X86_IRQ_REGS_H 9 + 10 + #include <asm/percpu.h> 11 + 12 + #define ARCH_HAS_OWN_IRQ_REGS 13 + 14 + DECLARE_PER_CPU(struct pt_regs *, irq_regs); 15 + 16 + static inline struct pt_regs *get_irq_regs(void) 17 + { 18 + return percpu_read(irq_regs); 19 + } 20 + 21 + static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) 22 + { 23 + struct pt_regs *old_regs; 24 + 25 + old_regs = get_irq_regs(); 26 + percpu_write(irq_regs, new_regs); 27 + 28 + return old_regs; 29 + } 30 + 31 + #endif /* _ASM_X86_IRQ_REGS_32_H */
-31
arch/x86/include/asm/irq_regs_32.h
··· 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 - * Jeremy Fitzhardinge <jeremy@goop.org> 6 - */ 7 - #ifndef _ASM_X86_IRQ_REGS_32_H 8 - #define _ASM_X86_IRQ_REGS_32_H 9 - 10 - #include <asm/percpu.h> 11 - 12 - #define ARCH_HAS_OWN_IRQ_REGS 13 - 14 - DECLARE_PER_CPU(struct pt_regs *, irq_regs); 15 - 16 - static inline struct pt_regs *get_irq_regs(void) 17 - { 18 - return percpu_read(irq_regs); 19 - } 20 - 21 - static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) 22 - { 23 - struct pt_regs *old_regs; 24 - 25 - old_regs = get_irq_regs(); 26 - percpu_write(irq_regs, new_regs); 27 - 28 - return old_regs; 29 - } 30 - 31 - #endif /* _ASM_X86_IRQ_REGS_32_H */
-1
arch/x86/include/asm/irq_regs_64.h
··· 1 - #include <asm-generic/irq_regs.h>
+3
arch/x86/kernel/irq_64.c
··· 22 22 DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); 23 23 EXPORT_PER_CPU_SYMBOL(irq_stat); 24 24 25 + DEFINE_PER_CPU(struct pt_regs *, irq_regs); 26 + EXPORT_PER_CPU_SYMBOL(irq_regs); 27 + 25 28 /* 26 29 * Probabilistic stack overflow check: 27 30 *