This commit was generated by cvs2svn to compensate for changes in r925,
[linux-2.6.git] / include / asm-xen / linux-public / privcmd.h
1 /******************************************************************************
2  * privcmd.h
3  * 
4  * Interface to /proc/xen/privcmd.
5  * 
6  * Copyright (c) 2003-2004, K A Fraser
7  * 
8  * This file may be distributed separately from the Linux kernel, or
9  * incorporated into other software packages, subject to the following license:
10  * 
11  * Permission is hereby granted, free of charge, to any person obtaining a copy
12  * of this source file (the "Software"), to deal in the Software without
13  * restriction, including without limitation the rights to use, copy, modify,
14  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
15  * and to permit persons to whom the Software is furnished to do so, subject to
16  * the following conditions:
17  * 
18  * The above copyright notice and this permission notice shall be included in
19  * all copies or substantial portions of the Software.
20  * 
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27  * IN THE SOFTWARE.
28  */
29
30 #ifndef __PRIVCMD_H__
31 #define __PRIVCMD_H__
32
33 typedef struct privcmd_hypercall
34 {
35     unsigned long op;
36     unsigned long arg[5];
37 } privcmd_hypercall_t;
38
39 typedef struct privcmd_mmap_entry {
40     unsigned long va;
41     unsigned long mfn;
42     unsigned long npages;
43 } privcmd_mmap_entry_t; 
44
45 typedef struct privcmd_mmap {
46     int num;
47     domid_t dom; /* target domain */
48     privcmd_mmap_entry_t *entry;
49 } privcmd_mmap_t; 
50
51 typedef struct privcmd_mmapbatch {
52     int num;     /* number of pages to populate */
53     domid_t dom; /* target domain */
54     unsigned long addr;  /* virtual address */
55     unsigned long *arr; /* array of mfns - top nibble set on err */
56 } privcmd_mmapbatch_t; 
57
58 typedef struct privcmd_blkmsg
59 {
60     unsigned long op;
61     void         *buf;
62     int           buf_size;
63 } privcmd_blkmsg_t;
64
65 /*
66  * @cmd: IOCTL_PRIVCMD_HYPERCALL
67  * @arg: &privcmd_hypercall_t
68  * Return: Value returned from execution of the specified hypercall.
69  */
70 #define IOCTL_PRIVCMD_HYPERCALL         \
71     _IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t))
72
73 /*
74  * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
75  * @arg: n/a
76  * Return: Port associated with domain-controller end of control event channel
77  *         for the initial domain.
78  */
79 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
80     _IOC(_IOC_NONE, 'P', 1, 0)
81 #define IOCTL_PRIVCMD_MMAP             \
82     _IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t))
83 #define IOCTL_PRIVCMD_MMAPBATCH             \
84     _IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t))
85 #define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \
86     _IOC(_IOC_READ, 'P', 4, sizeof(unsigned long))
87
88 #endif /* __PRIVCMD_H__ */