166 extern user_desc_t *cpu_get_gdt(void);
167
168 extern void switch_sp_and_call(void *, void (*)(uint_t, uint_t), uint_t,
169 uint_t);
170 extern hrtime_t (*gethrtimef)(void);
171 extern hrtime_t (*gethrtimeunscaledf)(void);
172 extern void (*scalehrtimef)(hrtime_t *);
173 extern uint64_t (*unscalehrtimef)(hrtime_t);
174 extern void (*gethrestimef)(timestruc_t *);
175
176 extern void av_dispatch_softvect(uint_t);
177 extern void av_dispatch_autovect(uint_t);
178 extern uint_t atomic_btr32(uint32_t *, uint_t);
179 extern uint_t bsrw_insn(uint16_t);
180 extern int sys_rtt_common(struct regs *);
181 extern void fakesoftint(void);
182
183 extern void *plat_traceback(void *);
184
185 /*
186 * The following two macros are the four byte instruction sequence of stac, ret
187 * and clac, ret. These are used in startup_smap() as a part of properly setting
188 * up the valid instructions. For more information on SMAP, see
189 * uts/intel/ia32/ml/copy.s.
190 */
191 #define SMAP_CLAC_INSTR 0xc3ca010f
192 #define SMAP_STAC_INSTR 0xc3cb010f
193 extern void smap_disable(void);
194 extern void smap_enable(void);
195
196 #if defined(__xpv)
197 extern void xen_init_callbacks(void);
198 extern void xen_set_callback(void (*)(void), uint_t, uint_t);
199 extern void xen_printf(const char *, ...);
200 #define cpr_dprintf xen_printf
201 extern int xpv_panicking;
202 #define IN_XPV_PANIC() (xpv_panicking > 0)
203 #else
204 extern void setup_mca(void);
205 extern void pat_sync(void);
206 extern void patch_tsc_read(int);
207 #if defined(__amd64) && !defined(__xpv)
208 extern void patch_memops(uint_t);
209 #endif /* defined(__amd64) && !defined(__xpv) */
210 extern void setup_xfem(void);
211 #define cpr_dprintf prom_printf
212 #define IN_XPV_PANIC() (__lintzero)
|
166 extern user_desc_t *cpu_get_gdt(void);
167
168 extern void switch_sp_and_call(void *, void (*)(uint_t, uint_t), uint_t,
169 uint_t);
170 extern hrtime_t (*gethrtimef)(void);
171 extern hrtime_t (*gethrtimeunscaledf)(void);
172 extern void (*scalehrtimef)(hrtime_t *);
173 extern uint64_t (*unscalehrtimef)(hrtime_t);
174 extern void (*gethrestimef)(timestruc_t *);
175
176 extern void av_dispatch_softvect(uint_t);
177 extern void av_dispatch_autovect(uint_t);
178 extern uint_t atomic_btr32(uint32_t *, uint_t);
179 extern uint_t bsrw_insn(uint16_t);
180 extern int sys_rtt_common(struct regs *);
181 extern void fakesoftint(void);
182
183 extern void *plat_traceback(void *);
184
185 /*
186 * The following two macros are the four byte instruction sequence of stac, nop
187 * and clac, nop. These are used in startup_smap() and hotinline_smap() as a
188 * part of properly setting up the valid instructions. For more information on
189 * SMAP, see uts/intel/ia32/ml/copy.s, uts/i86pc/os/machdep.c and
190 * uts/common/os/modctl.c.
191 *
192 * Note that smap_disable and smap_enable are resolved to stubs at compile time,
193 * but inlined at runtime by do_hotinlines() in uts/i86pc/os/machdep.c.
194 */
195 #define SMAP_CLAC_INSTR 0x90ca010f
196 #define SMAP_STAC_INSTR 0x90cb010f
197 extern void smap_disable(void);
198 extern void smap_enable(void);
199
200 #if defined(__xpv)
201 extern void xen_init_callbacks(void);
202 extern void xen_set_callback(void (*)(void), uint_t, uint_t);
203 extern void xen_printf(const char *, ...);
204 #define cpr_dprintf xen_printf
205 extern int xpv_panicking;
206 #define IN_XPV_PANIC() (xpv_panicking > 0)
207 #else
208 extern void setup_mca(void);
209 extern void pat_sync(void);
210 extern void patch_tsc_read(int);
211 #if defined(__amd64) && !defined(__xpv)
212 extern void patch_memops(uint_t);
213 #endif /* defined(__amd64) && !defined(__xpv) */
214 extern void setup_xfem(void);
215 #define cpr_dprintf prom_printf
216 #define IN_XPV_PANIC() (__lintzero)
|