Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uefi-test-runner/src/bin/shell_launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn get_shell_app_device_path(storage: &mut Vec<u8>) -> &DevicePath {
boot::open_protocol_exclusive::<LoadedImageDevicePath>(boot::image_handle())
.expect("failed to open LoadedImageDevicePath protocol");

let mut builder = DevicePathBuilder::with_vec(storage);
let mut builder = DevicePathBuilder::with_rust_heap(storage);
for node in loaded_image_device_path.node_iter() {
if node.full_type() == (DeviceType::MEDIA, DeviceSubType::MEDIA_FILE_PATH) {
break;
Expand Down
2 changes: 1 addition & 1 deletion uefi-test-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn reconnect_serial_to_console(serial_handle: Handle) {
} else {
Vendor::VT_UTF8
};
let terminal_device_path = DevicePathBuilder::with_vec(&mut storage)
let terminal_device_path = DevicePathBuilder::with_rust_heap(&mut storage)
.push(&build::messaging::Vendor {
vendor_guid: terminal_guid,
vendor_defined_data: &[],
Expand Down
2 changes: 1 addition & 1 deletion uefi-test-runner/src/proto/device_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn test() {

fn create_test_device_path() -> Box<DevicePath> {
let mut v = Vec::new();
DevicePathBuilder::with_vec(&mut v)
DevicePathBuilder::with_rust_heap(&mut v)
// Add an ATAPI node because edk2 displays it differently depending on
// the value of `DisplayOnly`.
.push(&build::messaging::Atapi {
Expand Down
2 changes: 1 addition & 1 deletion uefi-test-runner/src/proto/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn test() {
}

let mut dvp_vec = Vec::new();
let dummy_dvp = DevicePathBuilder::with_vec(&mut dvp_vec);
let dummy_dvp = DevicePathBuilder::with_rust_heap(&mut dvp_vec);
let dummy_dvp = dummy_dvp.finalize().unwrap();

let mut load_file_protocol = boot::open_protocol_exclusive::<LoadFile>(image).unwrap();
Expand Down
36 changes: 0 additions & 36 deletions uefi-test-runner/src/proto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,7 @@ use uefi::{Identify, proto};
pub fn test() {
info!("Testing various protocols");

console::test();

find_protocol();
test_protocols_per_handle();
test_test_protocol();

debug::test();
device_path::test();
driver::test();
load::test();
loaded_image::test();
media::test();
network::test();
pci::test();
pi::test();
rng::test();
shell_params::test();
string::test();
usb::test();
misc::test();

// disable the ATA test on aarch64 for now. The aarch64 UEFI Firmware does not yet seem
// to support SATA controllers (and providing an AtaPassThru protocol instance for them).
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
ata::test();
scsi::test();
nvme::test();

#[cfg(any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64"
))]
shim::test();
shell::test();
tcg::test();
}

fn find_protocol() {
Expand Down
1 change: 1 addition & 0 deletions uefi/src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ pub unsafe fn free_pages(ptr: NonNull<u8>, count: usize) -> Result {
/// * [`Status::OUT_OF_RESOURCES`]: allocation failed.
/// * [`Status::INVALID_PARAMETER`]: `mem_ty` is [`MemoryType::PERSISTENT_MEMORY`],
/// [`MemoryType::UNACCEPTED`], or in the range <code>[MemoryType::MAX]..=0x6fff_ffff</code>.
// TODO should we return PoolAllocation here?
pub fn allocate_pool(memory_type: MemoryType, size: usize) -> Result<NonNull<u8>> {
let bt = boot_services_raw_panicking();
let bt = unsafe { bt.as_ref() };
Expand Down
4 changes: 4 additions & 0 deletions uefi/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub use aligned_buffer::{AlignedBuffer, AlignmentError};
pub(crate) struct PoolAllocation(NonNull<u8>);

impl PoolAllocation {
/// This creates a new [`PoolAllocation`] from a `ptr` that represents
/// the allocation.
///
/// This function doesn't allocate.
pub(crate) const fn new(ptr: NonNull<u8>) -> Self {
Self(ptr)
}
Expand Down
Loading
Loading