1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26#pragma ident "%Z%%M% %I% %E% SMI" 27 .inline _curthread, 0 28 movq %fs:0, %rax 29 .end 30 31 .inline __curthread, 0 32 movq %fs:0, %rax 33 .end 34 35 .inline stkptr, 0 36 movq %rsp, %rax 37 .end 38 39 .inline gethrtime, 0 40 movl $3, %eax 41 int $0xd2 42 .end 43 44 .inline set_lock_byte, 0 45 movl $1, %eax 46 xchgb %al, (%rdi) 47 .end 48 49 .inline atomic_cas_32, 0 50 movl %esi, %eax 51 lock 52 cmpxchgl %edx, (%rdi) 53 .end 54 55 .inline atomic_swap_32, 0 56 movl %esi, %eax 57 xchgl (%rdi), %eax 58 .end 59 60 .inline atomic_inc_32, 0 61 lock 62 incl (%rdi) 63 .end 64 65 .inline atomic_dec_32, 0 66 lock 67 decl (%rdi) 68 .end 69 70 .inline atomic_and_32, 0 71 lock 72 andl %esi, (%rdi) 73 .end 74 75 .inline atomic_or_32, 0 76 lock 77 orl %esi, (%rdi) 78 .end 79 80 .inline ht_pause, 0 81 rep / "rep nop" is equivalent to "pause" 82 nop 83 .end 84