mcamd_subr.c revision 7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fe
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*/
#include <sys/cpu_module_impl.h>
#include <mcamd.h>
#include <mcamd_off.h>
int mcamd_debug = 0; /* see mcamd_api.h for MCAMD_DBG_* values */
struct mc_propmap {
};
static uint_t
{
}
static void *
{
return (mch);
}
/*
* Iterate over all memory controllers.
*/
/*ARGSUSED*/
{
return ((mcamd_node_t *)mc_list);
}
/*
* Iterate over all chip-selects of a MC or all chip-selects of a DIMM
* depending on the node type of 'node'. In the DIMM case we do not
* have a linked list of associated chip-selects but an array of pointer
* to them.
*/
/*ARGSUSED*/
{
int i;
void *retval;
switch (nt) {
case MC_NT_MC:
break;
case MC_NT_DIMM:
break;
}
} else {
switch (nt) {
case MC_NT_MC:
break;
case MC_NT_DIMM:
for (i = 0; i < MC_CHIP_DIMMRANKMAX; i++) {
break;
}
if (i == MC_CHIP_DIMMRANKMAX)
"mcamd_cs_next");
if (i == MC_CHIP_DIMMRANKMAX - 1)
else
break;
}
}
return ((mcamd_node_t *)retval);
}
/*
* Iterate over all DIMMs of an MC or all DIMMs of a chip-select depending
* on the node type of 'node'. In the chip-select case we don not have
* a linked list of associated DIMMs but an array of pointers to them.
*/
/*ARGSUSED*/
{
int i;
void *retval;
switch (nt) {
case MC_NT_MC:
break;
case MC_NT_CS:
break;
}
} else {
switch (nt) {
case MC_NT_MC:
break;
case MC_NT_CS:
for (i = 0; i < MC_CHIP_DIMMPERCS; i++) {
break;
}
if (i == MC_CHIP_DIMMPERCS)
"mcamd_dimm_next");
if (i == MC_CHIP_DIMMPERCS - 1)
else
break;
}
}
return ((mcamd_node_t *)retval);
}
/*ARGSUSED*/
{
}
/*ARGSUSED*/
{
}
/*
* Node properties. A property is accessed through a property number code;
* we search these tables for a match (choosing table from node type) and
* return the uint64_t property at the indicated offset into the node
* structure. All properties must be of type uint64_t. It is assumed that
* property lookup does not have to be super-fast - we search linearly
* down the (small) lists.
*/
static const struct mc_propmap mcamd_mc_propmap[] = {
};
static const struct mc_propmap mcamd_cs_propmap[] = {
};
static const struct mc_propmap mcamd_dimm_propmap[] = {
};
/*ARGSUSED*/
int
{
int i;
int found = 0;
const struct mc_propmap *pmp;
struct mcamd_nt_props {
const struct mc_propmap *props;
int numprops;
} props[] = {
{ mcamd_mc_propmap, /* MC_NT_MC */
sizeof (mcamd_mc_propmap) / sizeof (struct mc_propmap) },
{ mcamd_cs_propmap, /* MC_NT_CS */
sizeof (mcamd_cs_propmap) / sizeof (struct mc_propmap) },
{ mcamd_dimm_propmap, /* MC_NT_DIMM */
sizeof (mcamd_dimm_propmap) / sizeof (struct mc_propmap) },
};
i++, pmp++) {
found = 1;
break;
}
}
}
if (found) {
}
return (found == 1);
}
int
{
return (mcamd->mcamd_errno);
}
int
{
return (-1);
}
void
{
return;
}
void
{
hdl->mcamd_errno = 0;
}
/*ARGSUSED*/
static int
{
int rc;
mcamd_mkhdl(&mcamd);
#ifdef DEBUG
/*
* Apply the reverse operation to verify the result. If there is
* a problem complain but continue.
*/
"mcamd_patounum_wrap: offset calculation "
"verification for PA 0x%llx failed\n", pa);
}
}
#endif
return (rc == 0);
}
static int
{
int i;
return (0);
for (i = 0; i < MC_UNUM_NDIMM; i++)
for (i = 0; i < npr; i++) {
long v;
return (0);
unump->unum_board = (int)v;
unump->unum_dimms[0] = (int)v;
}
return (1);
}
/*ARGSUSED*/
static int
{
int rc;
return (0);
return (0);
}
mcamd_mkhdl(&mcamd);
return (rc == 0);
}
static const cmi_mc_ops_t mcamd_mc_ops = {
};
void
{
}