From de7a51dbb8af4ad7a541067f41ae4e8c2dd42711 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sun, 10 Nov 2019 13:26:58 +0100 Subject: spl: Squash levels 1-6 into level 7 * i386/i386/spl.S (SETIPL): Remove macro. (splsoftclock, spl1, spl2, spl3, splnet, splhdw, spl4, splbio, spldcm, spl5, spltty, splimp, splvm, spl6): Move entries to the spl7 entry. --- i386/i386/spl.S | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/i386/i386/spl.S b/i386/i386/spl.S index 307739f5..20a80766 100644 --- a/i386/i386/spl.S +++ b/i386/i386/spl.S @@ -29,25 +29,6 @@ #define mb #endif -/* - * Set IPL to the specified value. - * - * NOTE: Normally we would not have to enable interrupts - * here. Linux drivers, however, use cli()/sti(), so we must - * guard against the case where a Mach routine which - * has done an spl() calls a Linux routine that returns - * with interrupts disabled. A subsequent splx() can, - * potentially, return with interrupts disabled. - */ -#define SETIPL(level) \ - mb; \ - movl $(level),%edx; \ - cmpl EXT(curr_ipl),%edx; \ - jne spl; \ - sti; \ - movl %edx,%eax; \ - ret - /* * Program PICs with mask in %eax. */ @@ -117,39 +98,37 @@ ENTRY(spl0) popl %eax /* return previous mask */ ret + +/* + * Historically, SETIPL(level) was called + * for spl levels 1-6, now we have combined + * all the intermediate levels into the highest level + * such that interrupts are either on or off, + * since modern hardware can handle it. + * This simplifies the interrupt handling + * especially for the linux drivers. + */ Entry(splsoftclock) ENTRY(spl1) - SETIPL(SPL1) - ENTRY(spl2) - SETIPL(SPL2) - ENTRY(spl3) - SETIPL(SPL3) - Entry(splnet) Entry(splhdw) ENTRY(spl4) - SETIPL(SPL4) - Entry(splbio) Entry(spldcm) ENTRY(spl5) - SETIPL(SPL5) - Entry(spltty) Entry(splimp) Entry(splvm) ENTRY(spl6) - SETIPL(SPL6) - Entry(splclock) Entry(splsched) Entry(splhigh) Entry(splhi) ENTRY(spl7) mb; - /* ipl7 just clears IF */ + /* just clear IF */ movl $SPL7,%eax xchgl EXT(curr_ipl),%eax cli -- cgit v1.2.3