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 53446Smrj * Common Development and Distribution License (the "License"). 63446Smrj * 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/* 223446Smrj * 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 movl %gs:0, %eax 300Sstevel@tonic-gate .end 310Sstevel@tonic-gate 320Sstevel@tonic-gate .inline __curthread, 0 330Sstevel@tonic-gate movl %gs:0, %eax 340Sstevel@tonic-gate .end 350Sstevel@tonic-gate 360Sstevel@tonic-gate .inline stkptr, 0 370Sstevel@tonic-gate movl %esp, %eax 380Sstevel@tonic-gate .end 390Sstevel@tonic-gate 400Sstevel@tonic-gate .inline gethrtime, 0 410Sstevel@tonic-gate movl $3, %eax 420Sstevel@tonic-gate int $0xd2 430Sstevel@tonic-gate .end 440Sstevel@tonic-gate 450Sstevel@tonic-gate .inline set_lock_byte, 0 460Sstevel@tonic-gate movl $1, %eax 470Sstevel@tonic-gate movl (%esp), %ecx 480Sstevel@tonic-gate xchgb %al, (%ecx) 490Sstevel@tonic-gate .end 500Sstevel@tonic-gate 51*4570Sraf .inline atomic_cas_32, 0 520Sstevel@tonic-gate movl 0(%esp), %edx 530Sstevel@tonic-gate movl 4(%esp), %eax 540Sstevel@tonic-gate movl 8(%esp), %ecx 550Sstevel@tonic-gate lock 560Sstevel@tonic-gate cmpxchgl %ecx, (%edx) 570Sstevel@tonic-gate .end 580Sstevel@tonic-gate 59*4570Sraf .inline atomic_swap_32, 0 600Sstevel@tonic-gate movl 0(%esp), %ecx 610Sstevel@tonic-gate movl 4(%esp), %eax 620Sstevel@tonic-gate xchgl (%ecx), %eax 630Sstevel@tonic-gate .end 640Sstevel@tonic-gate 65*4570Sraf .inline atomic_inc_32, 0 660Sstevel@tonic-gate movl 0(%esp), %eax 670Sstevel@tonic-gate lock 680Sstevel@tonic-gate incl (%eax) 690Sstevel@tonic-gate .end 700Sstevel@tonic-gate 71*4570Sraf .inline atomic_dec_32, 0 720Sstevel@tonic-gate movl 0(%esp), %eax 730Sstevel@tonic-gate lock 740Sstevel@tonic-gate decl (%eax) 750Sstevel@tonic-gate .end 760Sstevel@tonic-gate 77*4570Sraf .inline atomic_and_32, 0 78*4570Sraf movl 0(%esp), %ecx 79*4570Sraf movl 4(%esp), %eax 80*4570Sraf lock 81*4570Sraf andl %eax, (%ecx) 82*4570Sraf .end 83*4570Sraf 84*4570Sraf .inline atomic_or_32, 0 85*4570Sraf movl 0(%esp), %ecx 86*4570Sraf movl 4(%esp), %eax 87*4570Sraf lock 88*4570Sraf orl %eax, (%ecx) 89*4570Sraf .end 90*4570Sraf 910Sstevel@tonic-gate .inline ht_pause, 0 920Sstevel@tonic-gate rep / "rep nop" is equivalent to "pause" 930Sstevel@tonic-gate nop 940Sstevel@tonic-gate .end 95