192849878SLoGin use core::{fmt, mem}; 292849878SLoGin 392849878SLoGin use uefi_raw::Guid; 492849878SLoGin 592849878SLoGin /// 由DragonStub设置的,用于描述内核被放置在的地址的GUID 692849878SLoGin pub static DRAGONSTUB_EFI_PAYLOAD_EFI_GUID: Guid = Guid::new( 792849878SLoGin unsafe { mem::transmute_copy(&0xddf1d47cu32) }, 892849878SLoGin unsafe { mem::transmute_copy(&0x102cu32) }, 992849878SLoGin unsafe { mem::transmute_copy(&0xaaf9u32) }, 1092849878SLoGin 0xce, 1192849878SLoGin 0x34, 1292849878SLoGin [0xbc, 0xef, 0x98, 0x12, 0x00, 0x31], 1392849878SLoGin ); 1492849878SLoGin 15*453452ccSLoGin pub static EFI_MEMORY_ATTRIBUTES_TABLE_GUID: Guid = Guid::new( 16*453452ccSLoGin unsafe { mem::transmute_copy(&0xdcfa911du32) }, 17*453452ccSLoGin unsafe { mem::transmute_copy(&0x26ebu32) }, 18*453452ccSLoGin unsafe { mem::transmute_copy(&0x469fu32) }, 19*453452ccSLoGin 0xa2, 20*453452ccSLoGin 0x20, 21*453452ccSLoGin [0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20], 22*453452ccSLoGin ); 23*453452ccSLoGin 24*453452ccSLoGin pub static EFI_MEMRESERVE_TABLE_GUID: Guid = Guid::new( 25*453452ccSLoGin unsafe { mem::transmute_copy(&0x888eb0c6u32) }, 26*453452ccSLoGin unsafe { mem::transmute_copy(&0x8edeu32) }, 27*453452ccSLoGin unsafe { mem::transmute_copy(&0x4ff5u32) }, 28*453452ccSLoGin 0xa8, 29*453452ccSLoGin 0xf0, 30*453452ccSLoGin [0x9a, 0xee, 0x5c, 0xb9, 0x77, 0xc2], 31*453452ccSLoGin ); 3292849878SLoGin /// 表示内核被加载到的地址的信息。 3392849878SLoGin /// 3492849878SLoGin /// 对应 `DRAGONSTUB_EFI_PAYLOAD_EFI_GUID` 3592849878SLoGin #[derive(Clone, Copy)] 3692849878SLoGin #[repr(C)] 3792849878SLoGin pub struct DragonStubPayloadEFI { 3892849878SLoGin /// 内核文件被加载到的物理地址 3992849878SLoGin pub paddr: u64, 4092849878SLoGin 4192849878SLoGin /// 占用的空间的大小 4292849878SLoGin pub size: u64, 4392849878SLoGin } 4492849878SLoGin 4592849878SLoGin impl fmt::Debug for DragonStubPayloadEFI { 4692849878SLoGin fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 4792849878SLoGin f.debug_struct("DragonStubPayloadEFI") 4892849878SLoGin .field("paddr", &format_args!("0x{:x}", self.paddr)) 4992849878SLoGin .field("size", &self.size) 5092849878SLoGin .finish() 5192849878SLoGin } 5292849878SLoGin } 53