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