summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pe.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pe.c b/pe.c
index 33056017..1d8bdfa8 100644
--- a/pe.c
+++ b/pe.c
@@ -480,7 +480,7 @@ update_mem_attrs(uintptr_t addr, uint64_t size,
&before, efi_status);
if (!IS_PAGE_ALIGNED(physaddr) || !IS_PAGE_ALIGNED(size) || size == 0) {
- dprint(L"%a called on 0x%llx-0x%llx (size 0x%llx) +%a%a%a -%a%a%a\n",
+ perror(L"Invalid call %a(addr:0x%llx-0x%llx, size:0x%llx, +%a%a%a, -%a%a%a)\n",
__func__, (unsigned long long)physaddr,
(unsigned long long)(physaddr + size - 1),
(unsigned long long)size,
@@ -490,6 +490,12 @@ update_mem_attrs(uintptr_t addr, uint64_t size,
(clear_attrs & MEM_ATTR_R) ? "r" : "",
(clear_attrs & MEM_ATTR_W) ? "w" : "",
(clear_attrs & MEM_ATTR_X) ? "x" : "");
+ if (!IS_PAGE_ALIGNED(physaddr))
+ perror(L" addr is not page aligned\n");
+ if (!IS_PAGE_ALIGNED(size))
+ perror(L" size is not page aligned\n");
+ if (size == 0)
+ perror(L" size is 0\n");
return 0;
}