10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 52011Shyw * Common Development and Distribution License (the "License"). 62011Shyw * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*3446Smrj * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _KAIF_H 270Sstevel@tonic-gate #define _KAIF_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifndef sun4v 320Sstevel@tonic-gate #include <sys/spitregs.h> 330Sstevel@tonic-gate #endif /* sun4v */ 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifndef _ASM 360Sstevel@tonic-gate #include <kmdb/kmdb_dpi_impl.h> 370Sstevel@tonic-gate #include <kmdb/kaif_regs.h> 380Sstevel@tonic-gate #endif 390Sstevel@tonic-gate 400Sstevel@tonic-gate #ifdef __cplusplus 410Sstevel@tonic-gate extern "C" { 420Sstevel@tonic-gate #endif 430Sstevel@tonic-gate 440Sstevel@tonic-gate #define KAIF_CPU_STATE_NONE 0 450Sstevel@tonic-gate #define KAIF_CPU_STATE_MASTER 1 460Sstevel@tonic-gate #define KAIF_CPU_STATE_SLAVE 2 470Sstevel@tonic-gate 480Sstevel@tonic-gate #define KAIF_LSUCTL_VWAPT_MASK (LSU_VM|LSU_VR|LSU_VW) 490Sstevel@tonic-gate #define KAIF_LSUCTL_PWAPT_MASK (LSU_PM|LSU_PR|LSU_PW) 500Sstevel@tonic-gate #define KAIF_LSUCTL_WAPT_MASK (LSU_PM|LSU_VM|LSU_PR|LSU_PW|LSU_VR|LSU_VW) 510Sstevel@tonic-gate 520Sstevel@tonic-gate #ifndef _ASM 530Sstevel@tonic-gate extern kaif_cpusave_t *kaif_cpusave; 540Sstevel@tonic-gate extern kaif_cpusave_t kaif_cb_save; 550Sstevel@tonic-gate extern int kaif_ncpusave; 560Sstevel@tonic-gate extern int kaif_master_cpuid; 570Sstevel@tonic-gate 580Sstevel@tonic-gate extern int *kaif_promexitarmp; 590Sstevel@tonic-gate 600Sstevel@tonic-gate extern void (*kaif_ktrap_install)(int, void (*)(void)); 610Sstevel@tonic-gate extern void (*kaif_ktrap_restore)(void); 620Sstevel@tonic-gate 630Sstevel@tonic-gate extern caddr_t kaif_tba; 640Sstevel@tonic-gate extern caddr_t kaif_tba_obp; 650Sstevel@tonic-gate #ifdef sun4v 660Sstevel@tonic-gate extern caddr_t kaif_tba_kernel; 670Sstevel@tonic-gate #endif 680Sstevel@tonic-gate extern caddr_t kaif_tba_native; 690Sstevel@tonic-gate extern size_t kaif_tba_native_sz; 700Sstevel@tonic-gate 710Sstevel@tonic-gate extern int kaif_trap_switch; 720Sstevel@tonic-gate 730Sstevel@tonic-gate extern void kaif_trap_set_debugger(void); 740Sstevel@tonic-gate extern void kaif_trap_set_saved(kaif_cpusave_t *); 750Sstevel@tonic-gate 760Sstevel@tonic-gate extern void kaif_hdlr_imiss(void); 770Sstevel@tonic-gate extern caddr_t kaif_hdlr_imiss_patch; 780Sstevel@tonic-gate extern void kaif_hdlr_dmiss(void); 790Sstevel@tonic-gate extern caddr_t kaif_hdlr_dmiss_patch; 800Sstevel@tonic-gate extern void kaif_hdlr_generic(void); 810Sstevel@tonic-gate extern void kaif_dtrap(void); 820Sstevel@tonic-gate 830Sstevel@tonic-gate extern caddr_t kaif_dseg_start; 840Sstevel@tonic-gate extern caddr_t kaif_dseg_lim; 850Sstevel@tonic-gate 860Sstevel@tonic-gate extern uintptr_t kaif_invoke(uintptr_t, uint_t, const uintptr_t[], 870Sstevel@tonic-gate kreg_t, kreg_t); 880Sstevel@tonic-gate 890Sstevel@tonic-gate extern void kaif_enter(void); 900Sstevel@tonic-gate 910Sstevel@tonic-gate extern void kaif_ktrap(void); 920Sstevel@tonic-gate extern void kaif_slave_entry(void); 930Sstevel@tonic-gate extern void kaif_trap_obp(void); 940Sstevel@tonic-gate 950Sstevel@tonic-gate extern void kaif_mod_loaded(struct modctl *); 960Sstevel@tonic-gate extern void kaif_mod_unloading(struct modctl *); 970Sstevel@tonic-gate 980Sstevel@tonic-gate extern void kaif_wapt_set_regs(void); 990Sstevel@tonic-gate extern void kaif_wapt_clear_regs(void); 1000Sstevel@tonic-gate 1010Sstevel@tonic-gate extern void kaif_activate(kdi_debugvec_t **, uint_t); 1020Sstevel@tonic-gate extern void kaif_deactivate(void); 1030Sstevel@tonic-gate extern void kaif_resume(int); 1040Sstevel@tonic-gate extern void kaif_slave_entry(void); 1050Sstevel@tonic-gate extern void kaif_prom_rearm(void); 1060Sstevel@tonic-gate extern void kaif_debugger_entry(kaif_cpusave_t *); 1070Sstevel@tonic-gate 1082011Shyw extern void kaif_slave_loop_barrier(void); 1092011Shyw 1100Sstevel@tonic-gate #endif 1110Sstevel@tonic-gate 1120Sstevel@tonic-gate #ifdef __cplusplus 1130Sstevel@tonic-gate } 1140Sstevel@tonic-gate #endif 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate #endif /* _KAIF_H */ 117