[ulib][inspector] Migrate to zx_system_get_page_size
Migrates usages of page size constants to zx_system_get_page_size
Bug: 67899
Change-Id: I2a9cced8fbd5199278c448e3ef4f3f891aae5186
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/509163
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Adrian Danis <adanis@google.com>
Reviewed-by: Roland McGrath <mcgrathr@google.com>
diff --git a/zircon/system/ulib/inspector/dso-list.cc b/zircon/system/ulib/inspector/dso-list.cc
index c440e84..e788eac 100644
--- a/zircon/system/ulib/inspector/dso-list.cc
+++ b/zircon/system/ulib/inspector/dso-list.cc
@@ -145,6 +145,7 @@
fprintf(f, "{{{reset}}}\n");
elf_search::ForEachModule(
*zx::unowned_process{process}, [f, count = 0u](const elf_search::ModuleInfo& info) mutable {
+ const size_t kPageSize = zx_system_get_page_size();
unsigned int module_id = count++;
// Print out the module first.
fprintf(f, "{{{module:%#x:%s:elf:", module_id, info.name.begin());
@@ -157,8 +158,8 @@
if (phdr.p_type != PT_LOAD) {
continue;
}
- uintptr_t start = phdr.p_vaddr & -PAGE_SIZE;
- uintptr_t end = (phdr.p_vaddr + phdr.p_memsz + PAGE_SIZE - 1) & -PAGE_SIZE;
+ uintptr_t start = phdr.p_vaddr & -kPageSize;
+ uintptr_t end = (phdr.p_vaddr + phdr.p_memsz + kPageSize - 1) & -kPageSize;
fprintf(f, "{{{mmap:%#" PRIxPTR ":%#" PRIxPTR ":load:%#x:", info.vaddr + start,
end - start, module_id);
if (phdr.p_flags & PF_R) {