File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
//! UEFI services available during boot.
2
2
3
- use super :: Header ;
3
+ use super :: { Header , Revision } ;
4
4
use crate :: data_types:: Align ;
5
5
use crate :: proto:: device_path:: { DevicePath , FfiDevicePath } ;
6
6
#[ cfg( feature = "exts" ) ]
@@ -437,6 +437,9 @@ impl BootServices {
437
437
/// More than one event of type `EventType::TIMER` may be part of a single event group. However,
438
438
/// there is no mechanism for determining which of the timers was signaled.
439
439
///
440
+ /// This operation is only supported starting with UEFI 2.0; earlier
441
+ /// versions will fail with [`Status::UNSUPPORTED`].
442
+ ///
440
443
/// # Safety
441
444
///
442
445
/// The caller must ensure they are passing a valid `Guid` as `event_group`, if applicable.
@@ -448,6 +451,10 @@ impl BootServices {
448
451
notify_ctx : Option < NonNull < c_void > > ,
449
452
event_group : Option < NonNull < Guid > > ,
450
453
) -> Result < Event > {
454
+ if self . header . revision < Revision :: EFI_2_00 {
455
+ return Err ( Status :: UNSUPPORTED . into ( ) ) ;
456
+ }
457
+
451
458
let mut event = MaybeUninit :: < Event > :: uninit ( ) ;
452
459
453
460
( self . create_event_ex ) (
Original file line number Diff line number Diff line change 1
1
//! UEFI services available at runtime, even after the OS boots.
2
2
3
- use super :: Header ;
3
+ use super :: { Header , Revision } ;
4
4
#[ cfg( feature = "exts" ) ]
5
5
use crate :: data_types:: FromSliceWithNulError ;
6
6
use crate :: result:: Error ;
@@ -248,11 +248,18 @@ impl RuntimeServices {
248
248
/// Get information about UEFI variable storage space for the type
249
249
/// of variable specified in `attributes`.
250
250
///
251
+ /// This operation is only supported starting with UEFI 2.0; earlier
252
+ /// versions will fail with [`Status::UNSUPPORTED`].
253
+ ///
251
254
/// See [`VariableStorageInfo`] for details of the information returned.
252
255
pub fn query_variable_info (
253
256
& self ,
254
257
attributes : VariableAttributes ,
255
258
) -> Result < VariableStorageInfo > {
259
+ if self . header . revision < Revision :: EFI_2_00 {
260
+ return Err ( Status :: UNSUPPORTED . into ( ) ) ;
261
+ }
262
+
256
263
let mut info = VariableStorageInfo :: default ( ) ;
257
264
unsafe {
258
265
( self . query_variable_info ) (
You can’t perform that action at this time.
0 commit comments