cpu.c revision 6dfee4834394825da35b977ca71cdc965bc7b6a4
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/processor.h>
#include <fm/fmd_fmri.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <kstat.h>
#ifdef sparc
#include <cpu.h>
#endif /* sparc */
/*
* The scheme plugin for cpu FMRIs.
*/
#ifdef sparc
#define ONTARIO_PLAT_NAME "SUNW,Sun-Fire-T200"
#define ERIE_PLAT_NAME "SUNW,Sun-Fire-T1000"
#endif /* sparc */
{
return (fmd_fmri_set_errno(EINVAL));
}
static int
{
int i;
return (-1); /* errno is set for us */
(void) kstat_close(kc);
return (fmd_fmri_set_errno(ENOENT));
}
(void) kstat_close(kc);
return (fmd_fmri_set_errno(oserr));
}
(void) kstat_close(kc);
return (0);
}
}
(void) kstat_close(kc);
return (fmd_fmri_set_errno(ENOENT));
}
static int
{
#ifdef sparc
else
#endif /* sparc */
}
#ifdef sparc
static int
{
int idx;
return (ENOENT);
continue; /* ignore invalid value */
return (0);
}
}
return (ENOENT);
}
#endif /* sparc */
int
{
int rc;
return (fmd_fmri_set_errno(EINVAL));
&serialid)) != 0) {
return (fmd_fmri_set_errno(rc));
return (-1); /* errno is set for us */
serialid)) != 0)
return (fmd_fmri_set_errno(rc));
}
#ifdef sparc
{
const char *platform = fmd_fmri_get_platform();
return (fmd_fmri_set_errno(ENOENT));
cpuvid)) != 0)
return (fmd_fmri_set_errno(rc));
}
}
#endif /* sparc */
return (0);
}
int
{
return (fmd_fmri_set_errno(EINVAL));
}
int
{
return (fmd_fmri_set_errno(EINVAL));
#ifdef sparc
{
/*
* This FMRI has a 'cpuvid' member, but its value could
* be stale -- especially when restoring saved state.
* Do a fresh lookup and use the result for p_online().
*/
return (fmd_fmri_set_errno(ENOENT));
}
}
#endif /* sparc */
}
#ifdef sparc
int
fmd_fmri_init(void)
{
return (cpu_mdesc_init());
}
void
fmd_fmri_fini(void)
{
}
#endif /* sparc */