| Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 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_REQ_PLUG 0 | 
|  | 27 | #define VIRTIO_MEM_REQ_UNPLUG 1 | 
|  | 28 | #define VIRTIO_MEM_REQ_UNPLUG_ALL 2 | 
|  | 29 | #define VIRTIO_MEM_REQ_STATE 3 | 
|  | 30 | struct virtio_mem_req_plug { | 
|  | 31 | __virtio64 addr; | 
|  | 32 | __virtio16 nb_blocks; | 
|  | 33 | __virtio16 padding[3]; | 
|  | 34 | }; | 
|  | 35 | struct virtio_mem_req_unplug { | 
|  | 36 | __virtio64 addr; | 
|  | 37 | __virtio16 nb_blocks; | 
|  | 38 | __virtio16 padding[3]; | 
|  | 39 | }; | 
|  | 40 | struct virtio_mem_req_state { | 
|  | 41 | __virtio64 addr; | 
|  | 42 | __virtio16 nb_blocks; | 
|  | 43 | __virtio16 padding[3]; | 
|  | 44 | }; | 
|  | 45 | struct virtio_mem_req { | 
|  | 46 | __virtio16 type; | 
|  | 47 | __virtio16 padding[3]; | 
|  | 48 | union { | 
|  | 49 | struct virtio_mem_req_plug plug; | 
|  | 50 | struct virtio_mem_req_unplug unplug; | 
|  | 51 | struct virtio_mem_req_state state; | 
|  | 52 | } u; | 
|  | 53 | }; | 
|  | 54 | #define VIRTIO_MEM_RESP_ACK 0 | 
|  | 55 | #define VIRTIO_MEM_RESP_NACK 1 | 
|  | 56 | #define VIRTIO_MEM_RESP_BUSY 2 | 
|  | 57 | #define VIRTIO_MEM_RESP_ERROR 3 | 
|  | 58 | #define VIRTIO_MEM_STATE_PLUGGED 0 | 
|  | 59 | #define VIRTIO_MEM_STATE_UNPLUGGED 1 | 
|  | 60 | #define VIRTIO_MEM_STATE_MIXED 2 | 
|  | 61 | struct virtio_mem_resp_state { | 
|  | 62 | __virtio16 state; | 
|  | 63 | }; | 
|  | 64 | struct virtio_mem_resp { | 
|  | 65 | __virtio16 type; | 
|  | 66 | __virtio16 padding[3]; | 
|  | 67 | union { | 
|  | 68 | struct virtio_mem_resp_state state; | 
|  | 69 | } u; | 
|  | 70 | }; | 
|  | 71 | struct virtio_mem_config { | 
| Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 72 | __le64 block_size; | 
|  | 73 | __le16 node_id; | 
| Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 74 | __u8 padding[6]; | 
| Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 75 | __le64 addr; | 
|  | 76 | __le64 region_size; | 
|  | 77 | __le64 usable_region_size; | 
|  | 78 | __le64 plugged_size; | 
|  | 79 | __le64 requested_size; | 
| Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 80 | }; | 
|  | 81 | #endif |