14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * or http://www.opensolaris.org/os/licensing.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma ident "%Z%%M% %I% %E% SMI"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on module unix
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on provider sched
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncstruct cpuinfo {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync processorid_t cpu_id; /* CPU identifier */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync psetid_t cpu_pset; /* processor set identifier */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync chipid_t cpu_chip; /* chip identifier */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync lgrp_id_t cpu_lgrp; /* locality group identifer */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync processor_info_t cpu_info; /* CPU information */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct cpuinfo cpuinfo_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator cpuinfo_t < cpu_t *C > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_id = C->cpu_id;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_pset = C->cpu_part->cp_id;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_chip = C->cpu_physid->cpu_chipid;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_lgrp = C->cpu_lpl->lpl_lgrpid;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_info = (processor_info_t)C->cpu_type_info;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator cpuinfo_t < disp_t *D > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_id = D->disp_cpu == NULL ? -1 :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xlate <cpuinfo_t> (D->disp_cpu).cpu_id;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_pset = D->disp_cpu == NULL ? -1 :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xlate <cpuinfo_t> (D->disp_cpu).cpu_pset;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_chip = D->disp_cpu == NULL ? -1 :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xlate <cpuinfo_t> (D->disp_cpu).cpu_chip;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_lgrp = D->disp_cpu == NULL ? -1 :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync xlate <cpuinfo_t> (D->disp_cpu).cpu_lgrp;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cpu_info = D->disp_cpu == NULL ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *((processor_info_t *)dtrace`dtrace_zero) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (processor_info_t)xlate <cpuinfo_t> (D->disp_cpu).cpu_info;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinline cpuinfo_t *curcpu = xlate <cpuinfo_t *> (curthread->t_cpu);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D attributes Stable/Stable/Common curcpu
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.0" curcpu
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinline processorid_t cpu = curcpu->cpu_id;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D attributes Stable/Stable/Common cpu
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.0" cpu
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinline psetid_t pset = curcpu->cpu_pset;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D attributes Stable/Stable/Common pset
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.0" pset
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinline chipid_t chip = curcpu->cpu_chip;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D attributes Stable/Stable/Common chip
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.0" chip
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinline lgrp_id_t lgrp = curcpu->cpu_lgrp;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D attributes Stable/Stable/Common lgrp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.0" lgrp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync