| ... | ... | @@ -158,12 +158,10 @@ pub const BootServices = extern struct { |
| 158 | 158 | _locateProtocol: *const fn (protocol: *const Guid, registration: ?EventRegistration, interface: *?*const anyopaque) callconv(cc) Status, |
| 159 | 159 | |
| 160 | 160 | /// Installs one or more protocol interfaces into the boot services environment |
| 161 | | // TODO: use callconv(cc) instead once that works |
| 162 | | _installMultipleProtocolInterfaces: *const fn (handle: *Handle, ...) callconv(.c) Status, |
| 161 | _installMultipleProtocolInterfaces: *const fn (handle: *?Handle, ...) callconv(cc) Status, |
| 163 | 162 | |
| 164 | 163 | /// Removes one or more protocol interfaces into the boot services environment |
| 165 | | // TODO: use callconv(cc) instead once that works |
| 166 | | _uninstallMultipleProtocolInterfaces: *const fn (handle: *Handle, ...) callconv(.c) Status, |
| 164 | _uninstallMultipleProtocolInterfaces: *const fn (handle: Handle, ...) callconv(cc) Status, |
| 167 | 165 | |
| 168 | 166 | /// Computes and returns a 32-bit CRC for a data buffer. |
| 169 | 167 | _calculateCrc32: *const fn (data: [*]const u8, data_size: usize, *u32) callconv(cc) Status, |
| ... | ... | @@ -1238,8 +1236,9 @@ fn protocolInterfaces( |
| 1238 | 1236 | @TypeOf(interfaces), |
| 1239 | 1237 | ) = undefined; |
| 1240 | 1238 | result[0] = handle_arg; |
| 1239 | result[result.len - 1] = null; |
| 1241 | 1240 | |
| 1242 | | var idx: usize = 1; |
| 1241 | comptime var idx: usize = 1; |
| 1243 | 1242 | inline for (interfaces) |interface| { |
| 1244 | 1243 | const InterfacePtr = @TypeOf(interface); |
| 1245 | 1244 | const Interface = switch (@typeInfo(InterfacePtr)) { |
| ... | ... | @@ -1272,13 +1271,15 @@ fn ProtocolInterfaces(HandleType: type, Interfaces: type) type { |
| 1272 | 1271 | @compileError("expected tuple of protocol interfaces, got " ++ @typeName(Interfaces)); |
| 1273 | 1272 | const interfaces_info = interfaces_type_info.@"struct"; |
| 1274 | 1273 | |
| 1275 | | var tuple_types: [interfaces_info.fields.len * 2 + 1]type = undefined; |
| 1274 | var tuple_types: [interfaces_info.fields.len * 2 + 2]type = undefined; |
| 1276 | 1275 | tuple_types[0] = HandleType; |
| 1276 | tuple_types[tuple_types.len - 1] = ?*const Guid; |
| 1277 | |
| 1277 | 1278 | var idx = 1; |
| 1278 | | while (idx < tuple_types.len) : (idx += 2) { |
| 1279 | while (idx < tuple_types.len - 1) : (idx += 2) { |
| 1279 | 1280 | tuple_types[idx] = *const Guid; |
| 1280 | 1281 | tuple_types[idx + 1] = *const anyopaque; |
| 1281 | 1282 | } |
| 1282 | 1283 | |
| 1283 | | return std.meta.Tuple(tuple_types[0..]); |
| 1284 | return @Tuple(tuple_types[0..]); |
| 1284 | 1285 | } |