html-to-markdown 2.27.2 → 2.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
- data/lib/html_to_markdown/version.rb +1 -1
- data/rust-vendor/getrandom/.cargo-checksum.json +1 -1
- data/rust-vendor/getrandom/.cargo_vcs_info.json +1 -1
- data/rust-vendor/getrandom/CHANGELOG.md +62 -43
- data/rust-vendor/getrandom/Cargo.lock +49 -56
- data/rust-vendor/getrandom/Cargo.toml +2 -2
- data/rust-vendor/getrandom/Cargo.toml.orig +2 -2
- data/rust-vendor/getrandom/src/backends/efi_rng.rs +8 -10
- data/rust-vendor/getrandom/src/backends/getentropy.rs +13 -4
- data/rust-vendor/getrandom/src/backends/linux_android_with_fallback.rs +10 -25
- data/rust-vendor/getrandom/src/backends/netbsd.rs +17 -25
- data/rust-vendor/getrandom/src/backends/rdrand.rs +15 -9
- data/rust-vendor/getrandom/src/backends/rndr.rs +2 -1
- data/rust-vendor/getrandom/src/backends/vxworks.rs +7 -3
- data/rust-vendor/getrandom/src/backends/windows.rs +21 -5
- data/rust-vendor/getrandom/src/utils/lazy_bool.rs +39 -0
- data/rust-vendor/getrandom/src/utils/lazy_ptr.rs +57 -0
- data/rust-vendor/html-to-markdown-rs/Cargo.toml +2 -2
- data/rust-vendor/html-to-markdown-rs/src/converter/text_node.rs +2 -1
- data/rust-vendor/html-to-markdown-rs/tests/issue_216_217_regressions.rs +82 -0
- data/rust-vendor/quote/.cargo-checksum.json +1 -1
- data/rust-vendor/quote/.cargo_vcs_info.json +1 -1
- data/rust-vendor/quote/.github/workflows/ci.yml +2 -2
- data/rust-vendor/quote/Cargo.lock +21 -21
- data/rust-vendor/quote/Cargo.toml +2 -2
- data/rust-vendor/quote/Cargo.toml.orig +2 -2
- data/rust-vendor/quote/README.md +0 -1
- data/rust-vendor/quote/src/lib.rs +1 -1
- data/rust-vendor/quote/src/to_tokens.rs +7 -0
- data/rust-vendor/quote/tests/ui/not-quotable.stderr +1 -1
- data/rust-vendor/quote/tests/ui/not-repeatable.stderr +3 -11
- data/rust-vendor/r-efi/.cargo-checksum.json +1 -1
- data/rust-vendor/r-efi/.cargo_vcs_info.json +1 -1
- data/rust-vendor/r-efi/AUTHORS +1 -0
- data/rust-vendor/r-efi/Cargo.lock +1 -1
- data/rust-vendor/r-efi/Cargo.toml +1 -3
- data/rust-vendor/r-efi/Cargo.toml.orig +1 -5
- data/rust-vendor/r-efi/NEWS.md +16 -0
- data/rust-vendor/r-efi/src/base.rs +1 -1
- data/rust-vendor/r-efi/src/lib.rs +27 -12
- data/rust-vendor/r-efi/src/protocols/absolute_pointer.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/block_io.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/bus_specific_driver_override.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/debug_support.rs +10 -10
- data/rust-vendor/r-efi/src/protocols/debugport.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/decompress.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/device_path_from_text.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/device_path_to_text.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/device_path_utilities.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/disk_io.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/disk_io2.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/driver_binding.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/driver_diagnostics2.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/driver_family_override.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/file.rs +28 -28
- data/rust-vendor/r-efi/src/protocols/graphics_output.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/hii_database.rs +24 -24
- data/rust-vendor/r-efi/src/protocols/hii_font.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/hii_font_ex.rs +10 -10
- data/rust-vendor/r-efi/src/protocols/hii_string.rs +10 -10
- data/rust-vendor/r-efi/src/protocols/ip4.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/ip6.rs +18 -18
- data/rust-vendor/r-efi/src/protocols/load_file.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/loaded_image.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/managed_network.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/memory_attribute.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/mp_services.rs +15 -15
- data/rust-vendor/r-efi/src/protocols/pci_io.rs +26 -26
- data/rust-vendor/r-efi/src/protocols/platform_driver_override.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/rng.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/service_binding.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/shell.rs +81 -81
- data/rust-vendor/r-efi/src/protocols/shell_dynamic_command.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/simple_file_system.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/simple_network.rs +26 -26
- data/rust-vendor/r-efi/src/protocols/simple_text_input.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/simple_text_input_ex.rs +11 -11
- data/rust-vendor/r-efi/src/protocols/simple_text_output.rs +18 -18
- data/rust-vendor/r-efi/src/protocols/tcp4.rs +20 -20
- data/rust-vendor/r-efi/src/protocols/tcp6.rs +18 -18
- data/rust-vendor/r-efi/src/protocols/timestamp.rs +3 -3
- data/rust-vendor/r-efi/src/protocols/udp4.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/udp6.rs +14 -14
- data/rust-vendor/r-efi/src/system.rs +115 -115
- data/rust-vendor/r-efi/src/vendor/intel/console_control.rs +6 -6
- data/rust-vendor/r-efi-5.3.0/.cargo-checksum.json +1 -0
- data/rust-vendor/r-efi-5.3.0/.cargo_vcs_info.json +6 -0
- data/rust-vendor/r-efi-5.3.0/.github/workflows/publish.yml +39 -0
- data/rust-vendor/r-efi-5.3.0/.github/workflows/rust-tests.yml +125 -0
- data/rust-vendor/r-efi-5.3.0/AUTHORS +74 -0
- data/rust-vendor/r-efi-5.3.0/Cargo.lock +16 -0
- data/rust-vendor/r-efi-5.3.0/Cargo.toml +70 -0
- data/rust-vendor/r-efi-5.3.0/Cargo.toml.orig +51 -0
- data/rust-vendor/r-efi-5.3.0/Makefile +85 -0
- data/rust-vendor/r-efi-5.3.0/NEWS.md +301 -0
- data/rust-vendor/r-efi-5.3.0/README.md +99 -0
- data/rust-vendor/r-efi-5.3.0/examples/freestanding.rs +34 -0
- data/rust-vendor/r-efi-5.3.0/examples/gop-query.rs +188 -0
- data/rust-vendor/r-efi-5.3.0/examples/hello-world.rs +55 -0
- data/rust-vendor/r-efi-5.3.0/src/base.rs +993 -0
- data/rust-vendor/r-efi-5.3.0/src/hii.rs +1300 -0
- data/rust-vendor/r-efi-5.3.0/src/lib.rs +182 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/absolute_pointer.rs +69 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/block_io.rs +70 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/bus_specific_driver_override.rs +32 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/debug_support.rs +835 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/debugport.rs +42 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/decompress.rs +37 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path.rs +82 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path_from_text.rs +26 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path_to_text.rs +30 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path_utilities.rs +63 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/disk_io.rs +40 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/disk_io2.rs +58 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/driver_binding.rs +42 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/driver_diagnostics2.rs +38 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/driver_family_override.rs +23 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/file.rs +183 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/graphics_output.rs +103 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_database.rs +299 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_font.rs +87 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_font_ex.rs +107 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_package_list.rs +14 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_string.rs +71 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/ip4.rs +202 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/ip6.rs +264 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/load_file.rs +26 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/load_file2.rs +15 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/loaded_image.rs +39 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/loaded_image_device_path.rs +13 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/managed_network.rs +147 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/memory_attribute.rs +40 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/mp_services.rs +121 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/pci_io.rs +203 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/platform_driver_override.rs +46 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/rng.rs +83 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/service_binding.rs +20 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/shell.rs +295 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/shell_dynamic_command.rs +33 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/shell_parameters.rs +23 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_file_system.rs +26 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_network.rs +196 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_text_input.rs +38 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_text_input_ex.rs +85 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_text_output.rs +86 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/tcp4.rs +224 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/tcp6.rs +202 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/timestamp.rs +32 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/udp4.rs +151 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/udp6.rs +137 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols.rs +54 -0
- data/rust-vendor/r-efi-5.3.0/src/system.rs +1130 -0
- data/rust-vendor/r-efi-5.3.0/src/vendor/intel/console_control.rs +37 -0
- data/rust-vendor/r-efi-5.3.0/src/vendor.rs +10 -0
- data/rust-vendor/tokio/.cargo-checksum.json +1 -1
- data/rust-vendor/tokio/.cargo_vcs_info.json +1 -1
- data/rust-vendor/tokio/CHANGELOG.md +94 -0
- data/rust-vendor/tokio/Cargo.lock +1549 -0
- data/rust-vendor/tokio/Cargo.toml +96 -83
- data/rust-vendor/tokio/Cargo.toml.orig +7 -7
- data/rust-vendor/tokio/README.md +1 -1
- data/rust-vendor/tokio/src/fs/open_options.rs +4 -1
- data/rust-vendor/tokio/src/fs/read.rs +4 -1
- data/rust-vendor/tokio/src/fs/write.rs +4 -1
- data/rust-vendor/tokio/src/io/async_write.rs +3 -4
- data/rust-vendor/tokio/src/io/poll_evented.rs +23 -1
- data/rust-vendor/tokio/src/io/stderr.rs +15 -1
- data/rust-vendor/tokio/src/io/stdout.rs +14 -0
- data/rust-vendor/tokio/src/io/util/async_write_ext.rs +2 -2
- data/rust-vendor/tokio/src/io/util/write_buf.rs +11 -2
- data/rust-vendor/tokio/src/lib.rs +12 -28
- data/rust-vendor/tokio/src/macros/select.rs +6 -8
- data/rust-vendor/tokio/src/net/tcp/socket.rs +25 -1
- data/rust-vendor/tokio/src/net/tcp/stream.rs +40 -1
- data/rust-vendor/tokio/src/process/unix/pidfd_reaper.rs +1 -41
- data/rust-vendor/tokio/src/runtime/blocking/pool.rs +18 -14
- data/rust-vendor/tokio/src/runtime/builder.rs +10 -4
- data/rust-vendor/tokio/src/runtime/handle.rs +3 -2
- data/rust-vendor/tokio/src/runtime/io/driver/uring.rs +49 -61
- data/rust-vendor/tokio/src/runtime/io/driver.rs +6 -5
- data/rust-vendor/tokio/src/runtime/mod.rs +20 -1
- data/rust-vendor/tokio/src/runtime/runtime.rs +71 -1
- data/rust-vendor/tokio/src/runtime/scheduler/current_thread/mod.rs +24 -8
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs +5 -0
- data/rust-vendor/tokio/src/runtime/task/core.rs +1 -0
- data/rust-vendor/tokio/src/runtime/task/join.rs +7 -3
- data/rust-vendor/tokio/src/runtime/task/list.rs +5 -3
- data/rust-vendor/tokio/src/runtime/task/mod.rs +0 -5
- data/rust-vendor/tokio/src/runtime/tests/loom_blocking.rs +39 -1
- data/rust-vendor/tokio/src/signal/mod.rs +6 -17
- data/rust-vendor/tokio/src/signal/registry.rs +1 -1
- data/rust-vendor/tokio/src/signal/unix.rs +24 -44
- data/rust-vendor/tokio/src/signal/windows/sys.rs +52 -64
- data/rust-vendor/tokio/src/signal/windows.rs +35 -23
- data/rust-vendor/tokio/src/sync/mpsc/mod.rs +3 -1
- data/rust-vendor/tokio/src/sync/oneshot.rs +13 -0
- data/rust-vendor/tokio/src/sync/rwlock.rs +4 -5
- data/rust-vendor/tokio/src/sync/tests/loom_oneshot.rs +27 -1
- data/rust-vendor/tokio/src/task/blocking.rs +16 -1
- data/rust-vendor/tokio/src/task/builder.rs +2 -2
- data/rust-vendor/tokio/src/task/mod.rs +1 -1
- data/rust-vendor/tokio/src/task/spawn.rs +8 -3
- data/rust-vendor/tokio/src/task/yield_now.rs +13 -23
- data/rust-vendor/tokio/src/time/clock.rs +62 -0
- data/rust-vendor/tokio/src/util/memchr.rs +32 -4
- data/rust-vendor/tokio/src/util/sharded_list.rs +6 -4
- data/rust-vendor/tokio/tests/fs_link.rs +54 -0
- data/rust-vendor/tokio/tests/io_async_fd_memory_leak.rs +209 -0
- data/rust-vendor/tokio/tests/io_write_buf.rs +56 -0
- data/rust-vendor/tokio/tests/process_issue_7144.rs +8 -0
- data/rust-vendor/tokio/tests/rt_basic.rs +41 -0
- data/rust-vendor/tokio/tests/rt_common_before_park.rs +92 -0
- data/rust-vendor/tokio/tests/rt_metrics.rs +1 -1
- data/rust-vendor/tokio/tests/rt_panic.rs +12 -0
- data/rust-vendor/tokio/tests/rt_shutdown_err.rs +82 -0
- data/rust-vendor/tokio/tests/rt_threaded.rs +49 -1
- data/rust-vendor/tokio/tests/rt_unstable_metrics.rs +32 -0
- data/rust-vendor/tokio/tests/tcp_connect.rs +2 -3
- data/rust-vendor/tokio/tests/tcp_shutdown.rs +1 -3
- data/rust-vendor/tokio/tests/tcp_socket.rs +3 -4
- data/rust-vendor/tokio/tests/tcp_stream.rs +3 -0
- metadata +78 -3
- data/rust-vendor/getrandom/src/utils/lazy.rs +0 -64
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# r-efi - UEFI Reference Specification Protocol Constants and Definitions
|
|
2
|
+
|
|
3
|
+
## CHANGES WITH 5.3.0:
|
|
4
|
+
|
|
5
|
+
* Remove the optional dependency on `compiler-builtins`, which was
|
|
6
|
+
needed to build r-efi as part of rustc. This is no longer necessary.
|
|
7
|
+
|
|
8
|
+
Contributions from: David Rheinsberg, Trevor Gross
|
|
9
|
+
|
|
10
|
+
- Dußlingen, 2025-06-17
|
|
11
|
+
|
|
12
|
+
## CHANGES WITH 5.2.0:
|
|
13
|
+
|
|
14
|
+
* Add the memory attribute protocol.
|
|
15
|
+
|
|
16
|
+
Contributions from: David Rheinsberg, Oliver Smith-Denny
|
|
17
|
+
|
|
18
|
+
- Dußlingen, 2024-12-22
|
|
19
|
+
|
|
20
|
+
## CHANGES WITH 5.1.0:
|
|
21
|
+
|
|
22
|
+
* Mark `Guid::as_bytes` and `Guid::from_bytes` as `const fn`, aligning
|
|
23
|
+
them with the other methods on `Guid`. This helps creating constant
|
|
24
|
+
GUIDs via macros or other external helpers.
|
|
25
|
+
|
|
26
|
+
Contributions from: Christopher Zurcher, David Rheinsberg
|
|
27
|
+
|
|
28
|
+
- Dußlingen, 2024-09-01
|
|
29
|
+
|
|
30
|
+
## CHANGES WITH 5.0.0:
|
|
31
|
+
|
|
32
|
+
* Change the type of the `unload` function-pointer of the Loaded Image
|
|
33
|
+
Protocol to `Option<Unload>`, given that it can be `NULL` to indicate
|
|
34
|
+
that the image cannot be unloaded.
|
|
35
|
+
This is a major API break, but any users very likely need to adjust
|
|
36
|
+
anyway to avoid NULL-derefs.
|
|
37
|
+
|
|
38
|
+
Contributions from: David Rheinsberg, John Schock
|
|
39
|
+
|
|
40
|
+
- Dußlingen, 2024-07-30
|
|
41
|
+
|
|
42
|
+
## CHANGES WITH 4.5.0:
|
|
43
|
+
|
|
44
|
+
* Implement or derive more standard traits for UEFI base types. In
|
|
45
|
+
particular, implement `[Partial]Eq`, `Hash`, `[Partial]Ord` for
|
|
46
|
+
`Boolean`, `Status`, `Guid`, and network address types.
|
|
47
|
+
|
|
48
|
+
* Fix the signature of `BootUninstallMultipleProtocolInterfaces` to
|
|
49
|
+
match the UEFI specification. Note that it uses var-args and is thus
|
|
50
|
+
not fully usable from stable Rust.
|
|
51
|
+
|
|
52
|
+
Contributions from: Ayush Singh, David Rheinsberg, John Schock
|
|
53
|
+
|
|
54
|
+
- Dußlingen, 2024-05-23
|
|
55
|
+
|
|
56
|
+
## CHANGES WITH 4.4.0:
|
|
57
|
+
|
|
58
|
+
* Add definitions for `UNACCEPTED_MEMORY_TYPE`, media device subtypes
|
|
59
|
+
for device paths, before-EBS and after-RTB event groups, missing
|
|
60
|
+
memory attributes.
|
|
61
|
+
|
|
62
|
+
* Add memory masks for common memory attribute classes. The symbol
|
|
63
|
+
names are takend from EDK2, yet their purpose is defined in the
|
|
64
|
+
specification.
|
|
65
|
+
|
|
66
|
+
* New protocols: platform_driver_override, bus_specific_driver_override,
|
|
67
|
+
driver_family_override, load_file, load_file2, pci-io
|
|
68
|
+
|
|
69
|
+
Contributions from: David Rheinsberg, Dmitry Mostovenko, John Schock,
|
|
70
|
+
Michael Kubacki
|
|
71
|
+
|
|
72
|
+
- Dußlingen, 2024-03-27
|
|
73
|
+
|
|
74
|
+
## CHANGES WITH 4.3.0:
|
|
75
|
+
|
|
76
|
+
* Change alignment of `Guid` to 4 (was 8 before). This deviates from
|
|
77
|
+
the specification, but aligns with EDK2. This should fix alignment
|
|
78
|
+
mismatches when combining r-efi with EDK2, or other UEFI
|
|
79
|
+
implementations.
|
|
80
|
+
|
|
81
|
+
* `Guid` gained a new constructor `from_bytes()` to allow creating
|
|
82
|
+
GUID-abstractions from foreign types based on the standardized
|
|
83
|
+
memory representation.
|
|
84
|
+
|
|
85
|
+
* Add all configuration-table GUIDs mentioned in the spec. These are
|
|
86
|
+
often rooted in external specifications, but are strongly related
|
|
87
|
+
to UEFI.
|
|
88
|
+
|
|
89
|
+
* Add configuration-table definitions for RT_PROPERTIES and
|
|
90
|
+
CONFORMANCE_PROFILES.
|
|
91
|
+
|
|
92
|
+
* New protocols: hii_package_list, absolute_pointer
|
|
93
|
+
|
|
94
|
+
Contributions from: David Rheinsberg, John Schock, Michael Kubacki,
|
|
95
|
+
Nicholas Bishop
|
|
96
|
+
|
|
97
|
+
- Dußlingen, 2023-10-18
|
|
98
|
+
|
|
99
|
+
## CHANGES WITH 4.2.0:
|
|
100
|
+
|
|
101
|
+
* Bump required compiler version to: rust-1.68
|
|
102
|
+
|
|
103
|
+
* New Protocols: debugport, debug-support, driver-diagnostics2,
|
|
104
|
+
mp-services, shell, shell-dynamic-command,
|
|
105
|
+
shell-parameters, udp-4, udp-6
|
|
106
|
+
|
|
107
|
+
* Use const-generics instead of ZSTs to represent dynamic trailing
|
|
108
|
+
members in C structs.
|
|
109
|
+
|
|
110
|
+
* The `examples` feature has been renamed to `native` (a backwards
|
|
111
|
+
compatible feature is left in place).
|
|
112
|
+
|
|
113
|
+
* Add support for riscv64.
|
|
114
|
+
|
|
115
|
+
* Use the official rust `efiapi` calling convention. This was
|
|
116
|
+
stabilized with rust-1.68.
|
|
117
|
+
|
|
118
|
+
Contributions from: Ayush Singh, David Rheinsberg, Rob Bradford
|
|
119
|
+
|
|
120
|
+
- Dußlingen, 2023-03-20
|
|
121
|
+
|
|
122
|
+
## CHANGES WITH 4.1.0:
|
|
123
|
+
|
|
124
|
+
* New Protocols: device-path-{from,to}-text, ip4, ip6, managed-network,
|
|
125
|
+
rng, service-binding, tcp4, tcp6, timestamp
|
|
126
|
+
|
|
127
|
+
* `ImageEntryPoint` is now correctly annotated as `eficall`.
|
|
128
|
+
|
|
129
|
+
* `Time` now derives `Default`.
|
|
130
|
+
|
|
131
|
+
* Fix nullable function pointers to use `Option<fn ...>`.
|
|
132
|
+
|
|
133
|
+
* Function prototypes now have an explicit type definition and can be
|
|
134
|
+
used independent of their protocol definition.
|
|
135
|
+
|
|
136
|
+
* The new `rust-dep-of-std` feature option allows pulling in r-efi
|
|
137
|
+
into the rust standard library. It prepares the crate workspace to
|
|
138
|
+
be suitable for the standard library. It has no use outside of this.
|
|
139
|
+
|
|
140
|
+
* Adopt the MIT license as 3rd licensing option to allow for
|
|
141
|
+
integration into the rust compiler and ecosystem.
|
|
142
|
+
|
|
143
|
+
Contributions from: Ayush Singh, David Rheinsberg, Joe Richey
|
|
144
|
+
|
|
145
|
+
- Tübingen, 2022-08-23
|
|
146
|
+
|
|
147
|
+
## CHANGES WITH 4.0.0:
|
|
148
|
+
|
|
149
|
+
* Convert all enums to constants with type-aliases. This is an API
|
|
150
|
+
break, but it is needed for spec-compliance. With the old enums, one
|
|
151
|
+
couldn't encode all the possible values defined by the spec.
|
|
152
|
+
Especially, the vendor-reserved ranges were unable to be encoded in
|
|
153
|
+
a safe manner. Also see commit 401a91901e860 for a detailed
|
|
154
|
+
discussion.
|
|
155
|
+
API users likely need to convert their CamelCase enum usage to the
|
|
156
|
+
new UPPER_CASE constants.
|
|
157
|
+
|
|
158
|
+
* Convert all incomplete types to empty arrays. This affects all
|
|
159
|
+
structures that use trailing unbound arrays. These are actually ABI
|
|
160
|
+
incompatible with UEFI, since rust represents raw-pointers to such
|
|
161
|
+
types as fat-pointers. Such arrays have now been converted to empty
|
|
162
|
+
arrays, which should still allow accessing the memory location and
|
|
163
|
+
retaining structure properties, but avoids fat-pointers.
|
|
164
|
+
This is an API break, so you might have to adjust your accessors of
|
|
165
|
+
those trailing structure members.
|
|
166
|
+
|
|
167
|
+
* Implement `Clone` and `Copy` for most basic structures. Since these
|
|
168
|
+
are used as plain carriers, no higher clone/copy logic is needed. It
|
|
169
|
+
should be clear from the project-description, that only basic UEFI
|
|
170
|
+
compatibility is provided.
|
|
171
|
+
|
|
172
|
+
* Add the console-control vendor protocol. This protocol allows
|
|
173
|
+
controlling console properties. It is not part of the UEFI
|
|
174
|
+
specification, but rather defined by the TianoCore project.
|
|
175
|
+
|
|
176
|
+
* Add a new example showing how to use the GOP functions to query the
|
|
177
|
+
active graphics device.
|
|
178
|
+
|
|
179
|
+
Contributions from: David Rheinsberg, GGRei, Hiroki Tokunaga,
|
|
180
|
+
Richard Wiedenhöft
|
|
181
|
+
|
|
182
|
+
- Tübingen, 2021-06-23
|
|
183
|
+
|
|
184
|
+
## CHANGES WITH 3.2.0:
|
|
185
|
+
|
|
186
|
+
* Add new protocols: DiskIo, DiskIo2, BlockIo, DriverBinding
|
|
187
|
+
|
|
188
|
+
* Extend the Device-Path payload structure and add the HardDriveMedia
|
|
189
|
+
payload.
|
|
190
|
+
|
|
191
|
+
* Add HII definitions: A new top-level module `hii` with all the basic
|
|
192
|
+
HII constants, as well as a handful of HII protocols (hii_database,
|
|
193
|
+
hii_font, hii_string)
|
|
194
|
+
|
|
195
|
+
* Document new `-Zbuild-std` based cross-compilation, serving as
|
|
196
|
+
official rust alternative to cargo-xbuild.
|
|
197
|
+
|
|
198
|
+
Contributions from: Alex James, Bret Barkelew, David Rheinsberg,
|
|
199
|
+
Michael Kubacki
|
|
200
|
+
|
|
201
|
+
- Tübingen, 2020-10-23
|
|
202
|
+
|
|
203
|
+
## CHANGES WITH 3.1.0:
|
|
204
|
+
|
|
205
|
+
* Add the basic networking types to `r_efi::base`. This includes MAC
|
|
206
|
+
and IP address types.
|
|
207
|
+
|
|
208
|
+
* Add the EFI_SIMPLE_NETWORK_PROTOCOL definitions and all required
|
|
209
|
+
constants to make basic networking available.
|
|
210
|
+
|
|
211
|
+
* Add a new uefi-cross example, which is copied from upstream rustc
|
|
212
|
+
sources, so we can test local modifications to it.
|
|
213
|
+
|
|
214
|
+
Contributions from: Alex James, David Rheinsberg
|
|
215
|
+
|
|
216
|
+
- Tübingen, 2020-09-10
|
|
217
|
+
|
|
218
|
+
## CHANGES WITH 3.0.0:
|
|
219
|
+
|
|
220
|
+
* Fix a missing parameter in `BootServices::locate_device_path()`. The
|
|
221
|
+
prototype incorrectly had 2 arguments, while the official version
|
|
222
|
+
takes 3. The final `handle` argument was missing.
|
|
223
|
+
This is an API break in `r-efi`. It should have a limited impact,
|
|
224
|
+
since the function was mostly useless without a handle.
|
|
225
|
+
Thanks to Michael Kubacki for catching this!
|
|
226
|
+
|
|
227
|
+
* Adjust the `device_path` parameter in a bunch of `BootServices`
|
|
228
|
+
calls. This used to take a `*mut c_void` parameter, since the device
|
|
229
|
+
path protocol was not implemented.
|
|
230
|
+
Since we have to bump the major version anyway, we use this to also
|
|
231
|
+
fix these argument-types to the correct device-path protocol type,
|
|
232
|
+
which has been implemented some time ago.
|
|
233
|
+
|
|
234
|
+
Contributions from: David Rheinsberg, Michael Kubacki
|
|
235
|
+
|
|
236
|
+
- Tübingen, 2020-04-24
|
|
237
|
+
|
|
238
|
+
## CHANGES WITH 2.2.0:
|
|
239
|
+
|
|
240
|
+
* Provide `as_usize()` accessor for `efi::Status` types. This allows
|
|
241
|
+
accessing the raw underlying value of a status object.
|
|
242
|
+
|
|
243
|
+
* The project moved to its new home at: github.com/r-efi/r-efi
|
|
244
|
+
|
|
245
|
+
Contributions from: David Rheinsberg, Joe Richey
|
|
246
|
+
|
|
247
|
+
- Tübingen, 2020-04-16
|
|
248
|
+
|
|
249
|
+
## CHANGES WITH 2.1.0:
|
|
250
|
+
|
|
251
|
+
* Add the graphics-output-protocol.
|
|
252
|
+
|
|
253
|
+
* Expose reserved fields in open structures, otherwise they cannot be
|
|
254
|
+
instantiated from outside the crate itself.
|
|
255
|
+
|
|
256
|
+
Contributions from: David Herrmann, Richard Wiedenhöft, Rob Bradford
|
|
257
|
+
|
|
258
|
+
- Tübingen, 2019-03-20
|
|
259
|
+
|
|
260
|
+
## CHANGES WITH 2.0.0:
|
|
261
|
+
|
|
262
|
+
* Add a set of UEFI protocols, including simple-text-input,
|
|
263
|
+
file-protocol, simple-file-system, device-path, and more.
|
|
264
|
+
|
|
265
|
+
* Fix signature of `BootServices::allocate_pages`.
|
|
266
|
+
|
|
267
|
+
Contributions from: David Rheinsberg, Richard Wiedenhöft, Tom Gundersen
|
|
268
|
+
|
|
269
|
+
- Tübingen, 2019-03-01
|
|
270
|
+
|
|
271
|
+
## CHANGES WITH 1.0.0:
|
|
272
|
+
|
|
273
|
+
* Enhance the basic UEFI type integration with the rust ecosystem. Add
|
|
274
|
+
`Debug`, `Eq`, `Ord`, ... derivations, provide converters to/from the
|
|
275
|
+
core library, and document the internal workings.
|
|
276
|
+
|
|
277
|
+
* Fix `Boolean` to use `newtype(u8)` to make it ABI compatible to UEFI.
|
|
278
|
+
This now accepts any byte value that UEFI accetps without any
|
|
279
|
+
conversion required.
|
|
280
|
+
|
|
281
|
+
Contributions from: Boris-Chengbiao Zhou, David Rheinsberg, Tom
|
|
282
|
+
Gundersen
|
|
283
|
+
|
|
284
|
+
- Tübingen, 2019-02-14
|
|
285
|
+
|
|
286
|
+
## CHANGES WITH 0.1.1:
|
|
287
|
+
|
|
288
|
+
* Feature gate examples to make `cargo test` work on non-UEFI systems
|
|
289
|
+
like CI.
|
|
290
|
+
|
|
291
|
+
Contributions from: David Herrmann
|
|
292
|
+
|
|
293
|
+
- Tübingen, 2018-12-10
|
|
294
|
+
|
|
295
|
+
## CHANGES WITH 0.1.0:
|
|
296
|
+
|
|
297
|
+
* Initial release of r-efi.
|
|
298
|
+
|
|
299
|
+
Contributions from: David Herrmann
|
|
300
|
+
|
|
301
|
+
- Tübingen, 2018-12-10
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
r-efi
|
|
2
|
+
=====
|
|
3
|
+
|
|
4
|
+
UEFI Reference Specification Protocol Constants and Definitions
|
|
5
|
+
|
|
6
|
+
The r-efi project provides the protocol constants and definitions of the
|
|
7
|
+
UEFI Reference Specification as native rust code. The scope of this project is
|
|
8
|
+
limited to those protocol definitions. The protocols are not actually
|
|
9
|
+
implemented. As such, this project serves as base for any UEFI application that
|
|
10
|
+
needs to interact with UEFI, or implement (parts of) the UEFI specification.
|
|
11
|
+
|
|
12
|
+
### Project
|
|
13
|
+
|
|
14
|
+
* **Website**: <https://github.com/r-efi/r-efi/wiki>
|
|
15
|
+
* **Bug Tracker**: <https://github.com/r-efi/r-efi/issues>
|
|
16
|
+
|
|
17
|
+
### Requirements
|
|
18
|
+
|
|
19
|
+
The requirements for this project are:
|
|
20
|
+
|
|
21
|
+
* `rustc >= 1.68.0`
|
|
22
|
+
|
|
23
|
+
### Build
|
|
24
|
+
|
|
25
|
+
To build this project, run:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
cargo build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Available configuration options are:
|
|
32
|
+
|
|
33
|
+
* **native**: This feature-selector enables compilation of modules and
|
|
34
|
+
examples that require native UEFI targets. Those will not
|
|
35
|
+
compile on foreign targets and thus are guarded by this flag.
|
|
36
|
+
|
|
37
|
+
##### Build via: official toolchains
|
|
38
|
+
|
|
39
|
+
Starting with rust-version 1.68, rustup distributes pre-compiled toolchains for
|
|
40
|
+
many UEFI targets. You can enumerate and install them via `rustup`. This
|
|
41
|
+
example shows how to enumerate all available targets for your stable toolchain
|
|
42
|
+
and then install the UEFI target for the `x86_64` architecture:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
rustup target list --toolchain=stable
|
|
46
|
+
rustup target add --toolchain=stable x86_64-unknown-uefi
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This project can then be compiled directly for the selected target:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
cargo +stable build \
|
|
53
|
+
--examples \
|
|
54
|
+
--features native \
|
|
55
|
+
--lib \
|
|
56
|
+
--target x86_64-unknown-uefi
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
##### Build via: cargo/rustc nightly with -Zbuild-std
|
|
60
|
+
|
|
61
|
+
If no pre-compiled toolchains are available for your selected target, you can
|
|
62
|
+
compile the project and the required parts of the standard library via the
|
|
63
|
+
experimental `-Zbuild-std` feature of rustc. This requires a nightly compiler:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
cargo +nightly build \
|
|
67
|
+
-Zbuild-std=core,compiler_builtins,alloc \
|
|
68
|
+
-Zbuild-std-features=compiler-builtins-mem \
|
|
69
|
+
--examples \
|
|
70
|
+
--features native \
|
|
71
|
+
--lib \
|
|
72
|
+
--target x86_64-unknown-uefi
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
##### Build via: foreign target
|
|
76
|
+
|
|
77
|
+
The project can be built for non-UEFI targets via the standard rust toolchains.
|
|
78
|
+
This allows non-UEFI targets to interact with UEFI systems or otherwise host
|
|
79
|
+
UEFI operations. Furthermore, this allows running the foreign test-suite of
|
|
80
|
+
this project as long as the target supports the full standard library:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
cargo +stable build --all-targets
|
|
84
|
+
cargo +stable test --all-targets
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Note that the `native` feature must not be enabled for foreign targets as it
|
|
88
|
+
will not compile on non-UEFI systems.
|
|
89
|
+
|
|
90
|
+
### Repository:
|
|
91
|
+
|
|
92
|
+
- **web**: <https://github.com/r-efi/r-efi>
|
|
93
|
+
- **https**: `https://github.com/r-efi/r-efi.git`
|
|
94
|
+
- **ssh**: `git@github.com:r-efi/r-efi.git`
|
|
95
|
+
|
|
96
|
+
### License:
|
|
97
|
+
|
|
98
|
+
- **MIT** OR **Apache-2.0** OR **LGPL-2.1-or-later**
|
|
99
|
+
- See AUTHORS file for details.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Example: Freestanding
|
|
2
|
+
//
|
|
3
|
+
// This example is a plain UEFI application without any external requirements
|
|
4
|
+
// but `core`. It immediately returns control to the caller upon execution,
|
|
5
|
+
// yielding the exit code 0.
|
|
6
|
+
//
|
|
7
|
+
// The `main` function serves as entry-point. Depending on your
|
|
8
|
+
// target-configuration, it must be exported with a pre-configured name so the
|
|
9
|
+
// linker will correctly mark it as entry-point. The target configurations
|
|
10
|
+
// shipped with upstream rust-lang use `efi_main` as symbol name.
|
|
11
|
+
//
|
|
12
|
+
// Additionally, a panic handler is provided. This is executed by rust on
|
|
13
|
+
// panic. For simplicity, we simply end up in an infinite loop. For real
|
|
14
|
+
// applications, this method should probably call into
|
|
15
|
+
// `SystemTable->boot_services->exit()` to exit the UEFI application. Note,
|
|
16
|
+
// however, that UEFI applications are likely to run in the same address space
|
|
17
|
+
// as the entire firmware. Hence, halting the machine might be a viable
|
|
18
|
+
// alternative. All that is out-of-scope for this example, though.
|
|
19
|
+
//
|
|
20
|
+
// Note that as of rust-1.31.0, all features used here are stabilized. No
|
|
21
|
+
// unstable features are required, nor do we rely on nightly compilers.
|
|
22
|
+
|
|
23
|
+
#![no_main]
|
|
24
|
+
#![no_std]
|
|
25
|
+
|
|
26
|
+
#[panic_handler]
|
|
27
|
+
fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
|
|
28
|
+
loop {}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#[export_name = "efi_main"]
|
|
32
|
+
pub extern "C" fn main(_h: *mut core::ffi::c_void, _st: *mut core::ffi::c_void) -> usize {
|
|
33
|
+
0
|
|
34
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// Example: Graphics Query
|
|
2
|
+
//
|
|
3
|
+
// This is a slightly more complex UEFI application than `hello-world`. It
|
|
4
|
+
// locates the graphics-output-protocol, queries its current mode and prints
|
|
5
|
+
// the current resolution to the UEFI console.
|
|
6
|
+
//
|
|
7
|
+
// This example should make everyone aware that UEFI programing in Rust really
|
|
8
|
+
// asks for helper layers. While the C/FFI/Spec API can be used directly, it
|
|
9
|
+
// is quite cumbersome. Especially the error handling is overly difficult.
|
|
10
|
+
//
|
|
11
|
+
// Nevertheless, this example shows how to find UEFI protocol and invoke
|
|
12
|
+
// their member functions.
|
|
13
|
+
//
|
|
14
|
+
// Like all the other r-efi examples, it is a standalone example. That is, no
|
|
15
|
+
// UTF-16 helpers are pulled in, nor any allocators or panic frameworks. For
|
|
16
|
+
// real world scenarios, you really should choose such helpers.
|
|
17
|
+
|
|
18
|
+
#![no_main]
|
|
19
|
+
#![no_std]
|
|
20
|
+
|
|
21
|
+
use r_efi::efi;
|
|
22
|
+
|
|
23
|
+
#[panic_handler]
|
|
24
|
+
fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
|
|
25
|
+
loop {}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fn fail(_r: efi::Status) -> ! {
|
|
29
|
+
panic!();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// A simple `itoa()`-ish function that takes a u32 and turns it into a UTF-16
|
|
33
|
+
// string. It always prints exactly 10 characters, so leading zeroes are used
|
|
34
|
+
// for small numbers.
|
|
35
|
+
fn utoa(mut u: u32, a: &mut [u16]) {
|
|
36
|
+
for i in 0..10 {
|
|
37
|
+
a[9 - i] = 0x0030u16 + ((u % 10) as u16);
|
|
38
|
+
u = u / 10;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// A simple helper that takes two integers and prints them to the UEFI console
|
|
43
|
+
// with a short prefix. It uses a UTF-16 buffer and fills in the numbers before
|
|
44
|
+
// printing the entire buffer.
|
|
45
|
+
fn print_xy(st: *mut efi::SystemTable, x: u32, y: u32) {
|
|
46
|
+
let mut s = [
|
|
47
|
+
0x0058u16, 0x0059u16, 0x003au16, // "XY:"
|
|
48
|
+
0x0020u16, // " "
|
|
49
|
+
0x0020u16, 0x0020u16, 0x0020u16, 0x0020u16, // " "
|
|
50
|
+
0x0020u16, 0x0020u16, 0x0020u16, 0x0020u16, // " "
|
|
51
|
+
0x0020u16, 0x0020u16, // " "
|
|
52
|
+
0x0078u16, // "x"
|
|
53
|
+
0x0020u16, 0x0020u16, 0x0020u16, 0x0020u16, // " "
|
|
54
|
+
0x0020u16, 0x0020u16, 0x0020u16, 0x0020u16, // " "
|
|
55
|
+
0x0020u16, 0x0020u16, // " "
|
|
56
|
+
0x000au16, // "\n"
|
|
57
|
+
0x0000u16, // NUL
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
utoa(x, &mut s[4..14]);
|
|
61
|
+
utoa(y, &mut s[15..25]);
|
|
62
|
+
|
|
63
|
+
unsafe {
|
|
64
|
+
let r = ((*(*st).con_out).output_string)((*st).con_out, s.as_ptr() as *mut efi::Char16);
|
|
65
|
+
if r.is_error() {
|
|
66
|
+
fail(r);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// This function locates singleton UEFI protocols. Those protocols do not
|
|
72
|
+
// require to register listener handles, but are globally available to all
|
|
73
|
+
// UEFI applications. It takes a GUID of the protocol to locate and returns
|
|
74
|
+
// the protocol pointer on success.
|
|
75
|
+
fn locate_singleton(
|
|
76
|
+
st: *mut efi::SystemTable,
|
|
77
|
+
guid: *const efi::Guid,
|
|
78
|
+
) -> Result<*mut core::ffi::c_void, efi::Status> {
|
|
79
|
+
let mut interface: *mut core::ffi::c_void = core::ptr::null_mut();
|
|
80
|
+
let mut handles: *mut efi::Handle = core::ptr::null_mut();
|
|
81
|
+
let mut n_handles: usize = 0;
|
|
82
|
+
let mut r: efi::Status;
|
|
83
|
+
|
|
84
|
+
// Use `locate_handle_buffer()` to find all handles that support the
|
|
85
|
+
// specified protocol.
|
|
86
|
+
unsafe {
|
|
87
|
+
if (*st).hdr.revision < efi::SYSTEM_TABLE_REVISION_1_10 {
|
|
88
|
+
// We use `LocateHandleBuffer`, which was introduced in 1.10.
|
|
89
|
+
return Err(efi::Status::UNSUPPORTED);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let r = ((*(*st).boot_services).locate_handle_buffer)(
|
|
93
|
+
efi::BY_PROTOCOL,
|
|
94
|
+
guid as *mut _,
|
|
95
|
+
core::ptr::null_mut(),
|
|
96
|
+
&mut n_handles,
|
|
97
|
+
&mut handles,
|
|
98
|
+
);
|
|
99
|
+
match r {
|
|
100
|
+
efi::Status::SUCCESS => {}
|
|
101
|
+
efi::Status::NOT_FOUND => return Err(r),
|
|
102
|
+
efi::Status::OUT_OF_RESOURCES => return Err(r),
|
|
103
|
+
_ => panic!(),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Now that we have all handles with the specified protocol, query it for
|
|
108
|
+
// the protocol interface. We loop here, even though every item should
|
|
109
|
+
// succeed. Lets be on the safe side.
|
|
110
|
+
// Secondly, we use `handle_protocol()` here, but really should be using
|
|
111
|
+
// `open_protocol()`. But for singleton protocols, this does not matter,
|
|
112
|
+
// so lets use the simple path for now.
|
|
113
|
+
unsafe {
|
|
114
|
+
r = efi::Status::NOT_FOUND;
|
|
115
|
+
for i in 0..n_handles {
|
|
116
|
+
r = ((*(*st).boot_services).handle_protocol)(
|
|
117
|
+
*handles.offset(core::convert::TryFrom::<usize>::try_from(i).unwrap()),
|
|
118
|
+
guid as *mut _,
|
|
119
|
+
&mut interface,
|
|
120
|
+
);
|
|
121
|
+
match r {
|
|
122
|
+
efi::Status::SUCCESS => break,
|
|
123
|
+
efi::Status::UNSUPPORTED => continue,
|
|
124
|
+
_ => panic!(),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Free the allocated buffer memory of `handles`. This was allocated on the
|
|
130
|
+
// pool by `locate_handle_buffer()`.
|
|
131
|
+
unsafe {
|
|
132
|
+
let r = ((*(*st).boot_services).free_pool)(handles as *mut core::ffi::c_void);
|
|
133
|
+
assert!(!r.is_error());
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// In case we found nothing, return `NOT_FOUND`, otherwise return the
|
|
137
|
+
// interface identifier.
|
|
138
|
+
match r {
|
|
139
|
+
efi::Status::SUCCESS => Ok(interface),
|
|
140
|
+
_ => Err(efi::Status::NOT_FOUND),
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// A simple helper that queries the current mode of the GraphicsOutputProtocol
|
|
145
|
+
// and returns the x and y dimensions on success.
|
|
146
|
+
fn query_gop(
|
|
147
|
+
gop: *mut efi::protocols::graphics_output::Protocol,
|
|
148
|
+
) -> Result<(u32, u32), efi::Status> {
|
|
149
|
+
let mut info: *mut efi::protocols::graphics_output::ModeInformation = core::ptr::null_mut();
|
|
150
|
+
let mut z_info: usize = 0;
|
|
151
|
+
|
|
152
|
+
unsafe {
|
|
153
|
+
// We could just look at `gop->mode->info`, but lets query the mode
|
|
154
|
+
// instead to show how to query other modes than the active one.
|
|
155
|
+
let r = ((*gop).query_mode)(gop, (*(*gop).mode).mode, &mut z_info, &mut info);
|
|
156
|
+
match r {
|
|
157
|
+
efi::Status::SUCCESS => {}
|
|
158
|
+
efi::Status::DEVICE_ERROR => return Err(r),
|
|
159
|
+
_ => panic!(),
|
|
160
|
+
};
|
|
161
|
+
if z_info < core::mem::size_of_val(&*info) {
|
|
162
|
+
return Err(efi::Status::UNSUPPORTED);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
Ok(((*info).horizontal_resolution, (*info).vertical_resolution))
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// This is the UEFI application entrypoint. We use it to locate the GOP
|
|
170
|
+
// pointer, query the current mode, and then print it to the system console.
|
|
171
|
+
#[export_name = "efi_main"]
|
|
172
|
+
pub extern "C" fn main(_h: efi::Handle, st: *mut efi::SystemTable) -> efi::Status {
|
|
173
|
+
let r = locate_singleton(st, &efi::protocols::graphics_output::PROTOCOL_GUID);
|
|
174
|
+
let gop = match r {
|
|
175
|
+
Ok(v) => v,
|
|
176
|
+
Err(r) => fail(r),
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
let r = query_gop(gop as _);
|
|
180
|
+
let v = match r {
|
|
181
|
+
Ok(v) => v,
|
|
182
|
+
Err(r) => fail(r),
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
print_xy(st, v.0, v.1);
|
|
186
|
+
|
|
187
|
+
efi::Status::SUCCESS
|
|
188
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Example: Hello World!
|
|
2
|
+
//
|
|
3
|
+
// This is an example UEFI application that prints "Hello World!", then waits
|
|
4
|
+
// for key input before it exits. It serves as base example how to write UEFI
|
|
5
|
+
// applications without any helper modules other than the UEFI protocol
|
|
6
|
+
// definitions.
|
|
7
|
+
//
|
|
8
|
+
// This example builds upon the `freestanding.rs` example, using the same setup
|
|
9
|
+
// and rust integration. See there for details on the panic-handler and entry
|
|
10
|
+
// point configuration.
|
|
11
|
+
//
|
|
12
|
+
// Note that UEFI uses UTF-16 strings. Since rust literals are UTF-8, we have
|
|
13
|
+
// to use an open-coded, zero-terminated, UTF-16 array as argument to
|
|
14
|
+
// `output_string()`. Similarly to the panic handler, real applications should
|
|
15
|
+
// rather use UTF-16 modules.
|
|
16
|
+
|
|
17
|
+
#![no_main]
|
|
18
|
+
#![no_std]
|
|
19
|
+
|
|
20
|
+
use r_efi::efi;
|
|
21
|
+
|
|
22
|
+
#[panic_handler]
|
|
23
|
+
fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
|
|
24
|
+
loop {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[export_name = "efi_main"]
|
|
28
|
+
pub extern "C" fn main(_h: efi::Handle, st: *mut efi::SystemTable) -> efi::Status {
|
|
29
|
+
let s = [
|
|
30
|
+
0x0048u16, 0x0065u16, 0x006cu16, 0x006cu16, 0x006fu16, // "Hello"
|
|
31
|
+
0x0020u16, // " "
|
|
32
|
+
0x0057u16, 0x006fu16, 0x0072u16, 0x006cu16, 0x0064u16, // "World"
|
|
33
|
+
0x0021u16, // "!"
|
|
34
|
+
0x000au16, // "\n"
|
|
35
|
+
0x0000u16, // NUL
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
// Print "Hello World!".
|
|
39
|
+
let r =
|
|
40
|
+
unsafe { ((*(*st).con_out).output_string)((*st).con_out, s.as_ptr() as *mut efi::Char16) };
|
|
41
|
+
if r.is_error() {
|
|
42
|
+
return r;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Wait for key input, by waiting on the `wait_for_key` event hook.
|
|
46
|
+
let r = unsafe {
|
|
47
|
+
let mut x: usize = 0;
|
|
48
|
+
((*(*st).boot_services).wait_for_event)(1, &mut (*(*st).con_in).wait_for_key, &mut x)
|
|
49
|
+
};
|
|
50
|
+
if r.is_error() {
|
|
51
|
+
return r;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
efi::Status::SUCCESS
|
|
55
|
+
}
|