summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-08-25 10:13:31 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-08-25 10:13:31 +0000
commit17f1f0da9189e82c93381a61aace686d52339576 (patch)
treed816adac02b9344761cb3843f9fba856c754d419 /sys/arch/i386
parenteb53c59ffd7697d190539b5f500a59265109c9a1 (diff)
Change pci_intr_map to take pci_attach_args as an argument.
All callers actually took all arguments to pci_intr_map from pci_attach_args structs, so this simplifies code. This also allows more complicated interrupt assignment schemes like the one on sparc64. This makes sparc64 pci interrupts work. Inspired by the same change in NetBSD.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/conf/files.i3863
-rw-r--r--sys/arch/i386/pci/pci_machdep.c13
-rw-r--r--sys/arch/i386/pci/pci_machdep.h13
3 files changed, 12 insertions, 17 deletions
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index 806f8bbaff3..7f4a97ac8c9 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: files.i386,v 1.91 2001/08/17 21:11:54 mickey Exp $
+# $OpenBSD: files.i386,v 1.92 2001/08/25 10:13:29 art Exp $
# $NetBSD: files.i386,v 1.73 1996/05/07 00:58:36 thorpej Exp $
#
# new style config file for i386 architecture
@@ -90,7 +90,6 @@ file arch/i386/i386/mainbus.c mainbus
include "../../../dev/pci/files.pci"
file arch/i386/pci/pci_machdep.c pci
-file arch/i386/pci/pci_compat.c pci # XXX compatibility
file arch/i386/pci/pciide_machdep.c pciide
file arch/i386/pci/pcic_pci_machdep.c pcic_pci
diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c
index de242832c0a..df9d24054b8 100644
--- a/sys/arch/i386/pci/pci_machdep.c
+++ b/sys/arch/i386/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.18 2001/01/27 04:59:40 mickey Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.19 2001/08/25 10:13:29 art Exp $ */
/* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */
/*-
@@ -405,12 +405,15 @@ not1:
}
int
-pci_intr_map(pc, intrtag, pin, line, ihp)
- pci_chipset_tag_t pc;
- pcitag_t intrtag;
- int pin, line;
+pci_intr_map(pa, ihp)
+ struct pci_attach_args *pa;
pci_intr_handle_t *ihp;
{
+ pci_chipset_tag_t pc = pa->pa_pc;
+ pcitag_t intrtag = pa->pa_intrtag;
+ int pin = pa->pa_intrpin;
+ int line = pa->pa_intrline;
+
if (pin == 0) {
/* No IRQ used. */
goto bad;
diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h
index 64adaecff05..911dc7f897a 100644
--- a/sys/arch/i386/pci/pci_machdep.h
+++ b/sys/arch/i386/pci/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.8 2001/08/17 22:26:58 mickey Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.9 2001/08/25 10:13:29 art Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */
/*
@@ -87,7 +87,8 @@ pcitag_t pci_make_tag __P((pci_chipset_tag_t, int, int, int));
pcireg_t pci_conf_read __P((pci_chipset_tag_t, pcitag_t, int));
void pci_conf_write __P((pci_chipset_tag_t, pcitag_t, int,
pcireg_t));
-int pci_intr_map __P((pci_chipset_tag_t, pcitag_t, int, int,
+struct pci_attach_args;
+int pci_intr_map __P((struct pci_attach_args *,
pci_intr_handle_t *));
#define pci_intr_line(ih) ((ih).line)
const char *pci_intr_string __P((pci_chipset_tag_t, pci_intr_handle_t));
@@ -98,14 +99,6 @@ void pci_decompose_tag __P((pci_chipset_tag_t, pcitag_t,
int *, int *, int *));
/*
- * Compatibility functions, to map the old i386 PCI functions to the new ones.
- * NOT TO BE USED BY NEW CODE.
- */
-void *pci_map_int __P((pcitag_t, int, int (*)(void *), void *));
-int pci_map_io __P((pcitag_t, int, int *));
-int pci_map_mem __P((pcitag_t, int, vm_offset_t *, vm_offset_t *));
-
-/*
* Section 6.2.4, `Miscellaneous Functions' of the PIC Specification,
* says that 255 means `unknown' or `no connection' to the interrupt
* controller on a PC.