summaryrefslogtreecommitdiff
path: root/libc/kernel/uapi/linux/virtio_mem.h
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
committerJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
commit7e4fe6a28b718ab97c08811566238af2893ca65b (patch)
tree5413a5ec890b5a1ac4fbbe4548b5014e41a2591b /libc/kernel/uapi/linux/virtio_mem.h
parentdcdcb3fa15004669823a3a118189d9d72ff30852 (diff)
parentab08b955a34423d53b28a6210e7530e67241af4a (diff)
Merge SP1A.200921.001
Change-Id: Id2ab019914bb555dadf52c46b8403c0d5fb3c20a
Diffstat (limited to 'libc/kernel/uapi/linux/virtio_mem.h')
-rw-r--r--libc/kernel/uapi/linux/virtio_mem.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/libc/kernel/uapi/linux/virtio_mem.h b/libc/kernel/uapi/linux/virtio_mem.h
new file mode 100644
index 000000000..854a2fe1b
--- /dev/null
+++ b/libc/kernel/uapi/linux/virtio_mem.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VIRTIO_MEM_H
+#define _LINUX_VIRTIO_MEM_H
+#include <linux/types.h>
+#include <linux/virtio_types.h>
+#include <linux/virtio_ids.h>
+#include <linux/virtio_config.h>
+#define VIRTIO_MEM_F_ACPI_PXM 0
+#define VIRTIO_MEM_REQ_PLUG 0
+#define VIRTIO_MEM_REQ_UNPLUG 1
+#define VIRTIO_MEM_REQ_UNPLUG_ALL 2
+#define VIRTIO_MEM_REQ_STATE 3
+struct virtio_mem_req_plug {
+ __virtio64 addr;
+ __virtio16 nb_blocks;
+ __virtio16 padding[3];
+};
+struct virtio_mem_req_unplug {
+ __virtio64 addr;
+ __virtio16 nb_blocks;
+ __virtio16 padding[3];
+};
+struct virtio_mem_req_state {
+ __virtio64 addr;
+ __virtio16 nb_blocks;
+ __virtio16 padding[3];
+};
+struct virtio_mem_req {
+ __virtio16 type;
+ __virtio16 padding[3];
+ union {
+ struct virtio_mem_req_plug plug;
+ struct virtio_mem_req_unplug unplug;
+ struct virtio_mem_req_state state;
+ } u;
+};
+#define VIRTIO_MEM_RESP_ACK 0
+#define VIRTIO_MEM_RESP_NACK 1
+#define VIRTIO_MEM_RESP_BUSY 2
+#define VIRTIO_MEM_RESP_ERROR 3
+#define VIRTIO_MEM_STATE_PLUGGED 0
+#define VIRTIO_MEM_STATE_UNPLUGGED 1
+#define VIRTIO_MEM_STATE_MIXED 2
+struct virtio_mem_resp_state {
+ __virtio16 state;
+};
+struct virtio_mem_resp {
+ __virtio16 type;
+ __virtio16 padding[3];
+ union {
+ struct virtio_mem_resp_state state;
+ } u;
+};
+struct virtio_mem_config {
+ __u64 block_size;
+ __u16 node_id;
+ __u8 padding[6];
+ __u64 addr;
+ __u64 region_size;
+ __u64 usable_region_size;
+ __u64 plugged_size;
+ __u64 requested_size;
+};
+#endif