xref: /titanic_44/usr/src/uts/sparc/ml/sparc.il (revision 7c2fbfb345896881c631598ee3852ce9ce33fb07)
1!
2! Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3! Use is subject to license terms.
4!
5! CDDL HEADER START
6!
7! The contents of this file are subject to the terms of the
8! Common Development and Distribution License (the "License").
9! You may not use this file except in compliance with the License.
10!
11! You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12! or http://www.opensolaris.org/os/licensing.
13! See the License for the specific language governing permissions
14! and limitations under the License.
15!
16! When distributing Covered Code, include this CDDL HEADER in each
17! file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18! If applicable, add the following below this CDDL HEADER, with the
19! fields enclosed by brackets "[]" replaced with your own identifying
20! information: Portions Copyright [yyyy] [name of copyright owner]
21!
22! CDDL HEADER END
23!
24!
25! In-line functions for sparc kernels.
26!
27
28! return current thread pointer
29
30	.inline	threadp,0
31	.register %g7, #scratch
32	mov	%g7, %o0
33	.end
34
35! return caller
36
37	.inline	caller,0
38	mov	%i7, %o0
39	.end
40
41! return callee
42
43	.inline	callee,0
44	mov	%o7, %o0
45	.end
46
47! needed by krtld
48
49	.inline doflush,0
50	andn	%o0, 3, %o0
51	flush	%o0
52	.end
53
54! prefetch 64 bytes into L2-cache
55
56	.inline	prefetch64,8
57	prefetch [%o0], #n_writes
58	.end
59