summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/apic_ipl.s
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>1999-04-10 19:22:17 +0000
committertegge <tegge@FreeBSD.org>1999-04-10 19:22:17 +0000
commitf800e1dc81bf4458c809693ece8464c61072efde (patch)
treec5b2c66ff3578653cfa396a8ddcf2a818d98e439 /sys/i386/isa/apic_ipl.s
parent0601e1a0748571938c48c648f3dfd6a1d88fb71d (diff)
downloadFreeBSD-src-f800e1dc81bf4458c809693ece8464c61072efde.zip
FreeBSD-src-f800e1dc81bf4458c809693ece8464c61072efde.tar.gz
When trying to enable or disable an interrupt not described by the mp table,
just return instead of dereferencing a null pointer.
Diffstat (limited to 'sys/i386/isa/apic_ipl.s')
-rw-r--r--sys/i386/isa/apic_ipl.s10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/i386/isa/apic_ipl.s b/sys/i386/isa/apic_ipl.s
index 8d9b9d8..51ba095 100644
--- a/sys/i386/isa/apic_ipl.s
+++ b/sys/i386/isa/apic_ipl.s
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: apic_ipl.s,v 1.21 1998/08/11 15:08:12 bde Exp $
+ * $Id: apic_ipl.s,v 1.22 1998/09/06 22:41:41 tegge Exp $
*/
@@ -246,12 +246,14 @@ ENTRY(INTREN)
shll $4, %ecx
movl CNAME(int_to_apicintpin) + 8(%ecx), %edx
movl CNAME(int_to_apicintpin) + 12(%ecx), %ecx
+ testl %edx, %edx
+ jz 1f
movl %ecx, (%edx) /* write the target register index */
movl 16(%edx), %eax /* read the target register data */
andl $~IOART_INTMASK, %eax /* clear mask bit */
movl %eax, 16(%edx) /* write the APIC register data */
-
+1:
IMASK_UNLOCK /* exit critical reg */
popfl /* restore old state of EI flag */
ret
@@ -276,12 +278,14 @@ ENTRY(INTRDIS)
shll $4, %ecx
movl CNAME(int_to_apicintpin) + 8(%ecx), %edx
movl CNAME(int_to_apicintpin) + 12(%ecx), %ecx
+ testl %edx, %edx
+ jz 1f
movl %ecx, (%edx) /* write the target register index */
movl 16(%edx), %eax /* read the target register data */
orl $IOART_INTMASK, %eax /* set mask bit */
movl %eax, 16(%edx) /* write the APIC register data */
-
+1:
IMASK_UNLOCK /* exit critical reg */
popfl /* restore old state of EI flag */
ret
OpenPOWER on IntegriCloud