blob: c4de85eb7f1385d7d01cb50fb1d6854559be7792 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -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_PUBLIC_PRIVCMD_H__
20#define __LINUX_PUBLIC_PRIVCMD_H__
21#include <linux/types.h>
22#include <linux/compiler.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <xen/interface/xen.h>
24struct privcmd_hypercall {
Tao Baod7db5942015-01-28 10:07:51 -080025 __u64 op;
26 __u64 arg[5];
Ben Cheng655a7c02013-10-16 16:09:24 -070027};
28struct privcmd_mmap_entry {
Tao Baod7db5942015-01-28 10:07:51 -080029 __u64 va;
30 __u64 mfn;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u64 npages;
Ben Cheng655a7c02013-10-16 16:09:24 -070032};
33struct privcmd_mmap {
Tao Baod7db5942015-01-28 10:07:51 -080034 int num;
Tao Baod7db5942015-01-28 10:07:51 -080035 domid_t dom;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070036 struct privcmd_mmap_entry * entry;
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38struct privcmd_mmapbatch {
Tao Baod7db5942015-01-28 10:07:51 -080039 int num;
40 domid_t dom;
41 __u64 addr;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070042 xen_pfn_t * arr;
Ben Cheng655a7c02013-10-16 16:09:24 -070043};
44#define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U
45#define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U
46struct privcmd_mmapbatch_v2 {
Tao Baod7db5942015-01-28 10:07:51 -080047 unsigned int num;
48 domid_t dom;
49 __u64 addr;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070050 const xen_pfn_t * arr;
51 int * err;
Ben Cheng655a7c02013-10-16 16:09:24 -070052};
Christopher Ferris525ce912017-07-26 13:12:53 -070053struct privcmd_dm_op_buf {
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070054 void * uptr;
Christopher Ferris525ce912017-07-26 13:12:53 -070055 size_t size;
56};
57struct privcmd_dm_op {
58 domid_t dom;
59 __u16 num;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070060 const struct privcmd_dm_op_buf * ubufs;
Christopher Ferris525ce912017-07-26 13:12:53 -070061};
Christopher Ferris9ce28842018-10-25 12:11:39 -070062struct privcmd_mmap_resource {
63 domid_t dom;
64 __u32 type;
65 __u32 id;
66 __u32 idx;
67 __u64 num;
68 __u64 addr;
69};
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070070#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
71struct privcmd_irqfd {
72 void * dm_op;
73 __u32 size;
74 __u32 fd;
75 __u32 flags;
76 domid_t dom;
77 __u8 pad[2];
78};
Tao Baod7db5942015-01-28 10:07:51 -080079#define IOCTL_PRIVCMD_HYPERCALL _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
80#define IOCTL_PRIVCMD_MMAP _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
Tao Baod7db5942015-01-28 10:07:51 -080081#define IOCTL_PRIVCMD_MMAPBATCH _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
82#define IOCTL_PRIVCMD_MMAPBATCH_V2 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
Christopher Ferris525ce912017-07-26 13:12:53 -070083#define IOCTL_PRIVCMD_DM_OP _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
84#define IOCTL_PRIVCMD_RESTRICT _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
Christopher Ferris9ce28842018-10-25 12:11:39 -070085#define IOCTL_PRIVCMD_MMAP_RESOURCE _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070086#define IOCTL_PRIVCMD_IRQFD _IOC(_IOC_NONE, 'P', 8, sizeof(struct privcmd_irqfd))
Ben Cheng655a7c02013-10-16 16:09:24 -070087#endif