1*7c478bd9Sstevel@tonic-gate/* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate/* 23*7c478bd9Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate#if defined(lint) 30*7c478bd9Sstevel@tonic-gate#include <sys/types.h> 31*7c478bd9Sstevel@tonic-gate#else 32*7c478bd9Sstevel@tonic-gate#include "assym.h" 33*7c478bd9Sstevel@tonic-gate#endif /* lint */ 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate#include <sys/asm_linkage.h> 36*7c478bd9Sstevel@tonic-gate#include <sys/param.h> 37*7c478bd9Sstevel@tonic-gate#include <sys/privregs.h> 38*7c478bd9Sstevel@tonic-gate#include <sys/machasi.h> 39*7c478bd9Sstevel@tonic-gate#include <sys/mmu.h> 40*7c478bd9Sstevel@tonic-gate#include <sys/machthread.h> 41*7c478bd9Sstevel@tonic-gate#include <sys/pte.h> 42*7c478bd9Sstevel@tonic-gate#include <sys/stack.h> 43*7c478bd9Sstevel@tonic-gate#include <sys/vis.h> 44*7c478bd9Sstevel@tonic-gate#include <sys/param.h> 45*7c478bd9Sstevel@tonic-gate#include <sys/errno.h> 46*7c478bd9Sstevel@tonic-gate#include <sys/vtrace.h> 47*7c478bd9Sstevel@tonic-gate#include <sys/clock.h> 48*7c478bd9Sstevel@tonic-gate#include <sys/asi.h> 49*7c478bd9Sstevel@tonic-gate#include <sys/fsr.h> 50*7c478bd9Sstevel@tonic-gate#include <sys/cheetahregs.h> 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate#if defined(lint) 53*7c478bd9Sstevel@tonic-gate 54*7c478bd9Sstevel@tonic-gate/* ARGSUSED */ 55*7c478bd9Sstevel@tonic-gateuint64_t 56*7c478bd9Sstevel@tonic-gatelddmcdecode(uint64_t physaddr) 57*7c478bd9Sstevel@tonic-gate{ 58*7c478bd9Sstevel@tonic-gate return (0x0ull); 59*7c478bd9Sstevel@tonic-gate} 60*7c478bd9Sstevel@tonic-gate 61*7c478bd9Sstevel@tonic-gate/* ARGSUSED */ 62*7c478bd9Sstevel@tonic-gateuint64_t 63*7c478bd9Sstevel@tonic-gatelddsafaddr(uint64_t physaddr) 64*7c478bd9Sstevel@tonic-gate{ 65*7c478bd9Sstevel@tonic-gate return (0x0ull); 66*7c478bd9Sstevel@tonic-gate} 67*7c478bd9Sstevel@tonic-gate 68*7c478bd9Sstevel@tonic-gate#else /* !lint */ 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gate! 71*7c478bd9Sstevel@tonic-gate! Load the safari address for a specific cpu 72*7c478bd9Sstevel@tonic-gate! 73*7c478bd9Sstevel@tonic-gate! 74*7c478bd9Sstevel@tonic-gate ENTRY(lddsafaddr) 75*7c478bd9Sstevel@tonic-gate#ifndef __sparcv9 76*7c478bd9Sstevel@tonic-gate sllx %o0, 32, %o0 ! shift upper 32 bits 77*7c478bd9Sstevel@tonic-gate srl %o1, 0, %o1 ! clear upper 32 bits 78*7c478bd9Sstevel@tonic-gate or %o0, %o1, %o0 ! form 64 bit physaddr in %o0 using (%o0,%o1) 79*7c478bd9Sstevel@tonic-gate#endif 80*7c478bd9Sstevel@tonic-gate rdpr %pstate, %o4 81*7c478bd9Sstevel@tonic-gate andn %o4, PSTATE_IE | PSTATE_AM, %o5 82*7c478bd9Sstevel@tonic-gate wrpr %o5, 0, %pstate ! clear IE, AM bits 83*7c478bd9Sstevel@tonic-gate#ifdef __sparcv9 84*7c478bd9Sstevel@tonic-gate ldxa [%o0]ASI_SAFARI_CONFIG, %o0 85*7c478bd9Sstevel@tonic-gate#else 86*7c478bd9Sstevel@tonic-gate ldxa [%o0]ASI_SAFARI_CONFIG, %g1 87*7c478bd9Sstevel@tonic-gate srlx %g1, 32, %o0 ! put the high 32 bits in low part of o0 88*7c478bd9Sstevel@tonic-gate srl %g1, 0, %o1 ! put lower 32 bits in o1, clear upper 32 bits 89*7c478bd9Sstevel@tonic-gate#endif 90*7c478bd9Sstevel@tonic-gate retl 91*7c478bd9Sstevel@tonic-gate wrpr %g0, %o4, %pstate ! restore earlier pstate register value 92*7c478bd9Sstevel@tonic-gate SET_SIZE(lddsafaddr) 93*7c478bd9Sstevel@tonic-gate 94*7c478bd9Sstevel@tonic-gate! 95*7c478bd9Sstevel@tonic-gate! Load the mc_decode reg for this cpu. 96*7c478bd9Sstevel@tonic-gate! 97*7c478bd9Sstevel@tonic-gate! 98*7c478bd9Sstevel@tonic-gate ENTRY(lddmcdecode) 99*7c478bd9Sstevel@tonic-gate#ifndef __sparcv9 100*7c478bd9Sstevel@tonic-gate sllx %o0, 32, %o0 ! shift upper 32 bits 101*7c478bd9Sstevel@tonic-gate srl %o1, 0, %o1 ! clear upper 32 bits 102*7c478bd9Sstevel@tonic-gate or %o0, %o1, %o0 ! form 64 bit physaddr in %o0 using (%o0,%o1) 103*7c478bd9Sstevel@tonic-gate#endif 104*7c478bd9Sstevel@tonic-gate rdpr %pstate, %o4 105*7c478bd9Sstevel@tonic-gate andn %o4, PSTATE_IE | PSTATE_AM, %o5 106*7c478bd9Sstevel@tonic-gate wrpr %o5, 0, %pstate ! clear IE, AM bits 107*7c478bd9Sstevel@tonic-gate#ifdef __sparcv9 108*7c478bd9Sstevel@tonic-gate ldxa [%o0]ASI_MC_DECODE, %o0 109*7c478bd9Sstevel@tonic-gate#else 110*7c478bd9Sstevel@tonic-gate ldxa [%o0]ASI_MC_DECODE, %g1 111*7c478bd9Sstevel@tonic-gate srlx %g1, 32, %o0 ! put the high 32 bits in low part of o0 112*7c478bd9Sstevel@tonic-gate srl %g1, 0, %o1 ! put lower 32 bits in o1, clear upper 32 bits 113*7c478bd9Sstevel@tonic-gate#endif 114*7c478bd9Sstevel@tonic-gate retl 115*7c478bd9Sstevel@tonic-gate wrpr %g0, %o4, %pstate ! restore earlier pstate register value 116*7c478bd9Sstevel@tonic-gate SET_SIZE(lddmcdecode) 117*7c478bd9Sstevel@tonic-gate 118*7c478bd9Sstevel@tonic-gate#endif /* lint */ 119