xref: /onnv-gate/usr/src/uts/sparc/ml/sparc.il (revision 9171:ee979187414d)
10Sstevel@tonic-gate!
2*9171Sxiuyan.wang@Sun.COM! Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
30Sstevel@tonic-gate! Use is subject to license terms.
40Sstevel@tonic-gate!
50Sstevel@tonic-gate! CDDL HEADER START
60Sstevel@tonic-gate!
70Sstevel@tonic-gate! The contents of this file are subject to the terms of the
88286SDave.Plauger@Sun.COM! Common Development and Distribution License (the "License").
98286SDave.Plauger@Sun.COM! You may not use this file except in compliance with the License.
100Sstevel@tonic-gate!
110Sstevel@tonic-gate! You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
120Sstevel@tonic-gate! or http://www.opensolaris.org/os/licensing.
130Sstevel@tonic-gate! See the License for the specific language governing permissions
140Sstevel@tonic-gate! and limitations under the License.
150Sstevel@tonic-gate!
160Sstevel@tonic-gate! When distributing Covered Code, include this CDDL HEADER in each
170Sstevel@tonic-gate! file and include the License file at usr/src/OPENSOLARIS.LICENSE.
180Sstevel@tonic-gate! If applicable, add the following below this CDDL HEADER, with the
190Sstevel@tonic-gate! fields enclosed by brackets "[]" replaced with your own identifying
200Sstevel@tonic-gate! information: Portions Copyright [yyyy] [name of copyright owner]
210Sstevel@tonic-gate!
220Sstevel@tonic-gate! CDDL HEADER END
230Sstevel@tonic-gate!
240Sstevel@tonic-gate!
250Sstevel@tonic-gate! In-line functions for sparc kernels.
260Sstevel@tonic-gate!
270Sstevel@tonic-gate
280Sstevel@tonic-gate! return current thread pointer
290Sstevel@tonic-gate
300Sstevel@tonic-gate	.inline	threadp,0
310Sstevel@tonic-gate	.register %g7, #scratch
320Sstevel@tonic-gate	mov	%g7, %o0
330Sstevel@tonic-gate	.end
340Sstevel@tonic-gate
350Sstevel@tonic-gate! return caller
360Sstevel@tonic-gate
370Sstevel@tonic-gate	.inline	caller,0
380Sstevel@tonic-gate	mov	%i7, %o0
390Sstevel@tonic-gate	.end
400Sstevel@tonic-gate
410Sstevel@tonic-gate! return callee
420Sstevel@tonic-gate
430Sstevel@tonic-gate	.inline	callee,0
440Sstevel@tonic-gate	mov	%o7, %o0
450Sstevel@tonic-gate	.end
460Sstevel@tonic-gate
470Sstevel@tonic-gate! needed by krtld
480Sstevel@tonic-gate
490Sstevel@tonic-gate	.inline doflush,0
500Sstevel@tonic-gate	andn	%o0, 3, %o0
510Sstevel@tonic-gate	flush	%o0
520Sstevel@tonic-gate	.end
538286SDave.Plauger@Sun.COM
548286SDave.Plauger@Sun.COM! prefetch 64 bytes into L2-cache
558286SDave.Plauger@Sun.COM
56*9171Sxiuyan.wang@Sun.COM	.inline prefetch_read_many,8
57*9171Sxiuyan.wang@Sun.COM	prefetch [%o0], #n_reads
58*9171Sxiuyan.wang@Sun.COM	.end
59*9171Sxiuyan.wang@Sun.COM
60*9171Sxiuyan.wang@Sun.COM	.inline prefetch_read_once,8
61*9171Sxiuyan.wang@Sun.COM	prefetch [%o0], #one_read
62*9171Sxiuyan.wang@Sun.COM	.end
63*9171Sxiuyan.wang@Sun.COM
64*9171Sxiuyan.wang@Sun.COM	.inline prefetch_write_many,8
658286SDave.Plauger@Sun.COM	prefetch [%o0], #n_writes
668286SDave.Plauger@Sun.COM	.end
67*9171Sxiuyan.wang@Sun.COM
68*9171Sxiuyan.wang@Sun.COM	.inline prefetch_write_once,8
69*9171Sxiuyan.wang@Sun.COM	prefetch [%o0], #one_write
70*9171Sxiuyan.wang@Sun.COM	.end
71