Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/acpica/acpi_iort.c
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | map_entry = ACPI_ADD_PTR(ACPI_IORT_ID_MAPPING, node_entry, | ||||
node_entry->MappingOffset); | node_entry->MappingOffset); | ||||
node->nentries = node_entry->MappingCount; | node->nentries = node_entry->MappingCount; | ||||
node->usecount = 0; | node->usecount = 0; | ||||
mapping = malloc(sizeof(*mapping) * node->nentries, M_DEVBUF, | mapping = malloc(sizeof(*mapping) * node->nentries, M_DEVBUF, | ||||
M_WAITOK | M_ZERO); | M_WAITOK | M_ZERO); | ||||
node->entries.mappings = mapping; | node->entries.mappings = mapping; | ||||
for (i = 0; i < node->nentries; i++, mapping++, map_entry++) { | for (i = 0; i < node->nentries; i++, mapping++, map_entry++) { | ||||
mapping->base = map_entry->InputBase; | mapping->base = map_entry->InputBase; | ||||
mapping->end = map_entry->InputBase + map_entry->IdCount - 1; | mapping->end = map_entry->InputBase + map_entry->IdCount + 1; | ||||
andrew: Won't this mean we have an off-by-one error in the opposite direction? | |||||
val_packett.coolAuthorUnsubmitted Done Inline ActionsHm, yeah, we actually do lookup with id <= entry->end instead of id < entry->end for some reason. If we change to id < entry->end, it won't. (We could also not do +1 but the comparison being inclusive on both ends seems odd to me) val_packett.cool: Hm, yeah, we actually do lookup with `id <= entry->end` instead of `id < entry->end` for some… | |||||
andrewUnsubmitted Not Done Inline Actions<= allows for entries at the end of the address space while < would require a 65 bit value for a 64 bit address space. andrew: `<=` allows for entries at the end of the address space while `<` would require a 65 bit value… | |||||
mapping->outbase = map_entry->OutputBase; | mapping->outbase = map_entry->OutputBase; | ||||
mapping->out_node_offset = map_entry->OutputReference; | mapping->out_node_offset = map_entry->OutputReference; | ||||
mapping->flags = map_entry->Flags; | mapping->flags = map_entry->Flags; | ||||
mapping->out_node = NULL; | mapping->out_node = NULL; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |
Won't this mean we have an off-by-one error in the opposite direction?