]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
2e3d0692 LP |
2 | #pragma once |
3 | ||
0bb2f0f1 | 4 | #include "efivars.h" |
7b4d7cc0 | 5 | |
af2697e8 LP |
6 | #include <sys/stat.h> |
7 | ||
349cc4a5 | 8 | #if ENABLE_EFI |
b28ce7c6 | 9 | |
5bdf2243 JJ |
10 | int efi_reboot_to_firmware_supported(void); |
11 | int efi_get_reboot_to_firmware(void); | |
12 | int efi_set_reboot_to_firmware(bool value); | |
34e5a31e | 13 | |
0974a682 KS |
14 | int efi_get_boot_option(uint16_t nr, char **title, sd_id128_t *part_uuid, char **path, bool *active); |
15 | int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path); | |
16 | int efi_remove_boot_option(uint16_t id); | |
9cde64ff | 17 | int efi_get_boot_order(uint16_t **order); |
0974a682 | 18 | int efi_set_boot_order(uint16_t *order, size_t n); |
9cde64ff | 19 | int efi_get_boot_options(uint16_t **options); |
34e5a31e | 20 | |
c51d84dc KS |
21 | int efi_loader_get_device_part_uuid(sd_id128_t *u); |
22 | int efi_loader_get_boot_usec(usec_t *firmware, usec_t *loader); | |
0974a682 | 23 | |
bd2865ca LP |
24 | int efi_loader_get_entries(char ***ret); |
25 | ||
80641a81 LP |
26 | int efi_loader_get_features(uint64_t *ret); |
27 | ||
e8df4eee | 28 | int efi_loader_get_config_timeout_one_shot(usec_t *ret); |
af2697e8 | 29 | int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat); |
e8df4eee | 30 | |
b28ce7c6 TG |
31 | #else |
32 | ||
b28ce7c6 TG |
33 | static inline int efi_reboot_to_firmware_supported(void) { |
34 | return -EOPNOTSUPP; | |
35 | } | |
36 | ||
37 | static inline int efi_get_reboot_to_firmware(void) { | |
38 | return -EOPNOTSUPP; | |
39 | } | |
40 | ||
41 | static inline int efi_set_reboot_to_firmware(bool value) { | |
42 | return -EOPNOTSUPP; | |
43 | } | |
44 | ||
b28ce7c6 TG |
45 | static inline int efi_get_boot_option(uint16_t nr, char **title, sd_id128_t *part_uuid, char **path, bool *active) { |
46 | return -EOPNOTSUPP; | |
47 | } | |
48 | ||
49 | static inline int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path) { | |
50 | return -EOPNOTSUPP; | |
51 | } | |
52 | ||
53 | static inline int efi_remove_boot_option(uint16_t id) { | |
54 | return -EOPNOTSUPP; | |
55 | } | |
56 | ||
57 | static inline int efi_get_boot_order(uint16_t **order) { | |
58 | return -EOPNOTSUPP; | |
59 | } | |
60 | ||
61 | static inline int efi_set_boot_order(uint16_t *order, size_t n) { | |
62 | return -EOPNOTSUPP; | |
63 | } | |
64 | ||
65 | static inline int efi_get_boot_options(uint16_t **options) { | |
66 | return -EOPNOTSUPP; | |
67 | } | |
68 | ||
69 | static inline int efi_loader_get_device_part_uuid(sd_id128_t *u) { | |
70 | return -EOPNOTSUPP; | |
71 | } | |
72 | ||
73 | static inline int efi_loader_get_boot_usec(usec_t *firmware, usec_t *loader) { | |
74 | return -EOPNOTSUPP; | |
75 | } | |
76 | ||
bd2865ca LP |
77 | static inline int efi_loader_get_entries(char ***ret) { |
78 | return -EOPNOTSUPP; | |
79 | } | |
80 | ||
80641a81 LP |
81 | static inline int efi_loader_get_features(uint64_t *ret) { |
82 | return -EOPNOTSUPP; | |
83 | } | |
84 | ||
e8df4eee LP |
85 | static inline int efi_loader_get_config_timeout_one_shot(usec_t *ret) { |
86 | return -EOPNOTSUPP; | |
87 | } | |
88 | ||
af2697e8 LP |
89 | static inline int efi_loader_update_entry_one_shot_cache(char **cache, struct stat *cache_stat) { |
90 | return -EOPNOTSUPP; | |
91 | } | |
92 | ||
b28ce7c6 TG |
93 | #endif |
94 | ||
995cbd72 LP |
95 | bool efi_loader_entry_name_valid(const char *s); |
96 | ||
0974a682 | 97 | char *efi_tilt_backslashes(char *s); |