-/* $OpenBSD: dsdt.c,v 1.176 2010/07/28 16:00:29 deraadt Exp $ */
+/* $OpenBSD: dsdt.c,v 1.177 2010/08/04 18:11:55 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
* @@@: Opcode utility functions
*/
-u_int64_t
-aml_getpciaddr(struct acpi_softc *sc, struct aml_node *root)
-{
- int64_t tmpres;
- u_int64_t pciaddr;
-
- /* PCI */
- pciaddr = 0;
- if (!aml_evalinteger(acpi_softc, root, "_ADR", 0, NULL, &tmpres)) {
- /* Device:Function are bits 16-31,32-47 */
- pciaddr += (tmpres << 16L);
- dnprintf(20, "got _adr [%s]\n", aml_nodename(root));
- } else {
- /* Mark invalid */
- pciaddr += (0xFFFF << 16L);
- return pciaddr;
- }
-
- if (!aml_evalinteger(acpi_softc, root, "_BBN", 0, NULL, &tmpres)) {
- /* PCI bus is in bits 48-63 */
- pciaddr += (tmpres << 48L);
- dnprintf(20, "got _bbn [%s]\n", aml_nodename(root));
- }
- dnprintf(20, "got pciaddr: %s:%llx\n", aml_nodename(root), pciaddr);
- return pciaddr;
-}
-
/*
* @@@: Opcode functions
*/
} else if (val->type == AML_OBJTYPE_PACKAGE) {
for (i = 0; i < val->length; i++)
aml_fixup_node(node, val->v_package[i]);
- } else if (val->type == AML_OBJTYPE_OPREGION) {
- if (val->v_opregion.iospace != GAS_PCI_CFG_SPACE)
- return (0);
- if (ACPI_PCI_FN(val->v_opregion.iobase) != 0xFFFF)
- return (0);
- val->v_opregion.iobase =
- ACPI_PCI_REG(val->v_opregion.iobase) +
- aml_getpciaddr(acpi_softc, node);
- dnprintf(20, "late ioaddr : %s:%llx\n",
- aml_nodename(node), val->v_opregion.iobase);
}
return (0);
}
-/* $OpenBSD: dsdt.h,v 1.54 2010/07/22 14:19:47 deraadt Exp $ */
+/* $OpenBSD: dsdt.h,v 1.55 2010/08/04 18:11:56 jordan Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
int (*)(struct aml_node *, int, void *), void *,
int);
-u_int64_t aml_getpciaddr(struct acpi_softc *, struct aml_node *);
-
int aml_evalnode(struct acpi_softc *, struct aml_node *,
int , struct aml_value *, struct aml_value *);
int aml_evalname(struct acpi_softc *, struct aml_node *,