blob: f37c14897600364350ba3c543b85f1002b894304 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _LINUX_VIRTIO_BALLOON_H
8#define _LINUX_VIRTIO_BALLOON_H
Christopher Ferris05d08e92016-02-04 13:16:38 -08009#include <linux/types.h>
10#include <linux/virtio_types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#include <linux/virtio_ids.h>
12#include <linux/virtio_config.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070013#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0
14#define VIRTIO_BALLOON_F_STATS_VQ 1
Christopher Ferris05d08e92016-02-04 13:16:38 -080015#define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2
Christopher Ferris86a48372019-01-10 14:14:59 -080016#define VIRTIO_BALLOON_F_FREE_PAGE_HINT 3
17#define VIRTIO_BALLOON_F_PAGE_POISON 4
Christopher Ferrisaf09c702020-06-01 20:29:29 -070018#define VIRTIO_BALLOON_F_REPORTING 5
Ben Cheng655a7c02013-10-16 16:09:24 -070019#define VIRTIO_BALLOON_PFN_SHIFT 12
Christopher Ferris86a48372019-01-10 14:14:59 -080020#define VIRTIO_BALLOON_CMD_ID_STOP 0
21#define VIRTIO_BALLOON_CMD_ID_DONE 1
Tao Baod7db5942015-01-28 10:07:51 -080022struct virtio_balloon_config {
Christopher Ferris25c18d42020-10-14 17:42:58 -070023 __le32 num_pages;
24 __le32 actual;
Christopher Ferrisaf09c702020-06-01 20:29:29 -070025 union {
Christopher Ferris25c18d42020-10-14 17:42:58 -070026 __le32 free_page_hint_cmd_id;
27 __le32 free_page_report_cmd_id;
Christopher Ferrisaf09c702020-06-01 20:29:29 -070028 };
Christopher Ferris25c18d42020-10-14 17:42:58 -070029 __le32 poison_val;
Ben Cheng655a7c02013-10-16 16:09:24 -070030};
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define VIRTIO_BALLOON_S_SWAP_IN 0
32#define VIRTIO_BALLOON_S_SWAP_OUT 1
33#define VIRTIO_BALLOON_S_MAJFLT 2
34#define VIRTIO_BALLOON_S_MINFLT 3
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define VIRTIO_BALLOON_S_MEMFREE 4
36#define VIRTIO_BALLOON_S_MEMTOT 5
Christopher Ferris106b3a82016-08-24 12:15:38 -070037#define VIRTIO_BALLOON_S_AVAIL 6
Christopher Ferris76a1d452018-06-27 14:12:29 -070038#define VIRTIO_BALLOON_S_CACHES 7
39#define VIRTIO_BALLOON_S_HTLB_PGALLOC 8
40#define VIRTIO_BALLOON_S_HTLB_PGFAIL 9
41#define VIRTIO_BALLOON_S_NR 10
42#define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { VIRTIO_BALLOON_S_NAMES_prefix "swap-in", VIRTIO_BALLOON_S_NAMES_prefix "swap-out", VIRTIO_BALLOON_S_NAMES_prefix "major-faults", VIRTIO_BALLOON_S_NAMES_prefix "minor-faults", VIRTIO_BALLOON_S_NAMES_prefix "free-memory", VIRTIO_BALLOON_S_NAMES_prefix "total-memory", VIRTIO_BALLOON_S_NAMES_prefix "available-memory", VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \
43}
44#define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("")
Ben Cheng655a7c02013-10-16 16:09:24 -070045struct virtio_balloon_stat {
Christopher Ferris05d08e92016-02-04 13:16:38 -080046 __virtio16 tag;
Christopher Ferris106b3a82016-08-24 12:15:38 -070047 __virtio64 val;
Ben Cheng655a7c02013-10-16 16:09:24 -070048} __attribute__((packed));
Nick Kralevicha67e4de2013-01-14 11:28:26 -080049#endif