diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-06-11 18:13:54 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-06-11 18:13:54 +0000 |
commit | 96fe3476dc8d86b7171b8a0b8b3f55d7acb58cf2 (patch) | |
tree | 27517585bc880b8159d0ddf7af2d24cb404e53a7 | |
parent | 83cc747b559d804370d843fb969fce111f2cad52 (diff) |
Fix small bug in parsing the IORT tables. Mapping entries specify the number
of IDs in a range minus one.
ok patrick@
-rw-r--r-- | sys/arch/arm64/dev/acpipci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/acpipci.c b/sys/arch/arm64/dev/acpipci.c index e558c203d3e..355db6ea43e 100644 --- a/sys/arch/arm64/dev/acpipci.c +++ b/sys/arch/arm64/dev/acpipci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipci.c,v 1.14 2020/05/02 13:29:23 kettenis Exp $ */ +/* $OpenBSD: acpipci.c,v 1.15 2020/06/11 18:13:53 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -592,7 +592,7 @@ struct acpi_iort_node { struct acpi_iort_mapping { uint32_t input_base; - uint32_t length; + uint32_t number_of_ids; uint32_t output_base; uint32_t output_reference; uint32_t flags; @@ -617,8 +617,9 @@ acpipci_iort_map_node(struct acpi_iort *iort, return acpipci_iort_map(iort, offset, id); } + /* Mapping encodes number of IDs in the range minus one. */ if (map[i].input_base <= id && - id < map[i].input_base + map[i].length) { + id <= map[i].input_base + map[i].number_of_ids) { id = map[i].output_base + (id - map[i].input_base); return acpipci_iort_map(iort, offset, id); } |