blob: 66ffce1503d93e7fe361fbed63660232d9b6ece6 [file] [log] [blame]
Christopher Ferris8177cdf2020-08-03 11:53:55 -07001/****************************************************************************
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
Christopher Ferrisa4792612022-01-10 13:51:15 -080026#define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1
Christopher Ferris8177cdf2020-08-03 11:53:55 -070027#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
31struct virtio_mem_req_plug {
32 __virtio64 addr;
33 __virtio16 nb_blocks;
34 __virtio16 padding[3];
35};
36struct virtio_mem_req_unplug {
37 __virtio64 addr;
38 __virtio16 nb_blocks;
39 __virtio16 padding[3];
40};
41struct virtio_mem_req_state {
42 __virtio64 addr;
43 __virtio16 nb_blocks;
44 __virtio16 padding[3];
45};
46struct 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
62struct virtio_mem_resp_state {
63 __virtio16 state;
64};
65struct virtio_mem_resp {
66 __virtio16 type;
67 __virtio16 padding[3];
68 union {
69 struct virtio_mem_resp_state state;
70 } u;
71};
72struct virtio_mem_config {
Christopher Ferris25c18d42020-10-14 17:42:58 -070073 __le64 block_size;
74 __le16 node_id;
Christopher Ferris8177cdf2020-08-03 11:53:55 -070075 __u8 padding[6];
Christopher Ferris25c18d42020-10-14 17:42:58 -070076 __le64 addr;
77 __le64 region_size;
78 __le64 usable_region_size;
79 __le64 plugged_size;
80 __le64 requested_size;
Christopher Ferris8177cdf2020-08-03 11:53:55 -070081};
82#endif