10Sstevel@tonic-gate/* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*3446Smrj * Common Development and Distribution License (the "License"). 6*3446Smrj * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate/* 22*3446Smrj * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 270Sstevel@tonic-gate 280Sstevel@tonic-gate .inline _curthread, 0 290Sstevel@tonic-gate .register %g7, #scratch 300Sstevel@tonic-gate mov %g7, %o0 310Sstevel@tonic-gate .end 320Sstevel@tonic-gate 330Sstevel@tonic-gate .inline __curthread, 0 340Sstevel@tonic-gate .register %g7, #scratch 350Sstevel@tonic-gate ld [%g7 + 80], %o0 ! ul_self 360Sstevel@tonic-gate .end 370Sstevel@tonic-gate 380Sstevel@tonic-gate .inline stkptr, 0 390Sstevel@tonic-gate mov %sp, %o0 400Sstevel@tonic-gate .end 410Sstevel@tonic-gate 420Sstevel@tonic-gate .inline gethrtime, 0 430Sstevel@tonic-gate ta 0x24 440Sstevel@tonic-gate .end 450Sstevel@tonic-gate 460Sstevel@tonic-gate .inline set_lock_byte, 0 470Sstevel@tonic-gate ldstub [%o0], %o0 480Sstevel@tonic-gate .end 490Sstevel@tonic-gate 500Sstevel@tonic-gate /* 510Sstevel@tonic-gate * When compiling with -xarch=v8, the compiler refuses to 520Sstevel@tonic-gate * accept the 'cas' instruction, so we encode it in hex below. 530Sstevel@tonic-gate * We can't compile the 32-bit libc with -xarch=v8plus because 540Sstevel@tonic-gate * then %g5 would become a scratch register and we would break 550Sstevel@tonic-gate * 32-bit applications that use %g5 as an invariant register. 560Sstevel@tonic-gate */ 570Sstevel@tonic-gate 580Sstevel@tonic-gate .inline cas32, 0 590Sstevel@tonic-gate .word 0xd5e21009 ! cas [%o0], %o1, %o2 600Sstevel@tonic-gate mov %o2, %o0 610Sstevel@tonic-gate .end 620Sstevel@tonic-gate 630Sstevel@tonic-gate .inline swap32, 0 640Sstevel@tonic-gate ld [%o0], %o2 650Sstevel@tonic-gate1: 660Sstevel@tonic-gate mov %o1, %o3 670Sstevel@tonic-gate .word 0xd7e2100a ! cas [%o0], %o2, %o3 680Sstevel@tonic-gate cmp %o2, %o3 690Sstevel@tonic-gate bne,a 1b 700Sstevel@tonic-gate mov %o3, %o2 710Sstevel@tonic-gate mov %o3, %o0 720Sstevel@tonic-gate .end 730Sstevel@tonic-gate 740Sstevel@tonic-gate .inline incr32, 0 750Sstevel@tonic-gate ld [%o0], %o2 760Sstevel@tonic-gate1: 770Sstevel@tonic-gate add %o2, 1, %o3 780Sstevel@tonic-gate .word 0xd7e2100a ! cas [%o0], %o2, %o3 790Sstevel@tonic-gate cmp %o2, %o3 800Sstevel@tonic-gate bne,a 1b 810Sstevel@tonic-gate mov %o3, %o2 820Sstevel@tonic-gate .end 830Sstevel@tonic-gate 840Sstevel@tonic-gate .inline decr32, 0 850Sstevel@tonic-gate ld [%o0], %o2 860Sstevel@tonic-gate1: 870Sstevel@tonic-gate sub %o2, 1, %o3 880Sstevel@tonic-gate .word 0xd7e2100a ! cas [%o0], %o2, %o3 890Sstevel@tonic-gate cmp %o2, %o3 900Sstevel@tonic-gate bne,a 1b 910Sstevel@tonic-gate mov %o3, %o2 920Sstevel@tonic-gate .end 930Sstevel@tonic-gate 940Sstevel@tonic-gate .inline caller, 0 950Sstevel@tonic-gate mov %i7, %o0 960Sstevel@tonic-gate .end 970Sstevel@tonic-gate 980Sstevel@tonic-gate .inline getfp, 0 990Sstevel@tonic-gate mov %fp, %o0 1000Sstevel@tonic-gate .end 101