Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/pci assertions. use a macro. no functional ch...



details:   https://anonhg.NetBSD.org/src/rev/cd35a5021341
branches:  trunk
changeset: 779744:cd35a5021341
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Jun 15 14:02:41 2012 +0000

description:
assertions.  use a macro.  no functional changes.

diffstat:

 sys/arch/x86/pci/pci_intr_machdep.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r b5a37d063602 -r cd35a5021341 sys/arch/x86/pci/pci_intr_machdep.c
--- a/sys/arch/x86/pci/pci_intr_machdep.c       Fri Jun 15 13:58:34 2012 +0000
+++ b/sys/arch/x86/pci/pci_intr_machdep.c       Fri Jun 15 14:02:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_intr_machdep.c,v 1.23 2011/08/29 22:41:52 dyoung Exp $     */
+/*     $NetBSD: pci_intr_machdep.c,v 1.24 2012/06/15 14:02:41 yamt Exp $       */
 
 /*-
  * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.23 2011/08/29 22:41:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.24 2012/06/15 14:02:41 yamt Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -140,10 +140,13 @@
        }
 
 #if NIOAPIC > 0 || NACPICA > 0
+       KASSERT(rawpin >= PCI_INTERRUPT_PIN_A);
+       KASSERT(rawpin <= PCI_INTERRUPT_PIN_D);
        pci_decompose_tag(pc, pa->pa_tag, &bus, &dev, &func);
        if (mp_busses != NULL) {
-               if (intr_find_mpmapping(bus, (dev<<2)|(rawpin-1), ihp) == 0) {
-                       if ((*ihp & 0xff) == 0)
+               if (intr_find_mpmapping(bus,
+                   (dev << 2) | (rawpin - PCI_INTERRUPT_PIN_A), ihp) == 0) {
+                       if (APIC_IRQ_LEGACY_IRQ(*ihp) == 0)
                                *ihp |= line;
                        return 0;
                }



Home | Main Index | Thread Index | Old Index