Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 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 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 14 | #define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 15 | #define VIRTIO_MEM_REQ_PLUG 0 |
| 16 | #define VIRTIO_MEM_REQ_UNPLUG 1 |
| 17 | #define VIRTIO_MEM_REQ_UNPLUG_ALL 2 |
| 18 | #define VIRTIO_MEM_REQ_STATE 3 |
| 19 | struct virtio_mem_req_plug { |
| 20 | __virtio64 addr; |
| 21 | __virtio16 nb_blocks; |
| 22 | __virtio16 padding[3]; |
| 23 | }; |
| 24 | struct virtio_mem_req_unplug { |
| 25 | __virtio64 addr; |
| 26 | __virtio16 nb_blocks; |
| 27 | __virtio16 padding[3]; |
| 28 | }; |
| 29 | struct virtio_mem_req_state { |
| 30 | __virtio64 addr; |
| 31 | __virtio16 nb_blocks; |
| 32 | __virtio16 padding[3]; |
| 33 | }; |
| 34 | struct virtio_mem_req { |
| 35 | __virtio16 type; |
| 36 | __virtio16 padding[3]; |
| 37 | union { |
| 38 | struct virtio_mem_req_plug plug; |
| 39 | struct virtio_mem_req_unplug unplug; |
| 40 | struct virtio_mem_req_state state; |
| 41 | } u; |
| 42 | }; |
| 43 | #define VIRTIO_MEM_RESP_ACK 0 |
| 44 | #define VIRTIO_MEM_RESP_NACK 1 |
| 45 | #define VIRTIO_MEM_RESP_BUSY 2 |
| 46 | #define VIRTIO_MEM_RESP_ERROR 3 |
| 47 | #define VIRTIO_MEM_STATE_PLUGGED 0 |
| 48 | #define VIRTIO_MEM_STATE_UNPLUGGED 1 |
| 49 | #define VIRTIO_MEM_STATE_MIXED 2 |
| 50 | struct virtio_mem_resp_state { |
| 51 | __virtio16 state; |
| 52 | }; |
| 53 | struct virtio_mem_resp { |
| 54 | __virtio16 type; |
| 55 | __virtio16 padding[3]; |
| 56 | union { |
| 57 | struct virtio_mem_resp_state state; |
| 58 | } u; |
| 59 | }; |
| 60 | struct virtio_mem_config { |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 61 | __le64 block_size; |
| 62 | __le16 node_id; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 63 | __u8 padding[6]; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 64 | __le64 addr; |
| 65 | __le64 region_size; |
| 66 | __le64 usable_region_size; |
| 67 | __le64 plugged_size; |
| 68 | __le64 requested_size; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 69 | }; |
| 70 | #endif |