mem_mdesc.c revision 25351652d920ae27c5a56c199da581033ce763f6
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <string.h>
#include <umem.h>
#include <mem_mdesc.h>
void *
{
}
void
{
}
#define MEM_BYTES_PER_CACHELINE 64
static void
{
int idx, mdesc_dimm_count;
mem_dimm_map_t *dm, *d;
uint64_t sysmem_size, i;
char s[20];
unum = "";
&serial) < 0)
serial = "";
&part) < 0)
part = "";
}
/* N1 (MD) specific segment initialization */
dimms = 0;
min_chan = 99;
max_chan = -1;
min_rank = 99;
max_rank = -1;
return;
dimms++;
}
listp);
sysmem_size = 0;
sysmem_size += size;
}
;
rank_mask = i >> 1;
} else {
rank_mask = 0;
}
if (chans > 2)
chan_step = 1;
else
idx = 0;
}
}
}
}
{
uint16_t i;
for (i = 0; v > 1; i++) {
v = v >> 1;
}
return (i);
}
{
return (dp);
}
return (NULL);
}
size_t i, j;
int err;
err = 0;
for (j = 0; j < mem_bank_count; j++) {
break;
}
}
}
else
err++;
if (err == 0)
return (mg);
}
return (NULL);
}
size_t i, j;
for (i = 0; i < n; i++) {
for (j = 0; j < mem_bank_count; j++) {
}
}
}
return (mg);
}
static void
{
uint64_t i;
int n;
mdesc_dimm_count = 0;
continue;
&nac) < 0)
nac = "";
&jnum) < 0)
jnum = "";
"serial_number", &serial) < 0)
serial = "";
"part_number", &part) < 0)
part = "";
"dash_number", &dash) < 0)
dash = "";
jnum);
} else {
}
/* The following is an insertion sort. */
break;
}
}
}
}
/* N2 (PRI) specific segment initialization occurs here */
listp);
/*
* banklist and bclist will be parallel arrays. For a given bank,
* bclist[i] will be the PRI node id, and *banklist+i will point to the
* mem_bank_map_t for that bank.
*/
sizeof (mem_bank_map_t *));
sizeof (mde_cookie_t));
mask = 0;
match = 0;
/* link this bank to its dimms */
dl);
for (i = 0; i < n; i++) {
"serial_number", &serial) < 0)
continue;
continue;
}
}
listp);
base = 0;
size = 0;
bl);
else
}
mdesc_bank_count * sizeof (mem_bank_map_t *));
}
int
{
int rc = 0;
int num_nodes;
int num_comps = 0;
}
if ((type & LDOM_TYPE_CONTROL) != 0) {
} else {
}
if (bufsiz <= 0) {
return (-1);
}
md_node_count(mdp) <= 0) {
return (-1);
}
listp);
if (num_comps == 0)
else
return (rc);
}
void
{
}
}
}
}
}