• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef _LINUX_VIRTIO_BALLOON_H
7 #define _LINUX_VIRTIO_BALLOON_H
8 #include <linux/types.h>
9 #include <linux/virtio_types.h>
10 #include <linux/virtio_ids.h>
11 #include <linux/virtio_config.h>
12 #define VIRTIO_BALLOON_F_MUST_TELL_HOST	0
13 #define VIRTIO_BALLOON_F_STATS_VQ	1
14 #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM	2
15 #define VIRTIO_BALLOON_PFN_SHIFT 12
16 struct virtio_balloon_config {
17 
18 	__u32 num_pages;
19 
20 	__u32 actual;
21 };
22 #define VIRTIO_BALLOON_S_SWAP_IN  0
23 #define VIRTIO_BALLOON_S_SWAP_OUT 1
24 #define VIRTIO_BALLOON_S_MAJFLT   2
25 #define VIRTIO_BALLOON_S_MINFLT   3
26 #define VIRTIO_BALLOON_S_MEMFREE  4
27 #define VIRTIO_BALLOON_S_MEMTOT   5
28 #define VIRTIO_BALLOON_S_AVAIL    6
29 #define VIRTIO_BALLOON_S_CACHES   7
30 #define VIRTIO_BALLOON_S_HTLB_PGALLOC  8
31 #define VIRTIO_BALLOON_S_HTLB_PGFAIL   9
32 #define VIRTIO_BALLOON_S_NR       10
33 #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \
34 	VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \
35 	VIRTIO_BALLOON_S_NAMES_prefix "swap-out", \
36 	VIRTIO_BALLOON_S_NAMES_prefix "major-faults", \
37 	VIRTIO_BALLOON_S_NAMES_prefix "minor-faults", \
38 	VIRTIO_BALLOON_S_NAMES_prefix "free-memory", \
39 	VIRTIO_BALLOON_S_NAMES_prefix "total-memory", \
40 	VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \
41 	VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \
42 	VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \
43 	VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \
44 }
45 #define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("")
46 struct virtio_balloon_stat {
47 	__virtio16 tag;
48 	__virtio64 val;
49 } __attribute__((packed));
50 #endif
51