1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _LINUX_VIRTIO_MEM_H 20 #define _LINUX_VIRTIO_MEM_H 21 #include <linux/types.h> 22 #include <linux/virtio_types.h> 23 #include <linux/virtio_ids.h> 24 #include <linux/virtio_config.h> 25 #define VIRTIO_MEM_F_ACPI_PXM 0 26 #define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1 27 #define VIRTIO_MEM_REQ_PLUG 0 28 #define VIRTIO_MEM_REQ_UNPLUG 1 29 #define VIRTIO_MEM_REQ_UNPLUG_ALL 2 30 #define VIRTIO_MEM_REQ_STATE 3 31 struct virtio_mem_req_plug { 32 __virtio64 addr; 33 __virtio16 nb_blocks; 34 __virtio16 padding[3]; 35 }; 36 struct virtio_mem_req_unplug { 37 __virtio64 addr; 38 __virtio16 nb_blocks; 39 __virtio16 padding[3]; 40 }; 41 struct virtio_mem_req_state { 42 __virtio64 addr; 43 __virtio16 nb_blocks; 44 __virtio16 padding[3]; 45 }; 46 struct virtio_mem_req { 47 __virtio16 type; 48 __virtio16 padding[3]; 49 union { 50 struct virtio_mem_req_plug plug; 51 struct virtio_mem_req_unplug unplug; 52 struct virtio_mem_req_state state; 53 } u; 54 }; 55 #define VIRTIO_MEM_RESP_ACK 0 56 #define VIRTIO_MEM_RESP_NACK 1 57 #define VIRTIO_MEM_RESP_BUSY 2 58 #define VIRTIO_MEM_RESP_ERROR 3 59 #define VIRTIO_MEM_STATE_PLUGGED 0 60 #define VIRTIO_MEM_STATE_UNPLUGGED 1 61 #define VIRTIO_MEM_STATE_MIXED 2 62 struct virtio_mem_resp_state { 63 __virtio16 state; 64 }; 65 struct virtio_mem_resp { 66 __virtio16 type; 67 __virtio16 padding[3]; 68 union { 69 struct virtio_mem_resp_state state; 70 } u; 71 }; 72 struct virtio_mem_config { 73 __le64 block_size; 74 __le16 node_id; 75 __u8 padding[6]; 76 __le64 addr; 77 __le64 region_size; 78 __le64 usable_region_size; 79 __le64 plugged_size; 80 __le64 requested_size; 81 }; 82 #endif 83