Move KernelProtocol trait to kernel-protocol feature

This commit is contained in:
Mark 2020-09-21 13:38:43 +03:00
parent 24561381fc
commit daa376a583
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,8 @@
pub trait KernelProtocol: Sized {
const KERNEL_MAGIC: [u8; 8];
}
#[cfg(feature = "kernel-protocol")]
impl KernelProtocol for ProtoV1 {
const KERNEL_MAGIC: [u8; 8] = [

View File

@ -12,6 +12,10 @@ pub mod v1;
pub use v1::ProtoV1;
pub use video::VideoInfo;
pub use mmap::MemoryMapInfo;
#[cfg(feature = "load-protocol")]
pub use load::LoadProtocol;
#[cfg(feature = "kernel-protocol")]
pub use kernel::KernelProtocol;
pub const FLAG_VIDEO: u32 = 1 << 0;
pub const FLAG_INITRD: u32 = 1 << 1;
@ -22,10 +26,6 @@ pub enum Error {
Error
}
pub trait KernelProtocol: Sized {
const KERNEL_MAGIC: [u8; 8];
}
#[repr(C)]
pub struct Header {
pub kernel_magic: [u8; 8],