Print this page
4764 Need a way to get tsc deltas
Reviewed by: Keith M Wesolowski <wesolows@foobazco.org>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/i86pc/sys/machsystm.h
+++ new/usr/src/uts/i86pc/sys/machsystm.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25 /*
26 26 * Copyright (c) 2010, Intel Corporation.
27 27 * All rights reserved.
28 28 */
29 29
30 30 #ifndef _SYS_MACHSYSTM_H
31 31 #define _SYS_MACHSYSTM_H
32 32
33 33 /*
34 34 * Numerous platform-dependent interfaces that don't seem to belong
35 35 * in any other header file.
36 36 *
37 37 * This file should not be included by code that purports to be
38 38 * platform-independent.
39 39 *
40 40 */
41 41
42 42 #include <sys/machparam.h>
43 43 #include <sys/varargs.h>
44 44 #include <sys/thread.h>
45 45 #include <sys/cpuvar.h>
46 46 #include <sys/privregs.h>
47 47 #include <sys/systm.h>
48 48 #include <sys/traptrace.h>
49 49 #include <vm/page.h>
50 50
51 51 #ifdef __cplusplus
52 52 extern "C" {
53 53 #endif
54 54
55 55 #ifdef _KERNEL
56 56
57 57 typedef enum mach_cpu_add_arg_type {
58 58 MACH_CPU_ARG_LOCAL_APIC,
59 59 MACH_CPU_ARG_LOCAL_X2APIC,
60 60 } mach_cpu_add_arg_type_t;
61 61
62 62 typedef struct mach_cpu_add_arg {
63 63 mach_cpu_add_arg_type_t type;
64 64 union {
65 65 struct {
66 66 uint32_t apic_id;
67 67 uint32_t proc_id;
68 68 } apic;
69 69 } arg;
70 70 } mach_cpu_add_arg_t;
71 71
72 72 extern void mach_cpu_idle(void);
73 73 extern void mach_cpu_halt(char *);
74 74 extern int mach_cpu_start(cpu_t *, void *);
75 75 extern int mach_cpuid_start(processorid_t, void *);
76 76 extern int mach_cpu_stop(cpu_t *, void *);
77 77 extern int mach_cpu_add(mach_cpu_add_arg_t *, processorid_t *);
78 78 extern int mach_cpu_remove(processorid_t);
79 79 extern int mach_cpu_create_device_node(cpu_t *, dev_info_t **);
80 80 extern int mach_cpu_get_device_node(cpu_t *, dev_info_t **);
81 81
82 82 extern int Cpudelay;
83 83 extern void setcpudelay(void);
84 84
85 85 extern void send_dirint(int, int);
86 86 extern void siron(void);
87 87 extern void sir_on(int);
88 88
89 89 extern void return_instr(void);
90 90
91 91 extern int kcpc_hw_load_pcbe(void);
92 92 extern void kcpc_hw_init(cpu_t *cp);
93 93 extern void kcpc_hw_fini(cpu_t *cp);
94 94 extern int kcpc_hw_overflow_intr_installed;
95 95
96 96 struct panic_trap_info {
97 97 struct regs *trap_regs;
98 98 uint_t trap_type;
99 99 caddr_t trap_addr;
100 100 };
101 101
102 102 struct memconf {
103 103 pfn_t mcf_spfn; /* begin page frame number */
104 104 pfn_t mcf_epfn; /* end page frame number */
105 105 };
106 106
107 107 struct system_hardware {
108 108 int hd_nodes; /* number of nodes */
109 109 int hd_cpus_per_node; /* max cpus in a node */
110 110 struct memconf hd_mem[MAXNODES];
111 111 /*
112 112 * memory layout for each
113 113 * node.
114 114 */
115 115 };
116 116 extern struct system_hardware system_hardware;
117 117 extern void get_system_configuration(void);
118 118 extern void mmu_init(void);
119 119 extern int cpuid2nodeid(int);
120 120 extern void map_kaddr(caddr_t, pfn_t, int, int);
121 121
122 122 extern void memscrub_init(void);
123 123 extern void trap(struct regs *, caddr_t, processorid_t);
124 124
125 125 extern void do_interrupt(struct regs *, trap_trace_rec_t *);
126 126 extern void memscrub_disable(void);
127 127
128 128 /*
129 129 * Interrupt handling hooks
130 130 */
131 131 extern void (*do_interrupt_common)(struct regs *, trap_trace_rec_t *);
132 132 extern uintptr_t (*get_intr_handler)(int, short);
133 133
134 134 /*
135 135 * Dispatcher hooks.
136 136 */
137 137 void (*idle_cpu)();
138 138 void (*non_deep_idle_cpu)();
139 139 void (*disp_enq_thread)(cpu_t *, int);
140 140 void (*non_deep_idle_disp_enq_thread)(cpu_t *, int);
141 141
142 142 #ifndef __xpv
143 143 extern unsigned int microdata;
144 144 #endif
145 145
146 146 extern int use_mp;
147 147
148 148 extern struct cpu cpus[]; /* pointer to other cpus */
149 149 extern struct cpu *cpu[]; /* pointer to all cpus */
150 150
151 151 /* Operation types for extended mach_cpucontext interfaces */
152 152 #define MACH_CPUCONTEXT_OP_START 0
153 153 #define MACH_CPUCONTEXT_OP_STOP 1
154 154
155 155 extern int mach_cpucontext_init(void);
156 156 extern void mach_cpucontext_fini(void);
157 157 extern void *mach_cpucontext_alloc(struct cpu *);
158 158 extern void mach_cpucontext_free(struct cpu *, void *, int);
159 159 extern void *mach_cpucontext_xalloc(struct cpu *, int);
160 160 extern void mach_cpucontext_xfree(struct cpu *, void *, int, int);
161 161 extern void rmp_gdt_init(rm_platter_t *);
162 162
163 163 extern uintptr_t hole_start, hole_end;
164 164
165 165 #define INVALID_VADDR(a) \
166 166 (((a) >= (caddr_t)hole_start && (a) < (caddr_t)hole_end))
167 167
168 168 /* kpm mapping window */
169 169 extern size_t kpm_size;
170 170 extern uchar_t kpm_size_shift;
171 171 extern caddr_t kpm_vbase;
172 172
173 173 struct memlist;
174 174 extern void memlist_add(uint64_t, uint64_t, struct memlist *,
175 175 struct memlist **);
176 176 extern page_t *page_get_physical(uintptr_t seed);
177 177 extern int linear_pc(struct regs *rp, proc_t *p, caddr_t *linearp);
178 178 extern int dtrace_linear_pc(struct regs *rp, proc_t *p, caddr_t *linearp);
179 179
180 180 extern int force_shutdown_method;
181 181
182 182 /* Dynamic Reconfiguration capability interface. */
183 183 #define PLAT_DR_OPTIONS_NAME "plat-dr-options"
184 184 #define PLAT_DR_PHYSMAX_NAME "plat-dr-physmax"
185 185 #define PLAT_MAX_NCPUS_NAME "plat-max-ncpus"
186 186 #define BOOT_MAX_NCPUS_NAME "boot-max-ncpus"
187 187 #define BOOT_NCPUS_NAME "boot-ncpus"
188 188
189 189 #define PLAT_DR_FEATURE_CPU 0x1
190 190 #define PLAT_DR_FEATURE_MEMORY 0x2
191 191 #define PLAT_DR_FEATURE_ENABLED 0x1000000
192 192
193 193 #define plat_dr_enabled() \
194 194 plat_dr_check_capability(PLAT_DR_FEATURE_ENABLED)
195 195
196 196 #define plat_dr_enable() \
197 197 plat_dr_enable_capability(PLAT_DR_FEATURE_ENABLED)
198 198
199 199 #define plat_dr_disable_cpu() \
200 200 plat_dr_disable_capability(PLAT_DR_FEATURE_CPU)
201 201 #define plat_dr_disable_memory() \
202 202 plat_dr_disable_capability(PLAT_DR_FEATURE_MEMORY)
203 203
204 204 extern boolean_t plat_dr_support_cpu(void);
205 205 extern boolean_t plat_dr_support_memory(void);
206 206 extern boolean_t plat_dr_check_capability(uint64_t features);
207 207 extern void plat_dr_enable_capability(uint64_t features);
208 208 extern void plat_dr_disable_capability(uint64_t features);
209 209
210 210 #pragma weak plat_dr_support_cpu
211 211 #pragma weak plat_dr_support_memory
212 212
213 213 /*
214 214 * Used to communicate DR updates to platform lgroup framework
215 215 */
216 216 typedef struct {
217 217 uint64_t u_base;
218 218 uint64_t u_length;
219 219 uint32_t u_domain;
220 220 uint32_t u_device_id;
221 221 uint32_t u_sli_cnt;
222 222 uchar_t *u_sli_ptr;
|
↓ open down ↓ |
222 lines elided |
↑ open up ↑ |
223 223 } update_membounds_t;
224 224
225 225 /* Maximum physical page number (PFN) for memory DR operations. */
226 226 extern uint64_t plat_dr_physmax;
227 227
228 228 #ifdef __xpv
229 229 #include <sys/xen_mmu.h>
230 230 extern page_t *page_get_high_mfn(mfn_t);
231 231 #endif
232 232
233 +extern hrtime_t tsc_gethrtime_tick_delta(void);
233 234
234 235 #endif /* _KERNEL */
235 236
236 237 #ifdef __cplusplus
237 238 }
238 239 #endif
239 240
240 241 #endif /* _SYS_MACHSYSTM_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX