chip_intel.c revision 20c794b39650d115e17a15983b6b82e46238cf45
/*
* 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"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <limits.h>
#include <alloca.h>
#include <kstat.h>
#include <fcntl.h>
#include <errno.h>
#include <libnvpair.h>
#include <sys/processor.h>
#include <sys/systeminfo.h>
#include <sys/mc_intel.h>
#include <fm/topo_mod.h>
#include "chip.h"
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
static const topo_pgroup_info_t dimm_channel_pgroup =
static const topo_pgroup_info_t dimm_pgroup =
static const topo_pgroup_info_t rank_pgroup =
static const topo_pgroup_info_t mc_pgroup =
static const topo_method_t rank_methods[] = {
{ NULL }
};
static const topo_method_t dimm_methods[] = {
{ NULL }
};
static int mc_fd;
int
{
return (mc_fd != -1);
}
void
{
int i;
int rank;
int err = 0;
" for rank\n");
return;
}
for (i = 0; i < nranks; i++) {
"mc_add_ranks: topo_mod_hcfmri failed\n");
return;
}
" for ranks\n");
return;
}
"topo_method_register failed");
}
rank++;
}
}
static void
{
int i;
int err;
char *name;
"mc_add_dimms: node range create failed\n");
return;
}
for (i = 0; i < ndimms; i++) {
(void) nvpair_value_nvlist_array(nvp,
}
}
"mc_add_dimms: topo_mod_hcfmri failed\n");
return;
}
" for dimm\n");
return;
}
"topo_method_register failed");
dnode);
}
}
if (label)
if (nranks) {
}
}
}
static int
{
int err;
return (-1);
}
return (-1);
}
&ndimms) == 0) {
}
return (0);
}
static int
{
int err;
int i, j;
int channel;
int nmc;
&nchannels) != 0) {
"mc_nb_create: failed to find channel information\n");
return (-1);
}
"mc_nb_create: node range create failed\n");
return (-1);
}
channel = 0;
for (i = 0; i < nmc; i++) {
return (-1);
}
" for memory-controller\n");
return (-1);
}
channel + 1) < 0) {
"mc_nb_create: channel node range create failed\n");
return (-1);
}
for (j = 0; j < 2; j++) {
channel_nvl[channel]) < 0) {
return (-1);
}
channel++;
}
}
return (NULL);
}
int
{
int rc;
return (NULL);
}
return (NULL);
} else if (ver != MCINTEL_NVLIST_VERS0) {
return (NULL);
}
return (rc);
}