win-pvdrivers

view common/include/public/sysctl.h @ 62:edd4a2ad5b44

Removed old inf files
author James Harper <james.harper@bendigoit.com.au>
date Wed Dec 19 10:22:50 2007 +1100 (2007-12-19)
parents 5712dede5a1b
children
line source
1 /******************************************************************************
2 * sysctl.h
3 *
4 * System management operations. For use by node control stack.
5 *
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:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
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.
23 *
24 * Copyright (c) 2002-2006, K Fraser
25 */
27 #ifndef __XEN_PUBLIC_SYSCTL_H__
28 #define __XEN_PUBLIC_SYSCTL_H__
30 #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
31 #error "sysctl operations are intended for use by node control tools only"
32 #endif
34 #include "xen.h"
35 #include "domctl.h"
37 #define XEN_SYSCTL_INTERFACE_VERSION 0x00000003
39 /*
40 * Read console content from Xen buffer ring.
41 */
42 #define XEN_SYSCTL_readconsole 1
43 struct xen_sysctl_readconsole {
44 /* IN variables. */
45 uint32_t clear; /* Non-zero -> clear after reading. */
46 XEN_GUEST_HANDLE_64(char) buffer; /* Buffer start */
47 /* IN/OUT variables. */
48 uint32_t count; /* In: Buffer size; Out: Used buffer size */
49 };
50 typedef struct xen_sysctl_readconsole xen_sysctl_readconsole_t;
51 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_readconsole_t);
53 /* Get trace buffers machine base address */
54 #define XEN_SYSCTL_tbuf_op 2
55 struct xen_sysctl_tbuf_op {
56 /* IN variables */
57 #define XEN_SYSCTL_TBUFOP_get_info 0
58 #define XEN_SYSCTL_TBUFOP_set_cpu_mask 1
59 #define XEN_SYSCTL_TBUFOP_set_evt_mask 2
60 #define XEN_SYSCTL_TBUFOP_set_size 3
61 #define XEN_SYSCTL_TBUFOP_enable 4
62 #define XEN_SYSCTL_TBUFOP_disable 5
63 uint32_t cmd;
64 /* IN/OUT variables */
65 struct xenctl_cpumap cpu_mask;
66 uint32_t evt_mask;
67 /* OUT variables */
68 uint64_aligned_t buffer_mfn;
69 uint32_t size;
70 };
71 typedef struct xen_sysctl_tbuf_op xen_sysctl_tbuf_op_t;
72 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tbuf_op_t);
74 /*
75 * Get physical information about the host machine
76 */
77 #define XEN_SYSCTL_physinfo 3
78 struct xen_sysctl_physinfo {
79 uint32_t threads_per_core;
80 uint32_t cores_per_socket;
81 uint32_t sockets_per_node;
82 uint32_t nr_nodes;
83 uint32_t cpu_khz;
84 uint64_aligned_t total_pages;
85 uint64_aligned_t free_pages;
86 uint64_aligned_t scrub_pages;
87 uint32_t hw_cap[8];
88 };
89 typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
90 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t);
92 /*
93 * Get the ID of the current scheduler.
94 */
95 #define XEN_SYSCTL_sched_id 4
96 struct xen_sysctl_sched_id {
97 /* OUT variable */
98 uint32_t sched_id;
99 };
100 typedef struct xen_sysctl_sched_id xen_sysctl_sched_id_t;
101 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_sched_id_t);
103 /* Interface for controlling Xen software performance counters. */
104 #define XEN_SYSCTL_perfc_op 5
105 /* Sub-operations: */
106 #define XEN_SYSCTL_PERFCOP_reset 1 /* Reset all counters to zero. */
107 #define XEN_SYSCTL_PERFCOP_query 2 /* Get perfctr information. */
108 struct xen_sysctl_perfc_desc {
109 char name[80]; /* name of perf counter */
110 uint32_t nr_vals; /* number of values for this counter */
111 };
112 typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t;
113 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t);
114 typedef uint32_t xen_sysctl_perfc_val_t;
115 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t);
117 struct xen_sysctl_perfc_op {
118 /* IN variables. */
119 uint32_t cmd; /* XEN_SYSCTL_PERFCOP_??? */
120 /* OUT variables. */
121 uint32_t nr_counters; /* number of counters description */
122 uint32_t nr_vals; /* number of values */
123 /* counter information (or NULL) */
124 XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc;
125 /* counter values (or NULL) */
126 XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val;
127 };
128 typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t;
129 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t);
131 #define XEN_SYSCTL_getdomaininfolist 6
132 struct xen_sysctl_getdomaininfolist {
133 /* IN variables. */
134 domid_t first_domain;
135 uint32_t max_domains;
136 XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer;
137 /* OUT variables. */
138 uint32_t num_domains;
139 };
140 typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
141 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
143 /* Inject debug keys into Xen. */
144 #define XEN_SYSCTL_debug_keys 7
145 struct xen_sysctl_debug_keys {
146 /* IN variables. */
147 XEN_GUEST_HANDLE_64(char) keys;
148 uint32_t nr_keys;
149 };
150 typedef struct xen_sysctl_debug_keys xen_sysctl_debug_keys_t;
151 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_debug_keys_t);
153 /* Get physical CPU information. */
154 #define XEN_SYSCTL_getcpuinfo 8
155 struct xen_sysctl_cpuinfo {
156 uint64_t idletime;
157 };
158 typedef struct xen_sysctl_cpuinfo xen_sysctl_cpuinfo_t;
159 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpuinfo_t);
160 struct xen_sysctl_getcpuinfo {
161 /* IN variables. */
162 uint32_t max_cpus;
163 XEN_GUEST_HANDLE_64(xen_sysctl_cpuinfo_t) info;
164 /* OUT variables. */
165 uint32_t nr_cpus;
166 };
167 typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t;
168 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t);
170 struct xen_sysctl {
171 uint32_t cmd;
172 uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
173 union {
174 struct xen_sysctl_readconsole readconsole;
175 struct xen_sysctl_tbuf_op tbuf_op;
176 struct xen_sysctl_physinfo physinfo;
177 struct xen_sysctl_sched_id sched_id;
178 struct xen_sysctl_perfc_op perfc_op;
179 struct xen_sysctl_getdomaininfolist getdomaininfolist;
180 struct xen_sysctl_debug_keys debug_keys;
181 struct xen_sysctl_getcpuinfo getcpuinfo;
182 uint8_t pad[128];
183 } u;
184 };
185 typedef struct xen_sysctl xen_sysctl_t;
186 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
188 #endif /* __XEN_PUBLIC_SYSCTL_H__ */
190 /*
191 * Local variables:
192 * mode: C
193 * c-set-style: "BSD"
194 * c-basic-offset: 4
195 * tab-width: 4
196 * indent-tabs-mode: nil
197 * End:
198 */