privcmd.h revision 525ce914edf136d2bd02ac8c404d56c52e737f4d
1/****************************************************************************
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>
23#include <xen/interface/xen.h>
24struct privcmd_hypercall {
25  __u64 op;
26  __u64 arg[5];
27};
28struct privcmd_mmap_entry {
29  __u64 va;
30  __u64 mfn;
31  __u64 npages;
32};
33struct privcmd_mmap {
34  int num;
35  domid_t dom;
36  struct privcmd_mmap_entry __user * entry;
37};
38struct privcmd_mmapbatch {
39  int num;
40  domid_t dom;
41  __u64 addr;
42  xen_pfn_t __user * arr;
43};
44#define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U
45#define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U
46struct privcmd_mmapbatch_v2 {
47  unsigned int num;
48  domid_t dom;
49  __u64 addr;
50  const xen_pfn_t __user * arr;
51  int __user * err;
52};
53struct 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};
62#define IOCTL_PRIVCMD_HYPERCALL _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
63#define IOCTL_PRIVCMD_MMAP _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
64#define IOCTL_PRIVCMD_MMAPBATCH _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
65#define IOCTL_PRIVCMD_MMAPBATCH_V2 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
66#define IOCTL_PRIVCMD_DM_OP _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
67#define IOCTL_PRIVCMD_RESTRICT _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
68#endif
69