Skip to content

Commit cacef00

Browse files
uefi: BootServices: Make device path args compatible with uefi_raw
1 parent 4693e78 commit cacef00

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

uefi/src/table/boot.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use super::{Header, Revision};
44
use crate::data_types::{Align, PhysicalAddress};
5-
use crate::proto::device_path::{DevicePath, FfiDevicePath};
5+
use crate::proto::device_path::DevicePath;
66
use crate::proto::{Protocol, ProtocolPointer};
77
use crate::{Char16, Event, Guid, Handle, Result, Status, StatusExt};
88
use core::cell::UnsafeCell;
@@ -130,7 +130,7 @@ struct BootServicesInternal {
130130
) -> Status,
131131
locate_device_path: unsafe extern "efiapi" fn(
132132
proto: &Guid,
133-
device_path: &mut *const FfiDevicePath,
133+
device_path: *mut *const uefi_raw::protocol::device_path::DevicePathProtocol,
134134
out_handle: &mut Option<Handle>,
135135
) -> Status,
136136
install_configuration_table:
@@ -140,7 +140,7 @@ struct BootServicesInternal {
140140
load_image: unsafe extern "efiapi" fn(
141141
boot_policy: u8,
142142
parent_image_handle: Handle,
143-
device_path: *const FfiDevicePath,
143+
device_path: *const uefi_raw::protocol::device_path::DevicePathProtocol,
144144
source_buffer: *const u8,
145145
source_size: usize,
146146
image_handle: &mut Option<Handle>,
@@ -173,7 +173,7 @@ struct BootServicesInternal {
173173
connect_controller: unsafe extern "efiapi" fn(
174174
controller: Handle,
175175
driver_image: Option<Handle>,
176-
remaining_device_path: *const FfiDevicePath,
176+
remaining_device_path: *const uefi_raw::protocol::device_path::DevicePathProtocol,
177177
recursive: bool,
178178
) -> Status,
179179
disconnect_controller: unsafe extern "efiapi" fn(
@@ -927,11 +927,12 @@ impl BootServices {
927927
device_path: &mut &DevicePath,
928928
) -> Result<Handle> {
929929
let mut handle = None;
930-
let mut device_path_ptr = device_path.as_ffi_ptr();
930+
let mut device_path_ptr: *const uefi_raw::protocol::device_path::DevicePathProtocol =
931+
device_path.as_ffi_ptr().cast();
931932
unsafe {
932933
(self.0.locate_device_path)(&P::GUID, &mut device_path_ptr, &mut handle)
933934
.to_result_with_val(|| {
934-
*device_path = DevicePath::from_ffi_ptr(device_path_ptr);
935+
*device_path = DevicePath::from_ffi_ptr(device_path_ptr.cast());
935936
// OK to unwrap: handle is non-null for Status::SUCCESS.
936937
handle.unwrap()
937938
})
@@ -1051,7 +1052,7 @@ impl BootServices {
10511052
(self.0.load_image)(
10521053
boot_policy,
10531054
parent_image_handle,
1054-
device_path,
1055+
device_path.cast(),
10551056
source_buffer,
10561057
source_size,
10571058
&mut image_handle,
@@ -1255,7 +1256,8 @@ impl BootServices {
12551256
driver_image,
12561257
remaining_device_path
12571258
.map(|dp| dp.as_ffi_ptr())
1258-
.unwrap_or(ptr::null()),
1259+
.unwrap_or(ptr::null())
1260+
.cast(),
12591261
recursive,
12601262
)
12611263
}

0 commit comments

Comments
 (0)