1*5084Sjohnlev /* 2*5084Sjohnlev * Copyright (c) 2003-2005, K A Fraser 3*5084Sjohnlev * 4*5084Sjohnlev * This file may be distributed separately from the Linux kernel, or 5*5084Sjohnlev * incorporated into other software packages, subject to the following license: 6*5084Sjohnlev * 7*5084Sjohnlev * Permission is hereby granted, free of charge, to any person obtaining a copy 8*5084Sjohnlev * of this source file (the "Software"), to deal in the Software without 9*5084Sjohnlev * restriction, including without limitation the rights to use, copy, modify, 10*5084Sjohnlev * merge, publish, distribute, sublicense, and/or sell copies of the Software, 11*5084Sjohnlev * and to permit persons to whom the Software is furnished to do so, subject to 12*5084Sjohnlev * the following conditions: 13*5084Sjohnlev * 14*5084Sjohnlev * The above copyright notice and this permission notice shall be included in 15*5084Sjohnlev * all copies or substantial portions of the Software. 16*5084Sjohnlev * 17*5084Sjohnlev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18*5084Sjohnlev * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19*5084Sjohnlev * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20*5084Sjohnlev * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21*5084Sjohnlev * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22*5084Sjohnlev * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23*5084Sjohnlev * IN THE SOFTWARE. 24*5084Sjohnlev */ 25*5084Sjohnlev 26*5084Sjohnlev /* 27*5084Sjohnlev * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 28*5084Sjohnlev * Use is subject to license terms. 29*5084Sjohnlev */ 30*5084Sjohnlev 31*5084Sjohnlev #ifndef _XEN_SYS_PRIVCMD_H 32*5084Sjohnlev #define _XEN_SYS_PRIVCMD_H 33*5084Sjohnlev 34*5084Sjohnlev #pragma ident "%Z%%M% %I% %E% SMI" 35*5084Sjohnlev 36*5084Sjohnlev /* 37*5084Sjohnlev * WARNING: 38*5084Sjohnlev * These numbers and structure are built into the ON privcmd 39*5084Sjohnlev * driver, as well as the low-level tools and libraries in 40*5084Sjohnlev * the Xen consolidation. 41*5084Sjohnlev */ 42*5084Sjohnlev 43*5084Sjohnlev #include <sys/types.h> 44*5084Sjohnlev 45*5084Sjohnlev #ifdef __cplusplus 46*5084Sjohnlev extern "C" { 47*5084Sjohnlev #endif 48*5084Sjohnlev 49*5084Sjohnlev /* 50*5084Sjohnlev * ioctl numbers and corresponding data structures 51*5084Sjohnlev */ 52*5084Sjohnlev 53*5084Sjohnlev #define __PRIVCMD_IOC (('p'<<24)|('r'<<16)|('v'<<8)) 54*5084Sjohnlev 55*5084Sjohnlev #define IOCTL_PRIVCMD_HYPERCALL (__PRIVCMD_IOC|0) 56*5084Sjohnlev #define IOCTL_PRIVCMD_MMAP (__PRIVCMD_IOC|1) 57*5084Sjohnlev #define IOCTL_PRIVCMD_MMAPBATCH (__PRIVCMD_IOC|2) 58*5084Sjohnlev 59*5084Sjohnlev typedef struct __privcmd_hypercall { 60*5084Sjohnlev unsigned long op; 61*5084Sjohnlev unsigned long arg[5]; 62*5084Sjohnlev } privcmd_hypercall_t; 63*5084Sjohnlev 64*5084Sjohnlev typedef struct __privcmd_mmap_entry { 65*5084Sjohnlev unsigned long va; 66*5084Sjohnlev unsigned long mfn; 67*5084Sjohnlev unsigned long npages; 68*5084Sjohnlev } privcmd_mmap_entry_t; 69*5084Sjohnlev 70*5084Sjohnlev typedef struct __privcmd_mmap { 71*5084Sjohnlev int num; 72*5084Sjohnlev domid_t dom; /* target domain */ 73*5084Sjohnlev privcmd_mmap_entry_t *entry; 74*5084Sjohnlev } privcmd_mmap_t; 75*5084Sjohnlev 76*5084Sjohnlev typedef struct __privcmd_mmapbatch { 77*5084Sjohnlev int num; /* number of pages to populate */ 78*5084Sjohnlev domid_t dom; /* target domain */ 79*5084Sjohnlev unsigned long addr; /* virtual address */ 80*5084Sjohnlev unsigned long *arr; /* array of mfns - top nibble set on err */ 81*5084Sjohnlev } privcmd_mmapbatch_t; 82*5084Sjohnlev 83*5084Sjohnlev #ifdef __cplusplus 84*5084Sjohnlev } 85*5084Sjohnlev #endif 86*5084Sjohnlev 87*5084Sjohnlev #endif /* _XEN_SYS_PRIVCMD_H */ 88