The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/cddl/dev/dtrace/arm/dtrace_asm.S

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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, Version 1.0 only
    6  * (the "License").  You may not use this file except in compliance
    7  * with the License.
    8  *
    9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   10  * or http://www.opensolaris.org/os/licensing.
   11  * See the License for the specific language governing permissions
   12  * and limitations under the License.
   13  *
   14  * When distributing Covered Code, include this CDDL HEADER in each
   15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
   16  * If applicable, add the following below this CDDL HEADER, with the
   17  * fields enclosed by brackets "[]" replaced with your own identifying
   18  * information: Portions Copyright [yyyy] [name of copyright owner]
   19  *
   20  * CDDL HEADER END
   21  *
   22  * $FreeBSD$
   23  */
   24 /*
   25  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
   26  * Use is subject to license terms.
   27  */
   28 
   29 #define _ASM
   30 #define _LOCORE
   31 
   32 #include <sys/cpuvar_defs.h>
   33 #include <sys/dtrace.h>
   34 
   35 #include <machine/asm.h>
   36 #include <machine/armreg.h>
   37 
   38 #include "assym.inc"
   39 
   40 /*
   41 void dtrace_membar_producer(void)
   42 */
   43 ENTRY(dtrace_membar_producer)
   44         RET
   45 END(dtrace_membar_producer)
   46 
   47 /*
   48 void dtrace_membar_consumer(void)
   49 */
   50 ENTRY(dtrace_membar_consumer)
   51         RET
   52 END(dtrace_membar_consumer)
   53 
   54 /*
   55 dtrace_icookie_t dtrace_interrupt_disable(void)
   56 */
   57 ENTRY(dtrace_interrupt_disable)
   58         mrs     r0, cpsr
   59         mov     r1, r0
   60         orr     r1, r1, #(PSR_I | PSR_F)
   61         msr     cpsr_c, r1
   62         RET
   63 END(dtrace_interrupt_disable)
   64 
   65 /*
   66 void dtrace_interrupt_enable(dtrace_icookie_t cookie)
   67 */
   68 ENTRY(dtrace_interrupt_enable)
   69         and     r0, r0, #(PSR_I | PSR_F) 
   70         mrs     r1, cpsr
   71         bic     r1, r1, #(PSR_I | PSR_F)
   72         orr     r1, r1, r0
   73         msr     cpsr_c, r1
   74         RET
   75 END(dtrace_interrupt_enable)
   76 /*
   77 uint8_t
   78 dtrace_fuword8_nocheck(void *addr)
   79 */
   80 ENTRY(dtrace_fuword8_nocheck)
   81         ldrb    r3, [r0]
   82         mov     r0, r3
   83         RET
   84 END(dtrace_fuword8_nocheck)
   85 
   86 /*
   87 uint16_t
   88 dtrace_fuword16_nocheck(void *addr)
   89 */
   90 ENTRY(dtrace_fuword16_nocheck)
   91         ldrh    r3, [r0]
   92         mov     r0, r3
   93         RET
   94 END(dtrace_fuword16_nocheck)
   95 
   96 /*
   97 uint32_t
   98 dtrace_fuword32_nocheck(void *addr)
   99 */
  100 ENTRY(dtrace_fuword32_nocheck)
  101         ldr     r3, [r0]
  102         mov     r0, r3
  103         RET
  104 END(dtrace_fuword32_nocheck)
  105 
  106 /*
  107 uint64_t
  108 dtrace_fuword64_nocheck(void *addr)
  109 */
  110 ENTRY(dtrace_fuword64_nocheck)
  111         ldm     r0, {r2, r3}
  112 
  113         mov     r0, r2
  114         mov     r1, r3
  115 #if defined(__BIG_ENDIAN__)
  116 /* big endian */
  117         mov     r0, r3
  118         mov     r1, r2
  119 #else
  120 /* little endian */
  121         mov     r0, r2
  122         mov     r1, r3
  123 
  124 #endif
  125         RET
  126 END(dtrace_fuword64_nocheck)
  127 
  128 /*
  129 void
  130 dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size)
  131 */
  132 ENTRY(dtrace_copy)
  133         stmfd   sp!, {r4-r5}                    /* stack is 8 byte aligned */
  134         teq     r2, #0x00000000
  135         mov     r5, #0x00000000
  136         beq     2f
  137 
  138 1:      ldrb    r4, [r0], #0x0001
  139         add     r5, r5, #0x00000001
  140         strb    r4, [r1], #0x0001
  141         teqne   r5, r2
  142         bne     1b
  143 
  144 2:      ldmfd   sp!, {r4-r5}                    /* stack is 8 byte aligned */
  145         RET
  146 END(dtrace_copy)
  147 
  148 /*
  149 void
  150 dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
  151     volatile uint16_t *flags)
  152 XXX: Check for flags?
  153 */
  154 ENTRY(dtrace_copystr)
  155         stmfd   sp!, {r4-r5}                    /* stack is 8 byte aligned */
  156         teq     r2, #0x00000000
  157         mov     r5, #0x00000000
  158         beq     2f
  159 
  160 1:      ldrb    r4, [r0], #0x0001
  161         add     r5, r5, #0x00000001
  162         teq     r4, #0x00000000
  163         strb    r4, [r1], #0x0001
  164         teqne   r5, r2
  165         bne     1b
  166 
  167 2:      ldmfd   sp!, {r4-r5}                    /* stack is 8 byte aligned */
  168         RET
  169 END(dtrace_copystr)
  170 
  171 /*
  172 uintptr_t
  173 dtrace_caller(int aframes)
  174 */
  175 ENTRY(dtrace_caller)
  176         mov     r0, #-1
  177         RET
  178 END(dtrace_caller)
  179 
  180 /*
  181 uint32_t
  182 dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
  183 
  184 void *
  185 dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new)
  186 */
  187 ENTRY(dtrace_cas32)
  188 EENTRY(dtrace_casptr)
  189 1:      ldrex   r3, [r0]        /* Load target */
  190         cmp     r3, r1          /* Check if *target == cmp */
  191         bne     2f              /* No, return */
  192         strex   ip, r2, [r0]    /* Store new to target */
  193         cmp     ip, #0          /* Did the store succeed? */
  194         bne     1b              /* No, try again */
  195 2:      mov     r0, r3          /* Return the value loaded from target */
  196         RET
  197 EEND(dtrace_casptr)
  198 END(dtrace_cas32)

Cache object: 9c295d9def851c1a7f4abb96966e989c


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.