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.
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.
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.
16 * Copyright IBM Corp. 2007
18 * Authors: Jimi Xenidis <jimix@watson.ibm.com>
19 * Hollis Blanchard <hollisb@us.ibm.com>
22 #ifndef __LINUX_XEN_COMPAT_H__
23 #define __LINUX_XEN_COMPAT_H__
25 #include <linux/compat.h>
26 #include <linux/compiler.h>
28 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
29 #define xen_pfn32_t __u32
32 extern int privcmd_ioctl_32(int fd, unsigned int cmd, unsigned long arg);
33 struct privcmd_mmap_32 {
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 */
48 __u64 addr; /* virtual address */
50 compat_uptr_t arr; /* array of mfns - top nibble set on err */
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 */
62 __u64 addr; /* virtual address */
64 compat_uptr_t arr; /* array of mfns */
65 compat_uptr_t err; /* array of error codes */
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))
75 #endif /* __LINUX_XEN_COMPAT_H__ */