efi: Drop all uses of efi_call_XX() wrappers

Now that GCC can generate function calls using the correct calling
convention for us, we can stop using the efi_call_XX() wrappers, and
just dereference the function pointers directly.

This avoids the untyped variadic wrapper routines, which means better
type checking for the method calls.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Ard Biesheuvel authored and Daniel Kiper committed 2023-05-25 16:48:00 +02:00
1 parent 6a080b9cde
commit bb4aa6e06e
23 files changed
+165 -170

No files matched your search

+8 -8
View File
@@ -203,14 +203,14 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type)
b = grub_efi_system_table->boot_services;
address = start & (~0xfffULL);
pages = (end - address + 0xfff) >> 12;
status = efi_call_2 (b->free_pages, address, pages);
status = b->free_pages (address, pages);
if (status != GRUB_EFI_SUCCESS && status != GRUB_EFI_NOT_FOUND)
{
grub_free (curover);
return 0;
}
status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS,
make_efi_memtype (type), pages, &address);
status = b->allocate_pages (GRUB_EFI_ALLOCATE_ADDRESS,
make_efi_memtype (type), pages, &address);
if (status != GRUB_EFI_SUCCESS)
{
grub_free (curover);
@@ -239,7 +239,7 @@ grub_mmap_unregister (int handle)
{
if (curover->handle == handle)
{
efi_call_2 (b->free_pages, curover->address, curover->pages);
b->free_pages (curover->address, curover->pages);
if (prevover != 0)
prevover->next = curover->next;
else
@@ -281,8 +281,8 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
#endif
pages = (size + 0xfff) >> 12;
status = efi_call_4 (b->allocate_pages, atype,
make_efi_memtype (type), pages, &address);
status = b->allocate_pages (atype,
make_efi_memtype (type), pages, &address);
if (status != GRUB_EFI_SUCCESS)
{
grub_free (curover);
@@ -294,8 +294,8 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)),
/* Uggh, the address 0 was allocated... This is too annoying,
so reallocate another one. */
address = 0xffffffff;
status = efi_call_4 (b->allocate_pages, atype,
make_efi_memtype (type), pages, &address);
status = b->allocate_pages (atype,
make_efi_memtype (type), pages, &address);
grub_efi_free_pages (0, pages);
if (status != GRUB_EFI_SUCCESS)
return 0;