xref: /illumos-gate/usr/src/uts/sparc/ml/sparc.il (revision 94e7edb1)
17c478bd9Sstevel@tonic-gate!
2*94e7edb1Slucy wang - Sun Microsystems - Beijing China! Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate! Use is subject to license terms.
47c478bd9Sstevel@tonic-gate!
57c478bd9Sstevel@tonic-gate! CDDL HEADER START
67c478bd9Sstevel@tonic-gate!
77c478bd9Sstevel@tonic-gate! The contents of this file are subject to the terms of the
85c7544f7SDavid Plauger! Common Development and Distribution License (the "License").
95c7544f7SDavid Plauger! You may not use this file except in compliance with the License.
107c478bd9Sstevel@tonic-gate!
117c478bd9Sstevel@tonic-gate! You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
127c478bd9Sstevel@tonic-gate! or http://www.opensolaris.org/os/licensing.
137c478bd9Sstevel@tonic-gate! See the License for the specific language governing permissions
147c478bd9Sstevel@tonic-gate! and limitations under the License.
157c478bd9Sstevel@tonic-gate!
167c478bd9Sstevel@tonic-gate! When distributing Covered Code, include this CDDL HEADER in each
177c478bd9Sstevel@tonic-gate! file and include the License file at usr/src/OPENSOLARIS.LICENSE.
187c478bd9Sstevel@tonic-gate! If applicable, add the following below this CDDL HEADER, with the
197c478bd9Sstevel@tonic-gate! fields enclosed by brackets "[]" replaced with your own identifying
207c478bd9Sstevel@tonic-gate! information: Portions Copyright [yyyy] [name of copyright owner]
217c478bd9Sstevel@tonic-gate!
227c478bd9Sstevel@tonic-gate! CDDL HEADER END
237c478bd9Sstevel@tonic-gate!
247c478bd9Sstevel@tonic-gate!
257c478bd9Sstevel@tonic-gate! In-line functions for sparc kernels.
267c478bd9Sstevel@tonic-gate!
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate! return current thread pointer
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gate	.inline	threadp,0
317c478bd9Sstevel@tonic-gate	.register %g7, #scratch
327c478bd9Sstevel@tonic-gate	mov	%g7, %o0
337c478bd9Sstevel@tonic-gate	.end
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gate! return caller
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gate	.inline	caller,0
387c478bd9Sstevel@tonic-gate	mov	%i7, %o0
397c478bd9Sstevel@tonic-gate	.end
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gate! return callee
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gate	.inline	callee,0
447c478bd9Sstevel@tonic-gate	mov	%o7, %o0
457c478bd9Sstevel@tonic-gate	.end
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gate! needed by krtld
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gate	.inline doflush,0
507c478bd9Sstevel@tonic-gate	andn	%o0, 3, %o0
517c478bd9Sstevel@tonic-gate	flush	%o0
527c478bd9Sstevel@tonic-gate	.end
535c7544f7SDavid Plauger
545c7544f7SDavid Plauger! prefetch 64 bytes into L2-cache
555c7544f7SDavid Plauger
56*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.inline prefetch_read_many,8
57*94e7edb1Slucy wang - Sun Microsystems - Beijing China	prefetch [%o0], #n_reads
58*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.end
59*94e7edb1Slucy wang - Sun Microsystems - Beijing China
60*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.inline prefetch_read_once,8
61*94e7edb1Slucy wang - Sun Microsystems - Beijing China	prefetch [%o0], #one_read
62*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.end
63*94e7edb1Slucy wang - Sun Microsystems - Beijing China
64*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.inline prefetch_write_many,8
655c7544f7SDavid Plauger	prefetch [%o0], #n_writes
665c7544f7SDavid Plauger	.end
67*94e7edb1Slucy wang - Sun Microsystems - Beijing China
68*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.inline prefetch_write_once,8
69*94e7edb1Slucy wang - Sun Microsystems - Beijing China	prefetch [%o0], #one_write
70*94e7edb1Slucy wang - Sun Microsystems - Beijing China	.end
71