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 15453452ccSLoGin pub static EFI_MEMORY_ATTRIBUTES_TABLE_GUID: Guid = Guid::new( 16453452ccSLoGin unsafe { mem::transmute_copy(&0xdcfa911du32) }, 17453452ccSLoGin unsafe { mem::transmute_copy(&0x26ebu32) }, 18453452ccSLoGin unsafe { mem::transmute_copy(&0x469fu32) }, 19453452ccSLoGin 0xa2, 20453452ccSLoGin 0x20, 21453452ccSLoGin [0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20], 22453452ccSLoGin ); 23453452ccSLoGin 24453452ccSLoGin pub static EFI_MEMRESERVE_TABLE_GUID: Guid = Guid::new( 25453452ccSLoGin unsafe { mem::transmute_copy(&0x888eb0c6u32) }, 26453452ccSLoGin unsafe { mem::transmute_copy(&0x8edeu32) }, 27453452ccSLoGin unsafe { mem::transmute_copy(&0x4ff5u32) }, 28453452ccSLoGin 0xa8, 29453452ccSLoGin 0xf0, 30453452ccSLoGin [0x9a, 0xee, 0x5c, 0xb9, 0x77, 0xc2], 31453452ccSLoGin ); 32*471d65cfSLoGin 33*471d65cfSLoGin pub static EFI_SYSTEM_RESOURCE_TABLE_GUID: Guid = Guid::new( 34*471d65cfSLoGin unsafe { mem::transmute_copy(&0xb122a263u32) }, 35*471d65cfSLoGin unsafe { mem::transmute_copy(&0x3661u32) }, 36*471d65cfSLoGin unsafe { mem::transmute_copy(&0x4f68u32) }, 37*471d65cfSLoGin 0x99, 38*471d65cfSLoGin 0x29, 39*471d65cfSLoGin [0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80], 40*471d65cfSLoGin ); 4192849878SLoGin /// 表示内核被加载到的地址的信息。 4292849878SLoGin /// 4392849878SLoGin /// 对应 `DRAGONSTUB_EFI_PAYLOAD_EFI_GUID` 4492849878SLoGin #[derive(Clone, Copy)] 4592849878SLoGin #[repr(C)] 4692849878SLoGin pub struct DragonStubPayloadEFI { 4792849878SLoGin /// 内核文件被加载到的物理地址 4892849878SLoGin pub paddr: u64, 4992849878SLoGin 5092849878SLoGin /// 占用的空间的大小 5192849878SLoGin pub size: u64, 5292849878SLoGin } 5392849878SLoGin 5492849878SLoGin impl fmt::Debug for DragonStubPayloadEFI { fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result5592849878SLoGin fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 5692849878SLoGin f.debug_struct("DragonStubPayloadEFI") 5792849878SLoGin .field("paddr", &format_args!("0x{:x}", self.paddr)) 5892849878SLoGin .field("size", &self.size) 5992849878SLoGin .finish() 6092849878SLoGin } 6192849878SLoGin } 62