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