17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 237c478bd9Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #include <sys/types.h> 307c478bd9Sstevel@tonic-gate #include <sys/machsystm.h> 317c478bd9Sstevel@tonic-gate #include <sys/cmp.h> 327c478bd9Sstevel@tonic-gate #include <sys/chip.h> 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate /* 357c478bd9Sstevel@tonic-gate * Note: For now assume the chip ID as 0 for all the cpus until additional 367c478bd9Sstevel@tonic-gate * information is available via machine description table 377c478bd9Sstevel@tonic-gate */ 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate /* 407c478bd9Sstevel@tonic-gate * Returns 1 if cpuid is CMP-capable, 0 otherwise. 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 437c478bd9Sstevel@tonic-gate int 447c478bd9Sstevel@tonic-gate cmp_cpu_is_cmp(processorid_t cpuid) 457c478bd9Sstevel@tonic-gate { 467c478bd9Sstevel@tonic-gate return (0); 477c478bd9Sstevel@tonic-gate } 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate /* 507c478bd9Sstevel@tonic-gate * Indicate that this core (cpuid) resides on the chip indicated by chipid. 517c478bd9Sstevel@tonic-gate * Called during boot and DR add. 527c478bd9Sstevel@tonic-gate */ 537c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 547c478bd9Sstevel@tonic-gate void 557c478bd9Sstevel@tonic-gate cmp_add_cpu(chipid_t chipid, processorid_t cpuid) 567c478bd9Sstevel@tonic-gate { 577c478bd9Sstevel@tonic-gate } 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gate /* 607c478bd9Sstevel@tonic-gate * Indicate that this core (cpuid) is being DR removed. 617c478bd9Sstevel@tonic-gate */ 627c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 637c478bd9Sstevel@tonic-gate void 647c478bd9Sstevel@tonic-gate cmp_delete_cpu(processorid_t cpuid) 657c478bd9Sstevel@tonic-gate { 667c478bd9Sstevel@tonic-gate } 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate /* 697c478bd9Sstevel@tonic-gate * Called when cpuid is being onlined or offlined. If the offlined 707c478bd9Sstevel@tonic-gate * processor is CMP-capable then current target of the CMP Error Steering 717c478bd9Sstevel@tonic-gate * Register is set to either the lowest numbered on-line sibling core, if 727c478bd9Sstevel@tonic-gate * one exists, or else to this core. 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 757c478bd9Sstevel@tonic-gate void 767c478bd9Sstevel@tonic-gate cmp_error_resteer(processorid_t cpuid) 777c478bd9Sstevel@tonic-gate { 787c478bd9Sstevel@tonic-gate } 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate /* 817c478bd9Sstevel@tonic-gate * Return 0, shortterm workaround until MD table is updated 827c478bd9Sstevel@tonic-gate * to provide cpu-chip mapping 837c478bd9Sstevel@tonic-gate */ 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 867c478bd9Sstevel@tonic-gate chipid_t 877c478bd9Sstevel@tonic-gate cmp_cpu_to_chip(processorid_t cpuid) 887c478bd9Sstevel@tonic-gate { 897c478bd9Sstevel@tonic-gate return (0); 907c478bd9Sstevel@tonic-gate } 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate /* 937c478bd9Sstevel@tonic-gate * Return a chip "id" for the given cpu_t 947c478bd9Sstevel@tonic-gate * cpu_t's residing on the same physical processor 957c478bd9Sstevel@tonic-gate * should map to the same "id" 967c478bd9Sstevel@tonic-gate */ 977c478bd9Sstevel@tonic-gate chipid_t 987c478bd9Sstevel@tonic-gate chip_plat_get_chipid(cpu_t *cp) 997c478bd9Sstevel@tonic-gate { 1007c478bd9Sstevel@tonic-gate return (cmp_cpu_to_chip(cp->cpu_id)); 1017c478bd9Sstevel@tonic-gate } 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 1047c478bd9Sstevel@tonic-gate void 1057c478bd9Sstevel@tonic-gate chip_plat_define_chip(cpu_t *cp, chip_def_t *cd) 1067c478bd9Sstevel@tonic-gate { 107*70f54eadSesaxe cd->chipd_type = CHIP_CMP_SHARED_CACHE; 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate /* 1107c478bd9Sstevel@tonic-gate * Define any needed adjustment of rechoose_interval 1117c478bd9Sstevel@tonic-gate * For now, all chips use the default. This 1127c478bd9Sstevel@tonic-gate * will change with future processors. 1137c478bd9Sstevel@tonic-gate */ 1147c478bd9Sstevel@tonic-gate cd->chipd_rechoose_adj = 0; 1157c478bd9Sstevel@tonic-gate } 116*70f54eadSesaxe 117*70f54eadSesaxe /* 118*70f54eadSesaxe * Return a pipeline "id" for the given cpu_t 119*70f54eadSesaxe * cpu_t's sharing the same instruction pipeline 120*70f54eadSesaxe * should map to the same "id" 121*70f54eadSesaxe */ 122*70f54eadSesaxe 123*70f54eadSesaxe id_t 124*70f54eadSesaxe chip_plat_get_pipeid(cpu_t *cp) 125*70f54eadSesaxe { 126*70f54eadSesaxe return (cp->cpu_m.cpu_ipipe); 127*70f54eadSesaxe } 128