xref: /aosp_15_r20/bionic/libc/kernel/uapi/linux/virtio_mem.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1 /*
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  */
7 #ifndef _LINUX_VIRTIO_MEM_H
8 #define _LINUX_VIRTIO_MEM_H
9 #include <linux/types.h>
10 #include <linux/virtio_types.h>
11 #include <linux/virtio_ids.h>
12 #include <linux/virtio_config.h>
13 #define VIRTIO_MEM_F_ACPI_PXM 0
14 #define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1
15 #define VIRTIO_MEM_F_PERSISTENT_SUSPEND 2
16 #define VIRTIO_MEM_REQ_PLUG 0
17 #define VIRTIO_MEM_REQ_UNPLUG 1
18 #define VIRTIO_MEM_REQ_UNPLUG_ALL 2
19 #define VIRTIO_MEM_REQ_STATE 3
20 struct virtio_mem_req_plug {
21   __virtio64 addr;
22   __virtio16 nb_blocks;
23   __virtio16 padding[3];
24 };
25 struct virtio_mem_req_unplug {
26   __virtio64 addr;
27   __virtio16 nb_blocks;
28   __virtio16 padding[3];
29 };
30 struct virtio_mem_req_state {
31   __virtio64 addr;
32   __virtio16 nb_blocks;
33   __virtio16 padding[3];
34 };
35 struct virtio_mem_req {
36   __virtio16 type;
37   __virtio16 padding[3];
38   union {
39     struct virtio_mem_req_plug plug;
40     struct virtio_mem_req_unplug unplug;
41     struct virtio_mem_req_state state;
42   } u;
43 };
44 #define VIRTIO_MEM_RESP_ACK 0
45 #define VIRTIO_MEM_RESP_NACK 1
46 #define VIRTIO_MEM_RESP_BUSY 2
47 #define VIRTIO_MEM_RESP_ERROR 3
48 #define VIRTIO_MEM_STATE_PLUGGED 0
49 #define VIRTIO_MEM_STATE_UNPLUGGED 1
50 #define VIRTIO_MEM_STATE_MIXED 2
51 struct virtio_mem_resp_state {
52   __virtio16 state;
53 };
54 struct virtio_mem_resp {
55   __virtio16 type;
56   __virtio16 padding[3];
57   union {
58     struct virtio_mem_resp_state state;
59   } u;
60 };
61 struct virtio_mem_config {
62   __le64 block_size;
63   __le16 node_id;
64   __u8 padding[6];
65   __le64 addr;
66   __le64 region_size;
67   __le64 usable_region_size;
68   __le64 plugged_size;
69   __le64 requested_size;
70 };
71 #endif
72