Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 00a2dea

Browse files
committedJul 14, 2024
uefi: mem: boot.rs -> boot/mod.rs
1 parent 7e8a86b commit 00a2dea

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed
 

‎uefi/src/table/boot.rs renamed to ‎uefi/src/table/boot/mod.rs

+34-34
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ impl BootServices {
285285
&mut desc_version,
286286
)
287287
}
288-
.to_result_with_val(|| MemoryMapMeta {
289-
map_size,
290-
desc_size,
291-
map_key,
292-
desc_version,
293-
})
288+
.to_result_with_val(|| MemoryMapMeta {
289+
map_size,
290+
desc_size,
291+
map_key,
292+
desc_version,
293+
})
294294
}
295295

296296
/// Allocates from a memory pool. The pointer will be 8-byte aligned.
@@ -436,10 +436,10 @@ impl BootServices {
436436
opt_nonnull_to_ptr(event_group),
437437
&mut event,
438438
)
439-
.to_result_with_val(
440-
// OK to unwrap: event is non-null for Status::SUCCESS.
441-
|| Event::from_ptr(event).unwrap(),
442-
)
439+
.to_result_with_val(
440+
// OK to unwrap: event is non-null for Status::SUCCESS.
441+
|| Event::from_ptr(event).unwrap(),
442+
)
443443
}
444444

445445
/// Sets the trigger for `EventType::TIMER` event.
@@ -602,7 +602,7 @@ impl BootServices {
602602
InterfaceType::NATIVE_INTERFACE,
603603
interface,
604604
))
605-
.to_result_with_val(|| Handle::from_ptr(handle).unwrap())
605+
.to_result_with_val(|| Handle::from_ptr(handle).unwrap())
606606
}
607607

608608
/// Reinstalls a protocol interface on a device handle. `old_interface` is replaced with `new_interface`.
@@ -637,7 +637,7 @@ impl BootServices {
637637
old_interface,
638638
new_interface,
639639
)
640-
.to_result()
640+
.to_result()
641641
}
642642

643643
/// Removes a protocol interface from a device handle.
@@ -905,10 +905,10 @@ impl BootServices {
905905
source_size,
906906
&mut image_handle,
907907
)
908-
.to_result_with_val(
909-
// OK to unwrap: image handle is non-null for Status::SUCCESS.
910-
|| Handle::from_ptr(image_handle).unwrap(),
911-
)
908+
.to_result_with_val(
909+
// OK to unwrap: image handle is non-null for Status::SUCCESS.
910+
|| Handle::from_ptr(image_handle).unwrap(),
911+
)
912912
}
913913
}
914914

@@ -1115,7 +1115,7 @@ impl BootServices {
11151115
recursive,
11161116
)
11171117
}
1118-
.to_result_with_err(|_| ())
1118+
.to_result_with_err(|_| ())
11191119
}
11201120

11211121
/// Disconnect one or more drivers from a controller.
@@ -1142,7 +1142,7 @@ impl BootServices {
11421142
Handle::opt_to_ptr(child),
11431143
)
11441144
}
1145-
.to_result_with_err(|_| ())
1145+
.to_result_with_err(|_| ())
11461146
}
11471147

11481148
/// Open a protocol interface for a handle.
@@ -1201,18 +1201,18 @@ impl BootServices {
12011201
Handle::opt_to_ptr(params.controller),
12021202
attributes as u32,
12031203
)
1204-
.to_result_with_val(|| {
1205-
let interface = (!interface.is_null()).then(|| {
1206-
let interface = P::mut_ptr_from_ffi(interface) as *const UnsafeCell<P>;
1207-
&*interface
1208-
});
1209-
1210-
ScopedProtocol {
1211-
interface,
1212-
open_params: params,
1213-
boot_services: self,
1214-
}
1215-
})
1204+
.to_result_with_val(|| {
1205+
let interface = (!interface.is_null()).then(|| {
1206+
let interface = P::mut_ptr_from_ffi(interface) as *const UnsafeCell<P>;
1207+
&*interface
1208+
});
1209+
1210+
ScopedProtocol {
1211+
interface,
1212+
open_params: params,
1213+
boot_services: self,
1214+
}
1215+
})
12161216
}
12171217

12181218
/// Open a protocol interface for a handle in exclusive mode.
@@ -1273,7 +1273,7 @@ impl BootServices {
12731273
TEST_PROTOCOL,
12741274
)
12751275
}
1276-
.to_result_with_val(|| ())
1276+
.to_result_with_val(|| ())
12771277
}
12781278

12791279
/// Get the list of protocol interface [`Guids`][Guid] that are installed
@@ -1804,11 +1804,11 @@ impl MemoryMapMeta {
18041804
/// ## UEFI pitfalls
18051805
/// Note that a MemoryMap can quickly become outdated, as soon as any explicit
18061806
/// or hidden allocation happens.
1807-
///
1807+
///
18081808
/// As soon as boot services are excited, all previous obtained memory maps must
18091809
/// be considered as outdated, except if the [`MemoryMapKey`] equals the one
18101810
/// returned by `exit_boot_services()`.
1811-
///
1811+
///
18121812
/// **Please note** that when working with memory maps, the `entry_size` is
18131813
/// usually larger than `size_of::<MemoryDescriptor` [[0]]. So to be safe,
18141814
/// always use `entry_size` as step-size when interfacing with the memory map on
@@ -2462,7 +2462,7 @@ mod tests_mmap_real {
24622462
7, 1048576, 0, 1792, 15, 0, 10, 8388608, 0, 8, 15, 0, 7, 8421376, 0, 3, 15, 0, 10, 8433664,
24632463
0, 1, 15, 0, 7, 8437760, 0, 4, 15, 0, 10, 8454144, 0, 240, 15, 0,
24642464
];
2465-
2465+
24662466
#[test]
24672467
fn basic_functionality() {
24682468
let mut buf = MMAP_RAW;

0 commit comments

Comments
 (0)
Please sign in to comment.