Skip to content

Commit 45d5165

Browse files
committed
efi: Add mixed-mode thunk recipe for GetMemoryAttributes
EFI mixed mode on x86 requires a recipe for each protocol method or firmware service that takes u64 arguments by value, or returns pointer or 'native int' (UINTN) values by reference (e.g,, through a void ** or unsigned long * parameter), due to the fact that these types cannot be translated 1:1 between the i386 and MS x64 calling conventions. So add the missing recipe for GetMemoryAttributes, which is not actually being used yet on x86, but the code exists and can be built for x86 so let's make sure it works as it should. Cc: Evgeniy Baskov <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 93be285 commit 45d5165

File tree

1 file changed

+3
-0
lines changed
  • arch/x86/include/asm

1 file changed

+3
-0
lines changed

arch/x86/include/asm/efi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ static inline u32 efi64_convert_status(efi_status_t status)
338338
((prot), efi64_zero_upper(file))
339339

340340
/* Memory Attribute Protocol */
341+
#define __efi64_argmap_get_memory_attributes(protocol, phys, size, flags) \
342+
((protocol), __efi64_split(phys), __efi64_split(size), (flags))
343+
341344
#define __efi64_argmap_set_memory_attributes(protocol, phys, size, flags) \
342345
((protocol), __efi64_split(phys), __efi64_split(size), __efi64_split(flags))
343346

0 commit comments

Comments
 (0)