2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _CPU_MDESC_H
2N/A#define _CPU_MDESC_H
2N/A
2N/A#include <fm/topo_mod.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * Node/Field names in the PRI/MD
2N/A */
2N/A#define MD_STR_ID "id"
2N/A#define MD_STR_PID "pid"
2N/A#define MD_STR_CPU_SERIAL "serial#"
2N/A#define MD_STR_CPU "cpu"
2N/A#define MD_STR_COMPONENT "component"
2N/A#define MD_STR_TYPE "type"
2N/A#define MD_STR_PROCESSOR "processor"
2N/A#define MD_STR_STRAND "strand"
2N/A#define MD_STR_FRU "fru"
2N/A#define MD_STR_NAC "nac"
2N/A#define MD_STR_SERIAL "serial_number"
2N/A#define MD_STR_PART "part_number"
2N/A#define MD_STR_DASH "dash_number"
2N/A
2N/A#define MD_FRU_DEF "MB"
2N/A#define MD_STR_BLANK ""
2N/A
2N/Atypedef struct md_cpumap {
2N/A uint32_t cpumap_id; /* virtual cpuid/strandid */
2N/A uint32_t cpumap_pid; /* physical cpuid/strandid */
2N/A uint64_t cpumap_serialno; /* cpu serial number */
2N/A int cpumap_chipidx; /* chip idx */
2N/A} md_cpumap_t;
2N/A
2N/Atypedef struct md_fru {
2N/A char *nac; /* FRU or nac */
2N/A char *serial; /* FRU serial */
2N/A char *part; /* FRU part number */
2N/A char *dash; /* FRU dash */
2N/A} md_fru_t;
2N/A
2N/Atypedef struct md_proc {
2N/A int32_t id; /* physiscal id of the CMP processor */
2N/A uint64_t serialno; /* processor serial number */
2N/A md_fru_t *fru; /* FRU info */
2N/A} md_proc_t;
2N/A
2N/Atypedef struct md_info {
2N/A md_proc_t *procs; /* list of processors */
2N/A uint32_t nprocs; /* size */
2N/A md_cpumap_t *cpus; /* List of cpu maps */
2N/A uint32_t ncpus; /* size */
2N/A} md_info_t;
2N/A
2N/A
2N/Aextern int cpu_mdesc_init(topo_mod_t *mod, md_info_t *chip);
2N/Aextern void cpu_mdesc_fini(topo_mod_t *mod, md_info_t *chip);
2N/A
2N/Aextern int cpu_get_serialid_mdesc(md_info_t *chip, uint32_t cpuid,
2N/A uint64_t *serialno);
2N/Aextern md_cpumap_t *cpu_find_cpumap(md_info_t *chip, uint32_t cpuid);
2N/Aextern md_proc_t *cpu_find_proc(md_info_t *chip, uint32_t procid);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _CPU_MDESC_H */