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 @@ -378,3 +378,27 @@ pub fn query_variable_info(attributes: VariableAttributes) -> Result<VariableSto
378
378
. to_result_with_val ( || info)
379
379
}
380
380
}
381
+
382
+ /// Resets the computer.
383
+ ///
384
+ /// See [`ResetType`] for details of the various reset types.
385
+ ///
386
+ /// For a normal reset the value of `status` should be
387
+ /// [`Status::SUCCESS`]. Otherwise, an error code can be used.
388
+ ///
389
+ /// The `data` arg is usually `None`. Otherwise, it must contain a UCS-2
390
+ /// null-terminated string followed by additional binary data. For
391
+ /// [`ResetType::PLATFORM_SPECIFIC`], the binary data must be a vendor-specific
392
+ /// [`Guid`] that indicates the type of reset to perform.
393
+ ///
394
+ /// This function never returns.
395
+ pub fn reset ( reset_type : ResetType , status : Status , data : Option < & [ u8 ] > ) -> ! {
396
+ let rt = runtime_services_raw_panicking ( ) ;
397
+ let rt = unsafe { rt. as_ref ( ) } ;
398
+
399
+ let ( size, data) = data
400
+ . map ( |data| ( data. len ( ) , data. as_ptr ( ) ) )
401
+ . unwrap_or ( ( 0 , ptr:: null ( ) ) ) ;
402
+
403
+ unsafe { ( rt. reset_system ) ( reset_type, status, size, data) }
404
+ }
You can’t perform that action at this time.
0 commit comments