ae115bc77f6fcde83175c75b4206dc2e50747966mrj * CDDL HEADER START
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * The contents of this file are subject to the terms of the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Common Development and Distribution License (the "License").
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * You may not use this file except in compliance with the License.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * See the License for the specific language governing permissions
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * and limitations under the License.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * When distributing Covered Code, include this CDDL HEADER in each
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * If applicable, add the following below this CDDL HEADER, with the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * fields enclosed by brackets "[]" replaced with your own identifying
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * information: Portions Copyright [yyyy] [name of copyright owner]
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * CDDL HEADER END
d3d50737e566cade9a08d73d2af95105ac7cd960Rafael Vanoni * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Use is subject to license terms.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Kernel/Debugger Interface (KDI) routines. Called during debugger under
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * various system states (boot, while running, while the debugger has control).
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Functions intended for use while the debugger has control may not grab any
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * locks or perform any functions that assume the availability of other system
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * services.
ae115bc77f6fcde83175c75b4206dc2e50747966mrjstatic void
ae115bc77f6fcde83175c75b4206dc2e50747966mrjstatic void
ae115bc77f6fcde83175c75b4206dc2e50747966mrj#if defined(__amd64)
ae115bc77f6fcde83175c75b4206dc2e50747966mrjkdi_get_cpuinfo(uint_t *vendorp, uint_t *familyp, uint_t *modelp)
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * CPU doesn't work until the GDT and gs/GSBASE have been set up.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Boot-loaded kmdb will call us well before then, so we have to
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * find the current cpu_t the hard way.
ae115bc77f6fcde83175c75b4206dc2e50747966mrj return (0);
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * This rare case could happen if we entered kmdb whilst still on the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * fake CPU set up by boot_kdi_tmpinit(). We're trying to restore the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * kernel's IDT that we saved on entry, but it was from the fake cpu_t
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * rather than the real IDT (which is still boot's). It's unpleasant,
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * but we just encode knowledge that it's idt0 we want to restore.
ae115bc77f6fcde83175c75b4206dc2e50747966mrjstatic void
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * On Intel, most of these are shared between i86*, so this is really an
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * arch_kdi_init().