xref: /titanic_52/usr/src/uts/sun4u/cherrystone/ml/cherrystone_asm.s (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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/*
53*7c478bd9Sstevel@tonic-gate * NOTE: This file is identical to the one found under sun4u/daktari/ml.
54*7c478bd9Sstevel@tonic-gate * If its found that either of these files will not change it might
55*7c478bd9Sstevel@tonic-gate * be a good idea to move this up to sun4u/ml.
56*7c478bd9Sstevel@tonic-gate */
57*7c478bd9Sstevel@tonic-gate
58*7c478bd9Sstevel@tonic-gate#if defined(lint)
59*7c478bd9Sstevel@tonic-gate
60*7c478bd9Sstevel@tonic-gate/* ARGSUSED */
61*7c478bd9Sstevel@tonic-gateuint64_t
62*7c478bd9Sstevel@tonic-gatelddmcdecode(uint64_t physaddr)
63*7c478bd9Sstevel@tonic-gate{
64*7c478bd9Sstevel@tonic-gate	return (0x0ull);
65*7c478bd9Sstevel@tonic-gate}
66*7c478bd9Sstevel@tonic-gate
67*7c478bd9Sstevel@tonic-gate/* ARGSUSED */
68*7c478bd9Sstevel@tonic-gateuint64_t
69*7c478bd9Sstevel@tonic-gatelddsafaddr(uint64_t physaddr)
70*7c478bd9Sstevel@tonic-gate{
71*7c478bd9Sstevel@tonic-gate	return (0x0ull);
72*7c478bd9Sstevel@tonic-gate}
73*7c478bd9Sstevel@tonic-gate
74*7c478bd9Sstevel@tonic-gate#else /* !lint */
75*7c478bd9Sstevel@tonic-gate
76*7c478bd9Sstevel@tonic-gate!
77*7c478bd9Sstevel@tonic-gate! Load the safari address for a specific cpu
78*7c478bd9Sstevel@tonic-gate!
79*7c478bd9Sstevel@tonic-gate!
80*7c478bd9Sstevel@tonic-gate	ENTRY(lddsafaddr)
81*7c478bd9Sstevel@tonic-gate#ifndef __sparcv9
82*7c478bd9Sstevel@tonic-gate	sllx	%o0, 32, %o0	! shift upper 32 bits
83*7c478bd9Sstevel@tonic-gate	srl	%o1, 0, %o1	! clear upper 32 bits
84*7c478bd9Sstevel@tonic-gate	or	%o0, %o1, %o0	! form 64 bit physaddr in %o0 using (%o0,%o1)
85*7c478bd9Sstevel@tonic-gate#endif
86*7c478bd9Sstevel@tonic-gate	rdpr	%pstate, %o4
87*7c478bd9Sstevel@tonic-gate	andn	%o4, PSTATE_IE | PSTATE_AM, %o5
88*7c478bd9Sstevel@tonic-gate	wrpr	%o5, 0, %pstate	! clear IE, AM bits
89*7c478bd9Sstevel@tonic-gate#ifdef __sparcv9
90*7c478bd9Sstevel@tonic-gate	ldxa	[%o0]ASI_SAFARI_CONFIG, %o0
91*7c478bd9Sstevel@tonic-gate#else
92*7c478bd9Sstevel@tonic-gate	ldxa	[%o0]ASI_SAFARI_CONFIG, %g1
93*7c478bd9Sstevel@tonic-gate	srlx	%g1, 32, %o0	! put the high 32 bits in low part of o0
94*7c478bd9Sstevel@tonic-gate	srl	%g1, 0, %o1	! put lower 32 bits in o1, clear upper 32 bits
95*7c478bd9Sstevel@tonic-gate#endif
96*7c478bd9Sstevel@tonic-gate	retl
97*7c478bd9Sstevel@tonic-gate	wrpr	%g0, %o4, %pstate	! restore earlier pstate register value
98*7c478bd9Sstevel@tonic-gate	SET_SIZE(lddsafaddr)
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gate!
101*7c478bd9Sstevel@tonic-gate! Load the mc_decode reg for this cpu.
102*7c478bd9Sstevel@tonic-gate!
103*7c478bd9Sstevel@tonic-gate!
104*7c478bd9Sstevel@tonic-gate	ENTRY(lddmcdecode)
105*7c478bd9Sstevel@tonic-gate#ifndef __sparcv9
106*7c478bd9Sstevel@tonic-gate	sllx	%o0, 32, %o0	! shift upper 32 bits
107*7c478bd9Sstevel@tonic-gate	srl	%o1, 0, %o1	! clear upper 32 bits
108*7c478bd9Sstevel@tonic-gate	or	%o0, %o1, %o0	! form 64 bit physaddr in %o0 using (%o0,%o1)
109*7c478bd9Sstevel@tonic-gate#endif
110*7c478bd9Sstevel@tonic-gate	rdpr	%pstate, %o4
111*7c478bd9Sstevel@tonic-gate	andn	%o4, PSTATE_IE | PSTATE_AM, %o5
112*7c478bd9Sstevel@tonic-gate	wrpr	%o5, 0, %pstate	! clear IE, AM bits
113*7c478bd9Sstevel@tonic-gate#ifdef __sparcv9
114*7c478bd9Sstevel@tonic-gate	ldxa	[%o0]ASI_MC_DECODE, %o0
115*7c478bd9Sstevel@tonic-gate#else
116*7c478bd9Sstevel@tonic-gate	ldxa	[%o0]ASI_MC_DECODE, %g1
117*7c478bd9Sstevel@tonic-gate	srlx	%g1, 32, %o0	! put the high 32 bits in low part of o0
118*7c478bd9Sstevel@tonic-gate	srl	%g1, 0, %o1	! put lower 32 bits in o1, clear upper 32 bits
119*7c478bd9Sstevel@tonic-gate#endif
120*7c478bd9Sstevel@tonic-gate	retl
121*7c478bd9Sstevel@tonic-gate	wrpr	%g0, %o4, %pstate	! restore earlier pstate register value
122*7c478bd9Sstevel@tonic-gate	SET_SIZE(lddmcdecode)
123*7c478bd9Sstevel@tonic-gate
124*7c478bd9Sstevel@tonic-gate#endif /* lint */
125