@@ -5,21 +5,21 @@ on that handle. See [Handles and Protocols] for an overview of what
5
5
these terms mean.
6
6
7
7
To get a handle you can use:
8
- * [ ` BootServices ::locate_handle_buffer` ] : this can be used to get _ all_
8
+ * [ ` boot ::locate_handle_buffer` ] : this can be used to get _ all_
9
9
available handles, or just the handles that support a particular
10
10
protocol.
11
- * [ ` BootServices ::locate_handle` ] : the same as ` locate_handle_buffer ` ,
11
+ * [ ` boot ::locate_handle` ] : the same as ` locate_handle_buffer ` ,
12
12
but you provide the slice that stores the handles.
13
- * [ ` BootServices ::locate_device_path` ] : find a handle by [ Device Path] .
13
+ * [ ` boot ::locate_device_path` ] : find a handle by [ Device Path] .
14
14
15
15
Once you have obtained a handle, use
16
- [ ` BootServices ::open_protocol_exclusive` ] to open a protocol on that
16
+ [ ` boot ::open_protocol_exclusive` ] to open a protocol on that
17
17
handle. This returns a [ ` ScopedProtocol ` ] , which automatically closes
18
18
the protocol when dropped.
19
19
20
- Using [ ` BootServices ::open_protocol_exclusive` ] is the safest way to
20
+ Using [ ` boot ::open_protocol_exclusive` ] is the safest way to
21
21
open a protocol, but in some cases a protocol cannot be opened in
22
- exclusive mode. The ` unsafe ` [ ` BootServices ::open_protocol` ] can be used
22
+ exclusive mode. The ` unsafe ` [ ` boot ::open_protocol` ] can be used
23
23
in that case.
24
24
25
25
## Example
@@ -63,12 +63,11 @@ The function starts by opening the [`LoadedImage`] protocol:
63
63
{{#include .. / .. / .. / uefi - test - runner / examples / loaded_image . rs: loaded_image }}
64
64
```
65
65
66
- The [ ` open_protocol_exclusive ` ] method takes a type parameter, which is
66
+ The [ ` boot:: open_protocol_exclusive` ] method takes a type parameter, which is
67
67
the type of [ ` Protocol ` ] you want to open ([ ` LoadedImage ` ] in this
68
68
case). It also takes one regular argument of type [ ` Handle ` ] . For this
69
- example we want the handle of the currently-running image, which was
70
- passed in as the first argument to ` main ` . The handle is conveniently
71
- accessible through [ ` BootServices::image_handle ` ] , so we use that here.
69
+ example we want the handle of the currently-running image, conveniently
70
+ accessible through [ ` boot::image_handle ` ] .
72
71
73
72
Next the program opens the [ ` DevicePathToText ` ] protocol:
74
73
@@ -77,9 +76,9 @@ Next the program opens the [`DevicePathToText`] protocol:
77
76
```
78
77
79
78
This protocol isn't available for the ` image_handle ` , so we start by
80
- using [ ` locate_handle_buffer ` ] to find all handles that support
79
+ using [ ` boot:: locate_handle_buffer` ] to find all handles that support
81
80
` DevicePathToText ` . We only need one handle though, so we call ` first() `
82
- and discard the rest. Then we call [ ` open_protocol_exclusive ` ] again. It
81
+ and discard the rest. Then we call [ ` boot:: open_protocol_exclusive` ] again. It
83
82
looks more or less like the previous time, but with [ ` DevicePathToText ` ]
84
83
as the type parameter and ` device_path_to_text_handle ` as the handle.
85
84
@@ -98,13 +97,12 @@ reference documentation] and the [UEFI Specification].
98
97
[ Device Path ] : ../concepts/device_paths.md
99
98
[ Handles and Protocols ] : ../concepts/handles_and_protocols.md
100
99
[ UEFI Specification ] : https://uefi.org/specifications
101
- [ `BootServices::image_handle` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.image_handle
102
- [ `BootServices::locate_device_path` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.locate_device_path
103
- [ `BootServices::locate_handle_buffer` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.locate_handle_buffer
104
- [ `BootServices::locate_handle` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.locate_handle
105
- [ `BootServices::open_protocol` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.open_protocol
106
- [ `BootServices::open_protocol_exclusive` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.open_protocol_exclusive
107
- [ `BootServices` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html
100
+ [ `boot::image_handle` ] : https://docs.rs/uefi/latest/uefi/boot/fn.image_handle.html
101
+ [ `boot::locate_device_path` ] : https://docs.rs/uefi/latest/uefi/boot/fn.locate_device_path.html
102
+ [ `boot::locate_handle_buffer` ] : https://docs.rs/uefi/latest/uefi/boot/fn.locate_handle_buffer.html
103
+ [ `boot::locate_handle` ] : https://docs.rs/uefi/latest/uefi/boot/fn.locate_handle.html
104
+ [ `boot::open_protocol` ] : https://docs.rs/uefi/latest/uefi/boot/fn.open_protocol.html
105
+ [ `boot::open_protocol_exclusive` ] : https://docs.rs/uefi/latest/uefi/boot/fn.open_protocol_exclusive.html
108
106
[ `DevicePathToText` ] : https://docs.rs/uefi/latest/uefi/proto/device_path/text/struct.DevicePathToText.html
109
107
[ "Hello world!" example ] : ../tutorial/app.html
110
108
[ `Handle` ] : https://docs.rs/uefi/latest/uefi/data_types/struct.Handle.html
@@ -113,10 +111,7 @@ reference documentation] and the [UEFI Specification].
113
111
[ `OpenProtocolAttributes` ] : https://docs.rs/uefi/latest/uefi/table/boot/enum.OpenProtocolAttributes.html
114
112
[ `OpenProtocolParams` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.OpenProtocolParams.html
115
113
[ `Protocol` ] : https://docs.rs/uefi/latest/uefi/proto/trait.Protocol.html
116
- [ `ScopedProtocol` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.ScopedProtocol.html
117
- [ `locate_handle_buffer` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.locate_handle_buffer
118
- [ `open_protocol` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.open_protocol
119
- [ `open_protocol_exclusive` ] : https://docs.rs/uefi/latest/uefi/table/boot/struct.BootServices.html#method.open_protocol_exclusive
114
+ [ `ScopedProtocol` ] : https://docs.rs/uefi/latest/uefi/boot/struct.ScopedProtocol.html
120
115
[ uefi-rs reference documentation ] : https://docs.rs/uefi/latest/uefi/proto/index.html
121
116
[ `uefi::Result` ] : https://docs.rs/uefi/latest/uefi/type.Result.html
122
117
[ `uefi::Status` ] : https://docs.rs/uefi/latest/uefi/struct.Status.html
0 commit comments