Closed nicholasbishop closed 1 year ago
@Nicholasbishop Actually, there already has a definition #define EFI_PAGE_MASK 0xFFF
in gnu-efi/inc/efidef.h
. For example, you could use:
if (physaddr & EFI_PAGE_MASK || size & EFI_PAGE_MASK || ...
I've pushed this (with @dennis-tseng99's suggestion) as e4f40ae862b5389c8cc7d4f938a34238421456a1
This makes some checks in
get_mem_attrs
andupdate_mem_attrs
clearer.Also add
test-pe-util.c
with a test for the new macro. The file is named that way instead oftest-pe.c
to avoid having to getpe.c
building in the unit test environment.Signed-off-by: Nicholas Bishop nicholasbishop@google.com