• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
24 struct privcmd_hypercall {
25   __u64 op;
26   __u64 arg[5];
27 };
28 struct privcmd_mmap_entry {
29   __u64 va;
30   __u64 mfn;
31   __u64 npages;
32 };
33 struct privcmd_mmap {
34   int num;
35   domid_t dom;
36   struct privcmd_mmap_entry __user * entry;
37 };
38 struct 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
46 struct 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 };
53 struct privcmd_dm_op_buf {
54   void __user * uptr;
55   size_t size;
56 };
57 struct privcmd_dm_op {
58   domid_t dom;
59   __u16 num;
60   const struct privcmd_dm_op_buf __user * ubufs;
61 };
62 struct privcmd_mmap_resource {
63   domid_t dom;
64   __u32 type;
65   __u32 id;
66   __u32 idx;
67   __u64 num;
68   __u64 addr;
69 };
70 #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))
72 #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))
74 #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))
76 #define IOCTL_PRIVCMD_MMAP_RESOURCE _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
77 #endif
78