final Address acpiEnd = arch.getEnd(ACPI);
// First unmap the entire ACPI region
arch.munmap(ACPI, acpiStart, acpiEnd.toWord().sub(acpiStart.toWord()).toExtent());
this.acpiVirtStart = acpiStart;
MemoryMapEntry lastAcpiEntry = null;
Address start = acpiStart;
for (MemoryMapEntry e : mmap) {
if (e.isAcpi() || e.isAcpiNVS()) {
// Calculate page aligned boundaries & sizes
final Address alignedPhysStart = arch.pageAlign(ACPI, e.getStart(), false);
final Word diff = e.getStart().toWord().sub(alignedPhysStart.toWord());
final Extent size = e.getSize().add(diff);
// Check for adjacent memory blocks
if (lastAcpiEntry != null) {
Address expected = lastAcpiEntry.getStart().add(lastAcpiEntry.getSize());
if (e.getStart().NE(expected)) {
throw new DriverException("ACPI memory map entries are not adjacent");
}
} else {
this.acpiPhysStart = alignedPhysStart;