Skip to content

Commit 5ad806e

Browse files
committed
misc fixes
1 parent 7568d98 commit 5ad806e

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

lib/std/os/uefi/tables/boot_services.zig

+15-12
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ pub const BootServices = extern struct {
3434
hdr: TableHeader,
3535

3636
/// Raises a task's priority level and returns its previous level.
37-
_aiseTpl: *const fn (new_tpl: usize) callconv(cc) usize,
37+
_raiseTpl: *const fn (new_tpl: usize) callconv(cc) usize,
3838

3939
/// Restores a task's priority level to its previous value.
40-
_estoreTpl: *const fn (old_tpl: usize) callconv(cc) void,
40+
_restoreTpl: *const fn (old_tpl: usize) callconv(cc) void,
4141

4242
/// Allocates memory pages from the system.
4343
_allocatePages: *const fn (alloc_type: AllocateType, mem_type: MemoryType, pages: usize, memory: *[*]align(4096) u8) callconv(cc) Status,
@@ -46,7 +46,7 @@ pub const BootServices = extern struct {
4646
_freePages: *const fn (memory: [*]align(4096) u8, pages: usize) callconv(cc) Status,
4747

4848
/// Returns the current memory map.
49-
_getMemoryMap: *const fn (mmap_size: *usize, mmap: [*]MemoryDescriptor, map_key: *MemoryMapKey, descriptor_size: *usize, descriptor_version: *u32) callconv(cc) Status,
49+
_getMemoryMap: *const fn (mmap_size: *usize, mmap: ?[*]MemoryDescriptor, map_key: *MemoryMapKey, descriptor_size: *usize, descriptor_version: *u32) callconv(cc) Status,
5050

5151
/// Allocates pool memory.
5252
_allocatePool: *const fn (pool_type: MemoryType, size: usize, buffer: *[*]align(8) u8) callconv(cc) Status,
@@ -479,8 +479,7 @@ pub const BootServices = extern struct {
479479
pub fn installProtocolInterface(
480480
self: *BootServices,
481481
handle: ?Handle,
482-
Interface: type,
483-
interface: *const Interface,
482+
interface: anytype,
484483
) InstallProtocolInterfacesError!Handle {
485484
return self.installProtocolInterfaces(handle, .{
486485
interface,
@@ -509,7 +508,6 @@ pub const BootServices = extern struct {
509508
pub fn uninstallProtocolInterface(
510509
self: *BootServices,
511510
handle: Handle,
512-
Interface: type,
513511
interface: *const Interface,
514512
) UninstallProtocolInterfacesError!void {
515513
return self.uninstallProtocolInterfaces(handle, .{
@@ -683,7 +681,11 @@ pub const BootServices = extern struct {
683681
else => |exit_code| exit_code,
684682
};
685683

686-
if (exit_data_size == 0) return error.Unexpected;
684+
if (exit_data_size == 0) return .{
685+
.code = exit_code,
686+
.description = null,
687+
.data = null,
688+
};
687689

688690
const description: [*:0]const u16 = @ptrCast(exit_data);
689691
var description_len: usize = 0;
@@ -734,9 +736,10 @@ pub const BootServices = extern struct {
734736
}
735737

736738
pub fn stall(self: *const BootServices, microseconds: usize) uefi.UnexpectedError!void {
737-
const status = self._stall(microseconds);
738-
if (status != .success)
739-
return uefi.unexpectedStatus(status);
739+
switch (self._stall(microseconds)) {
740+
.success => {},
741+
else => |status| return uefi.unexpectedStatus(status),
742+
}
740743
}
741744

742745
pub fn setWatchdogTimer(
@@ -1018,8 +1021,8 @@ pub const BootServices = extern struct {
10181021

10191022
pub const ImageExitData = struct {
10201023
code: Status,
1021-
description: [:0]const u16,
1022-
data: []const u16,
1024+
description: ?[:0]const u16,
1025+
data: ?[]const u16,
10231026
};
10241027
};
10251028

0 commit comments

Comments
 (0)