hardware 0.0.7

A no_std bare-metal hardware abstraction layer — all port I/O, memory and swap allocations are guarded at runtime. Do not consider this dependency stable before x.1.x
Documentation
#[derive(Copy, Clone)]
pub struct GpuDevice {
    pub bus: u8,
    pub device: u8,
    pub function: u8,
    pub vendor_id: u16,
    pub device_id: u16,
    pub class: u8,
    pub subclass: u8,
    pub prog_if: u8,
    pub bar0: u32,
}

pub fn detect_gpus_impl(out: &mut [GpuDevice]) -> usize {
    if out.is_empty() {
        return 0;
    }
    let found = crate::bus::pci::scan_video_devices(out);
    if found > 0 {
        return found;
    }
    if let crate::arch::Architecture::X86_64 = crate::arch::detect_arch() {
        let status = unsafe { crate::arch::x86_64::io::inb(0x3DA) };
        if status != 0 {
            out[0] = GpuDevice {
                bus: 0,
                device: 0,
                function: 0,
                vendor_id: 0xFFFF,
                device_id: 0xFFFF,
                class: 0x03,
                subclass: 0x00,
                prog_if: 0x00,
                bar0: 0,
            };
            return 1;
        }
    }
    0
}