cpu.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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <fm/libtopo_enum.h>
#include <sys/processor.h>
#include <string.h>
#include <kstat.h>
#define SERIALNUMPROP "SERIAL-ID"
#define STATUSPROP "CPU-STATUS"
int topo_cpu_init(void);
void topo_cpu_fini(void);
void topo_cpu_enum(tnode_t *);
NULL,
};
struct tenumr *
_enum_init(void)
{
return (&cpu_enumr);
}
int
topo_cpu_init(void)
{
return (TE_INITOK);
}
void
topo_cpu_fini(void)
{
}
static void
{
const char *pv;
return;
}
static void
{
int i;
return;
(void) kstat_close(kc);
return;
}
(void) kstat_close(kc);
return;
}
break;
}
}
(void) kstat_close(kc);
}
void
{
/*
* This is a dirt simple enumerator that relies on the static
* numbering scheme the platforms we care about seem to follow.
* The node we're being asked to enumerate may have either a
* single id or a range of ids. We just use p_online() to see
* if that id of cpu is present. If so, we'll also try to find
* the serial number and set a property containing that.
*/
"Unexpected cpu instance range min = %d - max = %d.\n",
return;
}
/*
* If we get an error, we'll assume the processor isn't
* present.
*/
continue;
cpu_serialid_prop(self, c, s);
/*
* If this cpu is a descendant of a topo node that's
* not enumerated but whose instance number is
* unambiguous, we now know that ancestor is
* present, and can enumerate it.
*/
if (topo_get_instance_num(pn) < 0) {
}
}
}
}