Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.os.uefi.protocol: ziggify function signatures #23214

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dotcarmen
Copy link
Contributor

@dotcarmen dotcarmen commented Mar 12, 2025

A lot of the function signatures in std.os.uefi.protocol aren't very ziggy. This PR modifies a significant number of the namespace's functions to align more with verbose Zig code.

  • Some parameters changed from * to *const and vice-versa as appropriate
  • Some pairs of parameters that represent slices were consolidated into a single slice parameter
  • Status errors associated with each function according to the UEFI Specification are handled specifically, resulting in narrow error unions being returned from each function
    • unexpected status codes result in a new call to uefi.unexpectedError, which is akin to posix.unexpectedError
  • As appropriate, return values from various functions are returned directly when the underlying function's return value is .success, rather than requiring an output pointer parameter

note: most of std.os.uefi is untested, and that's not really changing here. I'm mostly focused on making sure there are no compiler errors. Any further problems will require a future PR to address.

@dotcarmen
Copy link
Contributor Author

one problem I'm struggling to address in this PR is the potential for the underlying API to return status codes - most of std.os.uefi already assumes non-.success return values are errors, but I wonder if warnings (high bit clear) should be stored somewhere?

@dotcarmen dotcarmen force-pushed the uefi-fn-signatures branch from c5ad247 to 3c4cfa8 Compare March 12, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant