From 3eee2cda132bb1213ae0ec85a451a42d765323c3 Mon Sep 17 00:00:00 2001 From: Hqnnqh Date: Fri, 24 Jan 2025 11:53:09 +0100 Subject: [PATCH 1/3] docs: add warning to custom memory type --- uefi-raw/src/table/boot.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index 1dc76b67c..64e6b2aa1 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -439,6 +439,7 @@ impl MemoryType { /// Construct a custom `MemoryType`. Values in the range `0x8000_0000..=0xffff_ffff` are free for use if you are /// an OS loader. + /// **Warning:** Some EFI firmware versions (e.g., OVMF r11337) may crash or behave incorrectly when using a custom `MemoryType`. #[must_use] pub const fn custom(value: u32) -> Self { assert!(value >= 0x80000000); From 6fdbd7d7fc9807b54a9a9a93f5b7a841c190eb15 Mon Sep 17 00:00:00 2001 From: Hqnnqh Date: Fri, 24 Jan 2025 12:05:49 +0100 Subject: [PATCH 2/3] docs: extend warning for custom memory type --- uefi-raw/src/table/boot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index 64e6b2aa1..3aea4daf1 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -439,7 +439,7 @@ impl MemoryType { /// Construct a custom `MemoryType`. Values in the range `0x8000_0000..=0xffff_ffff` are free for use if you are /// an OS loader. - /// **Warning:** Some EFI firmware versions (e.g., OVMF r11337) may crash or behave incorrectly when using a custom `MemoryType`. + /// Warning* Some EFI firmware versions (e.g., OVMF r11337) may crash or [behave incorrectly]() when using a custom `MemoryType`. #[must_use] pub const fn custom(value: u32) -> Self { assert!(value >= 0x80000000); From a3269af73eb351333cee1b57ec003b4aa9a3d022 Mon Sep 17 00:00:00 2001 From: Hannah <53470737+Hqnnqh@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:09:00 +0100 Subject: [PATCH 3/3] docs: use proper formatting Co-authored-by: Philipp Schuster --- uefi-raw/src/table/boot.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index 3aea4daf1..c20705b3f 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -439,7 +439,8 @@ impl MemoryType { /// Construct a custom `MemoryType`. Values in the range `0x8000_0000..=0xffff_ffff` are free for use if you are /// an OS loader. - /// Warning* Some EFI firmware versions (e.g., OVMF r11337) may crash or [behave incorrectly]() when using a custom `MemoryType`. + /// + /// **Warning**: Some EFI firmware versions (e.g., OVMF r11337) may crash or [behave incorrectly](https://wiki.osdev.org/UEFI#My_bootloader_hangs_if_I_use_user_defined_EFI_MEMORY_TYPE_values) when using a custom `MemoryType`. #[must_use] pub const fn custom(value: u32) -> Self { assert!(value >= 0x80000000);