Module Name: src Committed By: cherry Date: Sun Oct 7 05:28:51 UTC 2018
Modified Files: src/sys/arch/x86/x86: i8259.c ioapic.c Log Message: While we're here, fix pic->pic_delroute() to DTRT on XEN and cleanup after itself. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/i8259.c cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x86/x86/ioapic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/i8259.c diff -u src/sys/arch/x86/x86/i8259.c:1.18 src/sys/arch/x86/x86/i8259.c:1.19 --- src/sys/arch/x86/x86/i8259.c:1.18 Sun Oct 7 05:23:01 2018 +++ src/sys/arch/x86/x86/i8259.c Sun Oct 7 05:28:51 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i8259.c,v 1.18 2018/10/07 05:23:01 cherry Exp $ */ +/* $NetBSD: i8259.c,v 1.19 2018/10/07 05:28:51 cherry Exp $ */ /* * Copyright 2002 (c) Wasabi Systems, Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i8259.c,v 1.18 2018/10/07 05:23:01 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i8259.c,v 1.19 2018/10/07 05:28:51 cherry Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -291,6 +291,11 @@ i8259_unsetup(struct pic *pic, struct cp port = unbind_pirq_from_evtch(irq); KASSERT(port < NR_EVENT_CHANNELS); + + KASSERT(irq2port[irq] != 0); + irq2port[irq] = 0; + + xen_atomic_clear_bit(&ci->ci_evtmask[0], port); #else if (CPU_IS_PRIMARY(ci)) i8259_reinit_irqs(); Index: src/sys/arch/x86/x86/ioapic.c diff -u src/sys/arch/x86/x86/ioapic.c:1.56 src/sys/arch/x86/x86/ioapic.c:1.57 --- src/sys/arch/x86/x86/ioapic.c:1.56 Wed Dec 13 16:30:18 2017 +++ src/sys/arch/x86/x86/ioapic.c Sun Oct 7 05:28:51 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ioapic.c,v 1.56 2017/12/13 16:30:18 bouyer Exp $ */ +/* $NetBSD: ioapic.c,v 1.57 2018/10/07 05:28:51 cherry Exp $ */ /*- * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.56 2017/12/13 16:30:18 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.57 2018/10/07 05:28:51 cherry Exp $"); #include "opt_ddb.h" @@ -601,6 +601,12 @@ ioapic_delroute(struct pic *pic, struct port = unbind_pirq_from_evtch(irq); KASSERT(port < NR_EVENT_CHANNELS); + + KASSERT(irq2port[irq] != 0); + irq2port[irq] = 0; + + xen_atomic_clear_bit(&ci->ci_evtmask[0], port); + #endif }