mach_kdi.c revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* various system states (boot, while running, while the debugger has control).
* Functions intended for use while the debugger has control may not grab any
* locks or perform any functions that assume the availability of other system
* services.
*/
#include <sys/x86_archext.h>
#include <sys/kdi_impl.h>
#include <sys/smp_impldefs.h>
#include <sys/psm_types.h>
#include <sys/segments.h>
#include <sys/archsystm.h>
#include <sys/controlregs.h>
#include <sys/kobj_impl.h>
#include <sys/mach_mmu.h>
void
{
/*
* See kdi_idtr_set().
*/
}
}
kdi_dreg_get(int reg)
{
switch (reg) {
case 0:
return (kdi_getdr0());
case 1:
return (kdi_getdr1());
case 2:
return (kdi_getdr2());
case 3:
return (kdi_getdr3());
case 6:
return (kdi_getdr6());
case 7:
return (kdi_getdr7());
default:
/*NOTREACHED*/
}
}
void
{
switch (reg) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 6:
break;
case 7:
break;
default:
/*NOTREACHED*/
}
}
void
kdi_flush_caches(void)
{
reload_cr3();
}
extern void kdi_slave_entry(void);
void
{
if (doxc)
}
/*
* On i86pc, slaves busy-loop, so we don't need to do anything here.
*/
void
kdi_start_slaves(void)
{
}
void
kdi_slave_wait(void)
{
}
/*
* Caution.
* These routines are called -extremely- early, during kmdb initialization.
*
* Many common kernel functions assume that %gs has been initialized,
* and fail horribly if it hasn't. At this point, the boot code has
* reserved a descriptor for us (KMDBGS_SEL) in it's GDT; arrange for it
* to point at a dummy cpu_t, temporarily at least.
*
*/
#if defined(__amd64)
void *
boot_kdi_tmpinit(void)
{
return ((void *)old);
}
void
boot_kdi_tmpfini(void *old)
{
}
void *
boot_kdi_tmpinit(void)
{
/*
* Now switch %gs to point at it.
*/
return ((void *)old);
}
void
boot_kdi_tmpfini(void *old)
{
}
#endif /* __i386 */