Home | History | Annotate | Line # | Download | only in include
xenio.h revision 1.1.8.2
      1 /******************************************************************************
      2  * privcmd.h
      3  *
      4  * Copyright (c) 2003-2004, K A Fraser
      5  *
      6  * This file may be distributed separately from the Linux kernel, or
      7  * incorporated into other software packages, subject to the following license:
      8  *
      9  * Permission is hereby granted, free of charge, to any person obtaining a copy
     10  * of this source file (the "Software"), to deal in the Software without
     11  * restriction, including without limitation the rights to use, copy, modify,
     12  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
     13  * and to permit persons to whom the Software is furnished to do so, subject to
     14  * the following conditions:
     15  *
     16  * The above copyright notice and this permission notice shall be included in
     17  * all copies or substantial portions of the Software.
     18  *
     19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     22  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     24  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     25  * IN THE SOFTWARE.
     26  */
     27 
     28 #ifndef __PRIVCMD_H__
     29 #define __PRIVCMD_H__
     30 
     31 /* Interface to /proc/xen/privcmd */
     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     _IOWR('P', 0, 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     _IO('P', 1)
     81 
     82 #define IOCTL_PRIVCMD_MMAP             \
     83     _IOW('P', 2, privcmd_mmap_t)
     84 #define IOCTL_PRIVCMD_MMAPBATCH        \
     85     _IOW('P', 3, privcmd_mmapbatch_t)
     86 #define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \
     87     _IOW('P', 4, unsigned long)
     88 
     89 /* Interface to /dev/xenevt */
     90 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
     91 #define EVTCHN_RESET  _IO('E', 1)
     92 /* EVTCHN_BIND: Bind to the specified event-channel port. */
     93 #define EVTCHN_BIND   _IOW('E', 2, unsigned long)
     94 /* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
     95 #define EVTCHN_UNBIND _IOW('E', 3, unsigned long)
     96 
     97 #endif /* __PRIVCMD_H__ */
     98