Skip to content

std.os.uefi: fix some mistakes #12897

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

Merged
merged 3 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/std/os/uefi/protocols/managed_network_protocol.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub const ManagedNetworkProtocol = extern struct {
_transmit: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status),
_receive: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status),
_cancel: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status),
_poll: std.meta.FnPtr(fn (*const ManagedNetworkProtocol) callconv(.C) usize),
_poll: std.meta.FnPtr(fn (*const ManagedNetworkProtocol) callconv(.C) Status),

/// Returns the operational parameters for the current MNP child driver.
/// May also support returning the underlying SNP driver mode data.
Expand All @@ -31,8 +31,7 @@ pub const ManagedNetworkProtocol = extern struct {
/// Translates an IP multicast address to a hardware (MAC) multicast address.
/// This function may be unsupported in some MNP implementations.
pub fn mcastIpToMac(self: *const ManagedNetworkProtocol, ipv6flag: bool, ipaddress: *const anyopaque, mac_address: *MacAddress) Status {
_ = mac_address;
return self._mcast_ip_to_mac(self, ipv6flag, ipaddress);
return self._mcast_ip_to_mac(self, ipv6flag, ipaddress, mac_address);
}

/// Enables and disables receive filters for multicast address.
Expand Down
4 changes: 2 additions & 2 deletions lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const SimpleTextInputExProtocol = extern struct {
_read_key_stroke_ex: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status),
wait_for_key_ex: Event,
_set_state: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status),
_register_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const KeyData, fn (*const KeyData) callconv(.C) usize, **anyopaque) callconv(.C) Status),
_register_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const KeyData, std.meta.FnPtr(fn (*const KeyData) callconv(.C) usize), **anyopaque) callconv(.C) Status),
_unregister_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status),

/// Resets the input device hardware.
Expand All @@ -29,7 +29,7 @@ pub const SimpleTextInputExProtocol = extern struct {
}

/// Register a notification function for a particular keystroke for the input device.
pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: fn (*const KeyData) callconv(.C) usize, handle: **anyopaque) Status {
pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: std.meta.FnPtr(fn (*const KeyData) callconv(.C) usize), handle: **anyopaque) Status {
return self._register_key_notify(self, key_data, notify, handle);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/std/os/uefi/tables/boot_services.zig
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub const BootServices = extern struct {
pub const tpl_high_level: usize = 31;
};

pub const EfiEventNotify = fn (event: Event, ctx: *anyopaque) callconv(.C) void;
pub const EfiEventNotify = std.meta.FnPtr(fn (event: Event, ctx: *anyopaque) callconv(.C) void);

pub const TimerDelay = enum(u32) {
TimerCancel,
Expand Down