@@ -48,6 +48,9 @@ pub mod memchr {
48
48
pub use core:: slice:: memchr:: { memchr, memrchr} ;
49
49
}
50
50
51
+ // SAFETY: must be called only once during runtime initialization.
52
+ // SAFETY: argc must be 2.
53
+ // SAFETY: argv must be &[Handle, *mut SystemTable].
51
54
pub unsafe fn init ( argc : isize , argv : * const * const u8 , _sigpipe : u8 ) {
52
55
assert_eq ! ( argc, 2 ) ;
53
56
let image_handle = unsafe { NonNull :: new ( * argv as * mut crate :: ffi:: c_void ) . unwrap ( ) } ;
@@ -66,10 +69,7 @@ pub const fn unsupported<T>() -> std_io::Result<T> {
66
69
67
70
#[ inline]
68
71
pub const fn unsupported_err ( ) -> std_io:: Error {
69
- std_io:: const_io_error!(
70
- std_io:: ErrorKind :: Unsupported ,
71
- "operation not supported on this platform" ,
72
- )
72
+ std_io:: const_io_error!( std_io:: ErrorKind :: Unsupported , "operation not supported on UEFI" , )
73
73
}
74
74
75
75
pub fn decode_error_kind ( code : i32 ) -> crate :: io:: ErrorKind {
@@ -114,7 +114,7 @@ pub fn hashmap_random_keys() -> (u64, u64) {
114
114
unsafe { ( get_random ( ) . unwrap_or ( 1 ) , get_random ( ) . unwrap_or ( 2 ) ) }
115
115
}
116
116
117
- unsafe fn get_random ( ) -> Option < u64 > {
117
+ fn get_random ( ) -> Option < u64 > {
118
118
use r_efi:: protocols:: rng;
119
119
120
120
let mut buf = [ 0u8 ; 8 ] ;
0 commit comments