1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #pragma once 3 4 #include <sys/stat.h> 5 6 #include "efivars-fundamental.h" 7 #include "efivars.h" 8 9 /* Various calls that interface with EFI variables implementing https://systemd.io/BOOT_LOADER_INTERFACE */ 10 11 #if ENABLE_EFI 12 13 int efi_loader_get_device_part_uuid(sd_id128_t *ret); 14 int efi_loader_get_boot_usec(usec_t *ret_firmware, usec_t *ret_loader); 15 16 int efi_loader_get_entries(char ***ret); 17 18 int efi_loader_get_features(uint64_t *ret); 19 20 int efi_loader_get_config_timeout_one_shot(usec_t *ret); 21 int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat); 22 23 #else 24 efi_loader_get_device_part_uuid(sd_id128_t * u)25static inline int efi_loader_get_device_part_uuid(sd_id128_t *u) { 26 return -EOPNOTSUPP; 27 } 28 efi_loader_get_boot_usec(usec_t * firmware,usec_t * loader)29static inline int efi_loader_get_boot_usec(usec_t *firmware, usec_t *loader) { 30 return -EOPNOTSUPP; 31 } 32 efi_loader_get_entries(char *** ret)33static inline int efi_loader_get_entries(char ***ret) { 34 return -EOPNOTSUPP; 35 } 36 efi_loader_get_features(uint64_t * ret)37static inline int efi_loader_get_features(uint64_t *ret) { 38 return -EOPNOTSUPP; 39 } 40 efi_loader_get_config_timeout_one_shot(usec_t * ret)41static inline int efi_loader_get_config_timeout_one_shot(usec_t *ret) { 42 return -EOPNOTSUPP; 43 } 44 efi_loader_update_entry_one_shot_cache(char ** cache,struct stat * cache_stat)45static inline int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat) { 46 return -EOPNOTSUPP; 47 } 48 49 #endif 50 51 bool efi_loader_entry_name_valid(const char *s); 52