diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-09-21 22:13:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-09-23 17:24:28 +0200 |
commit | 3a6249127eeef8c949a3aa5fad7914cf5f755589 (patch) | |
tree | e198a62a9b56dcd29a7c6ca32b7fd439f5de46ac /src/boot/efi/util.c | |
parent | 0d43ce5266228182189771901413cf59a57ad585 (diff) | |
download | systemd-3a6249127eeef8c949a3aa5fad7914cf5f755589.tar.gz |
boot: add get_os_indications_supported() helper
We inquire the EFI var for this at two places, let's add a helper that
queries it and gracefully handles it if we can't get it, by returning a
zero mask, i.e. no features supported.
Diffstat (limited to 'src/boot/efi/util.c')
-rw-r--r-- | src/boot/efi/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index e500069d51..13697c9433 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -743,3 +743,17 @@ EFI_STATUS open_directory( *ret = TAKE_PTR(dir); return EFI_SUCCESS; } + +UINT64 get_os_indications_supported(VOID) { + UINT64 osind; + EFI_STATUS err; + + /* Returns the supported OS indications. If we can't acquire it, returns a zeroed out mask, i.e. no + * supported features. */ + + err = efivar_get_uint64_le(EFI_GLOBAL_GUID, L"OsIndicationsSupported", &osind); + if (EFI_ERROR(err)) + return 0; + + return osind; +} |