17c478bd9Sstevel@tonic-gate/* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5ae115bc7Smrj * Common Development and Distribution License (the "License"). 6ae115bc7Smrj * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate/* 22ae115bc7Smrj * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate .inline _curthread, 0 297c478bd9Sstevel@tonic-gate .register %g7, #scratch 307c478bd9Sstevel@tonic-gate mov %g7, %o0 317c478bd9Sstevel@tonic-gate .end 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate .inline __curthread, 0 347c478bd9Sstevel@tonic-gate .register %g7, #scratch 357c478bd9Sstevel@tonic-gate ldx [%g7 + 80], %o0 ! ul_self 367c478bd9Sstevel@tonic-gate .end 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate .inline stkptr, 0 397c478bd9Sstevel@tonic-gate mov %sp, %o0 407c478bd9Sstevel@tonic-gate .end 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate .inline gethrtime, 0 437c478bd9Sstevel@tonic-gate .volatile 447c478bd9Sstevel@tonic-gate ta 0x24 457c478bd9Sstevel@tonic-gate sllx %o0, 32, %o0 467c478bd9Sstevel@tonic-gate or %o1, %o0, %o0 477c478bd9Sstevel@tonic-gate .nonvolatile 487c478bd9Sstevel@tonic-gate .end 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate .inline set_lock_byte, 0 517c478bd9Sstevel@tonic-gate ldstub [%o0], %o0 527c478bd9Sstevel@tonic-gate membar #LoadLoad 537c478bd9Sstevel@tonic-gate .end 547c478bd9Sstevel@tonic-gate 55*41efec22Sraf .inline atomic_cas_32, 0 567c478bd9Sstevel@tonic-gate cas [%o0], %o1, %o2 577c478bd9Sstevel@tonic-gate mov %o2, %o0 587c478bd9Sstevel@tonic-gate .end 597c478bd9Sstevel@tonic-gate 60*41efec22Sraf .inline atomic_swap_32, 0 617c478bd9Sstevel@tonic-gate ld [%o0], %o2 627c478bd9Sstevel@tonic-gate1: 637c478bd9Sstevel@tonic-gate mov %o1, %o3 647c478bd9Sstevel@tonic-gate cas [%o0], %o2, %o3 657c478bd9Sstevel@tonic-gate cmp %o2, %o3 667c478bd9Sstevel@tonic-gate bne,a,pn %icc, 1b 677c478bd9Sstevel@tonic-gate mov %o3, %o2 687c478bd9Sstevel@tonic-gate mov %o3, %o0 697c478bd9Sstevel@tonic-gate .end 707c478bd9Sstevel@tonic-gate 71*41efec22Sraf .inline atomic_inc_32, 0 727c478bd9Sstevel@tonic-gate ld [%o0], %o2 737c478bd9Sstevel@tonic-gate1: 747c478bd9Sstevel@tonic-gate add %o2, 1, %o3 757c478bd9Sstevel@tonic-gate cas [%o0], %o2, %o3 767c478bd9Sstevel@tonic-gate cmp %o2, %o3 777c478bd9Sstevel@tonic-gate bne,a,pn %icc, 1b 787c478bd9Sstevel@tonic-gate mov %o3, %o2 797c478bd9Sstevel@tonic-gate .end 807c478bd9Sstevel@tonic-gate 81*41efec22Sraf .inline atomic_dec_32, 0 827c478bd9Sstevel@tonic-gate ld [%o0], %o2 837c478bd9Sstevel@tonic-gate1: 847c478bd9Sstevel@tonic-gate sub %o2, 1, %o3 857c478bd9Sstevel@tonic-gate cas [%o0], %o2, %o3 867c478bd9Sstevel@tonic-gate cmp %o2, %o3 877c478bd9Sstevel@tonic-gate bne,a,pn %icc, 1b 887c478bd9Sstevel@tonic-gate mov %o3, %o2 897c478bd9Sstevel@tonic-gate .end 907c478bd9Sstevel@tonic-gate 91*41efec22Sraf .inline atomic_and_32, 0 92*41efec22Sraf ld [%o0], %o2 93*41efec22Sraf1: 94*41efec22Sraf and %o2, %o1, %o3 95*41efec22Sraf cas [%o0], %o2, %o3 96*41efec22Sraf cmp %o2, %o3 97*41efec22Sraf bne,a,pn %icc, 1b 98*41efec22Sraf mov %o3, %o2 99*41efec22Sraf .end 100*41efec22Sraf 101*41efec22Sraf .inline atomic_or_32, 0 102*41efec22Sraf ld [%o0], %o2 103*41efec22Sraf1: 104*41efec22Sraf or %o2, %o1, %o3 105*41efec22Sraf cas [%o0], %o2, %o3 106*41efec22Sraf cmp %o2, %o3 107*41efec22Sraf bne,a,pn %icc, 1b 108*41efec22Sraf mov %o3, %o2 109*41efec22Sraf .end 110*41efec22Sraf 1117c478bd9Sstevel@tonic-gate .inline caller, 0 1127c478bd9Sstevel@tonic-gate mov %i7, %o0 1137c478bd9Sstevel@tonic-gate .end 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate .inline getfp, 0 1167c478bd9Sstevel@tonic-gate mov %fp, %o0 1177c478bd9Sstevel@tonic-gate .end 118