| author | |
| committer | |
| log | eff332fd042a4ef556409c7650c6b74da0e30235 |
| tree | 7a3e10d56e276d41e7524188e26b94718ed1ff10 |
| parent | 80d84537f7c7002c29a39a429072f59303f7d0f7 |
closes #3145620 files changed, 336 insertions(+), 355 deletions(-)
lib/std/os/uefi/protocol/absolute_pointer.zig+3-4| ... | ... | @@ -4,7 +4,6 @@ const Event = uefi.Event; |
| 4 | 4 | const Guid = uefi.Guid; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// Protocol for touchscreens. |
| 10 | 9 | pub const AbsolutePointer = extern struct { |
| ... | ... | @@ -20,7 +19,7 @@ pub const AbsolutePointer = extern struct { |
| 20 | 19 | pub fn reset(self: *AbsolutePointer, verify: bool) ResetError!void { |
| 21 | 20 | switch (self._reset(self, verify)) { |
| 22 | 21 | .success => {}, |
| 23 | .device_error => return Error.DeviceError, | |
| 22 | .device_error => return error.DeviceError, | |
| 24 | 23 | else => |status| return uefi.unexpectedStatus(status), |
| 25 | 24 | } |
| 26 | 25 | } |
| ... | ... | @@ -30,8 +29,8 @@ pub const AbsolutePointer = extern struct { |
| 30 | 29 | var state: State = undefined; |
| 31 | 30 | switch (self._get_state(self, &state)) { |
| 32 | 31 | .success => return state, |
| 33 | .not_ready => return Error.NotReady, | |
| 34 | .device_error => return Error.DeviceError, | |
| 32 | .not_ready => return error.NotReady, | |
| 33 | .device_error => return error.DeviceError, | |
| 35 | 34 | else => |status| return uefi.unexpectedStatus(status), |
| 36 | 35 | } |
| 37 | 36 | } |
lib/std/os/uefi/protocol/block_io.zig+13-14| ... | ... | @@ -2,7 +2,6 @@ const std = @import("std"); |
| 2 | 2 | const uefi = std.os.uefi; |
| 3 | 3 | const Status = uefi.Status; |
| 4 | 4 | const cc = uefi.cc; |
| 5 | const Error = Status.Error; | |
| 6 | 5 | |
| 7 | 6 | pub const BlockIo = extern struct { |
| 8 | 7 | const Self = @This(); |
| ... | ... | @@ -39,7 +38,7 @@ pub const BlockIo = extern struct { |
| 39 | 38 | pub fn reset(self: *Self, extended_verification: bool) ResetError!void { |
| 40 | 39 | switch (self._reset(self, extended_verification)) { |
| 41 | 40 | .success => {}, |
| 42 | .device_error => return Error.DeviceError, | |
| 41 | .device_error => return error.DeviceError, | |
| 43 | 42 | else => |status| return uefi.unexpectedStatus(status), |
| 44 | 43 | } |
| 45 | 44 | } |
| ... | ... | @@ -48,10 +47,10 @@ pub const BlockIo = extern struct { |
| 48 | 47 | pub fn readBlocks(self: *Self, media_id: u32, lba: u64, buf: []u8) ReadBlocksError!void { |
| 49 | 48 | switch (self._read_blocks(self, media_id, lba, buf.len, buf.ptr)) { |
| 50 | 49 | .success => {}, |
| 51 | .device_error => return Error.DeviceError, | |
| 52 | .no_media => return Error.NoMedia, | |
| 53 | .bad_buffer_size => return Error.BadBufferSize, | |
| 54 | .invalid_parameter => return Error.InvalidParameter, | |
| 50 | .device_error => return error.DeviceError, | |
| 51 | .no_media => return error.NoMedia, | |
| 52 | .bad_buffer_size => return error.BadBufferSize, | |
| 53 | .invalid_parameter => return error.InvalidParameter, | |
| 55 | 54 | else => |status| return uefi.unexpectedStatus(status), |
| 56 | 55 | } |
| 57 | 56 | } |
| ... | ... | @@ -60,12 +59,12 @@ pub const BlockIo = extern struct { |
| 60 | 59 | pub fn writeBlocks(self: *Self, media_id: u32, lba: u64, buf: []const u8) WriteBlocksError!void { |
| 61 | 60 | switch (self._write_blocks(self, media_id, lba, buf.len, buf.ptr)) { |
| 62 | 61 | .success => {}, |
| 63 | .write_protected => return Error.WriteProtected, | |
| 64 | .no_media => return Error.NoMedia, | |
| 65 | .media_changed => return Error.MediaChanged, | |
| 66 | .device_error => return Error.DeviceError, | |
| 67 | .bad_buffer_size => return Error.BadBufferSize, | |
| 68 | .invalid_parameter => return Error.InvalidParameter, | |
| 62 | .write_protected => return error.WriteProtected, | |
| 63 | .no_media => return error.NoMedia, | |
| 64 | .media_changed => return error.MediaChanged, | |
| 65 | .device_error => return error.DeviceError, | |
| 66 | .bad_buffer_size => return error.BadBufferSize, | |
| 67 | .invalid_parameter => return error.InvalidParameter, | |
| 69 | 68 | else => |status| return uefi.unexpectedStatus(status), |
| 70 | 69 | } |
| 71 | 70 | } |
| ... | ... | @@ -74,8 +73,8 @@ pub const BlockIo = extern struct { |
| 74 | 73 | pub fn flushBlocks(self: *Self) FlushBlocksError!void { |
| 75 | 74 | switch (self._flush_blocks(self)) { |
| 76 | 75 | .success => {}, |
| 77 | .device_error => return Error.DeviceError, | |
| 78 | .no_media => return Error.NoMedia, | |
| 76 | .device_error => return error.DeviceError, | |
| 77 | .no_media => return error.NoMedia, | |
| 79 | 78 | else => |status| return uefi.unexpectedStatus(status), |
| 80 | 79 | } |
| 81 | 80 | } |
lib/std/os/uefi/protocol/edid.zig+1-2| ... | ... | @@ -4,7 +4,6 @@ const Guid = uefi.Guid; |
| 4 | 4 | const Handle = uefi.Handle; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// EDID information for an active video output device |
| 10 | 9 | pub const Active = extern struct { |
| ... | ... | @@ -51,7 +50,7 @@ pub const Override = extern struct { |
| 51 | 50 | var attributes: Attributes = undefined; |
| 52 | 51 | switch (self._get_edid(self, &handle, &attributes, &size, &ptr)) { |
| 53 | 52 | .success => {}, |
| 54 | .unsupported => return Error.Unsupported, | |
| 53 | .unsupported => return error.Unsupported, | |
| 55 | 54 | else => |status| return uefi.unexpectedStatus(status), |
| 56 | 55 | } |
| 57 | 56 |
lib/std/os/uefi/protocol/file.zig+47-48| ... | ... | @@ -4,7 +4,6 @@ const Guid = uefi.Guid; |
| 4 | 4 | const Time = uefi.Time; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | pub const File = extern struct { |
| 10 | 9 | revision: u64, |
| ... | ... | @@ -93,16 +92,16 @@ pub const File = extern struct { |
| 93 | 92 | create_attributes, |
| 94 | 93 | )) { |
| 95 | 94 | .success => return new, |
| 96 | .not_found => return Error.NotFound, | |
| 97 | .no_media => return Error.NoMedia, | |
| 98 | .media_changed => return Error.MediaChanged, | |
| 99 | .device_error => return Error.DeviceError, | |
| 100 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 101 | .write_protected => return Error.WriteProtected, | |
| 102 | .access_denied => return Error.AccessDenied, | |
| 103 | .out_of_resources => return Error.OutOfResources, | |
| 104 | .volume_full => return Error.VolumeFull, | |
| 105 | .invalid_parameter => return Error.InvalidParameter, | |
| 95 | .not_found => return error.NotFound, | |
| 96 | .no_media => return error.NoMedia, | |
| 97 | .media_changed => return error.MediaChanged, | |
| 98 | .device_error => return error.DeviceError, | |
| 99 | .volume_corrupted => return error.VolumeCorrupted, | |
| 100 | .write_protected => return error.WriteProtected, | |
| 101 | .access_denied => return error.AccessDenied, | |
| 102 | .out_of_resources => return error.OutOfResources, | |
| 103 | .volume_full => return error.VolumeFull, | |
| 104 | .invalid_parameter => return error.InvalidParameter, | |
| 106 | 105 | else => |status| return uefi.unexpectedStatus(status), |
| 107 | 106 | } |
| 108 | 107 | } |
| ... | ... | @@ -130,10 +129,10 @@ pub const File = extern struct { |
| 130 | 129 | var size: usize = buffer.len; |
| 131 | 130 | switch (self._read(self, &size, buffer.ptr)) { |
| 132 | 131 | .success => return size, |
| 133 | .no_media => return Error.NoMedia, | |
| 134 | .device_error => return Error.DeviceError, | |
| 135 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 136 | .buffer_too_small => return Error.BufferTooSmall, | |
| 132 | .no_media => return error.NoMedia, | |
| 133 | .device_error => return error.DeviceError, | |
| 134 | .volume_corrupted => return error.VolumeCorrupted, | |
| 135 | .buffer_too_small => return error.BufferTooSmall, | |
| 137 | 136 | else => |status| return uefi.unexpectedStatus(status), |
| 138 | 137 | } |
| 139 | 138 | } |
| ... | ... | @@ -142,13 +141,13 @@ pub const File = extern struct { |
| 142 | 141 | var size: usize = buffer.len; |
| 143 | 142 | switch (self._write(self, &size, buffer.ptr)) { |
| 144 | 143 | .success => return size, |
| 145 | .unsupported => return Error.Unsupported, | |
| 146 | .no_media => return Error.NoMedia, | |
| 147 | .device_error => return Error.DeviceError, | |
| 148 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 149 | .write_protected => return Error.WriteProtected, | |
| 150 | .access_denied => return Error.AccessDenied, | |
| 151 | .volume_full => return Error.VolumeFull, | |
| 144 | .unsupported => return error.Unsupported, | |
| 145 | .no_media => return error.NoMedia, | |
| 146 | .device_error => return error.DeviceError, | |
| 147 | .volume_corrupted => return error.VolumeCorrupted, | |
| 148 | .write_protected => return error.WriteProtected, | |
| 149 | .access_denied => return error.AccessDenied, | |
| 150 | .volume_full => return error.VolumeFull, | |
| 152 | 151 | else => |status| return uefi.unexpectedStatus(status), |
| 153 | 152 | } |
| 154 | 153 | } |
| ... | ... | @@ -157,8 +156,8 @@ pub const File = extern struct { |
| 157 | 156 | var position: u64 = undefined; |
| 158 | 157 | switch (self._get_position(self, &position)) { |
| 159 | 158 | .success => return position, |
| 160 | .unsupported => return Error.Unsupported, | |
| 161 | .device_error => return Error.DeviceError, | |
| 159 | .unsupported => return error.Unsupported, | |
| 160 | .device_error => return error.DeviceError, | |
| 162 | 161 | else => |status| return uefi.unexpectedStatus(status), |
| 163 | 162 | } |
| 164 | 163 | } |
| ... | ... | @@ -166,8 +165,8 @@ pub const File = extern struct { |
| 166 | 165 | pub fn setPosition(self: *File, position: u64) SeekError!void { |
| 167 | 166 | switch (self._set_position(self, position)) { |
| 168 | 167 | .success => {}, |
| 169 | .unsupported => return Error.Unsupported, | |
| 170 | .device_error => return Error.DeviceError, | |
| 168 | .unsupported => return error.Unsupported, | |
| 169 | .device_error => return error.DeviceError, | |
| 171 | 170 | else => |status| return uefi.unexpectedStatus(status), |
| 172 | 171 | } |
| 173 | 172 | } |
| ... | ... | @@ -190,10 +189,10 @@ pub const File = extern struct { |
| 190 | 189 | var len: usize = 0; |
| 191 | 190 | switch (self._get_info(self, &InfoType.guid, &len, null)) { |
| 192 | 191 | .success, .buffer_too_small => return len, |
| 193 | .unsupported => return Error.Unsupported, | |
| 194 | .no_media => return Error.NoMedia, | |
| 195 | .device_error => return Error.DeviceError, | |
| 196 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 192 | .unsupported => return error.Unsupported, | |
| 193 | .no_media => return error.NoMedia, | |
| 194 | .device_error => return error.DeviceError, | |
| 195 | .volume_corrupted => return error.VolumeCorrupted, | |
| 197 | 196 | else => |status| return uefi.unexpectedStatus(status), |
| 198 | 197 | } |
| 199 | 198 | } |
| ... | ... | @@ -216,11 +215,11 @@ pub const File = extern struct { |
| 216 | 215 | buffer.ptr, |
| 217 | 216 | )) { |
| 218 | 217 | .success => return @as(*InfoType, @ptrCast(buffer.ptr)), |
| 219 | .buffer_too_small => return Error.BufferTooSmall, | |
| 220 | .unsupported => return Error.Unsupported, | |
| 221 | .no_media => return Error.NoMedia, | |
| 222 | .device_error => return Error.DeviceError, | |
| 223 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 218 | .buffer_too_small => return error.BufferTooSmall, | |
| 219 | .unsupported => return error.Unsupported, | |
| 220 | .no_media => return error.NoMedia, | |
| 221 | .device_error => return error.DeviceError, | |
| 222 | .volume_corrupted => return error.VolumeCorrupted, | |
| 224 | 223 | else => |status| return uefi.unexpectedStatus(status), |
| 225 | 224 | } |
| 226 | 225 | } |
| ... | ... | @@ -244,14 +243,14 @@ pub const File = extern struct { |
| 244 | 243 | |
| 245 | 244 | switch (self._set_info(self, &InfoType.guid, len, @ptrCast(data))) { |
| 246 | 245 | .success => {}, |
| 247 | .unsupported => return Error.Unsupported, | |
| 248 | .no_media => return Error.NoMedia, | |
| 249 | .device_error => return Error.DeviceError, | |
| 250 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 251 | .write_protected => return Error.WriteProtected, | |
| 252 | .access_denied => return Error.AccessDenied, | |
| 253 | .volume_full => return Error.VolumeFull, | |
| 254 | .bad_buffer_size => return Error.BadBufferSize, | |
| 246 | .unsupported => return error.Unsupported, | |
| 247 | .no_media => return error.NoMedia, | |
| 248 | .device_error => return error.DeviceError, | |
| 249 | .volume_corrupted => return error.VolumeCorrupted, | |
| 250 | .write_protected => return error.WriteProtected, | |
| 251 | .access_denied => return error.AccessDenied, | |
| 252 | .volume_full => return error.VolumeFull, | |
| 253 | .bad_buffer_size => return error.BadBufferSize, | |
| 255 | 254 | else => |status| return uefi.unexpectedStatus(status), |
| 256 | 255 | } |
| 257 | 256 | } |
| ... | ... | @@ -259,11 +258,11 @@ pub const File = extern struct { |
| 259 | 258 | pub fn flush(self: *File) FlushError!void { |
| 260 | 259 | switch (self._flush(self)) { |
| 261 | 260 | .success => {}, |
| 262 | .device_error => return Error.DeviceError, | |
| 263 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 264 | .write_protected => return Error.WriteProtected, | |
| 265 | .access_denied => return Error.AccessDenied, | |
| 266 | .volume_full => return Error.VolumeFull, | |
| 261 | .device_error => return error.DeviceError, | |
| 262 | .volume_corrupted => return error.VolumeCorrupted, | |
| 263 | .write_protected => return error.WriteProtected, | |
| 264 | .access_denied => return error.AccessDenied, | |
| 265 | .volume_full => return error.VolumeFull, | |
| 267 | 266 | else => |status| return uefi.unexpectedStatus(status), |
| 268 | 267 | } |
| 269 | 268 | } |
lib/std/os/uefi/protocol/graphics_output.zig+6-7| ... | ... | @@ -3,7 +3,6 @@ const uefi = std.os.uefi; |
| 3 | 3 | const Guid = uefi.Guid; |
| 4 | 4 | const Status = uefi.Status; |
| 5 | 5 | const cc = uefi.cc; |
| 6 | const Error = Status.Error; | |
| 7 | 6 | |
| 8 | 7 | pub const GraphicsOutput = extern struct { |
| 9 | 8 | _query_mode: *const fn (*const GraphicsOutput, u32, *usize, **Mode.Info) callconv(cc) Status, |
| ... | ... | @@ -30,8 +29,8 @@ pub const GraphicsOutput = extern struct { |
| 30 | 29 | var info: *Mode.Info = undefined; |
| 31 | 30 | switch (self._query_mode(self, mode_id, &size_of_info, &info)) { |
| 32 | 31 | .success => return info, |
| 33 | .device_error => return Error.DeviceError, | |
| 34 | .invalid_parameter => return Error.InvalidParameter, | |
| 32 | .device_error => return error.DeviceError, | |
| 33 | .invalid_parameter => return error.InvalidParameter, | |
| 35 | 34 | else => |status| return uefi.unexpectedStatus(status), |
| 36 | 35 | } |
| 37 | 36 | } |
| ... | ... | @@ -40,8 +39,8 @@ pub const GraphicsOutput = extern struct { |
| 40 | 39 | pub fn setMode(self: *GraphicsOutput, mode_id: u32) SetModeError!void { |
| 41 | 40 | switch (self._set_mode(self, mode_id)) { |
| 42 | 41 | .success => {}, |
| 43 | .device_error => return Error.DeviceError, | |
| 44 | .unsupported => return Error.Unsupported, | |
| 42 | .device_error => return error.DeviceError, | |
| 43 | .unsupported => return error.Unsupported, | |
| 45 | 44 | else => |status| return uefi.unexpectedStatus(status), |
| 46 | 45 | } |
| 47 | 46 | } |
| ... | ... | @@ -72,8 +71,8 @@ pub const GraphicsOutput = extern struct { |
| 72 | 71 | delta, |
| 73 | 72 | )) { |
| 74 | 73 | .success => {}, |
| 75 | .device_error => return Error.DeviceError, | |
| 76 | .invalid_parameter => return Error.InvalidParameter, | |
| 74 | .device_error => return error.DeviceError, | |
| 75 | .invalid_parameter => return error.InvalidParameter, | |
| 77 | 76 | else => |status| return uefi.unexpectedStatus(status), |
| 78 | 77 | } |
| 79 | 78 | } |
lib/std/os/uefi/protocol/hii_database.zig+11-12| ... | ... | @@ -4,7 +4,6 @@ const Guid = uefi.Guid; |
| 4 | 4 | const Status = uefi.Status; |
| 5 | 5 | const hii = uefi.hii; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// Database manager for HII-related data structures. |
| 10 | 9 | pub const HiiDatabase = extern struct { |
| ... | ... | @@ -38,10 +37,10 @@ pub const HiiDatabase = extern struct { |
| 38 | 37 | }; |
| 39 | 38 | |
| 40 | 39 | /// Removes a package list from the HII database. |
| 41 | pub fn removePackageList(self: *HiiDatabase, handle: hii.Handle) !void { | |
| 40 | pub fn removePackageList(self: *HiiDatabase, handle: hii.Handle) RemovePackageListError!void { | |
| 42 | 41 | switch (self._remove_package_list(self, handle)) { |
| 43 | 42 | .success => {}, |
| 44 | .not_found => return Error.NotFound, | |
| 43 | .not_found => return error.NotFound, | |
| 45 | 44 | else => |status| return uefi.unexpectedStatus(status), |
| 46 | 45 | } |
| 47 | 46 | } |
| ... | ... | @@ -54,9 +53,9 @@ pub const HiiDatabase = extern struct { |
| 54 | 53 | ) UpdatePackageListError!void { |
| 55 | 54 | switch (self._update_package_list(self, handle, buffer)) { |
| 56 | 55 | .success => {}, |
| 57 | .out_of_resources => return Error.OutOfResources, | |
| 58 | .invalid_parameter => return Error.InvalidParameter, | |
| 59 | .not_found => return Error.NotFound, | |
| 56 | .out_of_resources => return error.OutOfResources, | |
| 57 | .invalid_parameter => return error.InvalidParameter, | |
| 58 | .not_found => return error.NotFound, | |
| 60 | 59 | else => |status| return uefi.unexpectedStatus(status), |
| 61 | 60 | } |
| 62 | 61 | } |
| ... | ... | @@ -77,9 +76,9 @@ pub const HiiDatabase = extern struct { |
| 77 | 76 | handles.ptr, |
| 78 | 77 | )) { |
| 79 | 78 | .success => return handles[0..len], |
| 80 | .buffer_too_small => return Error.BufferTooSmall, | |
| 81 | .invalid_parameter => return Error.InvalidParameter, | |
| 82 | .not_found => return Error.NotFound, | |
| 79 | .buffer_too_small => return error.BufferTooSmall, | |
| 80 | .invalid_parameter => return error.InvalidParameter, | |
| 81 | .not_found => return error.NotFound, | |
| 83 | 82 | else => |status| return uefi.unexpectedStatus(status), |
| 84 | 83 | } |
| 85 | 84 | } |
| ... | ... | @@ -93,9 +92,9 @@ pub const HiiDatabase = extern struct { |
| 93 | 92 | var len = buffer.len; |
| 94 | 93 | switch (self._export_package_lists(self, handle, &len, buffer.ptr)) { |
| 95 | 94 | .success => return buffer[0..len], |
| 96 | .buffer_too_small => return Error.BufferTooSmall, | |
| 97 | .invalid_parameter => return Error.InvalidParameter, | |
| 98 | .not_found => return Error.NotFound, | |
| 95 | .buffer_too_small => return error.BufferTooSmall, | |
| 96 | .invalid_parameter => return error.InvalidParameter, | |
| 97 | .not_found => return error.NotFound, | |
| 99 | 98 | else => |status| return uefi.unexpectedStatus(status), |
| 100 | 99 | } |
| 101 | 100 | } |
lib/std/os/uefi/protocol/hii_popup.zig+2-3| ... | ... | @@ -4,7 +4,6 @@ const Guid = uefi.Guid; |
| 4 | 4 | const Status = uefi.Status; |
| 5 | 5 | const hii = uefi.hii; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// Display a popup window |
| 10 | 9 | pub const HiiPopup = extern struct { |
| ... | ... | @@ -27,8 +26,8 @@ pub const HiiPopup = extern struct { |
| 27 | 26 | var res: PopupSelection = undefined; |
| 28 | 27 | switch (self._create_popup(self, style, popup_type, handle, msg, &res)) { |
| 29 | 28 | .success => return res, |
| 30 | .invalid_parameter => return Error.InvalidParameter, | |
| 31 | .out_of_resources => return Error.OutOfResources, | |
| 29 | .invalid_parameter => return error.InvalidParameter, | |
| 30 | .out_of_resources => return error.OutOfResources, | |
| 32 | 31 | else => |status| return uefi.unexpectedStatus(status), |
| 33 | 32 | } |
| 34 | 33 | } |
lib/std/os/uefi/protocol/ip6.zig+65-66| ... | ... | @@ -7,7 +7,6 @@ const MacAddress = uefi.MacAddress; |
| 7 | 7 | const ManagedNetworkConfigData = uefi.protocol.ManagedNetwork.Config; |
| 8 | 8 | const SimpleNetwork = uefi.protocol.SimpleNetwork; |
| 9 | 9 | const cc = uefi.cc; |
| 10 | const Error = Status.Error; | |
| 11 | 10 | |
| 12 | 11 | pub const Ip6 = extern struct { |
| 13 | 12 | _get_mode_data: *const fn (*const Ip6, ?*Mode, ?*ManagedNetworkConfigData, ?*SimpleNetwork) callconv(cc) Status, |
| ... | ... | @@ -102,8 +101,8 @@ pub const Ip6 = extern struct { |
| 102 | 101 | var data: ModeData = undefined; |
| 103 | 102 | switch (self._get_mode_data(self, &data.ip6_mode, &data.mnp_config, &data.snp_mode)) { |
| 104 | 103 | .success => return data, |
| 105 | .invalid_parameter => return Error.InvalidParameter, | |
| 106 | .out_of_resources => return Error.OutOfResources, | |
| 104 | .invalid_parameter => return error.InvalidParameter, | |
| 105 | .out_of_resources => return error.OutOfResources, | |
| 107 | 106 | else => |status| return uefi.unexpectedStatus(status), |
| 108 | 107 | } |
| 109 | 108 | } |
| ... | ... | @@ -114,12 +113,12 @@ pub const Ip6 = extern struct { |
| 114 | 113 | pub fn configure(self: *Ip6, ip6_config_data: *const Config) ConfigureError!void { |
| 115 | 114 | switch (self._configure(self, ip6_config_data)) { |
| 116 | 115 | .success => {}, |
| 117 | .invalid_parameter => return Error.InvalidParameter, | |
| 118 | .out_of_resources => return Error.OutOfResources, | |
| 119 | .no_mapping => return Error.NoMapping, | |
| 120 | .already_started => return Error.AlreadyStarted, | |
| 121 | .device_error => return Error.DeviceError, | |
| 122 | .unsupported => return Error.Unsupported, | |
| 116 | .invalid_parameter => return error.InvalidParameter, | |
| 117 | .out_of_resources => return error.OutOfResources, | |
| 118 | .no_mapping => return error.NoMapping, | |
| 119 | .already_started => return error.AlreadyStarted, | |
| 120 | .device_error => return error.DeviceError, | |
| 121 | .unsupported => return error.Unsupported, | |
| 123 | 122 | else => |status| return uefi.unexpectedStatus(status), |
| 124 | 123 | } |
| 125 | 124 | } |
| ... | ... | @@ -127,12 +126,12 @@ pub const Ip6 = extern struct { |
| 127 | 126 | pub fn disable(self: *Ip6) ConfigureError!void { |
| 128 | 127 | switch (self._configure(self, null)) { |
| 129 | 128 | .success => {}, |
| 130 | .invalid_parameter => return Error.InvalidParameter, | |
| 131 | .out_of_resources => return Error.OutOfResources, | |
| 132 | .no_mapping => return Error.NoMapping, | |
| 133 | .already_started => return Error.AlreadyStarted, | |
| 134 | .device_error => return Error.DeviceError, | |
| 135 | .unsupported => return Error.Unsupported, | |
| 129 | .invalid_parameter => return error.InvalidParameter, | |
| 130 | .out_of_resources => return error.OutOfResources, | |
| 131 | .no_mapping => return error.NoMapping, | |
| 132 | .already_started => return error.AlreadyStarted, | |
| 133 | .device_error => return error.DeviceError, | |
| 134 | .unsupported => return error.Unsupported, | |
| 136 | 135 | else => |status| return uefi.unexpectedStatus(status), |
| 137 | 136 | } |
| 138 | 137 | } |
| ... | ... | @@ -140,13 +139,13 @@ pub const Ip6 = extern struct { |
| 140 | 139 | pub fn leaveAllGroups(self: *Ip6) GroupsError!void { |
| 141 | 140 | switch (self._groups(self, false, null)) { |
| 142 | 141 | .success => {}, |
| 143 | .invalid_parameter => return Error.InvalidParameter, | |
| 144 | .not_started => return Error.NotStarted, | |
| 145 | .out_of_resources => return Error.OutOfResources, | |
| 146 | .unsupported => return Error.Unsupported, | |
| 147 | .already_started => return Error.AlreadyStarted, | |
| 148 | .not_found => return Error.NotFound, | |
| 149 | .device_error => return Error.DeviceError, | |
| 142 | .invalid_parameter => return error.InvalidParameter, | |
| 143 | .not_started => return error.NotStarted, | |
| 144 | .out_of_resources => return error.OutOfResources, | |
| 145 | .unsupported => return error.Unsupported, | |
| 146 | .already_started => return error.AlreadyStarted, | |
| 147 | .not_found => return error.NotFound, | |
| 148 | .device_error => return error.DeviceError, | |
| 150 | 149 | else => |status| return uefi.unexpectedStatus(status), |
| 151 | 150 | } |
| 152 | 151 | } |
| ... | ... | @@ -166,13 +165,13 @@ pub const Ip6 = extern struct { |
| 166 | 165 | group_address, |
| 167 | 166 | )) { |
| 168 | 167 | .success => {}, |
| 169 | .invalid_parameter => return Error.InvalidParameter, | |
| 170 | .not_started => return Error.NotStarted, | |
| 171 | .out_of_resources => return Error.OutOfResources, | |
| 172 | .unsupported => return Error.Unsupported, | |
| 173 | .already_started => return Error.AlreadyStarted, | |
| 174 | .not_found => return Error.NotFound, | |
| 175 | .device_error => return Error.DeviceError, | |
| 168 | .invalid_parameter => return error.InvalidParameter, | |
| 169 | .not_started => return error.NotStarted, | |
| 170 | .out_of_resources => return error.OutOfResources, | |
| 171 | .unsupported => return error.Unsupported, | |
| 172 | .already_started => return error.AlreadyStarted, | |
| 173 | .not_found => return error.NotFound, | |
| 174 | .device_error => return error.DeviceError, | |
| 176 | 175 | else => |status| return uefi.unexpectedStatus(status), |
| 177 | 176 | } |
| 178 | 177 | } |
| ... | ... | @@ -193,11 +192,11 @@ pub const Ip6 = extern struct { |
| 193 | 192 | gateway_address, |
| 194 | 193 | )) { |
| 195 | 194 | .success => {}, |
| 196 | .not_started => return Error.NotStarted, | |
| 197 | .invalid_parameter => return Error.InvalidParameter, | |
| 198 | .out_of_resources => return Error.OutOfResources, | |
| 199 | .not_found => return Error.NotFound, | |
| 200 | .access_denied => return Error.AccessDenied, | |
| 195 | .not_started => return error.NotStarted, | |
| 196 | .invalid_parameter => return error.InvalidParameter, | |
| 197 | .out_of_resources => return error.OutOfResources, | |
| 198 | .not_found => return error.NotFound, | |
| 199 | .access_denied => return error.AccessDenied, | |
| 201 | 200 | else => |status| return uefi.unexpectedStatus(status), |
| 202 | 201 | } |
| 203 | 202 | } |
| ... | ... | @@ -222,11 +221,11 @@ pub const Ip6 = extern struct { |
| 222 | 221 | override, |
| 223 | 222 | )) { |
| 224 | 223 | .success => {}, |
| 225 | .not_started => return Error.NotStarted, | |
| 226 | .invalid_parameter => return Error.InvalidParameter, | |
| 227 | .out_of_resources => return Error.OutOfResources, | |
| 228 | .not_found => return Error.NotFound, | |
| 229 | .access_denied => return Error.AccessDenied, | |
| 224 | .not_started => return error.NotStarted, | |
| 225 | .invalid_parameter => return error.InvalidParameter, | |
| 226 | .out_of_resources => return error.OutOfResources, | |
| 227 | .not_found => return error.NotFound, | |
| 228 | .access_denied => return error.AccessDenied, | |
| 230 | 229 | else => |status| return uefi.unexpectedStatus(status), |
| 231 | 230 | } |
| 232 | 231 | } |
| ... | ... | @@ -235,17 +234,17 @@ pub const Ip6 = extern struct { |
| 235 | 234 | pub fn transmit(self: *Ip6, token: *CompletionToken) TransmitError!void { |
| 236 | 235 | switch (self._transmit(self, token)) { |
| 237 | 236 | .success => {}, |
| 238 | .not_started => return Error.NotStarted, | |
| 239 | .no_mapping => return Error.NoMapping, | |
| 240 | .invalid_parameter => return Error.InvalidParameter, | |
| 241 | .access_denied => return Error.AccessDenied, | |
| 242 | .not_ready => return Error.NotReady, | |
| 243 | .not_found => return Error.NotFound, | |
| 244 | .out_of_resources => return Error.OutOfResources, | |
| 245 | .buffer_too_small => return Error.BufferTooSmall, | |
| 246 | .bad_buffer_size => return Error.BadBufferSize, | |
| 247 | .device_error => return Error.DeviceError, | |
| 248 | .no_media => return Error.NoMedia, | |
| 237 | .not_started => return error.NotStarted, | |
| 238 | .no_mapping => return error.NoMapping, | |
| 239 | .invalid_parameter => return error.InvalidParameter, | |
| 240 | .access_denied => return error.AccessDenied, | |
| 241 | .not_ready => return error.NotReady, | |
| 242 | .not_found => return error.NotFound, | |
| 243 | .out_of_resources => return error.OutOfResources, | |
| 244 | .buffer_too_small => return error.BufferTooSmall, | |
| 245 | .bad_buffer_size => return error.BadBufferSize, | |
| 246 | .device_error => return error.DeviceError, | |
| 247 | .no_media => return error.NoMedia, | |
| 249 | 248 | else => |status| return uefi.unexpectedStatus(status), |
| 250 | 249 | } |
| 251 | 250 | } |
| ... | ... | @@ -254,14 +253,14 @@ pub const Ip6 = extern struct { |
| 254 | 253 | pub fn receive(self: *Ip6, token: *CompletionToken) ReceiveError!void { |
| 255 | 254 | switch (self._receive(self, token)) { |
| 256 | 255 | .success => {}, |
| 257 | .not_started => return Error.NotStarted, | |
| 258 | .no_mapping => return Error.NoMapping, | |
| 259 | .invalid_parameter => return Error.InvalidParameter, | |
| 260 | .out_of_resources => return Error.OutOfResources, | |
| 261 | .device_error => return Error.DeviceError, | |
| 262 | .access_denied => return Error.AccessDenied, | |
| 263 | .not_ready => return Error.NotReady, | |
| 264 | .no_media => return Error.NoMedia, | |
| 256 | .not_started => return error.NotStarted, | |
| 257 | .no_mapping => return error.NoMapping, | |
| 258 | .invalid_parameter => return error.InvalidParameter, | |
| 259 | .out_of_resources => return error.OutOfResources, | |
| 260 | .device_error => return error.DeviceError, | |
| 261 | .access_denied => return error.AccessDenied, | |
| 262 | .not_ready => return error.NotReady, | |
| 263 | .no_media => return error.NoMedia, | |
| 265 | 264 | else => |status| return uefi.unexpectedStatus(status), |
| 266 | 265 | } |
| 267 | 266 | } |
| ... | ... | @@ -270,10 +269,10 @@ pub const Ip6 = extern struct { |
| 270 | 269 | pub fn cancel(self: *Ip6, token: ?*CompletionToken) CancelError!void { |
| 271 | 270 | switch (self._cancel(self, token)) { |
| 272 | 271 | .success => {}, |
| 273 | .invalid_parameter => return Error.InvalidParameter, | |
| 274 | .not_started => return Error.NotStarted, | |
| 275 | .not_found => return Error.NotFound, | |
| 276 | .device_error => return Error.DeviceError, | |
| 272 | .invalid_parameter => return error.InvalidParameter, | |
| 273 | .not_started => return error.NotStarted, | |
| 274 | .not_found => return error.NotFound, | |
| 275 | .device_error => return error.DeviceError, | |
| 277 | 276 | else => |status| return uefi.unexpectedStatus(status), |
| 278 | 277 | } |
| 279 | 278 | } |
| ... | ... | @@ -285,10 +284,10 @@ pub const Ip6 = extern struct { |
| 285 | 284 | switch (self._poll(self)) { |
| 286 | 285 | .success => return true, |
| 287 | 286 | .not_ready => return false, |
| 288 | .not_started => return Error.NotStarted, | |
| 289 | .invalid_parameter => return Error.InvalidParameter, | |
| 290 | .device_error => return Error.DeviceError, | |
| 291 | .timeout => return Error.Timeout, | |
| 287 | .not_started => return error.NotStarted, | |
| 288 | .invalid_parameter => return error.InvalidParameter, | |
| 289 | .device_error => return error.DeviceError, | |
| 290 | .timeout => return error.Timeout, | |
| 292 | 291 | else => |status| return uefi.unexpectedStatus(status), |
| 293 | 292 | } |
| 294 | 293 | } |
lib/std/os/uefi/protocol/ip6_config.zig+18-19| ... | ... | @@ -4,7 +4,6 @@ const Guid = uefi.Guid; |
| 4 | 4 | const Event = uefi.Event; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | const MacAddress = uefi.MacAddress; |
| 9 | 8 | const Ip6 = uefi.protocol.Ip6; |
| 10 | 9 | |
| ... | ... | @@ -49,14 +48,14 @@ pub const Ip6Config = extern struct { |
| 49 | 48 | const data_size = @sizeOf(@TypeOf(payload)); |
| 50 | 49 | switch (self._set_data(self, data_type, data_size, @ptrCast(payload))) { |
| 51 | 50 | .success => {}, |
| 52 | .invalid_parameter => return Error.InvalidParameter, | |
| 53 | .write_protected => return Error.WriteProtected, | |
| 54 | .access_denied => return Error.AccessDenied, | |
| 55 | .not_ready => return Error.NotReady, | |
| 56 | .bad_buffer_size => return Error.BadBufferSize, | |
| 57 | .unsupported => return Error.Unsupported, | |
| 58 | .out_of_resources => return Error.OutOfResources, | |
| 59 | .device_error => return Error.DeviceError, | |
| 51 | .invalid_parameter => return error.InvalidParameter, | |
| 52 | .write_protected => return error.WriteProtected, | |
| 53 | .access_denied => return error.AccessDenied, | |
| 54 | .not_ready => return error.NotReady, | |
| 55 | .bad_buffer_size => return error.BadBufferSize, | |
| 56 | .unsupported => return error.Unsupported, | |
| 57 | .out_of_resources => return error.OutOfResources, | |
| 58 | .device_error => return error.DeviceError, | |
| 60 | 59 | else => |status| return uefi.unexpectedStatus(status), |
| 61 | 60 | } |
| 62 | 61 | } |
| ... | ... | @@ -72,10 +71,10 @@ pub const Ip6Config = extern struct { |
| 72 | 71 | |
| 73 | 72 | switch (self._get_data(self, data_type, &payload_size, @ptrCast(&payload))) { |
| 74 | 73 | .success => return payload, |
| 75 | .invalid_parameter => return Error.InvalidParameter, | |
| 76 | .buffer_too_small => return Error.BufferTooSmall, | |
| 77 | .not_ready => return Error.NotReady, | |
| 78 | .not_found => return Error.NotFound, | |
| 74 | .invalid_parameter => return error.InvalidParameter, | |
| 75 | .buffer_too_small => return error.BufferTooSmall, | |
| 76 | .not_ready => return error.NotReady, | |
| 77 | .not_found => return error.NotFound, | |
| 79 | 78 | else => |status| return uefi.unexpectedStatus(status), |
| 80 | 79 | } |
| 81 | 80 | } |
| ... | ... | @@ -87,10 +86,10 @@ pub const Ip6Config = extern struct { |
| 87 | 86 | ) RegisterDataNotifyError!void { |
| 88 | 87 | switch (self._register_data_notify(self, data_type, event)) { |
| 89 | 88 | .success => {}, |
| 90 | .invalid_parameter => return Error.InvalidParameter, | |
| 91 | .unsupported => return Error.Unsupported, | |
| 92 | .out_of_resources => return Error.OutOfResources, | |
| 93 | .access_denied => return Error.AccessDenied, | |
| 89 | .invalid_parameter => return error.InvalidParameter, | |
| 90 | .unsupported => return error.Unsupported, | |
| 91 | .out_of_resources => return error.OutOfResources, | |
| 92 | .access_denied => return error.AccessDenied, | |
| 94 | 93 | else => |status| return uefi.unexpectedStatus(status), |
| 95 | 94 | } |
| 96 | 95 | } |
| ... | ... | @@ -102,8 +101,8 @@ pub const Ip6Config = extern struct { |
| 102 | 101 | ) UnregisterDataNotifyError!void { |
| 103 | 102 | switch (self._unregister_data_notify(self, data_type, event)) { |
| 104 | 103 | .success => {}, |
| 105 | .invalid_parameter => return Error.InvalidParameter, | |
| 106 | .not_found => return Error.NotFound, | |
| 104 | .invalid_parameter => return error.InvalidParameter, | |
| 105 | .not_found => return error.NotFound, | |
| 107 | 106 | else => |status| return uefi.unexpectedStatus(status), |
| 108 | 107 | } |
| 109 | 108 | } |
lib/std/os/uefi/protocol/loaded_image.zig+1-2| ... | ... | @@ -7,7 +7,6 @@ const SystemTable = uefi.tables.SystemTable; |
| 7 | 7 | const MemoryType = uefi.tables.MemoryType; |
| 8 | 8 | const DevicePath = uefi.protocol.DevicePath; |
| 9 | 9 | const cc = uefi.cc; |
| 10 | const Error = Status.Error; | |
| 11 | 10 | |
| 12 | 11 | pub const LoadedImage = extern struct { |
| 13 | 12 | revision: u32, |
| ... | ... | @@ -30,7 +29,7 @@ pub const LoadedImage = extern struct { |
| 30 | 29 | pub fn unload(self: *LoadedImage, handle: Handle) UnloadError!void { |
| 31 | 30 | switch (self._unload(self, handle)) { |
| 32 | 31 | .success => {}, |
| 33 | .invalid_parameter => return Error.InvalidParameter, | |
| 32 | .invalid_parameter => return error.InvalidParameter, | |
| 34 | 33 | else => |status| return uefi.unexpectedStatus(status), |
| 35 | 34 | } |
| 36 | 35 | } |
lib/std/os/uefi/protocol/managed_network.zig+21-21| ... | ... | @@ -141,13 +141,13 @@ pub const ManagedNetwork = extern struct { |
| 141 | 141 | pub fn transmit(self: *ManagedNetwork, token: *CompletionToken) TransmitError!void { |
| 142 | 142 | switch (self._transmit(self, token)) { |
| 143 | 143 | .success => {}, |
| 144 | .not_started => return Error.NotStarted, | |
| 145 | .invalid_parameter => return Error.InvalidParameter, | |
| 146 | .access_denied => return Error.AccessDenied, | |
| 147 | .out_of_resources => return Error.OutOfResources, | |
| 148 | .device_error => return Error.DeviceError, | |
| 149 | .not_ready => return Error.NotReady, | |
| 150 | .no_media => return Error.NoMedia, | |
| 144 | .not_started => return error.NotStarted, | |
| 145 | .invalid_parameter => return error.InvalidParameter, | |
| 146 | .access_denied => return error.AccessDenied, | |
| 147 | .out_of_resources => return error.OutOfResources, | |
| 148 | .device_error => return error.DeviceError, | |
| 149 | .not_ready => return error.NotReady, | |
| 150 | .no_media => return error.NoMedia, | |
| 151 | 151 | else => |status| return uefi.unexpectedStatus(status), |
| 152 | 152 | } |
| 153 | 153 | } |
| ... | ... | @@ -156,13 +156,13 @@ pub const ManagedNetwork = extern struct { |
| 156 | 156 | pub fn receive(self: *ManagedNetwork, token: *CompletionToken) TransmitError!void { |
| 157 | 157 | switch (self._receive(self, token)) { |
| 158 | 158 | .success => {}, |
| 159 | .not_started => return Error.NotStarted, | |
| 160 | .invalid_parameter => return Error.InvalidParameter, | |
| 161 | .out_of_resources => return Error.OutOfResources, | |
| 162 | .device_error => return Error.DeviceError, | |
| 163 | .access_denied => return Error.AccessDenied, | |
| 164 | .not_ready => return Error.NotReady, | |
| 165 | .no_media => return Error.NoMedia, | |
| 159 | .not_started => return error.NotStarted, | |
| 160 | .invalid_parameter => return error.InvalidParameter, | |
| 161 | .out_of_resources => return error.OutOfResources, | |
| 162 | .device_error => return error.DeviceError, | |
| 163 | .access_denied => return error.AccessDenied, | |
| 164 | .not_ready => return error.NotReady, | |
| 165 | .no_media => return error.NoMedia, | |
| 166 | 166 | else => |status| return uefi.unexpectedStatus(status), |
| 167 | 167 | } |
| 168 | 168 | } |
| ... | ... | @@ -171,9 +171,9 @@ pub const ManagedNetwork = extern struct { |
| 171 | 171 | pub fn cancel(self: *ManagedNetwork, token: ?*const CompletionToken) CancelError!void { |
| 172 | 172 | switch (self._cancel(self, token)) { |
| 173 | 173 | .success => {}, |
| 174 | .not_started => return Error.NotStarted, | |
| 175 | .invalid_parameter => return Error.InvalidParameter, | |
| 176 | .not_found => return Error.NotFound, | |
| 174 | .not_started => return error.NotStarted, | |
| 175 | .invalid_parameter => return error.InvalidParameter, | |
| 176 | .not_found => return error.NotFound, | |
| 177 | 177 | else => |status| return uefi.unexpectedStatus(status), |
| 178 | 178 | } |
| 179 | 179 | } |
| ... | ... | @@ -182,10 +182,10 @@ pub const ManagedNetwork = extern struct { |
| 182 | 182 | pub fn poll(self: *ManagedNetwork) PollError!void { |
| 183 | 183 | switch (self._poll(self)) { |
| 184 | 184 | .success => {}, |
| 185 | .not_started => return Error.NotStarted, | |
| 186 | .device_error => return Error.DeviceError, | |
| 187 | .not_ready => return Error.NotReady, | |
| 188 | .timeout => return Error.Timeout, | |
| 185 | .not_started => return error.NotStarted, | |
| 186 | .device_error => return error.DeviceError, | |
| 187 | .not_ready => return error.NotReady, | |
| 188 | .timeout => return error.Timeout, | |
| 189 | 189 | else => |status| return uefi.unexpectedStatus(status), |
| 190 | 190 | } |
| 191 | 191 | } |
lib/std/os/uefi/protocol/rng.zig+7-8| ... | ... | @@ -3,7 +3,6 @@ const uefi = std.os.uefi; |
| 3 | 3 | const Guid = uefi.Guid; |
| 4 | 4 | const Status = uefi.Status; |
| 5 | 5 | const cc = uefi.cc; |
| 6 | const Error = Status.Error; | |
| 7 | 6 | |
| 8 | 7 | /// Random Number Generator protocol |
| 9 | 8 | pub const Rng = extern struct { |
| ... | ... | @@ -27,9 +26,9 @@ pub const Rng = extern struct { |
| 27 | 26 | var len: usize = list.len; |
| 28 | 27 | switch (self._get_info(self, &len, list.ptr)) { |
| 29 | 28 | .success => return list[0..len], |
| 30 | .unsupported => return Error.Unsupported, | |
| 31 | .device_error => return Error.DeviceError, | |
| 32 | .buffer_too_small => return Error.BufferTooSmall, | |
| 29 | .unsupported => return error.Unsupported, | |
| 30 | .device_error => return error.DeviceError, | |
| 31 | .buffer_too_small => return error.BufferTooSmall, | |
| 33 | 32 | else => |status| return uefi.unexpectedStatus(status), |
| 34 | 33 | } |
| 35 | 34 | } |
| ... | ... | @@ -38,10 +37,10 @@ pub const Rng = extern struct { |
| 38 | 37 | pub fn getRNG(self: *const Rng, algo: ?*align(8) const Guid, value: []u8) GetRNGError!void { |
| 39 | 38 | switch (self._get_rng(self, algo, value.len, value.ptr)) { |
| 40 | 39 | .success => {}, |
| 41 | .unsupported => return Error.Unsupported, | |
| 42 | .device_error => return Error.DeviceError, | |
| 43 | .not_ready => return Error.NotReady, | |
| 44 | .invalid_parameter => return Error.InvalidParameter, | |
| 40 | .unsupported => return error.Unsupported, | |
| 41 | .device_error => return error.DeviceError, | |
| 42 | .not_ready => return error.NotReady, | |
| 43 | .invalid_parameter => return error.InvalidParameter, | |
| 45 | 44 | else => |status| return uefi.unexpectedStatus(status), |
| 46 | 45 | } |
| 47 | 46 | } |
lib/std/os/uefi/protocol/serial_io.zig+10-11| ... | ... | @@ -3,7 +3,6 @@ const uefi = std.os.uefi; |
| 3 | 3 | const Guid = uefi.Guid; |
| 4 | 4 | const Status = uefi.Status; |
| 5 | 5 | const cc = uefi.cc; |
| 6 | const Error = Status.Error; | |
| 7 | 6 | |
| 8 | 7 | pub const SerialIo = extern struct { |
| 9 | 8 | revision: u64, |
| ... | ... | @@ -39,7 +38,7 @@ pub const SerialIo = extern struct { |
| 39 | 38 | pub fn reset(self: *SerialIo) ResetError!void { |
| 40 | 39 | switch (self._reset(self)) { |
| 41 | 40 | .success => {}, |
| 42 | .device_error => return Error.DeviceError, | |
| 41 | .device_error => return error.DeviceError, | |
| 43 | 42 | else => |status| return uefi.unexpectedStatus(status), |
| 44 | 43 | } |
| 45 | 44 | } |
| ... | ... | @@ -64,8 +63,8 @@ pub const SerialIo = extern struct { |
| 64 | 63 | stop_bits, |
| 65 | 64 | )) { |
| 66 | 65 | .success => {}, |
| 67 | .invalid_parameter => return Error.InvalidParameter, | |
| 68 | .device_error => return Error.DeviceError, | |
| 66 | .invalid_parameter => return error.InvalidParameter, | |
| 67 | .device_error => return error.DeviceError, | |
| 69 | 68 | else => |status| return uefi.unexpectedStatus(status), |
| 70 | 69 | } |
| 71 | 70 | } |
| ... | ... | @@ -74,8 +73,8 @@ pub const SerialIo = extern struct { |
| 74 | 73 | pub fn setControl(self: *SerialIo, control: u32) SetControlError!void { |
| 75 | 74 | switch (self._set_control(self, control)) { |
| 76 | 75 | .success => {}, |
| 77 | .unsupported => return Error.Unsupported, | |
| 78 | .device_error => return Error.DeviceError, | |
| 76 | .unsupported => return error.Unsupported, | |
| 77 | .device_error => return error.DeviceError, | |
| 79 | 78 | else => |status| return uefi.unexpectedStatus(status), |
| 80 | 79 | } |
| 81 | 80 | } |
| ... | ... | @@ -85,7 +84,7 @@ pub const SerialIo = extern struct { |
| 85 | 84 | var control: u32 = undefined; |
| 86 | 85 | switch (self._get_control(self, &control)) { |
| 87 | 86 | .success => return control, |
| 88 | .device_error => return Error.DeviceError, | |
| 87 | .device_error => return error.DeviceError, | |
| 89 | 88 | else => |status| return uefi.unexpectedStatus(status), |
| 90 | 89 | } |
| 91 | 90 | } |
| ... | ... | @@ -95,8 +94,8 @@ pub const SerialIo = extern struct { |
| 95 | 94 | var len: usize = buffer.len; |
| 96 | 95 | switch (self._write(self, &len, buffer.ptr)) { |
| 97 | 96 | .success => return len, |
| 98 | .device_error => return Error.DeviceError, | |
| 99 | .timeout => return Error.Timeout, | |
| 97 | .device_error => return error.DeviceError, | |
| 98 | .timeout => return error.Timeout, | |
| 100 | 99 | else => |status| return uefi.unexpectedStatus(status), |
| 101 | 100 | } |
| 102 | 101 | } |
| ... | ... | @@ -106,8 +105,8 @@ pub const SerialIo = extern struct { |
| 106 | 105 | var len: usize = buffer.len; |
| 107 | 106 | switch (self._read(self, &len, buffer.ptr)) { |
| 108 | 107 | .success => return len, |
| 109 | .device_error => return Error.DeviceError, | |
| 110 | .timeout => return Error.Timeout, | |
| 108 | .device_error => return error.DeviceError, | |
| 109 | .timeout => return error.Timeout, | |
| 111 | 110 | else => |status| return uefi.unexpectedStatus(status), |
| 112 | 111 | } |
| 113 | 112 | } |
lib/std/os/uefi/protocol/simple_file_system.zig+7-8| ... | ... | @@ -4,7 +4,6 @@ const Guid = uefi.Guid; |
| 4 | 4 | const File = uefi.protocol.File; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | pub const SimpleFileSystem = extern struct { |
| 10 | 9 | revision: u64, |
| ... | ... | @@ -24,13 +23,13 @@ pub const SimpleFileSystem = extern struct { |
| 24 | 23 | var root: *File = undefined; |
| 25 | 24 | switch (self._open_volume(self, &root)) { |
| 26 | 25 | .success => return root, |
| 27 | .unsupported => return Error.Unsupported, | |
| 28 | .no_media => return Error.NoMedia, | |
| 29 | .device_error => return Error.DeviceError, | |
| 30 | .volume_corrupted => return Error.VolumeCorrupted, | |
| 31 | .access_denied => return Error.AccessDenied, | |
| 32 | .out_of_resources => return Error.OutOfResources, | |
| 33 | .media_changed => return Error.MediaChanged, | |
| 26 | .unsupported => return error.Unsupported, | |
| 27 | .no_media => return error.NoMedia, | |
| 28 | .device_error => return error.DeviceError, | |
| 29 | .volume_corrupted => return error.VolumeCorrupted, | |
| 30 | .access_denied => return error.AccessDenied, | |
| 31 | .out_of_resources => return error.OutOfResources, | |
| 32 | .media_changed => return error.MediaChanged, | |
| 34 | 33 | else => |status| return uefi.unexpectedStatus(status), |
| 35 | 34 | } |
| 36 | 35 | } |
lib/std/os/uefi/protocol/simple_network.zig+58-59| ... | ... | @@ -4,7 +4,6 @@ const Event = uefi.Event; |
| 4 | 4 | const Guid = uefi.Guid; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | pub const SimpleNetwork = extern struct { |
| 10 | 9 | revision: u64, |
| ... | ... | @@ -110,10 +109,10 @@ pub const SimpleNetwork = extern struct { |
| 110 | 109 | pub fn start(self: *SimpleNetwork) StartError!void { |
| 111 | 110 | switch (self._start(self)) { |
| 112 | 111 | .success => {}, |
| 113 | .already_started => return Error.AlreadyStarted, | |
| 114 | .invalid_parameter => return Error.InvalidParameter, | |
| 115 | .device_error => return Error.DeviceError, | |
| 116 | .unsupported => return Error.Unsupported, | |
| 112 | .already_started => return error.AlreadyStarted, | |
| 113 | .invalid_parameter => return error.InvalidParameter, | |
| 114 | .device_error => return error.DeviceError, | |
| 115 | .unsupported => return error.Unsupported, | |
| 117 | 116 | else => |status| return uefi.unexpectedStatus(status), |
| 118 | 117 | } |
| 119 | 118 | } |
| ... | ... | @@ -122,10 +121,10 @@ pub const SimpleNetwork = extern struct { |
| 122 | 121 | pub fn stop(self: *SimpleNetwork) StopError!void { |
| 123 | 122 | switch (self._stop(self)) { |
| 124 | 123 | .success => {}, |
| 125 | .not_started => return Error.NotStarted, | |
| 126 | .invalid_parameter => return Error.InvalidParameter, | |
| 127 | .device_error => return Error.DeviceError, | |
| 128 | .unsupported => return Error.Unsupported, | |
| 124 | .not_started => return error.NotStarted, | |
| 125 | .invalid_parameter => return error.InvalidParameter, | |
| 126 | .device_error => return error.DeviceError, | |
| 127 | .unsupported => return error.Unsupported, | |
| 129 | 128 | else => |status| return uefi.unexpectedStatus(status), |
| 130 | 129 | } |
| 131 | 130 | } |
| ... | ... | @@ -138,11 +137,11 @@ pub const SimpleNetwork = extern struct { |
| 138 | 137 | ) InitializeError!void { |
| 139 | 138 | switch (self._initialize(self, extra_rx_buffer_size, extra_tx_buffer_size)) { |
| 140 | 139 | .success => {}, |
| 141 | .not_started => return Error.NotStarted, | |
| 142 | .out_of_resources => return Error.OutOfResources, | |
| 143 | .invalid_parameter => return Error.InvalidParameter, | |
| 144 | .device_error => return Error.DeviceError, | |
| 145 | .unsupported => return Error.Unsupported, | |
| 140 | .not_started => return error.NotStarted, | |
| 141 | .out_of_resources => return error.OutOfResources, | |
| 142 | .invalid_parameter => return error.InvalidParameter, | |
| 143 | .device_error => return error.DeviceError, | |
| 144 | .unsupported => return error.Unsupported, | |
| 146 | 145 | else => |status| return uefi.unexpectedStatus(status), |
| 147 | 146 | } |
| 148 | 147 | } |
| ... | ... | @@ -151,10 +150,10 @@ pub const SimpleNetwork = extern struct { |
| 151 | 150 | pub fn reset(self: *SimpleNetwork, extended_verification: bool) ResetError!void { |
| 152 | 151 | switch (self._reset(self, extended_verification)) { |
| 153 | 152 | .success => {}, |
| 154 | .not_started => return Error.NotStarted, | |
| 155 | .invalid_parameter => return Error.InvalidParameter, | |
| 156 | .device_error => return Error.DeviceError, | |
| 157 | .unsupported => return Error.Unsupported, | |
| 153 | .not_started => return error.NotStarted, | |
| 154 | .invalid_parameter => return error.InvalidParameter, | |
| 155 | .device_error => return error.DeviceError, | |
| 156 | .unsupported => return error.Unsupported, | |
| 158 | 157 | else => |status| return uefi.unexpectedStatus(status), |
| 159 | 158 | } |
| 160 | 159 | } |
| ... | ... | @@ -163,9 +162,9 @@ pub const SimpleNetwork = extern struct { |
| 163 | 162 | pub fn shutdown(self: *SimpleNetwork) ShutdownError!void { |
| 164 | 163 | switch (self._shutdown(self)) { |
| 165 | 164 | .success => {}, |
| 166 | .not_started => return ShutdownError.NotStarted, | |
| 167 | .invalid_parameter => return ShutdownError.InvalidParameter, | |
| 168 | .device_error => return ShutdownError.DeviceError, | |
| 165 | .not_started => return error.NotStarted, | |
| 166 | .invalid_parameter => return error.InvalidParameter, | |
| 167 | .device_error => return error.DeviceError, | |
| 169 | 168 | else => |status| return uefi.unexpectedStatus(status), |
| 170 | 169 | } |
| 171 | 170 | } |
| ... | ... | @@ -186,10 +185,10 @@ pub const SimpleNetwork = extern struct { |
| 186 | 185 | |
| 187 | 186 | switch (self._receive_filters(self, enable, disable, reset_mcast_filter, count, ptr)) { |
| 188 | 187 | .success => {}, |
| 189 | .not_started => return Error.NotStarted, | |
| 190 | .invalid_parameter => return Error.InvalidParameter, | |
| 191 | .device_error => return Error.DeviceError, | |
| 192 | .unsupported => return Error.Unsupported, | |
| 188 | .not_started => return error.NotStarted, | |
| 189 | .invalid_parameter => return error.InvalidParameter, | |
| 190 | .device_error => return error.DeviceError, | |
| 191 | .unsupported => return error.Unsupported, | |
| 193 | 192 | else => |status| return uefi.unexpectedStatus(status), |
| 194 | 193 | } |
| 195 | 194 | } |
| ... | ... | @@ -202,10 +201,10 @@ pub const SimpleNetwork = extern struct { |
| 202 | 201 | ) StationAddressError!void { |
| 203 | 202 | switch (self._station_address(self, reset_flag, new)) { |
| 204 | 203 | .success => {}, |
| 205 | .not_started => return Error.NotStarted, | |
| 206 | .invalid_parameter => return Error.InvalidParameter, | |
| 207 | .device_error => return Error.DeviceError, | |
| 208 | .unsupported => return Error.Unsupported, | |
| 204 | .not_started => return error.NotStarted, | |
| 205 | .invalid_parameter => return error.InvalidParameter, | |
| 206 | .device_error => return error.DeviceError, | |
| 207 | .unsupported => return error.Unsupported, | |
| 209 | 208 | else => |status| return uefi.unexpectedStatus(status), |
| 210 | 209 | } |
| 211 | 210 | } |
| ... | ... | @@ -213,10 +212,10 @@ pub const SimpleNetwork = extern struct { |
| 213 | 212 | pub fn resetStatistics(self: *SimpleNetwork) StatisticsError!void { |
| 214 | 213 | switch (self._statistics(self, true, null, null)) { |
| 215 | 214 | .success => {}, |
| 216 | .not_started => return Error.NotStarted, | |
| 217 | .invalid_parameter => return Error.InvalidParameter, | |
| 218 | .device_error => return Error.DeviceError, | |
| 219 | .unsupported => return Error.Unsupported, | |
| 215 | .not_started => return error.NotStarted, | |
| 216 | .invalid_parameter => return error.InvalidParameter, | |
| 217 | .device_error => return error.DeviceError, | |
| 218 | .unsupported => return error.Unsupported, | |
| 220 | 219 | else => |status| return uefi.unexpectedStatus(status), |
| 221 | 220 | } |
| 222 | 221 | } |
| ... | ... | @@ -227,10 +226,10 @@ pub const SimpleNetwork = extern struct { |
| 227 | 226 | var stats_size: usize = @sizeOf(Statistics); |
| 228 | 227 | switch (self._statistics(self, reset_flag, &stats_size, &stats)) { |
| 229 | 228 | .success => {}, |
| 230 | .not_started => return Error.NotStarted, | |
| 231 | .invalid_parameter => return Error.InvalidParameter, | |
| 232 | .device_error => return Error.DeviceError, | |
| 233 | .unsupported => return Error.Unsupported, | |
| 229 | .not_started => return error.NotStarted, | |
| 230 | .invalid_parameter => return error.InvalidParameter, | |
| 231 | .device_error => return error.DeviceError, | |
| 232 | .unsupported => return error.Unsupported, | |
| 234 | 233 | else => |status| return uefi.unexpectedStatus(status), |
| 235 | 234 | } |
| 236 | 235 | |
| ... | ... | @@ -249,10 +248,10 @@ pub const SimpleNetwork = extern struct { |
| 249 | 248 | var mac: MacAddress = undefined; |
| 250 | 249 | switch (self._mcast_ip_to_mac(self, ipv6, ip, &mac)) { |
| 251 | 250 | .success => return mac, |
| 252 | .not_started => return Error.NotStarted, | |
| 253 | .invalid_parameter => return Error.InvalidParameter, | |
| 254 | .device_error => return Error.DeviceError, | |
| 255 | .unsupported => return Error.Unsupported, | |
| 251 | .not_started => return error.NotStarted, | |
| 252 | .invalid_parameter => return error.InvalidParameter, | |
| 253 | .device_error => return error.DeviceError, | |
| 254 | .unsupported => return error.Unsupported, | |
| 256 | 255 | else => |status| return uefi.unexpectedStatus(status), |
| 257 | 256 | } |
| 258 | 257 | } |
| ... | ... | @@ -273,10 +272,10 @@ pub const SimpleNetwork = extern struct { |
| 273 | 272 | buffer.ptr, |
| 274 | 273 | )) { |
| 275 | 274 | .success => {}, |
| 276 | .not_started => return Error.NotStarted, | |
| 277 | .invalid_parameter => return Error.InvalidParameter, | |
| 278 | .device_error => return Error.DeviceError, | |
| 279 | .unsupported => return Error.Unsupported, | |
| 275 | .not_started => return error.NotStarted, | |
| 276 | .invalid_parameter => return error.InvalidParameter, | |
| 277 | .device_error => return error.DeviceError, | |
| 278 | .unsupported => return error.Unsupported, | |
| 280 | 279 | else => |status| return uefi.unexpectedStatus(status), |
| 281 | 280 | } |
| 282 | 281 | } |
| ... | ... | @@ -289,9 +288,9 @@ pub const SimpleNetwork = extern struct { |
| 289 | 288 | ) GetStatusError!void { |
| 290 | 289 | switch (self._get_status(self, interrupt_status, recycled_tx_buf)) { |
| 291 | 290 | .success => {}, |
| 292 | .not_started => return Error.NotStarted, | |
| 293 | .invalid_parameter => return Error.InvalidParameter, | |
| 294 | .device_error => return Error.DeviceError, | |
| 291 | .not_started => return error.NotStarted, | |
| 292 | .invalid_parameter => return error.InvalidParameter, | |
| 293 | .device_error => return error.DeviceError, | |
| 295 | 294 | else => |status| return uefi.unexpectedStatus(status), |
| 296 | 295 | } |
| 297 | 296 | } |
| ... | ... | @@ -315,12 +314,12 @@ pub const SimpleNetwork = extern struct { |
| 315 | 314 | protocol, |
| 316 | 315 | )) { |
| 317 | 316 | .success => {}, |
| 318 | .not_started => return Error.NotStarted, | |
| 319 | .not_ready => return Error.NotReady, | |
| 320 | .buffer_too_small => return Error.BufferTooSmall, | |
| 321 | .invalid_parameter => return Error.InvalidParameter, | |
| 322 | .device_error => return Error.DeviceError, | |
| 323 | .unsupported => return Error.Unsupported, | |
| 317 | .not_started => return error.NotStarted, | |
| 318 | .not_ready => return error.NotReady, | |
| 319 | .buffer_too_small => return error.BufferTooSmall, | |
| 320 | .invalid_parameter => return error.InvalidParameter, | |
| 321 | .device_error => return error.DeviceError, | |
| 322 | .unsupported => return error.Unsupported, | |
| 324 | 323 | else => |status| return uefi.unexpectedStatus(status), |
| 325 | 324 | } |
| 326 | 325 | } |
| ... | ... | @@ -340,11 +339,11 @@ pub const SimpleNetwork = extern struct { |
| 340 | 339 | &packet.protocol, |
| 341 | 340 | )) { |
| 342 | 341 | .success => return packet, |
| 343 | .not_started => return Error.NotStarted, | |
| 344 | .not_ready => return Error.NotReady, | |
| 345 | .buffer_too_small => return Error.BufferTooSmall, | |
| 346 | .invalid_parameter => return Error.InvalidParameter, | |
| 347 | .device_error => return Error.DeviceError, | |
| 342 | .not_started => return error.NotStarted, | |
| 343 | .not_ready => return error.NotReady, | |
| 344 | .buffer_too_small => return error.BufferTooSmall, | |
| 345 | .invalid_parameter => return error.InvalidParameter, | |
| 346 | .device_error => return error.DeviceError, | |
| 348 | 347 | else => |status| return uefi.unexpectedStatus(status), |
| 349 | 348 | } |
| 350 | 349 | } |
lib/std/os/uefi/protocol/simple_pointer.zig+3-4| ... | ... | @@ -4,7 +4,6 @@ const Event = uefi.Event; |
| 4 | 4 | const Guid = uefi.Guid; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// Protocol for mice. |
| 10 | 9 | pub const SimplePointer = struct { |
| ... | ... | @@ -23,7 +22,7 @@ pub const SimplePointer = struct { |
| 23 | 22 | pub fn reset(self: *SimplePointer, verify: bool) ResetError!void { |
| 24 | 23 | switch (self._reset(self, verify)) { |
| 25 | 24 | .success => {}, |
| 26 | .device_error => return Error.DeviceError, | |
| 25 | .device_error => return error.DeviceError, | |
| 27 | 26 | else => |status| return uefi.unexpectedStatus(status), |
| 28 | 27 | } |
| 29 | 28 | } |
| ... | ... | @@ -33,8 +32,8 @@ pub const SimplePointer = struct { |
| 33 | 32 | var state: State = undefined; |
| 34 | 33 | switch (self._get_state(self, &state)) { |
| 35 | 34 | .success => return state, |
| 36 | .not_ready => return Error.NotReady, | |
| 37 | .device_error => return Error.DeviceError, | |
| 35 | .not_ready => return error.NotReady, | |
| 36 | .device_error => return error.DeviceError, | |
| 38 | 37 | else => |status| return uefi.unexpectedStatus(status), |
| 39 | 38 | } |
| 40 | 39 | } |
lib/std/os/uefi/protocol/simple_text_input.zig+4-5| ... | ... | @@ -4,7 +4,6 @@ const Event = uefi.Event; |
| 4 | 4 | const Guid = uefi.Guid; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// Character input devices, e.g. Keyboard |
| 10 | 9 | pub const SimpleTextInput = extern struct { |
| ... | ... | @@ -23,7 +22,7 @@ pub const SimpleTextInput = extern struct { |
| 23 | 22 | pub fn reset(self: *SimpleTextInput, verify: bool) ResetError!void { |
| 24 | 23 | switch (self._reset(self, verify)) { |
| 25 | 24 | .success => {}, |
| 26 | .device_error => return Error.DeviceError, | |
| 25 | .device_error => return error.DeviceError, | |
| 27 | 26 | else => |status| return uefi.unexpectedStatus(status), |
| 28 | 27 | } |
| 29 | 28 | } |
| ... | ... | @@ -33,9 +32,9 @@ pub const SimpleTextInput = extern struct { |
| 33 | 32 | var key: Key.Input = undefined; |
| 34 | 33 | switch (self._read_key_stroke(self, &key)) { |
| 35 | 34 | .success => return key, |
| 36 | .not_ready => return Error.NotReady, | |
| 37 | .device_error => return Error.DeviceError, | |
| 38 | .unsupported => return Error.Unsupported, | |
| 35 | .not_ready => return error.NotReady, | |
| 36 | .device_error => return error.DeviceError, | |
| 37 | .unsupported => return error.Unsupported, | |
| 39 | 38 | else => |status| return uefi.unexpectedStatus(status), |
| 40 | 39 | } |
| 41 | 40 | } |
lib/std/os/uefi/protocol/simple_text_input_ex.zig+8-9| ... | ... | @@ -4,7 +4,6 @@ const Event = uefi.Event; |
| 4 | 4 | const Guid = uefi.Guid; |
| 5 | 5 | const Status = uefi.Status; |
| 6 | 6 | const cc = uefi.cc; |
| 7 | const Error = Status.Error; | |
| 8 | 7 | |
| 9 | 8 | /// Character input devices, e.g. Keyboard |
| 10 | 9 | pub const SimpleTextInputEx = extern struct { |
| ... | ... | @@ -32,7 +31,7 @@ pub const SimpleTextInputEx = extern struct { |
| 32 | 31 | pub fn reset(self: *SimpleTextInputEx, verify: bool) ResetError!void { |
| 33 | 32 | switch (self._reset(self, verify)) { |
| 34 | 33 | .success => {}, |
| 35 | .device_error => return Error.DeviceError, | |
| 34 | .device_error => return error.DeviceError, | |
| 36 | 35 | else => |status| return uefi.unexpectedStatus(status), |
| 37 | 36 | } |
| 38 | 37 | } |
| ... | ... | @@ -42,9 +41,9 @@ pub const SimpleTextInputEx = extern struct { |
| 42 | 41 | var key: Key = undefined; |
| 43 | 42 | switch (self._read_key_stroke_ex(self, &key)) { |
| 44 | 43 | .success => return key, |
| 45 | .not_ready => return Error.NotReady, | |
| 46 | .device_error => return Error.DeviceError, | |
| 47 | .unsupported => return Error.Unsupported, | |
| 44 | .not_ready => return error.NotReady, | |
| 45 | .device_error => return error.DeviceError, | |
| 46 | .unsupported => return error.Unsupported, | |
| 48 | 47 | else => |status| return uefi.unexpectedStatus(status), |
| 49 | 48 | } |
| 50 | 49 | } |
| ... | ... | @@ -53,8 +52,8 @@ pub const SimpleTextInputEx = extern struct { |
| 53 | 52 | pub fn setState(self: *SimpleTextInputEx, state: *const Key.State.Toggle) SetStateError!void { |
| 54 | 53 | switch (self._set_state(self, @ptrCast(state))) { |
| 55 | 54 | .success => {}, |
| 56 | .device_error => return Error.DeviceError, | |
| 57 | .unsupported => return Error.Unsupported, | |
| 55 | .device_error => return error.DeviceError, | |
| 56 | .unsupported => return error.Unsupported, | |
| 58 | 57 | else => |status| return uefi.unexpectedStatus(status), |
| 59 | 58 | } |
| 60 | 59 | } |
| ... | ... | @@ -68,7 +67,7 @@ pub const SimpleTextInputEx = extern struct { |
| 68 | 67 | var handle: uefi.Handle = undefined; |
| 69 | 68 | switch (self._register_key_notify(self, key_data, notify, &handle)) { |
| 70 | 69 | .success => return handle, |
| 71 | .out_of_resources => return Error.OutOfResources, | |
| 70 | .out_of_resources => return error.OutOfResources, | |
| 72 | 71 | else => |status| return uefi.unexpectedStatus(status), |
| 73 | 72 | } |
| 74 | 73 | } |
| ... | ... | @@ -80,7 +79,7 @@ pub const SimpleTextInputEx = extern struct { |
| 80 | 79 | ) UnregisterKeyNotifyError!void { |
| 81 | 80 | switch (self._unregister_key_notify(self, handle)) { |
| 82 | 81 | .success => {}, |
| 83 | .invalid_parameter => return Error.InvalidParameter, | |
| 82 | .invalid_parameter => return error.InvalidParameter, | |
| 84 | 83 | else => |status| return uefi.unexpectedStatus(status), |
| 85 | 84 | } |
| 86 | 85 | } |
lib/std/os/uefi/protocol/simple_text_output.zig+14-15| ... | ... | @@ -3,7 +3,6 @@ const uefi = std.os.uefi; |
| 3 | 3 | const Guid = uefi.Guid; |
| 4 | 4 | const Status = uefi.Status; |
| 5 | 5 | const cc = uefi.cc; |
| 6 | const Error = Status.Error; | |
| 7 | 6 | |
| 8 | 7 | /// Character output devices |
| 9 | 8 | pub const SimpleTextOutput = extern struct { |
| ... | ... | @@ -49,7 +48,7 @@ pub const SimpleTextOutput = extern struct { |
| 49 | 48 | pub fn reset(self: *SimpleTextOutput, verify: bool) ResetError!void { |
| 50 | 49 | switch (self._reset(self, verify)) { |
| 51 | 50 | .success => {}, |
| 52 | .device_error => return Error.DeviceError, | |
| 51 | .device_error => return error.DeviceError, | |
| 53 | 52 | else => |status| return uefi.unexpectedStatus(status), |
| 54 | 53 | } |
| 55 | 54 | } |
| ... | ... | @@ -61,8 +60,8 @@ pub const SimpleTextOutput = extern struct { |
| 61 | 60 | switch (self._output_string(self, msg)) { |
| 62 | 61 | .success => return true, |
| 63 | 62 | .warn_unknown_glyph => return false, |
| 64 | .device_error => return Error.DeviceError, | |
| 65 | .unsupported => return Error.Unsupported, | |
| 63 | .device_error => return error.DeviceError, | |
| 64 | .unsupported => return error.Unsupported, | |
| 66 | 65 | else => |status| return uefi.unexpectedStatus(status), |
| 67 | 66 | } |
| 68 | 67 | } |
| ... | ... | @@ -81,8 +80,8 @@ pub const SimpleTextOutput = extern struct { |
| 81 | 80 | var geo: Geometry = undefined; |
| 82 | 81 | switch (self._query_mode(self, mode_number, &geo.columns, &geo.rows)) { |
| 83 | 82 | .success => return geo, |
| 84 | .device_error => return Error.DeviceError, | |
| 85 | .unsupported => return Error.Unsupported, | |
| 83 | .device_error => return error.DeviceError, | |
| 84 | .unsupported => return error.Unsupported, | |
| 86 | 85 | else => |status| return uefi.unexpectedStatus(status), |
| 87 | 86 | } |
| 88 | 87 | } |
| ... | ... | @@ -91,8 +90,8 @@ pub const SimpleTextOutput = extern struct { |
| 91 | 90 | pub fn setMode(self: *SimpleTextOutput, mode_number: usize) SetModeError!void { |
| 92 | 91 | switch (self._set_mode(self, mode_number)) { |
| 93 | 92 | .success => {}, |
| 94 | .device_error => return Error.DeviceError, | |
| 95 | .unsupported => return Error.Unsupported, | |
| 93 | .device_error => return error.DeviceError, | |
| 94 | .unsupported => return error.Unsupported, | |
| 96 | 95 | else => |status| return uefi.unexpectedStatus(status), |
| 97 | 96 | } |
| 98 | 97 | } |
| ... | ... | @@ -102,7 +101,7 @@ pub const SimpleTextOutput = extern struct { |
| 102 | 101 | const attr_as_num: u8 = @bitCast(attribute); |
| 103 | 102 | switch (self._set_attribute(self, @intCast(attr_as_num))) { |
| 104 | 103 | .success => {}, |
| 105 | .device_error => return Error.DeviceError, | |
| 104 | .device_error => return error.DeviceError, | |
| 106 | 105 | else => |status| return uefi.unexpectedStatus(status), |
| 107 | 106 | } |
| 108 | 107 | } |
| ... | ... | @@ -111,8 +110,8 @@ pub const SimpleTextOutput = extern struct { |
| 111 | 110 | pub fn clearScreen(self: *SimpleTextOutput) ClearScreenError!void { |
| 112 | 111 | switch (self._clear_screen(self)) { |
| 113 | 112 | .success => {}, |
| 114 | .device_error => return Error.DeviceError, | |
| 115 | .unsupported => return Error.Unsupported, | |
| 113 | .device_error => return error.DeviceError, | |
| 114 | .unsupported => return error.Unsupported, | |
| 116 | 115 | else => |status| return uefi.unexpectedStatus(status), |
| 117 | 116 | } |
| 118 | 117 | } |
| ... | ... | @@ -125,8 +124,8 @@ pub const SimpleTextOutput = extern struct { |
| 125 | 124 | ) SetCursorPositionError!void { |
| 126 | 125 | switch (self._set_cursor_position(self, column, row)) { |
| 127 | 126 | .success => {}, |
| 128 | .device_error => return Error.DeviceError, | |
| 129 | .unsupported => return Error.Unsupported, | |
| 127 | .device_error => return error.DeviceError, | |
| 128 | .unsupported => return error.Unsupported, | |
| 130 | 129 | else => |status| return uefi.unexpectedStatus(status), |
| 131 | 130 | } |
| 132 | 131 | } |
| ... | ... | @@ -135,8 +134,8 @@ pub const SimpleTextOutput = extern struct { |
| 135 | 134 | pub fn enableCursor(self: *SimpleTextOutput, visible: bool) EnableCursorError!void { |
| 136 | 135 | switch (self._enable_cursor(self, visible)) { |
| 137 | 136 | .success => {}, |
| 138 | .device_error => return Error.DeviceError, | |
| 139 | .unsupported => return Error.Unsupported, | |
| 137 | .device_error => return error.DeviceError, | |
| 138 | .unsupported => return error.Unsupported, | |
| 140 | 139 | else => |status| return uefi.unexpectedStatus(status), |
| 141 | 140 | } |
| 142 | 141 | } |
lib/std/os/uefi/protocol/udp6.zig+37-38| ... | ... | @@ -8,7 +8,6 @@ const Ip6 = uefi.protocol.Ip6; |
| 8 | 8 | const ManagedNetworkConfigData = uefi.protocol.ManagedNetwork.Config; |
| 9 | 9 | const SimpleNetwork = uefi.protocol.SimpleNetwork; |
| 10 | 10 | const cc = uefi.cc; |
| 11 | const Error = Status.Error; | |
| 12 | 11 | |
| 13 | 12 | pub const Udp6 = extern struct { |
| 14 | 13 | _get_mode_data: *const fn (*const Udp6, ?*Config, ?*Ip6.Mode, ?*ManagedNetworkConfigData, ?*SimpleNetwork) callconv(cc) Status, |
| ... | ... | @@ -81,8 +80,8 @@ pub const Udp6 = extern struct { |
| 81 | 80 | &data.snp_mode_data, |
| 82 | 81 | )) { |
| 83 | 82 | .success => return data, |
| 84 | .not_started => return Error.NotStarted, | |
| 85 | .invalid_parameter => return Error.InvalidParameter, | |
| 83 | .not_started => return error.NotStarted, | |
| 84 | .invalid_parameter => return error.InvalidParameter, | |
| 86 | 85 | else => |status| return uefi.unexpectedStatus(status), |
| 87 | 86 | } |
| 88 | 87 | } |
| ... | ... | @@ -90,12 +89,12 @@ pub const Udp6 = extern struct { |
| 90 | 89 | pub fn configure(self: *Udp6, udp6_config_data: ?*const Config) ConfigureError!void { |
| 91 | 90 | switch (self._configure(self, udp6_config_data)) { |
| 92 | 91 | .success => {}, |
| 93 | .no_mapping => return Error.NoMapping, | |
| 94 | .invalid_parameter => return Error.InvalidParameter, | |
| 95 | .already_started => return Error.AlreadyStarted, | |
| 96 | .access_denied => return Error.AccessDenied, | |
| 97 | .out_of_resources => return Error.OutOfResources, | |
| 98 | .device_error => return Error.DeviceError, | |
| 92 | .no_mapping => return error.NoMapping, | |
| 93 | .invalid_parameter => return error.InvalidParameter, | |
| 94 | .already_started => return error.AlreadyStarted, | |
| 95 | .access_denied => return error.AccessDenied, | |
| 96 | .out_of_resources => return error.OutOfResources, | |
| 97 | .device_error => return error.DeviceError, | |
| 99 | 98 | else => |status| return uefi.unexpectedStatus(status), |
| 100 | 99 | } |
| 101 | 100 | } |
| ... | ... | @@ -112,12 +111,12 @@ pub const Udp6 = extern struct { |
| 112 | 111 | multicast_address, |
| 113 | 112 | )) { |
| 114 | 113 | .success => {}, |
| 115 | .not_started => return Error.NotStarted, | |
| 116 | .out_of_resources => return Error.OutOfResources, | |
| 117 | .invalid_parameter => return Error.InvalidParameter, | |
| 118 | .already_started => return Error.AlreadyStarted, | |
| 119 | .not_found => return Error.NotFound, | |
| 120 | .device_error => return Error.DeviceError, | |
| 114 | .not_started => return error.NotStarted, | |
| 115 | .out_of_resources => return error.OutOfResources, | |
| 116 | .invalid_parameter => return error.InvalidParameter, | |
| 117 | .already_started => return error.AlreadyStarted, | |
| 118 | .not_found => return error.NotFound, | |
| 119 | .device_error => return error.DeviceError, | |
| 121 | 120 | else => |status| return uefi.unexpectedStatus(status), |
| 122 | 121 | } |
| 123 | 122 | } |
| ... | ... | @@ -125,15 +124,15 @@ pub const Udp6 = extern struct { |
| 125 | 124 | pub fn transmit(self: *Udp6, token: *CompletionToken) TransmitError!void { |
| 126 | 125 | switch (self._transmit(self, token)) { |
| 127 | 126 | .success => {}, |
| 128 | .not_started => return Error.NotStarted, | |
| 129 | .no_mapping => return Error.NoMapping, | |
| 130 | .invalid_parameter => return Error.InvalidParameter, | |
| 131 | .access_denied => return Error.AccessDenied, | |
| 132 | .not_ready => return Error.NotReady, | |
| 133 | .out_of_resources => return Error.OutOfResources, | |
| 134 | .not_found => return Error.NotFound, | |
| 135 | .bad_buffer_size => return Error.BadBufferSize, | |
| 136 | .no_media => return Error.NoMedia, | |
| 127 | .not_started => return error.NotStarted, | |
| 128 | .no_mapping => return error.NoMapping, | |
| 129 | .invalid_parameter => return error.InvalidParameter, | |
| 130 | .access_denied => return error.AccessDenied, | |
| 131 | .not_ready => return error.NotReady, | |
| 132 | .out_of_resources => return error.OutOfResources, | |
| 133 | .not_found => return error.NotFound, | |
| 134 | .bad_buffer_size => return error.BadBufferSize, | |
| 135 | .no_media => return error.NoMedia, | |
| 137 | 136 | else => |status| return uefi.unexpectedStatus(status), |
| 138 | 137 | } |
| 139 | 138 | } |
| ... | ... | @@ -141,14 +140,14 @@ pub const Udp6 = extern struct { |
| 141 | 140 | pub fn receive(self: *Udp6, token: *CompletionToken) ReceiveError!void { |
| 142 | 141 | switch (self._receive(self, token)) { |
| 143 | 142 | .success => {}, |
| 144 | .not_started => return Error.NotStarted, | |
| 145 | .no_mapping => return Error.NoMapping, | |
| 146 | .invalid_parameter => return Error.InvalidParameter, | |
| 147 | .out_of_resources => return Error.OutOfResources, | |
| 148 | .device_error => return Error.DeviceError, | |
| 149 | .access_denied => return Error.AccessDenied, | |
| 150 | .not_ready => return Error.NotReady, | |
| 151 | .no_media => return Error.NoMedia, | |
| 143 | .not_started => return error.NotStarted, | |
| 144 | .no_mapping => return error.NoMapping, | |
| 145 | .invalid_parameter => return error.InvalidParameter, | |
| 146 | .out_of_resources => return error.OutOfResources, | |
| 147 | .device_error => return error.DeviceError, | |
| 148 | .access_denied => return error.AccessDenied, | |
| 149 | .not_ready => return error.NotReady, | |
| 150 | .no_media => return error.NoMedia, | |
| 152 | 151 | else => |status| return uefi.unexpectedStatus(status), |
| 153 | 152 | } |
| 154 | 153 | } |
| ... | ... | @@ -156,9 +155,9 @@ pub const Udp6 = extern struct { |
| 156 | 155 | pub fn cancel(self: *Udp6, token: ?*CompletionToken) CancelError!void { |
| 157 | 156 | switch (self._cancel(self, token)) { |
| 158 | 157 | .success => {}, |
| 159 | .invalid_parameter => return Error.InvalidParameter, | |
| 160 | .not_started => return Error.NotStarted, | |
| 161 | .not_found => return Error.NotFound, | |
| 158 | .invalid_parameter => return error.InvalidParameter, | |
| 159 | .not_started => return error.NotStarted, | |
| 160 | .not_found => return error.NotFound, | |
| 162 | 161 | else => |status| return uefi.unexpectedStatus(status), |
| 163 | 162 | } |
| 164 | 163 | } |
| ... | ... | @@ -166,9 +165,9 @@ pub const Udp6 = extern struct { |
| 166 | 165 | pub fn poll(self: *Udp6) PollError!void { |
| 167 | 166 | switch (self._poll(self)) { |
| 168 | 167 | .success => {}, |
| 169 | .invalid_parameter => return Error.InvalidParameter, | |
| 170 | .device_error => return Error.DeviceError, | |
| 171 | .timeout => return Error.Timeout, | |
| 168 | .invalid_parameter => return error.InvalidParameter, | |
| 169 | .device_error => return error.DeviceError, | |
| 170 | .timeout => return error.Timeout, | |
| 172 | 171 | else => |status| return uefi.unexpectedStatus(status), |
| 173 | 172 | } |
| 174 | 173 | } |