1 /******************************************************************************
4 * Guest OS interface to Xen Transcendent Memory.
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 * Copyright (c) 2004, K A Fraser
27 #ifndef __XEN_PUBLIC_TMEM_H__
28 #define __XEN_PUBLIC_TMEM_H__
32 #if __XEN_INTERFACE_VERSION__ < 0x00041300
35 #define TMEM_SPEC_VERSION 1
37 #define TMEM_NEW_POOL 1
38 #define TMEM_DESTROY_POOL 2
39 #define TMEM_PUT_PAGE 4
40 #define TMEM_GET_PAGE 5
41 #define TMEM_FLUSH_PAGE 6
42 #define TMEM_FLUSH_OBJECT 7
43 #if __XEN_INTERFACE_VERSION__ < 0x00040400
44 #define TMEM_NEW_PAGE 3
50 /* Privileged commands now called via XEN_SYSCTL_tmem_op. */
51 #define TMEM_AUTH 101 /* as XEN_SYSCTL_TMEM_OP_SET_AUTH. */
52 #define TMEM_RESTORE_NEW 102 /* as XEN_SYSCTL_TMEM_OP_SET_POOL. */
54 /* Bits for HYPERVISOR_tmem_op(TMEM_NEW_POOL) */
55 #define TMEM_POOL_PERSIST 1
56 #define TMEM_POOL_SHARED 2
57 #define TMEM_POOL_PRECOMPRESSED 4
58 #define TMEM_POOL_PAGESIZE_SHIFT 4
59 #define TMEM_POOL_PAGESIZE_MASK 0xf
60 #define TMEM_POOL_VERSION_SHIFT 24
61 #define TMEM_POOL_VERSION_MASK 0xff
62 #define TMEM_POOL_RESERVED_BITS 0x00ffff00
64 /* Bits for client flags (save/restore) */
65 #define TMEM_CLIENT_COMPRESS 1
66 #define TMEM_CLIENT_FROZEN 2
68 /* Special errno values */
75 typedef struct xen_tmem_oid xen_tmem_oid_t;
76 DEFINE_XEN_GUEST_HANDLE(xen_tmem_oid_t);
79 #if __XEN_INTERFACE_VERSION__ < 0x00040400
80 typedef xen_pfn_t tmem_cli_mfn_t;
82 typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t;
91 } creat; /* for cmd == TMEM_NEW_POOL. */
93 #if __XEN_INTERFACE_VERSION__ < 0x00040600
102 xen_pfn_t cmfn; /* client machine page frame */
103 } gen; /* for all other cmd ("generic") */
106 typedef struct tmem_op tmem_op_t;
107 DEFINE_XEN_GUEST_HANDLE(tmem_op_t);
110 #endif /* __XEN_INTERFACE_VERSION__ < 0x00041300 */
112 #endif /* __XEN_PUBLIC_TMEM_H__ */
117 * c-file-style: "BSD"
120 * indent-tabs-mode: nil