]>
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 | ||
9fa0f584 MY |
8 | #include "macro.h" |
9 | ||
0e363838 | 10 | typedef struct KernelHibernateLocation KernelHibernateLocation; |
9fa0f584 MY |
11 | |
12 | typedef struct EFIHibernateLocation { | |
13 | char *device; | |
14 | ||
15 | sd_id128_t uuid; | |
16 | uint64_t offset; | |
17 | ||
18 | char *kernel_version; | |
19 | char *id; | |
20 | char *image_id; | |
21 | char *version_id; | |
22 | char *image_version; | |
23 | } EFIHibernateLocation; | |
24 | ||
25 | EFIHibernateLocation* efi_hibernate_location_free(EFIHibernateLocation *e); | |
26 | DEFINE_TRIVIAL_CLEANUP_FUNC(EFIHibernateLocation*, efi_hibernate_location_free); | |
27 | ||
28 | int get_efi_hibernate_location(EFIHibernateLocation **ret); | |
a628d933 MY |
29 | |
30 | typedef struct HibernateInfo { | |
31 | const char *device; | |
32 | uint64_t offset; /* in memory pages */ | |
a628d933 MY |
33 | |
34 | KernelHibernateLocation *cmdline; | |
35 | EFIHibernateLocation *efi; | |
36 | } HibernateInfo; | |
37 | ||
38 | void hibernate_info_done(HibernateInfo *info); | |
39 | ||
40 | int acquire_hibernate_info(HibernateInfo *ret); | |
41 | ||
a628d933 | 42 | void compare_hibernate_location_and_warn(const HibernateInfo *info); |