From bcc933048cf1ce68f66b6b5c6648bbbe057c427a Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 6 May 2023 13:36:49 -0400 Subject: [PATCH] Move InterfaceType to uefi-raw Also changed the underlying type to u32. It doesn't really matter in this case; from the FFI perspective they are the same here. But `u32` is more common, so use that. --- uefi-raw/src/table/boot.rs | 7 +++++++ uefi/src/table/boot.rs | 14 +++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index 10ce25d08..a6e40cedd 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -3,6 +3,13 @@ use crate::{PhysicalAddress, VirtualAddress}; use bitflags::bitflags; +newtype_enum! { +/// Interface type of a protocol interface. +pub enum InterfaceType: u32 => { + /// Native interface + NATIVE_INTERFACE = 0, +}} + bitflags! { /// Flags describing the capabilities of a memory range. #[repr(transparent)] diff --git a/uefi/src/table/boot.rs b/uefi/src/table/boot.rs index 8e51ef69c..7a00108b2 100644 --- a/uefi/src/table/boot.rs +++ b/uefi/src/table/boot.rs @@ -20,7 +20,9 @@ use { ::alloc::vec::Vec, }; -pub use uefi_raw::table::boot::{MemoryAttribute, MemoryDescriptor, MemoryType, Tpl}; +pub use uefi_raw::table::boot::{ + InterfaceType, MemoryAttribute, MemoryDescriptor, MemoryType, Tpl, +}; // TODO: this similar to `SyncUnsafeCell`. Once that is stabilized we // can use it instead. @@ -2139,16 +2141,6 @@ impl<'a> HandleBuffer<'a> { } } -newtype_enum! { -/// Interface type of a protocol interface -/// -/// Only has one variant when this was written (v2.10 of the UEFI spec) -pub enum InterfaceType: i32 => { - /// Native interface - NATIVE_INTERFACE = 0, -} -} - /// Opaque pointer returned by [`BootServices::register_protocol_notify`] to be used /// with [`BootServices::locate_handle`] via [`SearchType::ByRegisterNotify`]. #[derive(Debug, Clone, Copy)]