File tree 1 file changed +7
-2
lines changed
uefi-test-runner/src/proto
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
use alloc:: string:: ToString ;
2
2
use core:: cell:: RefCell ;
3
3
use core:: ptr:: NonNull ;
4
+ use uefi:: data_types:: Align ;
4
5
use uefi:: prelude:: * ;
5
6
use uefi:: proto:: media:: block:: BlockIO ;
6
7
use uefi:: proto:: media:: disk:: { DiskIo , DiskIo2 , DiskIo2Token } ;
@@ -29,8 +30,12 @@ fn test_existing_dir(directory: &mut Directory) {
29
30
30
31
let dir = RefCell :: new ( dir) ;
31
32
33
+ assert_eq ! ( FileInfo :: alignment( ) , 8 ) ;
34
+ #[ repr( align( 8 ) ) ]
35
+ struct Buf ( [ u8 ; 200 ] ) ;
36
+
32
37
// Backing memory to read the file info data into.
33
- let mut stack_buf = [ 0 ; 200 ] ;
38
+ let mut stack_buf = Buf ( [ 0 ; 200 ] ) ;
34
39
35
40
// The file names that the test read from the directory.
36
41
let entry_names = RefCell :: new ( vec ! [ ] ) ;
@@ -44,7 +49,7 @@ fn test_existing_dir(directory: &mut Directory) {
44
49
let mut entry_names = entry_names. borrow_mut ( ) ;
45
50
loop {
46
51
let entry = dir
47
- . read_entry ( & mut stack_buf)
52
+ . read_entry ( & mut stack_buf. 0 )
48
53
. expect ( "failed to read directory" ) ;
49
54
if let Some ( entry) = entry {
50
55
entry_names. push ( entry. file_name ( ) . to_string ( ) ) ;
You can’t perform that action at this time.
0 commit comments