File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -443,3 +443,27 @@ pub fn query_capsule_capabilities(capsule_header_array: &[&CapsuleHeader]) -> Re
443
443
. to_result_with_val ( || info)
444
444
}
445
445
}
446
+
447
+ /// Resets the computer.
448
+ ///
449
+ /// See [`ResetType`] for details of the various reset types.
450
+ ///
451
+ /// For a normal reset the value of `status` should be
452
+ /// [`Status::SUCCESS`]. Otherwise, an error code can be used.
453
+ ///
454
+ /// The `data` arg is usually `None`. Otherwise, it must contain a UCS-2
455
+ /// null-terminated string followed by additional binary data. For
456
+ /// [`ResetType::PLATFORM_SPECIFIC`], the binary data must be a vendor-specific
457
+ /// [`Guid`] that indicates the type of reset to perform.
458
+ ///
459
+ /// This function never returns.
460
+ pub fn reset ( reset_type : ResetType , status : Status , data : Option < & [ u8 ] > ) -> ! {
461
+ let rt = runtime_services_raw_panicking ( ) ;
462
+ let rt = unsafe { rt. as_ref ( ) } ;
463
+
464
+ let ( size, data) = data
465
+ . map ( |data| ( data. len ( ) , data. as_ptr ( ) ) )
466
+ . unwrap_or ( ( 0 , ptr:: null ( ) ) ) ;
467
+
468
+ unsafe { ( rt. reset_system ) ( reset_type, status, size, data) }
469
+ }
You can’t perform that action at this time.
0 commit comments