@@ -100,19 +100,19 @@ struct BootServicesInternal {
100
100
interface : * mut c_void ,
101
101
) -> Status ,
102
102
reinstall_protocol_interface : unsafe extern "efiapi" fn (
103
- handle : Handle ,
103
+ handle : uefi_raw :: Handle ,
104
104
protocol : & Guid ,
105
105
old_interface : * mut c_void ,
106
106
new_interface : * mut c_void ,
107
107
) -> Status ,
108
108
uninstall_protocol_interface : unsafe extern "efiapi" fn (
109
- handle : Handle ,
109
+ handle : uefi_raw :: Handle ,
110
110
protocol : & Guid ,
111
111
interface : * mut c_void ,
112
112
) -> Status ,
113
113
#[ deprecated = "open_protocol and open_protocol_exclusive are better alternatives and available since EFI 1.10 (2002)" ]
114
114
handle_protocol : unsafe extern "efiapi" fn (
115
- handle : Handle ,
115
+ handle : uefi_raw :: Handle ,
116
116
proto : & Guid ,
117
117
out_proto : & mut * mut c_void ,
118
118
) -> Status ,
@@ -140,25 +140,26 @@ struct BootServicesInternal {
140
140
// Image services
141
141
load_image : unsafe extern "efiapi" fn (
142
142
boot_policy : u8 ,
143
- parent_image_handle : Handle ,
143
+ parent_image_handle : uefi_raw :: Handle ,
144
144
device_path : * const uefi_raw:: protocol:: device_path:: DevicePathProtocol ,
145
145
source_buffer : * const u8 ,
146
146
source_size : usize ,
147
147
image_handle : & mut Option < Handle > ,
148
148
) -> Status ,
149
149
start_image : unsafe extern "efiapi" fn (
150
- image_handle : Handle ,
150
+ image_handle : uefi_raw :: Handle ,
151
151
exit_data_size : * mut usize ,
152
152
exit_data : & mut * mut Char16 ,
153
153
) -> Status ,
154
154
exit : unsafe extern "efiapi" fn (
155
- image_handle : Handle ,
155
+ image_handle : uefi_raw :: Handle ,
156
156
exit_status : Status ,
157
157
exit_data_size : usize ,
158
158
exit_data : * mut Char16 ,
159
159
) -> !,
160
- unload_image : unsafe extern "efiapi" fn ( image_handle : Handle ) -> Status ,
161
- exit_boot_services : unsafe extern "efiapi" fn ( image_handle : Handle , map_key : usize ) -> Status ,
160
+ unload_image : unsafe extern "efiapi" fn ( image_handle : uefi_raw:: Handle ) -> Status ,
161
+ exit_boot_services :
162
+ unsafe extern "efiapi" fn ( image_handle : uefi_raw:: Handle , map_key : usize ) -> Status ,
162
163
163
164
// Misc services
164
165
get_next_monotonic_count : usize ,
@@ -172,37 +173,37 @@ struct BootServicesInternal {
172
173
173
174
// Driver support services
174
175
connect_controller : unsafe extern "efiapi" fn (
175
- controller : Handle ,
176
+ controller : uefi_raw :: Handle ,
176
177
driver_image : Option < Handle > ,
177
178
remaining_device_path : * const uefi_raw:: protocol:: device_path:: DevicePathProtocol ,
178
179
recursive : bool ,
179
180
) -> Status ,
180
181
disconnect_controller : unsafe extern "efiapi" fn (
181
- controller : Handle ,
182
+ controller : uefi_raw :: Handle ,
182
183
driver_image : Option < Handle > ,
183
184
child : Option < Handle > ,
184
185
) -> Status ,
185
186
186
187
// Protocol open / close services
187
188
open_protocol : unsafe extern "efiapi" fn (
188
- handle : Handle ,
189
+ handle : uefi_raw :: Handle ,
189
190
protocol : & Guid ,
190
191
interface : & mut * mut c_void ,
191
- agent_handle : Handle ,
192
+ agent_handle : uefi_raw :: Handle ,
192
193
controller_handle : Option < Handle > ,
193
194
attributes : u32 ,
194
195
) -> Status ,
195
196
close_protocol : unsafe extern "efiapi" fn (
196
- handle : Handle ,
197
+ handle : uefi_raw :: Handle ,
197
198
protocol : & Guid ,
198
- agent_handle : Handle ,
199
+ agent_handle : uefi_raw :: Handle ,
199
200
controller_handle : Option < Handle > ,
200
201
) -> Status ,
201
202
open_protocol_information : usize ,
202
203
203
204
// Library services
204
205
protocols_per_handle : unsafe extern "efiapi" fn (
205
- handle : Handle ,
206
+ handle : uefi_raw :: Handle ,
206
207
protocol_buffer : * mut * mut * const Guid ,
207
208
protocol_buffer_count : * mut usize ,
208
209
) -> Status ,
@@ -796,8 +797,13 @@ impl BootServices {
796
797
old_interface : * mut c_void ,
797
798
new_interface : * mut c_void ,
798
799
) -> Result < ( ) > {
799
- ( self . 0 . reinstall_protocol_interface ) ( handle, protocol, old_interface, new_interface)
800
- . to_result ( )
800
+ ( self . 0 . reinstall_protocol_interface ) (
801
+ handle. as_ptr ( ) ,
802
+ protocol,
803
+ old_interface,
804
+ new_interface,
805
+ )
806
+ . to_result ( )
801
807
}
802
808
803
809
/// Removes a protocol interface from a device handle.
@@ -825,7 +831,7 @@ impl BootServices {
825
831
protocol : & Guid ,
826
832
interface : * mut c_void ,
827
833
) -> Result < ( ) > {
828
- ( self . 0 . uninstall_protocol_interface ) ( handle, protocol, interface) . to_result ( )
834
+ ( self . 0 . uninstall_protocol_interface ) ( handle. as_ptr ( ) , protocol, interface) . to_result ( )
829
835
}
830
836
831
837
/// Registers `event` to be signalled whenever a protocol interface is registered for
@@ -1054,7 +1060,7 @@ impl BootServices {
1054
1060
unsafe {
1055
1061
( self . 0 . load_image ) (
1056
1062
boot_policy,
1057
- parent_image_handle,
1063
+ parent_image_handle. as_ptr ( ) ,
1058
1064
device_path. cast ( ) ,
1059
1065
source_buffer,
1060
1066
source_size,
@@ -1081,7 +1087,7 @@ impl BootServices {
1081
1087
/// * [`uefi::Status::UNSUPPORTED`]
1082
1088
/// * [`uefi::Status::INVALID_PARAMETER`]
1083
1089
pub fn unload_image ( & self , image_handle : Handle ) -> Result {
1084
- unsafe { ( self . 0 . unload_image ) ( image_handle) } . to_result ( )
1090
+ unsafe { ( self . 0 . unload_image ) ( image_handle. as_ptr ( ) ) } . to_result ( )
1085
1091
}
1086
1092
1087
1093
/// Transfer control to a loaded image's entry point.
@@ -1101,7 +1107,8 @@ impl BootServices {
1101
1107
// TODO: implement returning exit data to the caller.
1102
1108
let mut exit_data_size: usize = 0 ;
1103
1109
let mut exit_data: * mut Char16 = ptr:: null_mut ( ) ;
1104
- ( self . 0 . start_image ) ( image_handle, & mut exit_data_size, & mut exit_data) . to_result ( )
1110
+ ( self . 0 . start_image ) ( image_handle. as_ptr ( ) , & mut exit_data_size, & mut exit_data)
1111
+ . to_result ( )
1105
1112
}
1106
1113
}
1107
1114
@@ -1121,7 +1128,12 @@ impl BootServices {
1121
1128
exit_data_size : usize ,
1122
1129
exit_data : * mut Char16 ,
1123
1130
) -> ! {
1124
- ( self . 0 . exit ) ( image_handle, exit_status, exit_data_size, exit_data)
1131
+ ( self . 0 . exit ) (
1132
+ image_handle. as_ptr ( ) ,
1133
+ exit_status,
1134
+ exit_data_size,
1135
+ exit_data,
1136
+ )
1125
1137
}
1126
1138
1127
1139
/// Exits the UEFI boot services
@@ -1145,7 +1157,7 @@ impl BootServices {
1145
1157
image : Handle ,
1146
1158
mmap_key : MemoryMapKey ,
1147
1159
) -> Result {
1148
- ( self . 0 . exit_boot_services ) ( image, mmap_key. 0 ) . to_result ( )
1160
+ ( self . 0 . exit_boot_services ) ( image. as_ptr ( ) , mmap_key. 0 ) . to_result ( )
1149
1161
}
1150
1162
1151
1163
/// Stalls the processor for an amount of time.
@@ -1255,7 +1267,7 @@ impl BootServices {
1255
1267
) -> Result {
1256
1268
unsafe {
1257
1269
( self . 0 . connect_controller ) (
1258
- controller,
1270
+ controller. as_ptr ( ) ,
1259
1271
driver_image,
1260
1272
remaining_device_path
1261
1273
. map ( |dp| dp. as_ffi_ptr ( ) )
@@ -1284,7 +1296,7 @@ impl BootServices {
1284
1296
driver_image : Option < Handle > ,
1285
1297
child : Option < Handle > ,
1286
1298
) -> Result {
1287
- unsafe { ( self . 0 . disconnect_controller ) ( controller, driver_image, child) }
1299
+ unsafe { ( self . 0 . disconnect_controller ) ( controller. as_ptr ( ) , driver_image, child) }
1288
1300
. to_result_with_err ( |_| ( ) )
1289
1301
}
1290
1302
@@ -1337,10 +1349,10 @@ impl BootServices {
1337
1349
) -> Result < ScopedProtocol < P > > {
1338
1350
let mut interface = ptr:: null_mut ( ) ;
1339
1351
( self . 0 . open_protocol ) (
1340
- params. handle ,
1352
+ params. handle . as_ptr ( ) ,
1341
1353
& P :: GUID ,
1342
1354
& mut interface,
1343
- params. agent ,
1355
+ params. agent . as_ptr ( ) ,
1344
1356
params. controller ,
1345
1357
attributes as u32 ,
1346
1358
)
@@ -1408,10 +1420,10 @@ impl BootServices {
1408
1420
let mut interface = ptr:: null_mut ( ) ;
1409
1421
unsafe {
1410
1422
( self . 0 . open_protocol ) (
1411
- params. handle ,
1423
+ params. handle . as_ptr ( ) ,
1412
1424
& P :: GUID ,
1413
1425
& mut interface,
1414
- params. agent ,
1426
+ params. agent . as_ptr ( ) ,
1415
1427
params. controller ,
1416
1428
TEST_PROTOCOL ,
1417
1429
)
@@ -1433,7 +1445,7 @@ impl BootServices {
1433
1445
let mut count = 0 ;
1434
1446
1435
1447
let mut status =
1436
- unsafe { ( self . 0 . protocols_per_handle ) ( handle, & mut protocols, & mut count) } ;
1448
+ unsafe { ( self . 0 . protocols_per_handle ) ( handle. as_ptr ( ) , & mut protocols, & mut count) } ;
1437
1449
1438
1450
if !status. is_error ( ) {
1439
1451
// Ensure that protocols isn't null, and that none of the GUIDs
@@ -1857,9 +1869,9 @@ impl<'a, P: Protocol + ?Sized> Drop for ScopedProtocol<'a, P> {
1857
1869
fn drop ( & mut self ) {
1858
1870
let status = unsafe {
1859
1871
( self . boot_services . 0 . close_protocol ) (
1860
- self . open_params . handle ,
1872
+ self . open_params . handle . as_ptr ( ) ,
1861
1873
& P :: GUID ,
1862
- self . open_params . agent ,
1874
+ self . open_params . agent . as_ptr ( ) ,
1863
1875
self . open_params . controller ,
1864
1876
)
1865
1877
} ;
0 commit comments