Skip to content

Commit 5ced740

Browse files
committed
uefi: move constants into ConfigTableEntry
1 parent 6a77e28 commit 5ced740

File tree

1 file changed

+42
-39
lines changed

1 file changed

+42
-39
lines changed

uefi/src/table/cfg.rs

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,53 @@ pub struct ConfigTableEntry {
2626
/// Whether this is a physical or virtual address depends on the table.
2727
pub address: *const c_void,
2828
}
29-
/// Entry pointing to the old ACPI 1 RSDP.
30-
pub const ACPI_GUID: Guid = guid!("eb9d2d30-2d88-11d3-9a16-0090273fc14d");
3129

32-
///Entry pointing to the ACPI 2 RSDP.
33-
pub const ACPI2_GUID: Guid = guid!("8868e871-e4f1-11d3-bc22-0080c73c8881");
30+
impl ConfigTableEntry {
31+
/// Entry pointing to the old ACPI 1 RSDP.
32+
pub const ACPI_GUID: Guid = guid!("eb9d2d30-2d88-11d3-9a16-0090273fc14d");
3433

35-
/// Entry pointing to the SMBIOS 1.0 table.
36-
pub const SMBIOS_GUID: Guid = guid!("eb9d2d31-2d88-11d3-9a16-0090273fc14d");
34+
/// Entry pointing to the ACPI 2 RSDP.
35+
pub const ACPI2_GUID: Guid = guid!("8868e871-e4f1-11d3-bc22-0080c73c8881");
3736

38-
/// Entry pointing to the SMBIOS 3.0 table.
39-
pub const SMBIOS3_GUID: Guid = guid!("f2fd1544-9794-4a2c-992e-e5bbcf20e394");
37+
/// Entry pointing to the SMBIOS 1.0 table.
38+
pub const SMBIOS_GUID: Guid = guid!("eb9d2d31-2d88-11d3-9a16-0090273fc14d");
4039

41-
/// Entry pointing to the EFI System Resource table (ESRT).
42-
pub const ESRT_GUID: Guid = guid!("b122a263-3661-4f68-9929-78f8b0d62180");
40+
/// Entry pointing to the SMBIOS 3.0 table.
41+
pub const SMBIOS3_GUID: Guid = guid!("f2fd1544-9794-4a2c-992e-e5bbcf20e394");
4342

44-
/// GUID of the UEFI properties table.
45-
///
46-
/// The properties table is used to provide additional info
47-
/// about the UEFI implementation.
48-
pub const PROPERTIES_TABLE_GUID: Guid = guid!("880aaca3-4adc-4a04-9079-b747340825e5");
43+
/// Entry pointing to the EFI System Resource table (ESRT).
44+
pub const ESRT_GUID: Guid = guid!("b122a263-3661-4f68-9929-78f8b0d62180");
45+
46+
/// Hand-off Blocks are used to pass data from the early pre-UEFI environment to the UEFI drivers.
47+
///
48+
/// Most OS loaders or applications should not mess with this.
49+
pub const HAND_OFF_BLOCK_LIST_GUID: Guid = guid!("7739f24c-93d7-11d4-9a3a-0090273fc14d");
50+
51+
/// Table used in the early boot environment to record memory ranges.
52+
pub const MEMORY_TYPE_INFORMATION_GUID: Guid = guid!("4c19049f-4137-4dd3-9c10-8b97a83ffdfa");
53+
54+
/// Used to identify Hand-off Blocks which store
55+
/// status codes reported during the pre-UEFI environment.
56+
pub const MEMORY_STATUS_CODE_RECORD_GUID: Guid = guid!("060cc026-4c0d-4dda-8f41-595fef00a502");
57+
58+
/// Table which provides Driver eXecution Environment services.
59+
pub const DXE_SERVICES_GUID: Guid = guid!("05ad34ba-6f02-4214-952e-4da0398e2bb9");
60+
61+
/// LZMA-compressed filesystem.
62+
pub const LZMA_COMPRESS_GUID: Guid = guid!("ee4e5898-3914-4259-9d6e-dc7bd79403cf");
63+
64+
/// A custom compressed filesystem used by the Tiano UEFI implementation.
65+
pub const TIANO_COMPRESS_GUID: Guid = guid!("a31280ad-481e-41b6-95e8-127f4c984779");
66+
67+
/// Pointer to the debug image info table.
68+
pub const DEBUG_IMAGE_INFO_GUID: Guid = guid!("49152e77-1ada-4764-b7a2-7afefed95e8b");
69+
70+
/// GUID of the UEFI properties table.
71+
///
72+
/// The properties table is used to provide additional info
73+
/// about the UEFI implementation.
74+
pub const PROPERTIES_TABLE_GUID: Guid = guid!("880aaca3-4adc-4a04-9079-b747340825e5");
75+
}
4976

5077
/// This table contains additional information about the UEFI implementation.
5178
#[repr(C)]
@@ -73,27 +100,3 @@ bitflags! {
73100
const NON_EXECUTABLE_DATA = 1;
74101
}
75102
}
76-
77-
/// Hand-off Blocks are used to pass data from the early pre-UEFI environment to the UEFI drivers.
78-
///
79-
/// Most OS loaders or applications should not mess with this.
80-
pub const HAND_OFF_BLOCK_LIST_GUID: Guid = guid!("7739f24c-93d7-11d4-9a3a-0090273fc14d");
81-
82-
/// Table used in the early boot environment to record memory ranges.
83-
pub const MEMORY_TYPE_INFORMATION_GUID: Guid = guid!("4c19049f-4137-4dd3-9c10-8b97a83ffdfa");
84-
85-
/// Used to identify Hand-off Blocks which store
86-
/// status codes reported during the pre-UEFI environment.
87-
pub const MEMORY_STATUS_CODE_RECORD_GUID: Guid = guid!("060cc026-4c0d-4dda-8f41-595fef00a502");
88-
89-
/// Table which provides Driver eXecution Environment services.
90-
pub const DXE_SERVICES_GUID: Guid = guid!("05ad34ba-6f02-4214-952e-4da0398e2bb9");
91-
92-
/// LZMA-compressed filesystem.
93-
pub const LZMA_COMPRESS_GUID: Guid = guid!("ee4e5898-3914-4259-9d6e-dc7bd79403cf");
94-
95-
/// A custom compressed filesystem used by the Tiano UEFI implementation.
96-
pub const TIANO_COMPRESS_GUID: Guid = guid!("a31280ad-481e-41b6-95e8-127f4c984779");
97-
98-
/// Pointer to the debug image info table.
99-
pub const DEBUG_IMAGE_INFO_GUID: Guid = guid!("49152e77-1ada-4764-b7a2-7afefed95e8b");

0 commit comments

Comments
 (0)