blob: e90853ec62561b4e068a3af1ab48ef4a9f3607aa [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 Ferris8177cdf2020-08-03 11:53:55 -07007#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 Ferrisa4792612022-01-10 13:51:15 -080014#define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1
Christopher Ferris8177cdf2020-08-03 11:53:55 -070015#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
19struct virtio_mem_req_plug {
20 __virtio64 addr;
21 __virtio16 nb_blocks;
22 __virtio16 padding[3];
23};
24struct virtio_mem_req_unplug {
25 __virtio64 addr;
26 __virtio16 nb_blocks;
27 __virtio16 padding[3];
28};
29struct virtio_mem_req_state {
30 __virtio64 addr;
31 __virtio16 nb_blocks;
32 __virtio16 padding[3];
33};
34struct 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
50struct virtio_mem_resp_state {
51 __virtio16 state;
52};
53struct virtio_mem_resp {
54 __virtio16 type;
55 __virtio16 padding[3];
56 union {
57 struct virtio_mem_resp_state state;
58 } u;
59};
60struct virtio_mem_config {
Christopher Ferris25c18d42020-10-14 17:42:58 -070061 __le64 block_size;
62 __le16 node_id;
Christopher Ferris8177cdf2020-08-03 11:53:55 -070063 __u8 padding[6];
Christopher Ferris25c18d42020-10-14 17:42:58 -070064 __le64 addr;
65 __le64 region_size;
66 __le64 usable_region_size;
67 __le64 plugged_size;
68 __le64 requested_size;
Christopher Ferris8177cdf2020-08-03 11:53:55 -070069};
70#endif