summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/alpha/pci/pci_machdep.h4
-rw-r--r--sys/arch/amd64/include/pci_machdep.h4
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c15
-rw-r--r--sys/arch/arm/include/pci_machdep.h4
-rw-r--r--sys/arch/hppa/include/pci_machdep.h4
-rw-r--r--sys/arch/hppa64/include/pci_machdep.h4
-rw-r--r--sys/arch/i386/pci/pci_machdep.c15
-rw-r--r--sys/arch/i386/pci/pci_machdep.h4
-rw-r--r--sys/arch/landisk/include/pci_machdep.h4
-rw-r--r--sys/arch/loongson/include/pci_machdep.h4
-rw-r--r--sys/arch/powerpc/pci/pci_machdep.h3
-rw-r--r--sys/arch/sgi/pci/pci_machdep.h4
-rw-r--r--sys/arch/sparc64/include/pci_machdep.h4
-rw-r--r--sys/dev/acpi/acpi.c132
-rw-r--r--sys/dev/acpi/acpireg.h4
-rw-r--r--sys/dev/acpi/amltypes.h20
-rw-r--r--sys/dev/acpi/dsdt.c5
-rw-r--r--sys/dev/pci/pci.c4
18 files changed, 215 insertions, 23 deletions
diff --git a/sys/arch/alpha/pci/pci_machdep.h b/sys/arch/alpha/pci/pci_machdep.h
index 1c86e6bfd45..6e20951e387 100644
--- a/sys/arch/alpha/pci/pci_machdep.h
+++ b/sys/arch/alpha/pci/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.22 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.23 2010/06/29 22:08:28 jordan Exp $ */
/* $NetBSD: pci_machdep.h,v 1.6 1996/11/19 04:49:21 cgd Exp $ */
/*
@@ -127,6 +127,8 @@ void pci_display_console(bus_space_tag_t, bus_space_tag_t,
((c)->pc_pciide_compat_intr_disestablish)((c)->pc_conf_v, \
(cookie)); } while (0)
+#define pci_dev_postattach(a, b)
+
#ifdef _KERNEL
void pci_display_console(bus_space_tag_t, bus_space_tag_t, pci_chipset_tag_t, int, int, int);
#endif /* _KERNEL */
diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h
index 0b493a9b367..439a4265213 100644
--- a/sys/arch/amd64/include/pci_machdep.h
+++ b/sys/arch/amd64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.14 2009/10/06 21:35:43 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.15 2010/06/29 22:08:28 jordan Exp $ */
/* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */
/*
@@ -85,6 +85,8 @@ void pci_intr_disestablish(pci_chipset_tag_t, void *);
void pci_decompose_tag(pci_chipset_tag_t, pcitag_t,
int *, int *, int *);
+void pci_dev_postattach(struct device *, struct pci_attach_args *);
+
/*
* ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED
* BY PORTABLE CODE.
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index 265d4dfdbe3..d2f35bed37e 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.32 2009/09/28 15:58:30 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.33 2010/06/29 22:08:29 jordan Exp $ */
/* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -418,3 +418,16 @@ pci_init_extents(void)
EX_CONFLICTOK | EX_NOWAIT);
}
}
+
+#include "acpi.h"
+#if NACPI > 0
+void acpi_pci_match(struct device *, struct pci_attach_args *);
+#endif
+
+void
+pci_dev_postattach(struct device *dev, struct pci_attach_args *pa)
+{
+#if NACPI > 0
+ acpi_pci_match(dev, pa);
+#endif
+}
diff --git a/sys/arch/arm/include/pci_machdep.h b/sys/arch/arm/include/pci_machdep.h
index 31a519c982b..9f075e4b56c 100644
--- a/sys/arch/arm/include/pci_machdep.h
+++ b/sys/arch/arm/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.7 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.8 2010/06/29 22:08:28 jordan Exp $ */
/* $NetBSD: pci_machdep.h,v 1.2 2002/05/15 19:23:52 thorpej Exp $ */
/*
@@ -95,3 +95,5 @@ struct arm32_pci_chipset {
(*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (n))
#define pci_intr_disestablish(c, iv) \
(*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv))
+
+#define pci_dev_postattach(a, b)
diff --git a/sys/arch/hppa/include/pci_machdep.h b/sys/arch/hppa/include/pci_machdep.h
index 717fb519931..c04ee8fc628 100644
--- a/sys/arch/hppa/include/pci_machdep.h
+++ b/sys/arch/hppa/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.5 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.6 2010/06/29 22:08:28 jordan Exp $ */
/*
* Copyright (c) 2003 Michael Shalayeff
@@ -88,4 +88,6 @@ struct hppa_pci_chipset_tag {
#define pciide_machdep_compat_intr_establish(a, b, c, d, e) (NULL)
#define pciide_machdep_compat_intr_disestablish(a, b) ((void)(a), (void)(b))
+#define pci_dev_postattach(a, b)
+
#endif /* _MACHINE_PCI_MACHDEP_H_ */
diff --git a/sys/arch/hppa64/include/pci_machdep.h b/sys/arch/hppa64/include/pci_machdep.h
index b92746d0da7..75727c4b20b 100644
--- a/sys/arch/hppa64/include/pci_machdep.h
+++ b/sys/arch/hppa64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.5 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.6 2010/06/29 22:08:28 jordan Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -79,4 +79,6 @@ struct hppa64_pci_chipset_tag {
#define pciide_machdep_compat_intr_establish(a, b, c, d, e) (NULL)
#define pciide_machdep_compat_intr_disestablish(a, b) ((void)(a), (void)(b))
+#define pci_dev_postattach(a, b)
+
#endif /* _MACHINE_PCI_MACHDEP_H_ */
diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c
index ca6590d4449..fa15c2019d4 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.50 2009/09/28 15:58:30 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.51 2010/06/29 22:08:28 jordan Exp $ */
/* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */
/*-
@@ -657,3 +657,16 @@ pci_init_extents(void)
EX_CONFLICTOK | EX_NOWAIT);
}
}
+
+#include "acpi.h"
+#if NACPI > 0
+void acpi_pci_match(struct device *, struct pci_attach_args *);
+#endif
+
+void
+pci_dev_postattach(struct device *dev, struct pci_attach_args *pa)
+{
+#if NACPI > 0
+ acpi_pci_match(dev, pa);
+#endif
+}
diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h
index b49e21b56a7..853792de17d 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.18 2009/10/06 21:35:43 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.19 2010/06/29 22:08:28 jordan Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */
/*
@@ -102,6 +102,8 @@ void pci_intr_disestablish(pci_chipset_tag_t, void *);
void pci_decompose_tag(pci_chipset_tag_t, pcitag_t,
int *, int *, int *);
+void pci_dev_postattach(struct device *, struct pci_attach_args *);
+
/*
* Section 6.2.4, `Miscellaneous Functions' of the PIC Specification,
* says that 255 means `unknown' or `no connection' to the interrupt
diff --git a/sys/arch/landisk/include/pci_machdep.h b/sys/arch/landisk/include/pci_machdep.h
index eb7a94a9174..cc24efb610d 100644
--- a/sys/arch/landisk/include/pci_machdep.h
+++ b/sys/arch/landisk/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.3 2008/12/06 19:59:38 tedu Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.4 2010/06/29 22:08:28 jordan Exp $ */
/* $NetBSD: pci_machdep.h,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*
@@ -79,3 +79,5 @@ void landisk_pci_conf_interrupt(void *v, int bus, int dev, int pin,
landisk_pci_intr_establish(v, ih, level, ih_fun, ih_arg, ih_name)
#define pci_intr_disestablish(v, cookie) \
landisk_pci_intr_disestablish(v, cookie)
+
+#define pci_dev_postattach(a, b)
diff --git a/sys/arch/loongson/include/pci_machdep.h b/sys/arch/loongson/include/pci_machdep.h
index 50b4bcc47b7..f4af5f559fb 100644
--- a/sys/arch/loongson/include/pci_machdep.h
+++ b/sys/arch/loongson/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.2 2010/02/05 20:53:26 miod Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.3 2010/06/29 22:08:28 jordan Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -88,3 +88,5 @@ extern paddr_t loongson_dma_base;
pcitag_t pci_make_tag_early(int, int, int);
pcireg_t pci_conf_read_early(pcitag_t, int);
+
+#define pci_dev_postattach(a, b)
diff --git a/sys/arch/powerpc/pci/pci_machdep.h b/sys/arch/powerpc/pci/pci_machdep.h
index 319c2f8223a..3868c325c67 100644
--- a/sys/arch/powerpc/pci/pci_machdep.h
+++ b/sys/arch/powerpc/pci/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.17 2009/08/22 02:54:51 mk Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.18 2010/06/29 22:08:28 jordan Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -93,3 +93,4 @@ struct ppc_pci_chipset {
#define pci_ether_hw_addr(c, s) \
(*(c)->pc_ether_hw_addr)((c), (s))
+#define pci_dev_postattach(a, b)
diff --git a/sys/arch/sgi/pci/pci_machdep.h b/sys/arch/sgi/pci/pci_machdep.h
index 2d7467b851e..51190bca23d 100644
--- a/sys/arch/sgi/pci/pci_machdep.h
+++ b/sys/arch/sgi/pci/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.10 2010/04/06 19:12:34 miod Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.11 2010/06/29 22:08:29 jordan Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -100,3 +100,5 @@ struct mips_pci_chipset {
void pccbb_initialize(pci_chipset_tag_t, pcitag_t, uint, uint, uint);
void ppb_initialize(pci_chipset_tag_t, pcitag_t, uint, uint, uint);
+
+#define pci_dev_postattach(a, b)
diff --git a/sys/arch/sparc64/include/pci_machdep.h b/sys/arch/sparc64/include/pci_machdep.h
index 112e8c0bd16..1e6f29e144c 100644
--- a/sys/arch/sparc64/include/pci_machdep.h
+++ b/sys/arch/sparc64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.23 2009/08/22 02:54:51 mk Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.24 2010/06/29 22:08:29 jordan Exp $ */
/* $NetBSD: pci_machdep.h,v 1.7 2001/07/20 00:07:14 eeh Exp $ */
/*
@@ -98,4 +98,6 @@ int sparc64_pci_enumerate_bus(struct pci_softc *,
#define pciide_machdep_compat_intr_establish(a, b, c, d, e) (NULL)
#define pciide_machdep_compat_intr_disestablish(a, b) do { } while (0)
+#define pci_dev_postattach(a, b)
+
#endif /* _MACHINE_PCI_MACHDEP_H_ */
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 2073ec98762..624a3645fbc 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.162 2010/06/29 18:54:35 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.163 2010/06/29 22:08:29 jordan Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -42,6 +42,10 @@
#include <dev/acpi/dsdt.h>
#include <dev/wscons/wsdisplayvar.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcidevs.h>
+#include <dev/pci/ppbreg.h>
+
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
@@ -67,6 +71,8 @@ int acpi_saved_spl;
void acpi_isr_thread(void *);
void acpi_create_thread(void *);
+void acpi_pci_match(struct device *, struct pci_attach_args *);
+
int acpi_match(struct device *, void *, void *);
void acpi_attach(struct device *, struct device *, void *);
int acpi_submatch(struct device *, void *, void *);
@@ -493,6 +499,127 @@ acpi_match(struct device *parent, void *match, void *aux)
return (1);
}
+TAILQ_HEAD(, acpi_pci) acpi_pcidevs =
+ TAILQ_HEAD_INITIALIZER(acpi_pcidevs);
+
+int acpi_getpci(struct aml_node *node, void *arg);
+int acpi_getminbus(union acpi_resource *crs, void *arg);
+
+int
+acpi_getminbus(union acpi_resource *crs, void *arg)
+{
+ int *bbn = arg;
+ int typ = AML_CRSTYPE(crs);
+
+ /* Check for embedded bus number */
+ if (typ == LR_WORD && crs->lr_word.type == 2)
+ *bbn = crs->lr_word._min;
+ return 0;
+}
+
+/* Map ACPI device node to PCI */
+int
+acpi_getpci(struct aml_node *node, void *arg)
+{
+ const char *pcihid[] = { ACPI_DEV_PCIB, ACPI_DEV_PCIEB, "HWP0002", 0 };
+ struct acpi_pci *pci, *ppci;
+ struct aml_value res;
+ struct acpi_softc *sc = arg;
+ pci_chipset_tag_t pc = NULL;
+ pcitag_t tag;
+ uint64_t val;
+ uint32_t reg;
+
+ if (!node->value || node->value->type != AML_OBJTYPE_DEVICE)
+ return 0;
+ if (!aml_evalhid(node, &res)) {
+ /* Check if this is a PCI Root node */
+ if (_acpi_matchhids(res.v_string, pcihid)) {
+ aml_freevalue(&res);
+
+ pci = malloc(sizeof(*pci), M_DEVBUF, M_WAITOK|M_ZERO);
+
+ if (!aml_evalinteger(sc, node, "_SEG", 0, NULL, &val))
+ pci->seg = val;
+ if (!aml_evalinteger(sc, node, "_BBN", 0, NULL, &val))
+ pci->bus = val;
+ else if (!aml_evalname(sc, node, "_CRS", 0, NULL, &res)) {
+ if (res.type == AML_OBJTYPE_BUFFER &&
+ res.length > 5)
+ aml_parse_resource(res.length,
+ res.v_buffer, acpi_getminbus,
+ &pci->bus);
+ }
+ node->pci = pci;
+ dnprintf(10, "found PCI root: %s %d\n",
+ aml_nodename(node), pci->bus);
+ }
+ aml_freevalue(&res);
+ return 0;
+ }
+
+ /* If parent is not PCI, or device does not have _ADR, return */
+ if (!node->parent || (ppci = node->parent->pci) == NULL)
+ return 0;
+ if (aml_evalinteger(sc, node, "_ADR", 0, NULL, &val))
+ return 0;
+
+ pci = malloc(sizeof(*pci), M_DEVBUF, M_WAITOK|M_ZERO);
+ pci->bus = ppci->sub;
+ pci->dev = ACPI_ADR_PCIDEV(val);
+ pci->fun = ACPI_ADR_PCIFUN(val);
+ pci->node = node;
+ pci->sub = -1;
+
+ dnprintf(10, "%.2x:%.2x.%x -> %s\n",
+ pci->bus, pci->dev, pci->fun,
+ aml_nodename(node));
+
+ /* Check if PCI device exists */
+ tag = pci_make_tag(pc, pci->bus, pci->dev, pci->fun);
+ reg = pci_conf_read(pc, tag, PCI_ID_REG);
+ if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID) {
+ free(pci, M_DEVBUF);
+ return (1);
+ }
+ node->pci = pci;
+
+ TAILQ_INSERT_TAIL(&acpi_pcidevs, pci, next);
+
+ /* Check if this is a PCI bridge */
+ reg = pci_conf_read(pc, tag, PCI_CLASS_REG);
+ if (PCI_CLASS(reg) == PCI_CLASS_BRIDGE &&
+ PCI_SUBCLASS(reg) == PCI_SUBCLASS_BRIDGE_PCI) {
+ reg = pci_conf_read(pc, tag, PPB_REG_BUSINFO);
+ pci->sub = PPB_BUSINFO_SECONDARY(reg);
+
+ dnprintf(10, "found PCI bridge: %s %d\n",
+ aml_nodename(node), pci->sub);
+
+ /* Continue scanning */
+ return (0);
+ }
+
+ /* Device does not have children, stop scanning */
+ return (1);
+}
+
+void
+acpi_pci_match(struct device *dev, struct pci_attach_args *pa)
+{
+ struct acpi_pci *pdev;
+
+ TAILQ_FOREACH(pdev, &acpi_pcidevs, next) {
+ if (pdev->bus == pa->pa_bus &&
+ pdev->dev == pa->pa_device &&
+ pdev->fun == pa->pa_function) {
+ dnprintf(10,"%s at acpi0 %s\n",
+ dev->dv_xname, aml_nodename(pdev->node));
+ pdev->device = dev;
+ }
+ }
+}
+
void
acpi_attach(struct device *parent, struct device *self, void *aux)
{
@@ -710,6 +837,9 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
/* initialize runtime environment */
aml_find_node(&aml_root, "_INI", acpi_inidev, sc);
+ /* Get PCI mapping */
+ aml_walknodes(&aml_root, AML_WALK_PRE, acpi_getpci, sc);
+
/* attach pci interrupt routing tables */
aml_find_node(&aml_root, "_PRT", acpi_foundprt, sc);
diff --git a/sys/dev/acpi/acpireg.h b/sys/dev/acpi/acpireg.h
index f1dba86c782..44560e01f1f 100644
--- a/sys/dev/acpi/acpireg.h
+++ b/sys/dev/acpi/acpireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpireg.h,v 1.21 2010/06/28 06:46:32 jordan Exp $ */
+/* $OpenBSD: acpireg.h,v 1.22 2010/06/29 22:08:29 jordan Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
@@ -603,6 +603,8 @@ struct acpi_ivrs {
/*
* PCI Configuration space
*/
+#define ACPI_ADR_PCIDEV(addr) (u_int16_t)(addr >> 16)
+#define ACPI_ADR_PCIFUN(addr) (u_int16_t)(addr & 0xFFFF)
#define ACPI_PCI_BUS(addr) (u_int16_t)((addr) >> 48)
#define ACPI_PCI_DEV(addr) (u_int16_t)((addr) >> 32)
#define ACPI_PCI_FN(addr) (u_int16_t)((addr) >> 16)
diff --git a/sys/dev/acpi/amltypes.h b/sys/dev/acpi/amltypes.h
index 5bea7d0c9e9..335a2399f0f 100644
--- a/sys/dev/acpi/amltypes.h
+++ b/sys/dev/acpi/amltypes.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amltypes.h,v 1.34 2010/06/27 21:04:22 jordan Exp $ */
+/* $OpenBSD: amltypes.h,v 1.35 2010/06/29 22:08:29 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -347,6 +347,19 @@ struct aml_value {
#define aml_pkglen(v) ((v)->length)
#define aml_pkgval(v,i) (&(v)->v_package[(i)])
+struct acpi_pci {
+ TAILQ_ENTRY(acpi_pci) next;
+
+ struct aml_node *node;
+ struct device *device;
+
+ int sub;
+ int seg;
+ int bus;
+ int dev;
+ int fun;
+};
+
struct aml_node {
struct aml_node *parent;
@@ -357,12 +370,9 @@ struct aml_node {
u_int16_t opcode;
u_int8_t *start;
u_int8_t *end;
- // const char *name;
- // const char *mnem;
struct aml_value *value;
-
- int depth;
+ struct acpi_pci *pci;
};
#define aml_bitmask(n) (1L << ((n) & 0x7))
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index b26fb31875f..0fa0a6bc4ac 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.160 2010/06/27 21:04:22 jordan Exp $ */
+/* $OpenBSD: dsdt.c,v 1.161 2010/06/29 22:08:29 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -1234,7 +1234,8 @@ aml_walknodes(struct aml_node *node, int mode,
if (node == NULL)
return;
if (mode == AML_WALK_PRE)
- nodecb(node, arg);
+ if (nodecb(node, arg))
+ return;
SIMPLEQ_FOREACH(child, &node->son, sib)
aml_walknodes(child, mode, nodecb, arg);
if (mode == AML_WALK_POST)
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 7a18d0f0746..7e21eeacf1f 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.76 2010/04/21 23:12:24 deraadt Exp $ */
+/* $OpenBSD: pci.c,v 1.77 2010/06/29 22:08:29 jordan Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -364,6 +364,8 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag,
pcisubmatch))) {
pcireg_t reg;
+ pci_dev_postattach(dev, &pa);
+
/* skip header type != 0 */
reg = pci_conf_read(pc, tag, PCI_BHLC_REG);
if (PCI_HDRTYPE_TYPE(reg) != 0)