blob: 145446b4abb8212792ab0f50c072f2231d13bf60 [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;
36 struct privcmd_mmap_entry __user * 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;
42 xen_pfn_t __user * 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;
50 const xen_pfn_t __user * arr;
Tao Baod7db5942015-01-28 10:07:51 -080051 int __user * err;
Ben Cheng655a7c02013-10-16 16:09:24 -070052};
Christopher Ferris525ce912017-07-26 13:12:53 -070053struct privcmd_dm_op_buf {
54 void __user * uptr;
55 size_t size;
56};
57struct privcmd_dm_op {
58 domid_t dom;
59 __u16 num;
60 const struct privcmd_dm_op_buf __user * ubufs;
61};
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};
Tao Baod7db5942015-01-28 10:07:51 -080070#define IOCTL_PRIVCMD_HYPERCALL _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
71#define IOCTL_PRIVCMD_MMAP _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
Tao Baod7db5942015-01-28 10:07:51 -080072#define IOCTL_PRIVCMD_MMAPBATCH _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
73#define IOCTL_PRIVCMD_MMAPBATCH_V2 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
Christopher Ferris525ce912017-07-26 13:12:53 -070074#define IOCTL_PRIVCMD_DM_OP _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
75#define IOCTL_PRIVCMD_RESTRICT _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
Christopher Ferris9ce28842018-10-25 12:11:39 -070076#define IOCTL_PRIVCMD_MMAP_RESOURCE _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
Ben Cheng655a7c02013-10-16 16:09:24 -070077#endif