cmi.c revision 8a40a695ee676a322b094e9afe5375567bfb51e3
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Public interface to routines implemented by CPU modules
*/
#include <sys/x86_archext.h>
#include <sys/cpu_module_impl.h>
#define CPUMOD_SUBDIR "cpu"
#define CPUMOD_PREFIX "cpu"
/*
* If cleared for debugging we will not attempt to load a model-specific
* cpu module but will load the generic cpu module instead.
*/
int cmi_force_generic = 0;
/*
* If cleared for debugging, we will suppress panicking on fatal hardware
* errors. This should *only* be used for debugging; it use can and will
* cause data corruption if actual hardware errors are detected by the system.
*/
int cmi_panic_on_uncorrectable_error = 1;
static kmutex_t cmi_load_lock;
static int
{
}
static cmi_t *
{
return (cmi);
}
return (NULL);
}
/*
* Hold the module in memory. We call to CPU modules without using the
* stubs mechanism, so these modules must be manually held in memory.
* The mod_ref acts as if another loaded module has a dependency on us.
*/
return (cmi);
}
static cmi_t *
{
int i, modid;
uint_t s[3];
/*
* Look to see if we've already got a module loaded for a CPU just
* like this one. If we do, then we'll re-use it.
*/
for (i = 0; i < NCPU; i++) {
}
}
/*
* If we can't find a match, attempt to load the appropriate module.
* If that also fails, try to load the generic CPU module.
*/
s[0] = cpuid_getfamily(cp);
if (modid == -1)
if (modid == -1)
return (NULL);
return (cmi);
}
static cmi_t *
cmi_load_generic(void)
{
int modid;
return (NULL);
return (cmi);
}
/*
* Load a CPU module for the specified CPU, and then call its cmi_init routine.
* If the module returns ENOTSUP, try using the generic CPU module instead.
* If all else fails, we return -1 and the caller will panic or halt.
*/
int
{
void *data;
if (!cmi_force_generic && (
return (-1);
}
if ((cmi_force_generic || err != 0) &&
return (-1);
}
cmi->cmi_refcnt++;
if (boothowto & RB_VERBOSE) {
printf("cpuid %d: initialized cpumod: %s\n",
}
return (0);
}
void
cmi_init(void)
{
}
void
cmi_post_init(void)
{
}
/*
* Called just once from start_other_cpus when all processors are started.
* This will not be called for each cpu, so the registered op must not
* assume it is called as such.
*/
void
cmi_post_mpstartup(void)
{
}
void
{
}
void
{
}
int
{
cscontig));
}
void
cmi_mca_init(void)
{
}
void
{
fm_panic("Unrecoverable Machine-Check Exception");
else
}
}
int
{
int err;
return (err);
}
void
cmi_mca_poke(void)
{
}
void
{
}
int
{
const struct cmi_mc_ops *mcops;
return (-1); /* not registered yet */
}
int
{
const struct cmi_mc_ops *mcops;
return (-1); /* only convert from one or the other form */
return (-1); /* not registered yet */
}