unionstd.os.uefi.device_path.DevicePath.BiosBootSpecification[src]

Fields

bbs101: *const BBS101DevicePath

Source Code

Source code
pub const BiosBootSpecification = union(Subtype) {
    bbs101: *const BBS101DevicePath,

    pub const Subtype = enum(u8) {
        bbs101 = 1,
        _,
    };

    pub const BBS101DevicePath = extern struct {
        type: DevicePath.Type,
        subtype: Subtype,
        length: u16 align(1),
        device_type: u16 align(1),
        status_flag: u16 align(1),

        pub fn getDescription(self: *const BBS101DevicePath) [*:0]const u8 {
            return @as([*:0]const u8, @ptrCast(self)) + @sizeOf(BBS101DevicePath);
        }
    };

    comptime {
        assert(8 == @sizeOf(BBS101DevicePath));
        assert(1 == @alignOf(BBS101DevicePath));

        assert(0 == @offsetOf(BBS101DevicePath, "type"));
        assert(1 == @offsetOf(BBS101DevicePath, "subtype"));
        assert(2 == @offsetOf(BBS101DevicePath, "length"));
        assert(4 == @offsetOf(BBS101DevicePath, "device_type"));
        assert(6 == @offsetOf(BBS101DevicePath, "status_flag"));
    }
}