2 * Copyright (C) 2003 Jake Burkholder <jake@freebsd.org>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Neither the name of the author nor the names of its contributors
11 * may be used to endorse or promote products derived from this software
12 * without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 #include <machine/asm.h>
28 __FBSDID("$FreeBSD$");
32 .weak CNAME(_thr_getcontext)
33 .set CNAME(_thr_getcontext),CNAME(__thr_getcontext)
34 ENTRY(__thr_getcontext)
37 stx %sp, [%o0 + MC_OUT + (6 * 8)]
38 stx %o1, [%o0 + MC_TPC]
39 stx %o2, [%o0 + MC_TNPC]
40 mov MC_VALID_FLAGS, %l0 /* Validate the context. */
41 stx %l0, [%o0 + MC_FLAGS]
43 stx %l0, [%o0 + MC_OUT + (0 * 8)] /* return 1 when resumed */
45 mov 0, %o0 /* return 0 */
48 .weak CNAME(_thr_setcontext)
49 .set CNAME(_thr_setcontext),CNAME(__thr_setcontext)
50 ENTRY(__thr_setcontext)
56 ldx [%l0 + MC_GLOBAL + (1 * 8)], %g1
57 ldx [%l0 + MC_GLOBAL + (2 * 8)], %g2
58 ldx [%l0 + MC_GLOBAL + (3 * 8)], %g3
59 ldx [%l0 + MC_GLOBAL + (4 * 8)], %g4
60 ldx [%l0 + MC_GLOBAL + (5 * 8)], %g5
61 ldx [%l0 + MC_GLOBAL + (6 * 8)], %g6
62 ldx [%l0 + MC_GLOBAL + (7 * 8)], %g7
63 ldx [%l0 + MC_OUT + (0 * 8)], %i0
64 ldx [%l0 + MC_OUT + (1 * 8)], %i1
65 ldx [%l0 + MC_OUT + (2 * 8)], %i2
66 ldx [%l0 + MC_OUT + (3 * 8)], %i3
67 ldx [%l0 + MC_OUT + (4 * 8)], %i4
68 ldx [%l0 + MC_OUT + (5 * 8)], %i5
69 ldx [%l0 + MC_OUT + (6 * 8)], %i6
70 ldx [%l0 + MC_OUT + (7 * 8)], %i7
71 ldx [%l0 + MC_TPC], %l4
72 ldx [%l0 + MC_TNPC], %l3
80 ENTRY(_sparc64_enter_uts)
84 sub %i2, SPOFF + CCFSZ, %sp
87 END(_sparc64_enter_uts)