From 544071f200124fafd4fe7628c54f124e8577ca82 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Tue, 14 Feb 2023 00:06:54 +0100 Subject: Make curr_ipl[] per cpu --- linux/dev/arch/i386/kernel/irq.c | 4 ++-- linux/dev/include/asm-i386/system.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'linux/dev') diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index c10888e3..73802c45 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux/dev/arch/i386/kernel/irq.c @@ -343,7 +343,7 @@ probe_irq_on (void) unsigned i, irqs = 0; unsigned long delay; - assert (curr_ipl == 0); + assert (curr_ipl[cpu_number()] == 0); /* * Allocate all available IRQs. @@ -374,7 +374,7 @@ probe_irq_off (unsigned long irqs) { unsigned int i; - assert (curr_ipl == 0); + assert (curr_ipl[cpu_number()] == 0); irqs &= linux_pic_mask; diff --git a/linux/dev/include/asm-i386/system.h b/linux/dev/include/asm-i386/system.h index 41eb65a4..ac091e27 100644 --- a/linux/dev/include/asm-i386/system.h +++ b/linux/dev/include/asm-i386/system.h @@ -1,7 +1,8 @@ #ifndef __ASM_SYSTEM_H #define __ASM_SYSTEM_H -#include /* curr_ipl, splx */ +#include /* curr_ipl[], splx */ +#include #include @@ -225,7 +226,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size) #define mb() __asm__ __volatile__ ("" : : :"memory") #define __sti() __asm__ __volatile__ ("sti": : :"memory") #define __cli() __asm__ __volatile__ ("cli": : :"memory") -#define __save_flags(x) (x = ((curr_ipl > 0) ? 0 : (1 << 9))) +#define __save_flags(x) (x = ((curr_ipl[cpu_number()] > 0) ? 0 : (1 << 9))) #define __restore_flags(x) splx((x & (1 << 9)) ? 0 : 7) #ifdef __SMP__ -- cgit v1.2.3