Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys Pull up to netbsd-1-5 branch



details:   https://anonhg.NetBSD.org/src/rev/1385cf672d8e
branches:  netbsd-1-5
changeset: 489033:1385cf672d8e
user:      soda <soda%NetBSD.org@localhost>
date:      Thu Aug 10 22:25:56 2000 +0000

description:
Pull up to netbsd-1-5 branch
Approved by: thorpej

- define PCI_INTERRUPT_PIN_MAX and use it instead of magic number.
- define I386_PCI_INTERRUPT_LINE_NO_CONNECTION and use it instead of
  magic number.

Revisions pulled up:
 > cvs rdiff -r1.28 -r1.29 syssrc/sys/dev/pci/pcireg.h
 > cvs rdiff -r1.14 -r1.15 syssrc/sys/arch/i386/include/pci_machdep.h
 > cvs rdiff -r1.38 -r1.39 syssrc/sys/arch/i386/pci/pci_machdep.c
 > cvs rdiff -r1.1 -r1.2 syssrc/sys/arch/i386/pci/opti82c558.c \
 >     syssrc/sys/arch/i386/pci/sis85c503.c \
 >     syssrc/sys/arch/i386/pci/via82c586.c

diffstat:

 sys/arch/i386/include/pci_machdep.h |  14 +++++++++++++-
 sys/arch/i386/pci/opti82c558.c      |   5 +++--
 sys/arch/i386/pci/pci_machdep.c     |   6 +++---
 sys/arch/i386/pci/sis85c503.c       |   4 ++--
 sys/arch/i386/pci/via82c586.c       |   5 +++--
 sys/dev/pci/pcireg.h                |   3 ++-
 6 files changed, 26 insertions(+), 11 deletions(-)

diffs (124 lines):

diff -r 6681abb3018a -r 1385cf672d8e sys/arch/i386/include/pci_machdep.h
--- a/sys/arch/i386/include/pci_machdep.h       Thu Aug 10 22:07:46 2000 +0000
+++ b/sys/arch/i386/include/pci_machdep.h       Thu Aug 10 22:25:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.h,v 1.14 2000/06/04 19:14:45 cgd Exp $     */
+/*     $NetBSD: pci_machdep.h,v 1.14.2.1 2000/08/10 22:25:57 soda Exp $        */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -98,3 +98,15 @@
 void           *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
                    int, int (*)(void *), void *);
 void           pci_intr_disestablish(pci_chipset_tag_t, void *);
+
+/*
+ * ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED
+ * BY PORTABLE CODE.
+ */
+
+/*
+ * Section 6.2.4, `Miscellaneous Functions' of the PCI Specification,
+ * says that 255 means `unknown' or `no connection' to the interrupt
+ * controller on a PC.
+ */
+#define        I386_PCI_INTERRUPT_LINE_NO_CONNECTION   0xff
diff -r 6681abb3018a -r 1385cf672d8e sys/arch/i386/pci/opti82c558.c
--- a/sys/arch/i386/pci/opti82c558.c    Thu Aug 10 22:07:46 2000 +0000
+++ b/sys/arch/i386/pci/opti82c558.c    Thu Aug 10 22:25:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: opti82c558.c,v 1.1 1999/11/17 01:21:20 thorpej Exp $   */
+/*     $NetBSD: opti82c558.c,v 1.1.8.1 2000/08/10 22:25:57 soda Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -173,7 +173,8 @@
 
        reg = pci_conf_read(ph->ph_pc, ph->ph_tag, VIPER_CFG_PIRQ);
        val = VIPER_PIRQ(reg, clink);
-       *irqp = (val == VIPER_PIRQ_NONE) ? 0xff : viper_pirq_decode[val];
+       *irqp = (val == VIPER_PIRQ_NONE) ?
+           I386_PCI_INTERRUPT_LINE_NO_CONNECTION : viper_pirq_decode[val];
 
        return (0);
 }
diff -r 6681abb3018a -r 1385cf672d8e sys/arch/i386/pci/pci_machdep.c
--- a/sys/arch/i386/pci/pci_machdep.c   Thu Aug 10 22:07:46 2000 +0000
+++ b/sys/arch/i386/pci/pci_machdep.c   Thu Aug 10 22:25:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.36 2000/06/04 19:14:47 cgd Exp $     */
+/*     $NetBSD: pci_machdep.c,v 1.36.2.1 2000/08/10 22:25:57 soda Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -479,7 +479,7 @@
                goto bad;
        }
 
-       if (pin > 4) {
+       if (pin > PCI_INTERRUPT_PIN_MAX) {
                printf("pci_intr_map: bad interrupt pin %d\n", pin);
                goto bad;
        }
@@ -498,7 +498,7 @@
         * that the BIOS did its job, we also recognize that as meaning that
         * the BIOS has not configured the device.
         */
-       if (line == 0 || line == 255) {
+       if (line == 0 || line == I386_PCI_INTERRUPT_LINE_NO_CONNECTION) {
                printf("pci_intr_map: no mapping for pin %c\n", '@' + pin);
                goto bad;
        } else {
diff -r 6681abb3018a -r 1385cf672d8e sys/arch/i386/pci/sis85c503.c
--- a/sys/arch/i386/pci/sis85c503.c     Thu Aug 10 22:07:46 2000 +0000
+++ b/sys/arch/i386/pci/sis85c503.c     Thu Aug 10 22:25:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sis85c503.c,v 1.1 1999/11/17 01:21:21 thorpej Exp $    */
+/*     $NetBSD: sis85c503.c,v 1.1.8.1 2000/08/10 22:25:57 soda Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@
        reg = SIS85C503_CFG_PIRQ_REG(reg, clink);
 
        if (reg & SIS85C503_CFG_PIRQ_ROUTE_DISABLE)
-               *irqp = 0xff;
+               *irqp = I386_PCI_INTERRUPT_LINE_NO_CONNECTION;
        else
                *irqp = reg & SIS85C503_CFG_PIRQ_INTR_MASK;
 
diff -r 6681abb3018a -r 1385cf672d8e sys/arch/i386/pci/via82c586.c
--- a/sys/arch/i386/pci/via82c586.c     Thu Aug 10 22:07:46 2000 +0000
+++ b/sys/arch/i386/pci/via82c586.c     Thu Aug 10 22:25:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: via82c586.c,v 1.1 1999/11/17 01:21:21 thorpej Exp $    */
+/*     $NetBSD: via82c586.c,v 1.1.8.1 2000/08/10 22:25:58 soda Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -170,7 +170,8 @@
 
        reg = pci_conf_read(ph->ph_pc, ph->ph_tag, VP3_CFG_PIRQ_REG);
        val = VP3_PIRQ(reg, clink);
-       *irqp = (val == VP3_PIRQ_NONE) ? 0xff : val;
+       *irqp = (val == VP3_PIRQ_NONE) ?
+           I386_PCI_INTERRUPT_LINE_NO_CONNECTION : val;
 
        return (0);
 }
diff -r 6681abb3018a -r 1385cf672d8e sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h      Thu Aug 10 22:07:46 2000 +0000
+++ b/sys/dev/pci/pcireg.h      Thu Aug 10 22:25:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcireg.h,v 1.28 2000/06/09 04:45:53 soda Exp $ */
+/*     $NetBSD: pcireg.h,v 1.28.2.1 2000/08/10 22:25:56 soda Exp $     */
 
 /*
  * Copyright (c) 1995, 1996, 1999
@@ -398,5 +398,6 @@
 #define        PCI_INTERRUPT_PIN_B                     0x02
 #define        PCI_INTERRUPT_PIN_C                     0x03
 #define        PCI_INTERRUPT_PIN_D                     0x04
+#define        PCI_INTERRUPT_PIN_MAX                   0x04
 
 #endif /* _DEV_PCI_PCIREG_H_ */



Home | Main Index | Thread Index | Old Index