Skip to content

Commit

Permalink
efirt: use correct ABI for runtime EFI functions
Browse files Browse the repository at this point in the history
When calling EFI RT methods through no fault path.

MFC after:	1 week
  • Loading branch information
VexedUXR authored and kostikbel committed Dec 25, 2024
1 parent dd2b544 commit 3e8f4a3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions sys/dev/efidev/efirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,31 +490,32 @@ efi_rt_arch_call_nofault(struct efirt_callinfo *ec)

switch (ec->ec_argcnt) {
case 0:
ec->ec_efi_status = ((register_t (*)(void))ec->ec_fptr)();
ec->ec_efi_status = ((register_t EFIABI_ATTR (*)(void))
ec->ec_fptr)();
break;
case 1:
ec->ec_efi_status = ((register_t (*)(register_t))ec->ec_fptr)
(ec->ec_arg1);
ec->ec_efi_status = ((register_t EFIABI_ATTR (*)(register_t))
ec->ec_fptr)(ec->ec_arg1);
break;
case 2:
ec->ec_efi_status = ((register_t (*)(register_t, register_t))
ec->ec_fptr)(ec->ec_arg1, ec->ec_arg2);
ec->ec_efi_status = ((register_t EFIABI_ATTR (*)(register_t,
register_t))ec->ec_fptr)(ec->ec_arg1, ec->ec_arg2);
break;
case 3:
ec->ec_efi_status = ((register_t (*)(register_t, register_t,
register_t))ec->ec_fptr)(ec->ec_arg1, ec->ec_arg2,
ec->ec_arg3);
ec->ec_efi_status = ((register_t EFIABI_ATTR (*)(register_t,
register_t, register_t))ec->ec_fptr)(ec->ec_arg1,
ec->ec_arg2, ec->ec_arg3);
break;
case 4:
ec->ec_efi_status = ((register_t (*)(register_t, register_t,
register_t, register_t))ec->ec_fptr)(ec->ec_arg1,
ec->ec_arg2, ec->ec_arg3, ec->ec_arg4);
ec->ec_efi_status = ((register_t EFIABI_ATTR (*)(register_t,
register_t, register_t, register_t))ec->ec_fptr)(
ec->ec_arg1, ec->ec_arg2, ec->ec_arg3, ec->ec_arg4);
break;
case 5:
ec->ec_efi_status = ((register_t (*)(register_t, register_t,
register_t, register_t, register_t))ec->ec_fptr)(
ec->ec_arg1, ec->ec_arg2, ec->ec_arg3, ec->ec_arg4,
ec->ec_arg5);
ec->ec_efi_status = ((register_t EFIABI_ATTR (*)(register_t,
register_t, register_t, register_t, register_t))
ec->ec_fptr)(ec->ec_arg1, ec->ec_arg2, ec->ec_arg3,
ec->ec_arg4, ec->ec_arg5);
break;
default:
panic("efi_rt_arch_call: %d args", (int)ec->ec_argcnt);
Expand Down

0 comments on commit 3e8f4a3

Please sign in to comment.