/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/cpu_module.h>
/*
* INIT_HDLS is the initial size of cmi_hdl_t array. We fill the array
* during cmi_hdl_walk, if the array overflows, we will reallocate
* a new array twice the size of the old one.
*/
typedef struct fm_cmi_walk_t
{
extern int x86gentopo_legacy;
int
{
char *scheme;
int err;
/* Verify FMRI scheme name and version number */
return (EINVAL);
}
return (EINVAL);
return (0);
}
/*
* Routines for cmi handles walk.
*/
static void
{
/*
* If callback is not set, we allocate an array to save the
* cmi handles.
*/
}
}
static void
{
}
static int
{
return (CMI_HDL_WALK_NEXT);
return (CMI_HDL_WALK_NEXT);
return (CMI_HDL_WALK_NEXT);
/*
* Call the callback function if any exists, otherwise we hold a
* reference of the handle and push it to preallocated array.
* If the allocated array is going to overflow, reallocate a
* bigger one to replace it.
*/
}
return (CMI_HDL_WALK_NEXT);
}
static void
{
/*
* If SMBIOS satisfies FMA Topology needs, gather
* more information on the chip's physical roots
* like /chassis=x/motherboard=y/cpuboard=z and
* set the chip_id to match the SMBIOS' Type 4
* ordering & this has to match the ereport's chip
* resource instance derived off of SMBIOS.
* Multi-Chip-Module support should set the chipid
* in terms of the processor package rather than
*/
if (!x86gentopo_legacy) {
} else
NULL);
}
/*ARGSUSED*/
int
{
int i, err;
/*
* Do a walk to save all the cmi handles in the array.
*/
return (ENOENT);
}
}
nvlist_free(cpus[i]);
if (err != 0) {
return (err);
}
return (0);
}
int
{
switch (cmd) {
case FM_IOC_CPU_RETIRE:
break;
case FM_IOC_CPU_STATUS:
break;
case FM_IOC_CPU_UNRETIRE:
break;
default:
return (ENOTTY);
}
return (EINVAL);
return (EINVAL);
if (rc == 0) {
}
return (rc);
}
/*
* Retrun the value of x86gentopo_legacy variable as an nvpair.
*
* The caller is responsible for freeing the nvlist.
*/
/* ARGSUSED */
int
{
if (cmd != FM_IOC_GENTOPO_LEGACY) {
return (ENOTTY);
}
/*
* Inform the caller of the intentions of the ereport generators to
* generate either a "generic" or "legacy" x86 topology.
*/
return (0);
}