diff options
author | Damien Zammit <damien@zamaudio.com> | 2019-11-10 16:27:42 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-11-10 16:28:50 +0100 |
commit | 1d34167488e56e36ad702627b17be7ac18a9db9c (patch) | |
tree | 9f107a4647490b81793e6548d0e0da444f742584 /linux/dev/include | |
parent | 09c207eb2e7dd63d51c1f5e2abccf2562e6fd87e (diff) | |
download | gnumach-1d34167488e56e36ad702627b17be7ac18a9db9c.tar.gz gnumach-1d34167488e56e36ad702627b17be7ac18a9db9c.tar.bz2 gnumach-1d34167488e56e36ad702627b17be7ac18a9db9c.zip |
simplify interrupt handling
We have removed spl levels, now remove the machinery to manage different
PIC masks according to levels. Only keep machinery to disable interrupts
whatever the level.
* i386/i386/pic.c (pic_mask): Remove array.
(picinit): Do not form PIC mask. Set initial PIC mask to 0.
(form_pic_mask): Remove function.
* i386/i386/pic.h (form_pic_mask, pic_mask): Remove declarations.
* i386/i386/spl.S (SETMASK): Remove macro.
(XEN_SETMASK): Add macro, containing the Xen version of SETMASK.
(spl0, splx_cli, spl) [MACH_XEN]: Call XEN_SETMASK instead of SETMASK.
* i386/i386/pit.c (clkstart): Do not call form_pic_mask.
* i386/i386at/autoconf.c (take_dev_irq, take_ctlr_irq): Likewise.
* i386/i386at/kd_mouse.c (kd_mouse_open, kd_mouse_close): Likewise.
* linux/dev/arch/i386/kernel/irq.c (mask_irq, unmask_irq): Directly update
curr_pic_mask without using pic_mask array.
(init_IRQ, restore_IRQ): do not call form_pic_mask.
* linux/dev/include/asm-i386/system.h: Include <i386/ipl.h>.
(__save_flags, __restore_flags): Use curr_ipl and splx instead of
hardware flags.
* linux/dev/init/main.c (linux_init): Do not call cli.
* linux/dev/kernel/sched.c (linux_timer_intr): Do not use pic_mask.
* linux/src/drivers/block/ide.c (try_to_identify): Disable irq probing.
* linux/src/drivers/scsi/NCR53c406a.c (NCR53c406a_detect): Disable irq
probing.
Diffstat (limited to 'linux/dev/include')
-rw-r--r-- | linux/dev/include/asm-i386/system.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/dev/include/asm-i386/system.h b/linux/dev/include/asm-i386/system.h index f26a33e7..41eb65a4 100644 --- a/linux/dev/include/asm-i386/system.h +++ b/linux/dev/include/asm-i386/system.h @@ -1,6 +1,8 @@ #ifndef __ASM_SYSTEM_H #define __ASM_SYSTEM_H +#include <i386/ipl.h> /* curr_ipl, splx */ + #include <asm/segment.h> /* @@ -223,10 +225,8 @@ 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) \ -__asm__ __volatile__("pushf ; pop %0" : "=r" (x): /* no input */ :"memory") -#define __restore_flags(x) \ -__asm__ __volatile__("push %0 ; popf": /* no output */ :"g" (x):"memory") +#define __save_flags(x) (x = ((curr_ipl > 0) ? 0 : (1 << 9))) +#define __restore_flags(x) splx((x & (1 << 9)) ? 0 : 7) #ifdef __SMP__ |