1.1 --- a/libmem/lib/src/flexpage.cc Tue Feb 27 17:20:22 2024 +0100
1.2 +++ b/libmem/lib/src/flexpage.cc Wed Feb 28 17:46:20 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A flexpage abstraction.
1.6 *
1.7 - * Copyright (C) 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2021, 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -70,6 +70,15 @@
1.13
1.14 page_offset = trunc(offset - base_offset, PAGE_SIZE);
1.15 page_addr = base_addr + page_offset;
1.16 +
1.17 + /* Where a physical address is available, also provide the base address in
1.18 + physical address space. Note that a physical address of zero is not
1.19 + considered as indicating such an address. */
1.20 +
1.21 + if (region->physical_start)
1.22 + base_addr_physical = region->physical_start + (base_addr - region->start);
1.23 + else
1.24 + base_addr_physical = 0;
1.25 }
1.26
1.27 /* Set a region. */