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