xenio.h revision 1.2 1 /* $NetBSD: xenio.h,v 1.2 2005/03/09 22:39:20 bouyer Exp $ */
2
3 /******************************************************************************
4 * privcmd.h
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 /* Interface to /proc/xen/privcmd */
34
35 typedef struct privcmd_hypercall
36 {
37 unsigned long op;
38 unsigned long arg[5];
39 } privcmd_hypercall_t;
40
41 typedef struct privcmd_mmap_entry {
42 unsigned long va;
43 unsigned long mfn;
44 unsigned long npages;
45 } privcmd_mmap_entry_t;
46
47 typedef struct privcmd_mmap {
48 int num;
49 domid_t dom; /* target domain */
50 privcmd_mmap_entry_t *entry;
51 } privcmd_mmap_t;
52
53 typedef struct privcmd_mmapbatch {
54 int num; /* number of pages to populate */
55 domid_t dom; /* target domain */
56 unsigned long addr; /* virtual address */
57 unsigned long *arr; /* array of mfns - top nibble set on err */
58 } privcmd_mmapbatch_t;
59
60 typedef struct privcmd_blkmsg
61 {
62 unsigned long op;
63 void *buf;
64 int buf_size;
65 } privcmd_blkmsg_t;
66
67 /*
68 * @cmd: IOCTL_PRIVCMD_HYPERCALL
69 * @arg: &privcmd_hypercall_t
70 * Return: Value returned from execution of the specified hypercall.
71 */
72 #define IOCTL_PRIVCMD_HYPERCALL \
73 _IOWR('P', 0, privcmd_hypercall_t)
74
75 /*
76 * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
77 * @arg: n/a
78 * Return: Port associated with domain-controller end of control event channel
79 * for the initial domain.
80 */
81 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
82 _IO('P', 1)
83
84 #define IOCTL_PRIVCMD_MMAP \
85 _IOW('P', 2, privcmd_mmap_t)
86 #define IOCTL_PRIVCMD_MMAPBATCH \
87 _IOW('P', 3, privcmd_mmapbatch_t)
88 #define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \
89 _IOW('P', 4, unsigned long)
90
91 /* Interface to /dev/xenevt */
92 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
93 #define EVTCHN_RESET _IO('E', 1)
94 /* EVTCHN_BIND: Bind to the specified event-channel port. */
95 #define EVTCHN_BIND _IOW('E', 2, unsigned long)
96 /* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
97 #define EVTCHN_UNBIND _IOW('E', 3, unsigned long)
98
99 #endif /* __PRIVCMD_H__ */
100