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>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.


  24  */
  25 
  26 /*
  27  * Kernel/Debugger Interface (KDI) routines.  Called during debugger under
  28  * various system states (boot, while running, while the debugger has control).
  29  * Functions intended for use while the debugger has control may not grab any
  30  * locks or perform any functions that assume the availability of other system
  31  * services.
  32  */
  33 
  34 #include <sys/systm.h>
  35 #include <sys/x86_archext.h>
  36 #include <sys/kdi_impl.h>
  37 #include <sys/smp_impldefs.h>
  38 #include <sys/psm_types.h>
  39 #include <sys/segments.h>
  40 #include <sys/archsystm.h>
  41 #include <sys/controlregs.h>
  42 #include <sys/trap.h>
  43 #include <sys/kobj.h>


 137 static void
 138 kdi_plat_call(void (*platfn)(void))
 139 {
 140         if (platfn != NULL)
 141                 platfn();
 142 }
 143 
 144 /*
 145  * On Intel, most of these are shared between i86*, so this is really an
 146  * arch_kdi_init().
 147  */
 148 void
 149 mach_kdi_init(kdi_t *kdi)
 150 {
 151         kdi->kdi_plat_call = kdi_plat_call;
 152         kdi->kdi_kmdb_enter = kmdb_enter;
 153         kdi->mkdi_activate = kdi_activate;
 154         kdi->mkdi_deactivate = kdi_deactivate;
 155         kdi->mkdi_idt_switch = kdi_idt_switch;
 156         kdi->mkdi_update_drreg = kdi_update_drreg;
 157         kdi->mkdi_set_debug_msrs = kdi_set_debug_msrs;
 158         kdi->mkdi_get_userlimit = kdi_get_userlimit;
 159         kdi->mkdi_get_cpuinfo = kdi_get_cpuinfo;
 160         kdi->mkdi_stop_slaves = kdi_stop_slaves;
 161         kdi->mkdi_start_slaves = kdi_start_slaves;
 162         kdi->mkdi_slave_wait = kdi_slave_wait;
 163         kdi->mkdi_memrange_add = kdi_memrange_add;
 164         kdi->mkdi_reboot = kdi_reboot;
 165 }
 166 
 167 void
 168 plat_kdi_init(kdi_t *kdi)
 169 {
 170         kdi->pkdi_system_claim = kdi_system_claim;
 171         kdi->pkdi_system_release = kdi_system_release;
 172 }


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  *
  25  * Copyright 2018 Joyent, Inc.
  26  */
  27 
  28 /*
  29  * Kernel/Debugger Interface (KDI) routines.  Called during debugger under
  30  * various system states (boot, while running, while the debugger has control).
  31  * Functions intended for use while the debugger has control may not grab any
  32  * locks or perform any functions that assume the availability of other system
  33  * services.
  34  */
  35 
  36 #include <sys/systm.h>
  37 #include <sys/x86_archext.h>
  38 #include <sys/kdi_impl.h>
  39 #include <sys/smp_impldefs.h>
  40 #include <sys/psm_types.h>
  41 #include <sys/segments.h>
  42 #include <sys/archsystm.h>
  43 #include <sys/controlregs.h>
  44 #include <sys/trap.h>
  45 #include <sys/kobj.h>


 139 static void
 140 kdi_plat_call(void (*platfn)(void))
 141 {
 142         if (platfn != NULL)
 143                 platfn();
 144 }
 145 
 146 /*
 147  * On Intel, most of these are shared between i86*, so this is really an
 148  * arch_kdi_init().
 149  */
 150 void
 151 mach_kdi_init(kdi_t *kdi)
 152 {
 153         kdi->kdi_plat_call = kdi_plat_call;
 154         kdi->kdi_kmdb_enter = kmdb_enter;
 155         kdi->mkdi_activate = kdi_activate;
 156         kdi->mkdi_deactivate = kdi_deactivate;
 157         kdi->mkdi_idt_switch = kdi_idt_switch;
 158         kdi->mkdi_update_drreg = kdi_update_drreg;

 159         kdi->mkdi_get_userlimit = kdi_get_userlimit;
 160         kdi->mkdi_get_cpuinfo = kdi_get_cpuinfo;
 161         kdi->mkdi_stop_slaves = kdi_stop_slaves;
 162         kdi->mkdi_start_slaves = kdi_start_slaves;
 163         kdi->mkdi_slave_wait = kdi_slave_wait;
 164         kdi->mkdi_memrange_add = kdi_memrange_add;
 165         kdi->mkdi_reboot = kdi_reboot;
 166 }
 167 
 168 void
 169 plat_kdi_init(kdi_t *kdi)
 170 {
 171         kdi->pkdi_system_claim = kdi_system_claim;
 172         kdi->pkdi_system_release = kdi_system_release;
 173 }