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