/*
* 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
*/
/*
*/
#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
{ NULL }
};
extern const topo_method_t rank_methods[];
extern const topo_method_t ntv_page_retire_methods[];
static int mc_fd;
int
{
return (mc_fd != -1);
}
static int
{
return (mc_fd != -1);
}
static void
{
int i;
int rank;
int err = 0;
/*
* If start_rank is defined, it is assigned to the first rank of this
* dimm.
*/
" 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");
ntv_page_retire_methods) < 0)
"topo_method_register failed");
if (FM_AWARE_SMBIOS(mod))
}
rank++;
}
}
static void
{
int i;
int err;
char *name;
"mc_add_dimms: node range create failed\n");
return;
}
for (i = 0; i < ndimms; i++) {
dimm_number = i;
(void) nvpair_value_nvlist_array(nvp,
}
}
if (FM_AWARE_SMBIOS(mod)) {
int channum;
DIMM_NODE_NAME, i, &channum);
smbid);
smbid);
smbid);
}
"mc_add_dimms: topo_mod_hcfmri failed\n");
return;
}
" for dimm\n");
return;
}
if (!FM_AWARE_SMBIOS(mod))
"topo_method_register failed");
dnode);
}
}
if (FM_AWARE_SMBIOS(mod)) {
/*
*/
}
if (FM_AWARE_SMBIOS(mod))
if (nranks) {
}
}
}
static int
{
char *name;
int err;
return (-1);
}
return (-1);
}
if (FM_AWARE_SMBIOS(mod))
&ndimms) == 0) {
}
}
}
return (0);
}
static int
{
int err;
int i, j;
int channel;
char *pname;
&nchannels) != 0) {
"mc_nb_create: failed to find channel information\n");
return (-1);
}
/*
* Assume channels are evenly divided among the controllers.
* Convert nchannels to channels per controller
*/
} else {
/*
* if number of memory controllers is not specified then there
* are two channels per controller and the nchannels is total
* we will set up nmc as number of controllers and convert
* nchannels to channels per controller
*/
}
maxranks = 2;
maxdimms = 0;
"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);
}
if (FM_AWARE_SMBIOS(mod))
"mc_nb_create: channel node range create failed\n");
return (-1);
}
for (j = 0; j < nchannels; j++) {
maxranks) < 0) {
return (-1);
}
channel++;
}
mcnode);
}
}
}
return (NULL);
}
int
{
int rc;
return (NULL);
}
return (NULL);
} else if (ver != MCINTEL_NVLIST_VERS0) {
return (NULL);
}
return (rc);
}
void
{
}
int
{
}