Mon Jan 30 16:44:23 2012 UTC ()
Mask all i8259 interrupts in ioapic_enable().
Should fix PR kern/45160.


(jakllsch)
diff -r1.45 -r1.46 src/sys/arch/x86/x86/ioapic.c

cvs diff -r1.45 -r1.46 src/sys/arch/x86/x86/ioapic.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/ioapic.c 2011/04/05 13:43:33 1.45
+++ src/sys/arch/x86/x86/ioapic.c 2012/01/30 16:44:23 1.46
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ioapic.c,v 1.45 2011/04/05 13:43:33 pgoyette Exp $ */ 1/* $NetBSD: ioapic.c,v 1.46 2012/01/30 16:44:23 jakllsch Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by RedBack Networks Inc, and by Andrew Doran. 8 * by RedBack Networks Inc, and by Andrew Doran.
9 * 9 *
10 * Author: Bill Sommerfeld 10 * Author: Bill Sommerfeld
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -54,27 +54,27 @@ @@ -54,27 +54,27 @@
54 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 54 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE 56 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE
57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 57 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 58 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 59 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE. 63 * SUCH DAMAGE.
64 */ 64 */
65 65
66#include <sys/cdefs.h> 66#include <sys/cdefs.h>
67__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.45 2011/04/05 13:43:33 pgoyette Exp $"); 67__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.46 2012/01/30 16:44:23 jakllsch Exp $");
68 68
69#include "opt_ddb.h" 69#include "opt_ddb.h"
70 70
71#include <sys/param.h> 71#include <sys/param.h>
72#include <sys/systm.h> 72#include <sys/systm.h>
73#include <sys/device.h> 73#include <sys/device.h>
74#include <sys/malloc.h> 74#include <sys/malloc.h>
75#include <sys/kernel.h> 75#include <sys/kernel.h>
76#include <sys/bus.h> 76#include <sys/bus.h>
77 77
78#include <uvm/uvm_extern.h> 78#include <uvm/uvm_extern.h>
79 79
80#include <machine/isa_machdep.h> /* XXX intrhand */ 80#include <machine/isa_machdep.h> /* XXX intrhand */
@@ -447,26 +447,28 @@ apic_set_redir(struct ioapic_softc *sc,  @@ -447,26 +447,28 @@ apic_set_redir(struct ioapic_softc *sc,
447 ioapic_print_redir(sc, "int", pin); 447 ioapic_print_redir(sc, "int", pin);
448} 448}
449 449
450/* 450/*
451 * Throw the switch and enable interrupts.. 451 * Throw the switch and enable interrupts..
452 */ 452 */
453 453
454void 454void
455ioapic_enable(void) 455ioapic_enable(void)
456{ 456{
457 if (ioapics == NULL) 457 if (ioapics == NULL)
458 return; 458 return;
459 459
 460 i8259_setmask(0xffff);
 461
460 if (ioapics->sc_flags & IOAPIC_PICMODE) { 462 if (ioapics->sc_flags & IOAPIC_PICMODE) {
461 aprint_debug_dev(ioapics->sc_dev, 463 aprint_debug_dev(ioapics->sc_dev,
462 "writing to IMCR to disable pics\n"); 464 "writing to IMCR to disable pics\n");
463 outb(IMCR_ADDR, IMCR_REGISTER); 465 outb(IMCR_ADDR, IMCR_REGISTER);
464 outb(IMCR_DATA, IMCR_APIC); 466 outb(IMCR_DATA, IMCR_APIC);
465 } 467 }
466} 468}
467 469
468void 470void
469ioapic_reenable(void) 471ioapic_reenable(void)
470{ 472{
471 int p, apic_id; 473 int p, apic_id;
472 struct ioapic_softc *sc; 474 struct ioapic_softc *sc;