Skip to content

Proposal: extern "uefi" ABI #54527

Closed
@HadrienG2

Description

@HadrienG2

The UEFI firmware interface has some calling conventions which are documented in chapter 2.3 of the current spec.

For the most part, these are pretty close to the Windows ABI conventions ("cdecl" on IA-32, "win64" on AMD64...), which should come as no surprise given the strong influence that Microsoft has on the UEFI forum. However, the UEFI spec also defines calling conventions for hardware architectures like RISC-V where Windows has not been ported.

UEFI applications (such as OS loaders) must be extra careful to use the right ABI when calling into UEFI, since unless you are Windows, extern "C" will not necessarily map into what the firmware expects.

In rust-osdev/uefi-rs#41 , @GabrielMajeri proposed to make the life of UEFI application developers easier by adding language-level support for the UEFI FFI in the form of an extern "uefi" ABI. How open would you be to this idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions