extern structstd.os.uefi.device_path.DevicePath.Acpi.AdrDevicePath[src]

Fields

type: DevicePath.Type
subtype: Subtype
length: u16 align(1)
adr: u32 align(1)

Functions

Functionadrs[src]

pub fn adrs(self: *const AdrDevicePath) []align(1) const u32

Parameters

self: *const AdrDevicePath

Source Code

Source code
pub fn adrs(self: *const AdrDevicePath) []align(1) const u32 {
    // self.length is a minimum of 8 with one adr which is size 4.
    const entries = (self.length - 4) / @sizeOf(u32);
    return @as([*]align(1) const u32, @ptrCast(&self.adr))[0..entries];
}

Source Code

Source code
pub const AdrDevicePath = extern struct {
    type: DevicePath.Type,
    subtype: Subtype,
    length: u16 align(1),
    adr: u32 align(1),

    // multiple adr entries can optionally follow
    pub fn adrs(self: *const AdrDevicePath) []align(1) const u32 {
        // self.length is a minimum of 8 with one adr which is size 4.
        const entries = (self.length - 4) / @sizeOf(u32);
        return @as([*]align(1) const u32, @ptrCast(&self.adr))[0..entries];
    }
}