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 528406508Ssudheer * Common Development and Distribution License (the "License"). 628406508Ssudheer * 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/* 2228406508Ssudheer * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 25*7aa76ffcSBryan Cantrill/* 26*7aa76ffcSBryan Cantrill * Copyright 2011 Joyent, Inc. All rights reserved. 27*7aa76ffcSBryan Cantrill */ 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate#include <sys/asm_linkage.h> 307c478bd9Sstevel@tonic-gate#include <sys/regset.h> 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate#if defined(lint) 337c478bd9Sstevel@tonic-gate#include <sys/dtrace_impl.h> 3428406508Ssudheer#else 3528406508Ssudheer#include "assym.h" 367c478bd9Sstevel@tonic-gate#endif 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate#if defined(lint) || defined(__lint) 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gategreg_t 417c478bd9Sstevel@tonic-gatedtrace_getfp(void) 427c478bd9Sstevel@tonic-gate{ return (0); } 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate#else /* lint */ 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate#if defined(__amd64) 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate ENTRY_NP(dtrace_getfp) 497c478bd9Sstevel@tonic-gate movq %rbp, %rax 507c478bd9Sstevel@tonic-gate ret 517c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_getfp) 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate#elif defined(__i386) 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate ENTRY_NP(dtrace_getfp) 567c478bd9Sstevel@tonic-gate movl %ebp, %eax 577c478bd9Sstevel@tonic-gate ret 587c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_getfp) 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate#endif /* __i386 */ 617c478bd9Sstevel@tonic-gate#endif /* lint */ 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate#if defined(lint) || defined(__lint) 657c478bd9Sstevel@tonic-gate 66*7aa76ffcSBryan Cantrill/*ARGSUSED*/ 67*7aa76ffcSBryan Cantrilluint64_t 68*7aa76ffcSBryan Cantrilldtrace_getvmreg(uint32_t reg, volatile uint16_t *flags) 69*7aa76ffcSBryan Cantrill{ return (0); } 70*7aa76ffcSBryan Cantrill 71*7aa76ffcSBryan Cantrill#else /* lint */ 72*7aa76ffcSBryan Cantrill 73*7aa76ffcSBryan Cantrill#if defined(__amd64) 74*7aa76ffcSBryan Cantrill 75*7aa76ffcSBryan Cantrill ENTRY_NP(dtrace_getvmreg) 76*7aa76ffcSBryan Cantrill 77*7aa76ffcSBryan Cantrill movq %rdi, %rdx 78*7aa76ffcSBryan Cantrill vmread %rdx, %rax 79*7aa76ffcSBryan Cantrill ret 80*7aa76ffcSBryan Cantrill 81*7aa76ffcSBryan Cantrill SET_SIZE(dtrace_getvmreg) 82*7aa76ffcSBryan Cantrill 83*7aa76ffcSBryan Cantrill#elif defined(__i386) 84*7aa76ffcSBryan Cantrill 85*7aa76ffcSBryan Cantrill ENTRY_NP(dtrace_getvmreg) 86*7aa76ffcSBryan Cantrill pushl %ebp / Setup stack frame 87*7aa76ffcSBryan Cantrill movl %esp, %ebp 88*7aa76ffcSBryan Cantrill 89*7aa76ffcSBryan Cantrill movl 12(%ebp), %eax / Load flag pointer 90*7aa76ffcSBryan Cantrill movw (%eax), %cx / Load flags 91*7aa76ffcSBryan Cantrill orw $CPU_DTRACE_ILLOP, %cx / Set ILLOP 92*7aa76ffcSBryan Cantrill movw %cx, (%eax) / Store flags 93*7aa76ffcSBryan Cantrill 94*7aa76ffcSBryan Cantrill leave 95*7aa76ffcSBryan Cantrill ret 96*7aa76ffcSBryan Cantrill SET_SIZE(dtrace_getvmreg) 97*7aa76ffcSBryan Cantrill 98*7aa76ffcSBryan Cantrill#endif /* __i386 */ 99*7aa76ffcSBryan Cantrill#endif /* lint */ 100*7aa76ffcSBryan Cantrill 101*7aa76ffcSBryan Cantrill 102*7aa76ffcSBryan Cantrill#if defined(lint) || defined(__lint) 103*7aa76ffcSBryan Cantrill 1047c478bd9Sstevel@tonic-gateuint32_t 1057c478bd9Sstevel@tonic-gatedtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) 1067c478bd9Sstevel@tonic-gate{ 1077c478bd9Sstevel@tonic-gate uint32_t old; 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate if ((old = *target) == cmp) 1107c478bd9Sstevel@tonic-gate *target = new; 1117c478bd9Sstevel@tonic-gate return (old); 1127c478bd9Sstevel@tonic-gate} 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gatevoid * 1157c478bd9Sstevel@tonic-gatedtrace_casptr(void *target, void *cmp, void *new) 1167c478bd9Sstevel@tonic-gate{ 1177c478bd9Sstevel@tonic-gate void *old; 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate if ((old = *(void **)target) == cmp) 1207c478bd9Sstevel@tonic-gate *(void **)target = new; 1217c478bd9Sstevel@tonic-gate return (old); 1227c478bd9Sstevel@tonic-gate} 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate#else /* lint */ 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate#if defined(__amd64) 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate ENTRY(dtrace_cas32) 1297c478bd9Sstevel@tonic-gate movl %esi, %eax 1307c478bd9Sstevel@tonic-gate lock 1317c478bd9Sstevel@tonic-gate cmpxchgl %edx, (%rdi) 1327c478bd9Sstevel@tonic-gate ret 1337c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_cas32) 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate ENTRY(dtrace_casptr) 1367c478bd9Sstevel@tonic-gate movq %rsi, %rax 1377c478bd9Sstevel@tonic-gate lock 1387c478bd9Sstevel@tonic-gate cmpxchgq %rdx, (%rdi) 1397c478bd9Sstevel@tonic-gate ret 1407c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_casptr) 1417c478bd9Sstevel@tonic-gate 1427c478bd9Sstevel@tonic-gate#elif defined(__i386) 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gate ENTRY(dtrace_cas32) 1457c478bd9Sstevel@tonic-gate ALTENTRY(dtrace_casptr) 1467c478bd9Sstevel@tonic-gate movl 4(%esp), %edx 1477c478bd9Sstevel@tonic-gate movl 8(%esp), %eax 1487c478bd9Sstevel@tonic-gate movl 12(%esp), %ecx 1497c478bd9Sstevel@tonic-gate lock 1507c478bd9Sstevel@tonic-gate cmpxchgl %ecx, (%edx) 1517c478bd9Sstevel@tonic-gate ret 1527c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_casptr) 1537c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_cas32) 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate#endif /* __i386 */ 1567c478bd9Sstevel@tonic-gate#endif /* lint */ 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gate#if defined(lint) 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 1617c478bd9Sstevel@tonic-gateuintptr_t 1627c478bd9Sstevel@tonic-gatedtrace_caller(int aframes) 1637c478bd9Sstevel@tonic-gate{ 1647c478bd9Sstevel@tonic-gate return (0); 1657c478bd9Sstevel@tonic-gate} 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate#else /* lint */ 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gate#if defined(__amd64) 1707c478bd9Sstevel@tonic-gate ENTRY(dtrace_caller) 1717c478bd9Sstevel@tonic-gate movq $-1, %rax 1727c478bd9Sstevel@tonic-gate ret 1737c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_caller) 1747c478bd9Sstevel@tonic-gate 1757c478bd9Sstevel@tonic-gate#elif defined(__i386) 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate ENTRY(dtrace_caller) 1787c478bd9Sstevel@tonic-gate movl $-1, %eax 1797c478bd9Sstevel@tonic-gate ret 1807c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_caller) 1817c478bd9Sstevel@tonic-gate 1827c478bd9Sstevel@tonic-gate#endif /* __i386 */ 1837c478bd9Sstevel@tonic-gate#endif /* lint */ 1847c478bd9Sstevel@tonic-gate 1857c478bd9Sstevel@tonic-gate#if defined(lint) 1867c478bd9Sstevel@tonic-gate 1877c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 1887c478bd9Sstevel@tonic-gatevoid 1897c478bd9Sstevel@tonic-gatedtrace_copy(uintptr_t src, uintptr_t dest, size_t size) 1907c478bd9Sstevel@tonic-gate{} 1917c478bd9Sstevel@tonic-gate 1927c478bd9Sstevel@tonic-gate#else 1937c478bd9Sstevel@tonic-gate 1947c478bd9Sstevel@tonic-gate#if defined(__amd64) 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate ENTRY(dtrace_copy) 1977c478bd9Sstevel@tonic-gate pushq %rbp 1987c478bd9Sstevel@tonic-gate movq %rsp, %rbp 1997c478bd9Sstevel@tonic-gate 2007c478bd9Sstevel@tonic-gate xchgq %rdi, %rsi /* make %rsi source, %rdi dest */ 2017c478bd9Sstevel@tonic-gate movq %rdx, %rcx /* load count */ 2027c478bd9Sstevel@tonic-gate repz /* repeat for count ... */ 2037c478bd9Sstevel@tonic-gate smovb /* move from %ds:rsi to %ed:rdi */ 2047c478bd9Sstevel@tonic-gate leave 2057c478bd9Sstevel@tonic-gate ret 2067c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_copy) 2077c478bd9Sstevel@tonic-gate 2087c478bd9Sstevel@tonic-gate#elif defined(__i386) 2097c478bd9Sstevel@tonic-gate 2107c478bd9Sstevel@tonic-gate ENTRY(dtrace_copy) 2117c478bd9Sstevel@tonic-gate pushl %ebp 2127c478bd9Sstevel@tonic-gate movl %esp, %ebp 2137c478bd9Sstevel@tonic-gate pushl %esi 2147c478bd9Sstevel@tonic-gate pushl %edi 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate movl 8(%ebp), %esi / Load source address 2177c478bd9Sstevel@tonic-gate movl 12(%ebp), %edi / Load destination address 2187c478bd9Sstevel@tonic-gate movl 16(%ebp), %ecx / Load count 2197c478bd9Sstevel@tonic-gate repz / Repeat for count... 2207c478bd9Sstevel@tonic-gate smovb / move from %ds:si to %es:di 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate popl %edi 2237c478bd9Sstevel@tonic-gate popl %esi 2247c478bd9Sstevel@tonic-gate movl %ebp, %esp 2257c478bd9Sstevel@tonic-gate popl %ebp 2267c478bd9Sstevel@tonic-gate ret 2277c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_copy) 2287c478bd9Sstevel@tonic-gate 2297c478bd9Sstevel@tonic-gate#endif /* __i386 */ 2307c478bd9Sstevel@tonic-gate#endif 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate#if defined(lint) 2337c478bd9Sstevel@tonic-gate 2347c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 2357c478bd9Sstevel@tonic-gatevoid 23628406508Ssudheerdtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, 23728406508Ssudheer volatile uint16_t *flags) 2387c478bd9Sstevel@tonic-gate{} 2397c478bd9Sstevel@tonic-gate 2407c478bd9Sstevel@tonic-gate#else 2417c478bd9Sstevel@tonic-gate 2427c478bd9Sstevel@tonic-gate#if defined(__amd64) 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate ENTRY(dtrace_copystr) 2457c478bd9Sstevel@tonic-gate pushq %rbp 2467c478bd9Sstevel@tonic-gate movq %rsp, %rbp 2477c478bd9Sstevel@tonic-gate 2487c478bd9Sstevel@tonic-gate0: 2497c478bd9Sstevel@tonic-gate movb (%rdi), %al /* load from source */ 2507c478bd9Sstevel@tonic-gate movb %al, (%rsi) /* store to destination */ 2517c478bd9Sstevel@tonic-gate addq $1, %rdi /* increment source pointer */ 2527c478bd9Sstevel@tonic-gate addq $1, %rsi /* increment destination pointer */ 2537c478bd9Sstevel@tonic-gate subq $1, %rdx /* decrement remaining count */ 2547c478bd9Sstevel@tonic-gate cmpb $0, %al 25528406508Ssudheer je 2f 25628406508Ssudheer testq $0xfff, %rdx /* test if count is 4k-aligned */ 25728406508Ssudheer jnz 1f /* if not, continue with copying */ 25828406508Ssudheer testq $CPU_DTRACE_BADADDR, (%rcx) /* load and test dtrace flags */ 25928406508Ssudheer jnz 2f 26028406508Ssudheer1: 2617c478bd9Sstevel@tonic-gate cmpq $0, %rdx 2627c478bd9Sstevel@tonic-gate jne 0b 26328406508Ssudheer2: 2647c478bd9Sstevel@tonic-gate leave 2657c478bd9Sstevel@tonic-gate ret 2667c478bd9Sstevel@tonic-gate 2677c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_copystr) 2687c478bd9Sstevel@tonic-gate 2697c478bd9Sstevel@tonic-gate#elif defined(__i386) 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate ENTRY(dtrace_copystr) 2727c478bd9Sstevel@tonic-gate 2737c478bd9Sstevel@tonic-gate pushl %ebp / Setup stack frame 2747c478bd9Sstevel@tonic-gate movl %esp, %ebp 2757c478bd9Sstevel@tonic-gate pushl %ebx / Save registers 2767c478bd9Sstevel@tonic-gate 2777c478bd9Sstevel@tonic-gate movl 8(%ebp), %ebx / Load source address 2787c478bd9Sstevel@tonic-gate movl 12(%ebp), %edx / Load destination address 2797c478bd9Sstevel@tonic-gate movl 16(%ebp), %ecx / Load count 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate0: 2827c478bd9Sstevel@tonic-gate movb (%ebx), %al / Load from source 2837c478bd9Sstevel@tonic-gate movb %al, (%edx) / Store to destination 2847c478bd9Sstevel@tonic-gate incl %ebx / Increment source pointer 2857c478bd9Sstevel@tonic-gate incl %edx / Increment destination pointer 2867c478bd9Sstevel@tonic-gate decl %ecx / Decrement remaining count 2877c478bd9Sstevel@tonic-gate cmpb $0, %al 28828406508Ssudheer je 2f 28928406508Ssudheer testl $0xfff, %ecx / Check if count is 4k-aligned 29028406508Ssudheer jnz 1f 29128406508Ssudheer movl 20(%ebp), %eax / load flags pointer 29228406508Ssudheer testl $CPU_DTRACE_BADADDR, (%eax) / load and test dtrace flags 29328406508Ssudheer jnz 2f 29428406508Ssudheer1: 2957c478bd9Sstevel@tonic-gate cmpl $0, %ecx 2967c478bd9Sstevel@tonic-gate jne 0b 2977c478bd9Sstevel@tonic-gate 29828406508Ssudheer2: 2997c478bd9Sstevel@tonic-gate popl %ebx 3007c478bd9Sstevel@tonic-gate movl %ebp, %esp 3017c478bd9Sstevel@tonic-gate popl %ebp 3027c478bd9Sstevel@tonic-gate ret 3037c478bd9Sstevel@tonic-gate 3047c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_copystr) 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate#endif /* __i386 */ 3077c478bd9Sstevel@tonic-gate#endif 3087c478bd9Sstevel@tonic-gate 3097c478bd9Sstevel@tonic-gate#if defined(lint) 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 3127c478bd9Sstevel@tonic-gateuintptr_t 3137c478bd9Sstevel@tonic-gatedtrace_fulword(void *addr) 3147c478bd9Sstevel@tonic-gate{ return (0); } 3157c478bd9Sstevel@tonic-gate 3167c478bd9Sstevel@tonic-gate#else 3177c478bd9Sstevel@tonic-gate#if defined(__amd64) 3187c478bd9Sstevel@tonic-gate 3197c478bd9Sstevel@tonic-gate ENTRY(dtrace_fulword) 3207c478bd9Sstevel@tonic-gate movq (%rdi), %rax 3217c478bd9Sstevel@tonic-gate ret 3227c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fulword) 3237c478bd9Sstevel@tonic-gate 3247c478bd9Sstevel@tonic-gate#elif defined(__i386) 3257c478bd9Sstevel@tonic-gate 3267c478bd9Sstevel@tonic-gate ENTRY(dtrace_fulword) 3277c478bd9Sstevel@tonic-gate movl 4(%esp), %ecx 3287c478bd9Sstevel@tonic-gate xorl %eax, %eax 3297c478bd9Sstevel@tonic-gate movl (%ecx), %eax 3307c478bd9Sstevel@tonic-gate ret 3317c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fulword) 3327c478bd9Sstevel@tonic-gate 3337c478bd9Sstevel@tonic-gate#endif /* __i386 */ 3347c478bd9Sstevel@tonic-gate#endif 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate#if defined(lint) 3377c478bd9Sstevel@tonic-gate 3387c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 3397c478bd9Sstevel@tonic-gateuint8_t 3407c478bd9Sstevel@tonic-gatedtrace_fuword8_nocheck(void *addr) 3417c478bd9Sstevel@tonic-gate{ return (0); } 3427c478bd9Sstevel@tonic-gate 3437c478bd9Sstevel@tonic-gate#else 3447c478bd9Sstevel@tonic-gate#if defined(__amd64) 3457c478bd9Sstevel@tonic-gate 3467c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword8_nocheck) 3477c478bd9Sstevel@tonic-gate xorq %rax, %rax 3487c478bd9Sstevel@tonic-gate movb (%rdi), %al 3497c478bd9Sstevel@tonic-gate ret 3507c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword8_nocheck) 3517c478bd9Sstevel@tonic-gate 3527c478bd9Sstevel@tonic-gate#elif defined(__i386) 3537c478bd9Sstevel@tonic-gate 3547c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword8_nocheck) 3557c478bd9Sstevel@tonic-gate movl 4(%esp), %ecx 3567c478bd9Sstevel@tonic-gate xorl %eax, %eax 3577c478bd9Sstevel@tonic-gate movzbl (%ecx), %eax 3587c478bd9Sstevel@tonic-gate ret 3597c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword8_nocheck) 3607c478bd9Sstevel@tonic-gate 3617c478bd9Sstevel@tonic-gate#endif /* __i386 */ 3627c478bd9Sstevel@tonic-gate#endif 3637c478bd9Sstevel@tonic-gate 3647c478bd9Sstevel@tonic-gate#if defined(lint) 3657c478bd9Sstevel@tonic-gate 3667c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 3677c478bd9Sstevel@tonic-gateuint16_t 3687c478bd9Sstevel@tonic-gatedtrace_fuword16_nocheck(void *addr) 3697c478bd9Sstevel@tonic-gate{ return (0); } 3707c478bd9Sstevel@tonic-gate 3717c478bd9Sstevel@tonic-gate#else 3727c478bd9Sstevel@tonic-gate#if defined(__amd64) 3737c478bd9Sstevel@tonic-gate 3747c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword16_nocheck) 3757c478bd9Sstevel@tonic-gate xorq %rax, %rax 3767c478bd9Sstevel@tonic-gate movw (%rdi), %ax 3777c478bd9Sstevel@tonic-gate ret 3787c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword16_nocheck) 3797c478bd9Sstevel@tonic-gate 3807c478bd9Sstevel@tonic-gate#elif defined(__i386) 3817c478bd9Sstevel@tonic-gate 3827c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword16_nocheck) 3837c478bd9Sstevel@tonic-gate movl 4(%esp), %ecx 3847c478bd9Sstevel@tonic-gate xorl %eax, %eax 3857c478bd9Sstevel@tonic-gate movzwl (%ecx), %eax 3867c478bd9Sstevel@tonic-gate ret 3877c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword16_nocheck) 3887c478bd9Sstevel@tonic-gate 3897c478bd9Sstevel@tonic-gate#endif /* __i386 */ 3907c478bd9Sstevel@tonic-gate#endif 3917c478bd9Sstevel@tonic-gate 3927c478bd9Sstevel@tonic-gate#if defined(lint) 3937c478bd9Sstevel@tonic-gate 3947c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 3957c478bd9Sstevel@tonic-gateuint32_t 3967c478bd9Sstevel@tonic-gatedtrace_fuword32_nocheck(void *addr) 3977c478bd9Sstevel@tonic-gate{ return (0); } 3987c478bd9Sstevel@tonic-gate 3997c478bd9Sstevel@tonic-gate#else 4007c478bd9Sstevel@tonic-gate#if defined(__amd64) 4017c478bd9Sstevel@tonic-gate 4027c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword32_nocheck) 4037c478bd9Sstevel@tonic-gate xorq %rax, %rax 4047c478bd9Sstevel@tonic-gate movl (%rdi), %eax 4057c478bd9Sstevel@tonic-gate ret 4067c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword32_nocheck) 4077c478bd9Sstevel@tonic-gate 4087c478bd9Sstevel@tonic-gate#elif defined(__i386) 4097c478bd9Sstevel@tonic-gate 4107c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword32_nocheck) 4117c478bd9Sstevel@tonic-gate movl 4(%esp), %ecx 4127c478bd9Sstevel@tonic-gate xorl %eax, %eax 4137c478bd9Sstevel@tonic-gate movl (%ecx), %eax 4147c478bd9Sstevel@tonic-gate ret 4157c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword32_nocheck) 4167c478bd9Sstevel@tonic-gate 4177c478bd9Sstevel@tonic-gate#endif /* __i386 */ 4187c478bd9Sstevel@tonic-gate#endif 4197c478bd9Sstevel@tonic-gate 4207c478bd9Sstevel@tonic-gate#if defined(lint) 4217c478bd9Sstevel@tonic-gate 4227c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 4237c478bd9Sstevel@tonic-gateuint64_t 4247c478bd9Sstevel@tonic-gatedtrace_fuword64_nocheck(void *addr) 4257c478bd9Sstevel@tonic-gate{ return (0); } 4267c478bd9Sstevel@tonic-gate 4277c478bd9Sstevel@tonic-gate#else 4287c478bd9Sstevel@tonic-gate#if defined(__amd64) 4297c478bd9Sstevel@tonic-gate 4307c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword64_nocheck) 4317c478bd9Sstevel@tonic-gate movq (%rdi), %rax 4327c478bd9Sstevel@tonic-gate ret 4337c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword64_nocheck) 4347c478bd9Sstevel@tonic-gate 4357c478bd9Sstevel@tonic-gate#elif defined(__i386) 4367c478bd9Sstevel@tonic-gate 4377c478bd9Sstevel@tonic-gate ENTRY(dtrace_fuword64_nocheck) 4387c478bd9Sstevel@tonic-gate movl 4(%esp), %ecx 4397c478bd9Sstevel@tonic-gate xorl %eax, %eax 4407c478bd9Sstevel@tonic-gate xorl %edx, %edx 4417c478bd9Sstevel@tonic-gate movl (%ecx), %eax 4427c478bd9Sstevel@tonic-gate movl 4(%ecx), %edx 4437c478bd9Sstevel@tonic-gate ret 4447c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_fuword64_nocheck) 4457c478bd9Sstevel@tonic-gate 4467c478bd9Sstevel@tonic-gate#endif /* __i386 */ 4477c478bd9Sstevel@tonic-gate#endif 4487c478bd9Sstevel@tonic-gate 4497c478bd9Sstevel@tonic-gate#if defined(lint) || defined(__lint) 4507c478bd9Sstevel@tonic-gate 4517c478bd9Sstevel@tonic-gate/*ARGSUSED*/ 4527c478bd9Sstevel@tonic-gatevoid 4537c478bd9Sstevel@tonic-gatedtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which, 4547c478bd9Sstevel@tonic-gate int fault, int fltoffs, uintptr_t illval) 4557c478bd9Sstevel@tonic-gate{} 4567c478bd9Sstevel@tonic-gate 4577c478bd9Sstevel@tonic-gate#else /* lint */ 4587c478bd9Sstevel@tonic-gate#if defined(__amd64) 4597c478bd9Sstevel@tonic-gate 4607c478bd9Sstevel@tonic-gate ENTRY(dtrace_probe_error) 4617c478bd9Sstevel@tonic-gate pushq %rbp 4627c478bd9Sstevel@tonic-gate movq %rsp, %rbp 4637c478bd9Sstevel@tonic-gate subq $0x8, %rsp 4647c478bd9Sstevel@tonic-gate movq %r9, (%rsp) 4657c478bd9Sstevel@tonic-gate movq %r8, %r9 4667c478bd9Sstevel@tonic-gate movq %rcx, %r8 4677c478bd9Sstevel@tonic-gate movq %rdx, %rcx 4687c478bd9Sstevel@tonic-gate movq %rsi, %rdx 4697c478bd9Sstevel@tonic-gate movq %rdi, %rsi 4707c478bd9Sstevel@tonic-gate movl dtrace_probeid_error(%rip), %edi 4717c478bd9Sstevel@tonic-gate call dtrace_probe 4727c478bd9Sstevel@tonic-gate addq $0x8, %rsp 4737c478bd9Sstevel@tonic-gate leave 4747c478bd9Sstevel@tonic-gate ret 4757c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_probe_error) 4767c478bd9Sstevel@tonic-gate 4777c478bd9Sstevel@tonic-gate#elif defined(__i386) 4787c478bd9Sstevel@tonic-gate 4797c478bd9Sstevel@tonic-gate ENTRY(dtrace_probe_error) 4807c478bd9Sstevel@tonic-gate pushl %ebp 4817c478bd9Sstevel@tonic-gate movl %esp, %ebp 4827c478bd9Sstevel@tonic-gate pushl 0x1c(%ebp) 4837c478bd9Sstevel@tonic-gate pushl 0x18(%ebp) 4847c478bd9Sstevel@tonic-gate pushl 0x14(%ebp) 4857c478bd9Sstevel@tonic-gate pushl 0x10(%ebp) 4867c478bd9Sstevel@tonic-gate pushl 0xc(%ebp) 4877c478bd9Sstevel@tonic-gate pushl 0x8(%ebp) 4887c478bd9Sstevel@tonic-gate pushl dtrace_probeid_error 4897c478bd9Sstevel@tonic-gate call dtrace_probe 4907c478bd9Sstevel@tonic-gate movl %ebp, %esp 4917c478bd9Sstevel@tonic-gate popl %ebp 4927c478bd9Sstevel@tonic-gate ret 4937c478bd9Sstevel@tonic-gate SET_SIZE(dtrace_probe_error) 4947c478bd9Sstevel@tonic-gate 4957c478bd9Sstevel@tonic-gate#endif /* __i386 */ 4967c478bd9Sstevel@tonic-gate#endif 497