Skip to content

Commit bb08157

Browse files
authored
Merge pull request #844 from nicholasbishop/bishop-pin-qemu
Fix various CI failures
2 parents 24dd6aa + 3ee53a5 commit bb08157

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
runs-on: windows-latest
7474
steps:
7575
- name: Install QEMU
76-
run: choco install qemu
76+
run: choco install qemu --version 2023.4.24
7777

7878
- name: Checkout sources
7979
uses: actions/checkout@v3

uefi-test-runner/src/proto/media.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use alloc::string::ToString;
22
use core::cell::RefCell;
33
use core::ptr::NonNull;
4+
use uefi::data_types::Align;
45
use uefi::prelude::*;
56
use uefi::proto::media::block::BlockIO;
67
use uefi::proto::media::disk::{DiskIo, DiskIo2, DiskIo2Token};
@@ -29,8 +30,12 @@ fn test_existing_dir(directory: &mut Directory) {
2930

3031
let dir = RefCell::new(dir);
3132

33+
assert_eq!(FileInfo::alignment(), 8);
34+
#[repr(align(8))]
35+
struct Buf([u8; 200]);
36+
3237
// Backing memory to read the file info data into.
33-
let mut stack_buf = [0; 200];
38+
let mut stack_buf = Buf([0; 200]);
3439

3540
// The file names that the test read from the directory.
3641
let entry_names = RefCell::new(vec![]);
@@ -44,7 +49,7 @@ fn test_existing_dir(directory: &mut Directory) {
4449
let mut entry_names = entry_names.borrow_mut();
4550
loop {
4651
let entry = dir
47-
.read_entry(&mut stack_buf)
52+
.read_entry(&mut stack_buf.0)
4853
.expect("failed to read directory");
4954
if let Some(entry) = entry {
5055
entry_names.push(entry.file_name().to_string());

uefi/src/proto/media/file/info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ trait InfoInternal: Align + ptr_meta::Pointee<Metadata = usize> {
6868
{
6969
// Calculate the final size of the struct.
7070
let name_length_ucs2 = name.as_slice_with_nul().len();
71-
let name_size = name_length_ucs2 * mem::size_of::<Char16>();
71+
let name_size = mem::size_of_val(name.as_slice_with_nul());
7272
let info_size = Self::name_offset() + name_size;
7373
let info_size = Self::round_up_to_alignment(info_size);
7474

uefi/src/proto/network/pxe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ impl DiscoverInfo {
680680
let required_size = core::mem::size_of::<bool>() * 4
681681
+ core::mem::size_of::<IpAddress>()
682682
+ core::mem::size_of::<u16>()
683-
+ core::mem::size_of::<Server>() * server_count;
683+
+ core::mem::size_of_val(srv_list);
684684

685685
if buffer.len() < required_size {
686686
return Err(Status::BUFFER_TOO_SMALL.into());

uefi/src/proto/rng.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl Rng {
1717
&mut self,
1818
algorithm_list: &'buf mut [RngAlgorithmType],
1919
) -> Result<&'buf [RngAlgorithmType], Option<usize>> {
20-
let mut algorithm_list_size = algorithm_list.len() * mem::size_of::<RngAlgorithmType>();
20+
let mut algorithm_list_size = mem::size_of_val(algorithm_list);
2121

2222
unsafe {
2323
(self.0.get_info)(

uefi/src/result/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
///! Facilities for dealing with UEFI operation results.
1+
//! Facilities for dealing with UEFI operation results.
2+
23
use core::fmt::Debug;
34

45
/// The error type that we use, essentially a status code + optional additional data

0 commit comments

Comments
 (0)