Date: Fri, 28 Apr 2006 06:57:57 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96295 for review Message-ID: <200604280657.k3S6vvxr050164@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96295 Change 96295 by jb@jb_freebsd2 on 2006/04/28 06:57:48 Add a bunch of functions. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/i386/dtrace_asm.S#2 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/i386/dtrace_asm.S#2 (text+ko) ==== @@ -27,6 +27,152 @@ #include <machine/asm.h> /* +greg_t dtrace_getfp(void) +*/ + + ENTRY(dtrace_getfp) + movl %ebp, %eax + ret + SET_SIZE(dtrace_getfp) + +/* +uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) +*/ + + ENTRY(dtrace_cas32) + ALTENTRY(dtrace_casptr) + movl 4(%esp), %edx + movl 8(%esp), %eax + movl 12(%esp), %ecx + lock + cmpxchgl %ecx, (%edx) + ret + SET_SIZE(dtrace_casptr) + SET_SIZE(dtrace_cas32) + +/* +uintptr_t dtrace_caller(int aframes) +*/ + + ENTRY(dtrace_caller) + movl $-1, %eax + ret + SET_SIZE(dtrace_caller) + +/* +void dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) +*/ + + ENTRY(dtrace_copy) + pushl %ebp + movl %esp, %ebp + pushl %esi + pushl %edi + + movl 8(%ebp), %esi /* Load source address */ + movl 12(%ebp), %edi /* Load destination address */ + movl 16(%ebp), %ecx /* Load count */ + repz /* Repeat for count... */ + smovb /* move from %ds:si to %es:di */ + + popl %edi + popl %esi + movl %ebp, %esp + popl %ebp + ret + SET_SIZE(dtrace_copy) + +/* +void dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size) +*/ + + ENTRY(dtrace_copystr) + + pushl %ebp /* Setup stack frame */ + movl %esp, %ebp + pushl %ebx /* Save registers */ + + movl 8(%ebp), %ebx /* Load source address */ + movl 12(%ebp), %edx /* Load destination address */ + movl 16(%ebp), %ecx /* Load count */ + +0: + movb (%ebx), %al /* Load from source */ + movb %al, (%edx) /* Store to destination */ + incl %ebx /* Increment source pointer */ + incl %edx /* Increment destination pointer */ + decl %ecx /* Decrement remaining count */ + cmpb $0, %al + je 1f + cmpl $0, %ecx + jne 0b + +1: + popl %ebx + movl %ebp, %esp + popl %ebp + ret + + SET_SIZE(dtrace_copystr) + +/* +uintptr_t dtrace_fulword(void *addr) +*/ + + ENTRY(dtrace_fulword) + movl 4(%esp), %ecx + xorl %eax, %eax + movl (%ecx), %eax + ret + SET_SIZE(dtrace_fulword) + +/* +uint8_t dtrace_fuword8_nocheck(void *addr) +*/ + + ENTRY(dtrace_fuword8_nocheck) + movl 4(%esp), %ecx + xorl %eax, %eax + movzbl (%ecx), %eax + ret + SET_SIZE(dtrace_fuword8_nocheck) + +/* +uint16_t dtrace_fuword16_nocheck(void *addr) +*/ + + ENTRY(dtrace_fuword16_nocheck) + movl 4(%esp), %ecx + xorl %eax, %eax + movzwl (%ecx), %eax + ret + SET_SIZE(dtrace_fuword16_nocheck) + +/* +uint32_t dtrace_fuword32_nocheck(void *addr) +*/ + + ENTRY(dtrace_fuword32_nocheck) + movl 4(%esp), %ecx + xorl %eax, %eax + movl (%ecx), %eax + ret + SET_SIZE(dtrace_fuword32_nocheck) + +/* +uint64_t dtrace_fuword64_nocheck(void *addr) +*/ + + ENTRY(dtrace_fuword64_nocheck) + movl 4(%esp), %ecx + xorl %eax, %eax + xorl %edx, %edx + movl (%ecx), %eax + movl 4(%ecx), %edx + ret + SET_SIZE(dtrace_fuword64_nocheck) + +/* void dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which, int fault, int fltoffs, uintptr_t illval) */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604280657.k3S6vvxr050164>