]>
Commit | Line | Data |
---|---|---|
a628d933 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
17ad0859 | 2 | #pragma once |
a628d933 MY |
3 | |
4 | #include <stdbool.h> | |
5 | ||
6 | #include "sd-id128.h" | |
7 | ||
8 | typedef struct KernelHibernateLocation { | |
9 | char *device; | |
10 | uint64_t offset; | |
11 | bool offset_set; | |
12 | } KernelHibernateLocation; | |
13 | ||
14 | typedef struct EFIHibernateLocation { | |
15 | char *device; | |
16 | ||
17 | sd_id128_t uuid; | |
18 | uint64_t offset; | |
19 | ||
20 | char *kernel_version; | |
21 | char *id; | |
22 | char *image_id; | |
23 | char *version_id; | |
24 | char *image_version; | |
25 | } EFIHibernateLocation; | |
26 | ||
27 | typedef struct HibernateInfo { | |
28 | const char *device; | |
29 | uint64_t offset; /* in memory pages */ | |
30 | bool from_efi; | |
31 | ||
32 | KernelHibernateLocation *cmdline; | |
33 | EFIHibernateLocation *efi; | |
34 | } HibernateInfo; | |
35 | ||
36 | void hibernate_info_done(HibernateInfo *info); | |
37 | ||
38 | int acquire_hibernate_info(HibernateInfo *ret); | |
39 | ||
40 | #if ENABLE_EFI | |
41 | ||
42 | void compare_hibernate_location_and_warn(const HibernateInfo *info); | |
43 | ||
44 | void clear_efi_hibernate_location(void); | |
45 | ||
46 | #else | |
47 | ||
48 | static inline void compare_hibernate_location_and_warn(const HibernateInfo *info) { | |
49 | return; | |
50 | } | |
51 | ||
52 | static inline void clear_efi_hibernate_location(void) { | |
53 | return; | |
54 | } | |
55 | ||
56 | #endif |