- supported.conf: Added sparse_keymap (eeepc_laptop depends on it)
[linux-flexiantxendom0-3.2.10.git] / include / xen / compat_ioctl.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
15  *
16  * Copyright IBM Corp. 2007
17  *
18  * Authors: Jimi Xenidis <jimix@watson.ibm.com>
19  *          Hollis Blanchard <hollisb@us.ibm.com>
20  */
21
22 #ifndef __LINUX_XEN_COMPAT_H__ 
23 #define __LINUX_XEN_COMPAT_H__ 
24
25 #include <linux/compat.h>
26 #include <linux/compiler.h>
27
28 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
29 #define xen_pfn32_t __u32
30 #endif
31
32 extern int privcmd_ioctl_32(int fd, unsigned int cmd, unsigned long arg);
33 struct privcmd_mmap_32 {
34         int num;
35         domid_t dom;
36         compat_uptr_t entry;
37 };
38
39 struct privcmd_mmapbatch_32 {
40         int num;     /* number of pages to populate */
41         domid_t dom; /* target domain */
42 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
43         union {      /* virtual address */
44                 __u64 addr __attribute__((packed));
45                 __u32 va; /* ensures union is 4-byte aligned */
46         };
47 #else
48         __u64 addr;  /* virtual address */
49 #endif
50         compat_uptr_t arr; /* array of mfns - top nibble set on err */
51 };
52
53 struct privcmd_mmapbatch_v2_32 {
54         unsigned int num; /* number of pages to populate */
55         domid_t dom;      /* target domain */
56 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
57         union {      /* virtual address */
58                 __u64 addr __attribute__((packed));
59                 __u32 va; /* ensures union is 4-byte aligned */
60         };
61 #else
62         __u64 addr;  /* virtual address */
63 #endif
64         compat_uptr_t arr; /* array of mfns */
65         compat_uptr_t err; /* array of error codes */
66 };
67
68 #define IOCTL_PRIVCMD_MMAP_32                   \
69         _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap_32))
70 #define IOCTL_PRIVCMD_MMAPBATCH_32              \
71         _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch_32))
72 #define IOCTL_PRIVCMD_MMAPBATCH_V2_32           \
73         _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2_32))
74
75 #endif /* __LINUX_XEN_COMPAT_H__ */