1*ae115bc7Smrj\ 2*ae115bc7Smrj\ Copyright 2007 Sun Microsystems, Inc. All rights reserved. 3*ae115bc7Smrj\ Use is subject to license terms. 4*ae115bc7Smrj\ 5*ae115bc7Smrj\ CDDL HEADER START 6*ae115bc7Smrj\ 7*ae115bc7Smrj\ The contents of this file are subject to the terms of the 8*ae115bc7Smrj\ Common Development and Distribution License (the "License"). 9*ae115bc7Smrj\ You may not use this file except in compliance with the License. 10*ae115bc7Smrj\ 11*ae115bc7Smrj\ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 12*ae115bc7Smrj\ or http://www.opensolaris.org/os/licensing. 13*ae115bc7Smrj\ See the License for the specific language governing permissions 14*ae115bc7Smrj\ and limitations under the License. 15*ae115bc7Smrj\ 16*ae115bc7Smrj\ When distributing Covered Code, include this CDDL HEADER in each 17*ae115bc7Smrj\ file and include the License file at usr/src/OPENSOLARIS.LICENSE. 18*ae115bc7Smrj\ If applicable, add the following below this CDDL HEADER, with the 19*ae115bc7Smrj\ fields enclosed by brackets "[]" replaced with your own identifying 20*ae115bc7Smrj\ information: Portions Copyright [yyyy] [name of copyright owner] 21*ae115bc7Smrj\ 22*ae115bc7Smrj\ CDDL HEADER END 23*ae115bc7Smrj\ 24*ae115bc7Smrj\ ident "%Z%%M% %I% %E% SMI" 25*ae115bc7Smrj\ 26*ae115bc7Smrj\ CPU-save structure offsets for use in assembly code. 27*ae115bc7Smrj\ 28*ae115bc7Smrj\ Keep in sync with kdi_state.h 29*ae115bc7Smrj\ 30*ae115bc7Smrj 31*ae115bc7Smrj#include <sys/cpuvar.h> 32*ae115bc7Smrj#include <sys/kdi_impl.h> 33*ae115bc7Smrj 34*ae115bc7Smrjkdi_memrange_t MR_SIZE 35*ae115bc7Smrj mr_base 36*ae115bc7Smrj mr_lim 37*ae115bc7Smrj 38*ae115bc7Smrjkdi_crumb_t KRM_SIZE 39*ae115bc7Smrj krm_cpu_state 40*ae115bc7Smrj krm_pc 41*ae115bc7Smrj krm_sp 42*ae115bc7Smrj krm_trapno 43*ae115bc7Smrj krm_flag 44*ae115bc7Smrj 45*ae115bc7Smrjkdi_drreg_t 46*ae115bc7Smrj dr_ctl 47*ae115bc7Smrj dr_stat 48*ae115bc7Smrj dr_addr 49*ae115bc7Smrj 50*ae115bc7Smrjkdi_msr_t MSR_SIZE 51*ae115bc7Smrj msr_num 52*ae115bc7Smrj msr_type 53*ae115bc7Smrj _u._msr_valp MSR_VALP 54*ae115bc7Smrj _u._msr_val MSR_VAL 55*ae115bc7Smrj 56*ae115bc7Smrjkdi_cpusave_t KRS_SIZE 57*ae115bc7Smrj krs_gregs 58*ae115bc7Smrj krs_dr 59*ae115bc7Smrj krs_dr.dr_ctl KRS_DRCTL 60*ae115bc7Smrj krs_dr.dr_stat KRS_DRSTAT 61*ae115bc7Smrj krs_gdt 62*ae115bc7Smrj krs_idt 63*ae115bc7Smrj krs_cr0 64*ae115bc7Smrj krs_msr 65*ae115bc7Smrj krs_cpu_state 66*ae115bc7Smrj krs_curcrumbidx 67*ae115bc7Smrj krs_curcrumb 68*ae115bc7Smrj krs_crumbs 69*ae115bc7Smrj 70*ae115bc7Smrjcpu 71*ae115bc7Smrj cpu_id 72*ae115bc7Smrj 73*ae115bc7Smrjgreg_t KREG_SIZE 74*ae115bc7Smrj 75*ae115bc7Smrj#if defined(__amd64) 76*ae115bc7Smrj\#define REG_SHIFT 3 77*ae115bc7Smrj#else 78*ae115bc7Smrj\#define REG_SHIFT 2 79*ae115bc7Smrj#endif 80*ae115bc7Smrj 81*ae115bc7Smrj\#define DRADDR_IDX(num) _CONST(_MUL(num, DR_ADDR_INCR)) 82*ae115bc7Smrj\#define DRADDR_OFF(num) _CONST(DRADDR_IDX(num) + DR_ADDR) 83*ae115bc7Smrj\#define KRS_DROFF(num) _CONST(DRADDR_OFF(num) + KRS_DR) 84*ae115bc7Smrj\#define REG_OFF(reg) _CONST(_CONST(reg) << REG_SHIFT) 85*ae115bc7Smrj\#define KDIREG_OFF(reg) _CONST(_MUL(KREG_SIZE, reg) + KRS_GREGS) 86