blob: 770623ad73792399635bfd7c21ff84948d18b1c4 [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 Ferris7ac54f52024-08-07 21:07:12 +000015#define VIRTIO_MEM_F_PERSISTENT_SUSPEND 2
Christopher Ferris8177cdf2020-08-03 11:53:55 -070016#define VIRTIO_MEM_REQ_PLUG 0
17#define VIRTIO_MEM_REQ_UNPLUG 1
18#define VIRTIO_MEM_REQ_UNPLUG_ALL 2
19#define VIRTIO_MEM_REQ_STATE 3
20struct virtio_mem_req_plug {
21 __virtio64 addr;
22 __virtio16 nb_blocks;
23 __virtio16 padding[3];
24};
25struct virtio_mem_req_unplug {
26 __virtio64 addr;
27 __virtio16 nb_blocks;
28 __virtio16 padding[3];
29};
30struct virtio_mem_req_state {
31 __virtio64 addr;
32 __virtio16 nb_blocks;
33 __virtio16 padding[3];
34};
35struct virtio_mem_req {
36 __virtio16 type;
37 __virtio16 padding[3];
38 union {
39 struct virtio_mem_req_plug plug;
40 struct virtio_mem_req_unplug unplug;
41 struct virtio_mem_req_state state;
42 } u;
43};
44#define VIRTIO_MEM_RESP_ACK 0
45#define VIRTIO_MEM_RESP_NACK 1
46#define VIRTIO_MEM_RESP_BUSY 2
47#define VIRTIO_MEM_RESP_ERROR 3
48#define VIRTIO_MEM_STATE_PLUGGED 0
49#define VIRTIO_MEM_STATE_UNPLUGGED 1
50#define VIRTIO_MEM_STATE_MIXED 2
51struct virtio_mem_resp_state {
52 __virtio16 state;
53};
54struct virtio_mem_resp {
55 __virtio16 type;
56 __virtio16 padding[3];
57 union {
58 struct virtio_mem_resp_state state;
59 } u;
60};
61struct virtio_mem_config {
Christopher Ferris25c18d42020-10-14 17:42:58 -070062 __le64 block_size;
63 __le16 node_id;
Christopher Ferris8177cdf2020-08-03 11:53:55 -070064 __u8 padding[6];
Christopher Ferris25c18d42020-10-14 17:42:58 -070065 __le64 addr;
66 __le64 region_size;
67 __le64 usable_region_size;
68 __le64 plugged_size;
69 __le64 requested_size;
Christopher Ferris8177cdf2020-08-03 11:53:55 -070070};
71#endif