Skip to content

The only way to get protocol that's available in runtime is deprecated #612

@liferooter

Description

@liferooter

I want to use GOP protocol. So I have to write something like this:

// Get GOP protocol when boot services are still avaliable
let mut gop = system_table
        .boot_services()
        .open_protocol_exclusive::<GraphicsOutput>(handle)?;

/* some code */

// Exit boot services later
let (system_table, memory_map) = exit_boot_services(handle, system_table)?;

I get compile error. system_table is borrowed by ScopedProtocol structure stored in gop variable. So I need to drop gop variable to be able to move system_table. But ScopedProtocol implements Drop. Its drop function closes protocol, so I have no way to use GOP in runtime without usage of deprecated functions to get raw UnsafeCell without unneeded auto-closing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions