File tree Expand file tree Collapse file tree 3 files changed +4
-43
lines changed
uefi-test-runner/src/boot Expand file tree Collapse file tree 3 files changed +4
-43
lines changed Original file line number Diff line number Diff line change 14
14
- ` FileSystem::try_exists ` now returns ` FileSystemResult<bool> ` .
15
15
- ` FileSystem::copy ` is now more efficient for large files.
16
16
17
+ ### Removed
18
+ - ` BootServices::memmove ` and ` BootServices::set_mem ` have been removed, use
19
+ standard functions like ` core::ptr::copy ` and ` core::ptr::write_bytes ` instead.
20
+
17
21
## uefi-macros - [ Unreleased]
18
22
19
23
## uefi-services - [ Unreleased]
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ pub fn test(bt: &BootServices) {
8
8
allocate_pages ( bt) ;
9
9
vec_alloc ( ) ;
10
10
alloc_alignment ( ) ;
11
- memmove ( bt) ;
12
11
13
12
memory_map ( bt) ;
14
13
}
@@ -57,28 +56,6 @@ fn alloc_alignment() {
57
56
assert_eq ! ( value. as_ptr( ) as usize % 0x100 , 0 , "Wrong alignment" ) ;
58
57
}
59
58
60
- // Test that the `memmove` / `set_mem` functions work.
61
- fn memmove ( bt : & BootServices ) {
62
- info ! ( "Testing the `memmove` / `set_mem` functions" ) ;
63
-
64
- let src = [ 1 , 2 , 3 , 4 ] ;
65
- let mut dest = [ 0u8 ; 4 ] ;
66
-
67
- // Fill the buffer with a value
68
- unsafe {
69
- bt. set_mem ( dest. as_mut_ptr ( ) , dest. len ( ) , 1 ) ;
70
- }
71
-
72
- assert_eq ! ( dest, [ 1 ; 4 ] , "Failed to set memory" ) ;
73
-
74
- // Copy other values on it
75
- unsafe {
76
- bt. memmove ( dest. as_mut_ptr ( ) , src. as_ptr ( ) , dest. len ( ) ) ;
77
- }
78
-
79
- assert_eq ! ( dest, src, "Failed to copy memory" ) ;
80
- }
81
-
82
59
fn memory_map ( bt : & BootServices ) {
83
60
info ! ( "Testing memory map functions" ) ;
84
61
Original file line number Diff line number Diff line change @@ -1320,26 +1320,6 @@ impl BootServices {
1320
1320
} )
1321
1321
}
1322
1322
1323
- /// Copies memory from source to destination. The buffers can overlap.
1324
- ///
1325
- /// # Safety
1326
- ///
1327
- /// This function is unsafe as it can be used to violate most safety
1328
- /// invariants of the Rust type system.
1329
- pub unsafe fn memmove ( & self , dest : * mut u8 , src : * const u8 , size : usize ) {
1330
- ( self . 0 . copy_mem ) ( dest, src, size) ;
1331
- }
1332
-
1333
- /// Sets a buffer to a certain value.
1334
- ///
1335
- /// # Safety
1336
- ///
1337
- /// This function is unsafe as it can be used to violate most safety
1338
- /// invariants of the Rust type system.
1339
- pub unsafe fn set_mem ( & self , buffer : * mut u8 , size : usize , value : u8 ) {
1340
- ( self . 0 . set_mem ) ( buffer, size, value) ;
1341
- }
1342
-
1343
1323
/// Retrieves a [`SimpleFileSystem`] protocol associated with the device the given
1344
1324
/// image was loaded from.
1345
1325
///
You can’t perform that action at this time.
0 commit comments