ia64/xen-unstable

view xen/include/public/sysctl.h @ 12938:b58670602d35

[POWERPC][XEN] Builtin cmdline dependency rule
Rebuild cmdline.o when the user changes the CMDLINE=X argument passed to
the make invocation. I couldn't find an example of another project that
handles this case properly, so I came up with this.
Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Thu Oct 05 15:48:26 2006 -0500 (2006-10-05)
parents 8d0e06c38c0c
children 0c2816fb60b9
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 0x00000002
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(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_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_t total_pages;
85 uint64_t free_pages;
86 uint64_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(xen_sysctl_perfc_desc_t) desc;
125 /* counter values (or NULL) */
126 XEN_GUEST_HANDLE(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(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 struct xen_sysctl {
144 uint32_t cmd;
145 uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
146 union {
147 struct xen_sysctl_readconsole readconsole;
148 struct xen_sysctl_tbuf_op tbuf_op;
149 struct xen_sysctl_physinfo physinfo;
150 struct xen_sysctl_sched_id sched_id;
151 struct xen_sysctl_perfc_op perfc_op;
152 struct xen_sysctl_getdomaininfolist getdomaininfolist;
153 uint8_t pad[128];
154 } u;
155 };
156 typedef struct xen_sysctl xen_sysctl_t;
157 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
159 #endif /* __XEN_PUBLIC_SYSCTL_H__ */
161 /*
162 * Local variables:
163 * mode: C
164 * c-set-style: "BSD"
165 * c-basic-offset: 4
166 * tab-width: 4
167 * indent-tabs-mode: nil
168 * End:
169 */