Print this page
9210 remove KMDB branch debugging support
9211 ::crregs could do with cr2/cr3 support
9209 ::ttrace should be able to filter by thread
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
   1 \
   2 \ Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
   3 \ Use is subject to license terms.
   4 \


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


  26 \ CPU-save structure offsets for use in assembly code.
  27 \
  28 \ Keep in sync with kdi_state.h
  29 \
  30 
  31 #include <sys/cpuvar.h>
  32 #include <sys/kdi_impl.h>
  33 
  34 kdi_memrange_t  MR_SIZE
  35                 mr_base
  36                 mr_lim
  37 
  38 kdi_crumb_t     KRM_SIZE
  39                 krm_cpu_state
  40                 krm_pc
  41                 krm_sp
  42                 krm_trapno
  43                 krm_flag
  44 
  45 kdi_drreg_t
  46                 dr_ctl
  47                 dr_stat
  48                 dr_addr
  49 






  50 kdi_cpusave_t   KRS_SIZE
  51                 krs_gregs
  52                 krs_dr
  53                 krs_dr.dr_ctl                   KRS_DRCTL
  54                 krs_dr.dr_stat                  KRS_DRSTAT
  55                 krs_gdt
  56                 krs_idt
  57                 krs_cr0

  58                 krs_cpu_state
  59                 krs_curcrumbidx
  60                 krs_curcrumb
  61                 krs_crumbs
  62 
  63 cpu
  64                 cpu_id
  65 
  66 greg_t          KREG_SIZE
  67 
  68 #if defined(__amd64)
  69 \#define        REG_SHIFT               3
  70 #else
  71 \#define        REG_SHIFT               2
  72 #endif
  73 
  74 \#define        DRADDR_IDX(num)         _CONST(_MUL(num, DR_ADDR_INCR))
  75 \#define        DRADDR_OFF(num)         _CONST(DRADDR_IDX(num) + DR_ADDR)
  76 \#define        KRS_DROFF(num)          _CONST(DRADDR_OFF(num) + KRS_DR)
  77 \#define        REG_OFF(reg)            _CONST(_CONST(reg) << REG_SHIFT)