Source-Changes archive

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

Re: CVS commit: src/sys/arch/i386/pci



Christos Zoulas <christos%NetBSD.org@localhost> writes:

> Module Name:  src
> Committed By: christos
> Date:         Sat Oct 25 18:40:58 UTC 2003
> 
> Modified Files:
>       src/sys/arch/i386/pci: elan520.c pchb.c pci_intr_fixup.c pcibios.c
> 
> Log Message:
> Fix uninitialized variable warnings
> 
> 
> To generate a diff of this commit:
> cvs rdiff -r1.5 -r1.6 src/sys/arch/i386/pci/elan520.c
> cvs rdiff -r1.46 -r1.47 src/sys/arch/i386/pci/pchb.c
> cvs rdiff -r1.25 -r1.26 src/sys/arch/i386/pci/pci_intr_fixup.c

I just found this due to conflicts in my local tree but is this really
just fixing uninitialized variables?

enami.

enami@memory-leak% cvs -qu rdiff -u -r1.25 -r1.26 
src/sys/arch/i386/ppci/pci_intr_fixup.c
Index: src/sys/arch/i386/pci/pci_intr_fixup.c
diff -u src/sys/arch/i386/pci/pci_intr_fixup.c:1.25 
src/sys/arch/i386/pci/pci_intr_fixup.c:1.26
--- src/sys/arch/i386/pci/pci_intr_fixup.c:1.25 Mon Oct 13 05:19:19 2003
+++ src/sys/arch/i386/pci/pci_intr_fixup.c      Sat Oct 25 18:40:58 2003
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_intr_fixup.c,v 1.25 2003/10/13 05:19:19 dyoung Exp $       
*/
+/*     $NetBSD: pci_intr_fixup.c,v 1.26 2003/10/25 18:40:58 christos Exp $     
*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_fixup.c,v 1.25 2003/10/13 05:19:19 dyoung 
Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_fixup.c,v 1.26 2003/10/25 18:40:58 
christos Exp $");
 
 #include "opt_pcibios.h"
 
@@ -574,12 +574,44 @@
        u_int16_t *pciirq;
 {
        int i, bit;
+       u_int16_t bios_pciirq;
+       int reg;
 
+#ifdef PCIINTR_DEBUG
+       printf("pciintr_irq_release: fixup pciirq level/edge map 0x%04x\n",
+           *pciirq);
+#endif
+
+       /* Get bios level/edge setting. */
+       bios_pciirq = 0;
+       for (i = 0, bit = 1; i < 16; i++, bit <<= 1) {
+               (void)pciintr_icu_get_trigger(pciintr_icu_tag,
+                   pciintr_icu_handle, i, &reg);
+               if (reg == IST_LEVEL)
+                       bios_pciirq |= bit;
+       }
+
+#ifdef PCIINTR_DEBUG
+       printf("pciintr_irq_release: bios  pciirq level/edge map 0x%04x\n",
+           bios_pciirq);
+#endif /* PCIINTR_DEBUG */
+
+       /* fixup final level/edge setting. */
+       *pciirq |= bios_pciirq;
        for (i = 0, bit = 1; i < 16; i++, bit <<= 1) {
                if ((*pciirq & bit) == 0)
-                       (void) pciintr_icu_set_trigger(pciintr_icu_tag,
-                           pciintr_icu_handle, i, IST_EDGE);
+                       reg = IST_EDGE;
+               else
+                       reg = IST_LEVEL;
+               (void) pciintr_icu_set_trigger(pciintr_icu_tag,
+                           pciintr_icu_handle, i, reg);
+
        }
+
+#ifdef PCIINTR_DEBUG
+       printf("pciintr_irq_release: final pciirq level/edge map 0x%04x\n",
+           *pciirq);
+#endif /* PCIINTR_DEBUG */
 
        return (0);
 }
enami@memory-leak% exit



Home | Main Index | Thread Index | Old Index