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