]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/hibernate-util.h
hwdb: Add mapping for Xiaomi Mipad 2 bottom bezel capacitive buttons
[thirdparty/systemd.git] / src / shared / hibernate-util.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
0ef6f454
LP
2#pragma once
3
17c40b3a 4#include <linux/fiemap.h>
1923373a 5#include <sys/types.h>
746cf898 6
596873c1
MY
7/* represents values for /sys/power/resume & /sys/power/resume_offset and the corresponding path */
8typedef struct HibernationDevice {
9 dev_t devno;
10 uint64_t offset; /* in memory pages */
8601ecbc 11 char *path;
596873c1 12} HibernationDevice;
7bdf56a2 13
596873c1 14void hibernation_device_done(HibernationDevice *hibernation_device);
7bdf56a2 15
596873c1
MY
16int find_suitable_hibernation_device_full(HibernationDevice *ret_device, uint64_t *ret_size, uint64_t *ret_used);
17static inline int find_suitable_hibernation_device(HibernationDevice *ret) {
18 return find_suitable_hibernation_device_full(ASSERT_PTR(ret), NULL, NULL);
19}
7bdf56a2 20
805deec0 21int hibernation_is_safe(void);
7bdf56a2 22
1923373a 23int write_resume_config(dev_t devno, uint64_t offset, const char *device);
596873c1 24
fbc88824 25int clear_efi_hibernate_location_and_warn(void);
8ad973ed 26
596873c1
MY
27/* Only for test-fiemap */
28int read_fiemap(int fd, struct fiemap **ret);