booting OpenBSD on some (ancient?) Hyper-V version.
Tested by Henryk Paluch
ok mlarkin@
-/* $OpenBSD: acpi.c,v 1.425 2023/07/08 08:01:10 tobhe Exp $ */
+/* $OpenBSD: acpi.c,v 1.426 2024/01/08 19:52:29 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
printf(" !DSDT");
p_dsdt = entry->q_table;
- acpi_parse_aml(sc, p_dsdt->aml, p_dsdt->hdr_length -
- sizeof(p_dsdt->hdr));
+ acpi_parse_aml(sc, NULL, p_dsdt->aml,
+ p_dsdt->hdr_length - sizeof(p_dsdt->hdr));
/* Load SSDT's */
SIMPLEQ_FOREACH(entry, &sc->sc_tables, q_next) {
if (memcmp(entry->q_table, SSDT_SIG,
sizeof(SSDT_SIG) - 1) == 0) {
p_dsdt = entry->q_table;
- acpi_parse_aml(sc, p_dsdt->aml, p_dsdt->hdr_length -
- sizeof(p_dsdt->hdr));
+ acpi_parse_aml(sc, NULL, p_dsdt->aml,
+ p_dsdt->hdr_length - sizeof(p_dsdt->hdr));
}
}
-/* $OpenBSD: dsdt.c,v 1.264 2021/12/09 20:21:35 patrick Exp $ */
+/* $OpenBSD: dsdt.c,v 1.265 2024/01/08 19:52:29 kettenis Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
SIMPLEQ_INIT(&node->son);
SIMPLEQ_INSERT_TAIL(&root->son, node, sib);
+ return node;
}
- return node;
+ return NULL;
}
/* Get absolute pathname of AML node */
struct acpi_dsdt *p_dsdt;
struct acpi_q *entry;
- if (strlen(rootpath) > 0)
- aml_die("LoadTable: RootPathString unsupported");
if (strlen(parameterpath) > 0)
aml_die("LoadTable: ParameterPathString unsupported");
strncmp(hdr->oemtableid, oemtableid,
sizeof(hdr->oemtableid)) == 0) {
p_dsdt = entry->q_table;
- acpi_parse_aml(sc, p_dsdt->aml, p_dsdt->hdr_length -
- sizeof(p_dsdt->hdr));
+ acpi_parse_aml(sc, rootpath, p_dsdt->aml,
+ p_dsdt->hdr_length - sizeof(p_dsdt->hdr));
return aml_allocvalue(AML_OBJTYPE_DDBHANDLE, 0, 0);
}
}
}
int
-acpi_parse_aml(struct acpi_softc *sc, uint8_t *start, uint32_t length)
+acpi_parse_aml(struct acpi_softc *sc, const char *rootpath,
+ uint8_t *start, uint32_t length)
{
+ struct aml_node *root = &aml_root;
struct aml_scope *scope;
struct aml_value res;
+ if (rootpath) {
+ root = aml_searchname(&aml_root, rootpath);
+ if (root == NULL)
+ aml_die("Invalid RootPathName %s\n", rootpath);
+ }
+
aml_root.start = start;
memset(&res, 0, sizeof(res));
res.type = AML_OBJTYPE_SCOPE;
-/* $OpenBSD: dsdt.h,v 1.80 2023/04/02 11:32:48 jsg Exp $ */
+/* $OpenBSD: dsdt.h,v 1.81 2024/01/08 19:52:29 kettenis Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
void aml_find_node(struct aml_node *, const char *,
int (*)(struct aml_node *, void *), void *);
-int acpi_parse_aml(struct acpi_softc *, u_int8_t *,
- uint32_t);
+int acpi_parse_aml(struct acpi_softc *, const char *,
+ u_int8_t *, uint32_t);
void aml_register_notify(struct aml_node *, const char *,
int (*)(struct aml_node *, int, void *), void *,
int);