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/aarch64/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/armreg.h>
   36 #include <machine/asm.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     x0, daif
   59         msr     daifset, #2
   60         RET
   61 END(dtrace_interrupt_disable)
   62 
   63 /*
   64 void dtrace_interrupt_enable(dtrace_icookie_t cookie)
   65 */
   66 ENTRY(dtrace_interrupt_enable)
   67         msr     daif, x0
   68         RET
   69 END(dtrace_interrupt_enable)
   70 /*
   71 uint8_t
   72 dtrace_fuword8_nocheck(void *addr)
   73 */
   74 ENTRY(dtrace_fuword8_nocheck)
   75         ldrb    w0, [x0]
   76         RET
   77 END(dtrace_fuword8_nocheck)
   78 
   79 /*
   80 uint16_t
   81 dtrace_fuword16_nocheck(void *addr)
   82 */
   83 ENTRY(dtrace_fuword16_nocheck)
   84         ldrh    w0, [x0]
   85         RET
   86 END(dtrace_fuword16_nocheck)
   87 
   88 /*
   89 uint32_t
   90 dtrace_fuword32_nocheck(void *addr)
   91 */
   92 ENTRY(dtrace_fuword32_nocheck)
   93         ldr     w0, [x0]
   94         RET
   95 END(dtrace_fuword32_nocheck)
   96 
   97 /*
   98 uint64_t
   99 dtrace_fuword64_nocheck(void *addr)
  100 */
  101 ENTRY(dtrace_fuword64_nocheck)
  102         ldr     x0, [x0]
  103         RET
  104 END(dtrace_fuword64_nocheck)
  105 
  106 /*
  107 void
  108 dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size)
  109 */
  110 ENTRY(dtrace_copy)
  111         cbz     x2, 2f          /* If len == 0 then skip loop */
  112 1:
  113         ldrb    w4, [x0], #1    /* Load from uaddr */
  114         strb    w4, [x1], #1    /* Store in kaddr */
  115         sub     x2, x2, #1      /* len-- */
  116         cbnz    x2, 1b
  117 2:
  118         RET
  119 END(dtrace_copy)
  120 
  121 /*
  122 void
  123 dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
  124     volatile uint16_t *flags)
  125 XXX: Check for flags?
  126 */
  127 ENTRY(dtrace_copystr)
  128         cbz     x2, 2f          /* If len == 0 then skip loop */
  129  
  130 1:      ldrb    w4, [x0], #1    /* Load from uaddr */
  131         strb    w4, [x1], #1    /* Store in kaddr */
  132         cbz     w4, 2f          /* If == 0 then break */
  133         sub     x2, x2, #1      /* len-- */
  134         cbnz    x2, 1b
  135 2:
  136         RET
  137 END(dtrace_copystr)
  138 
  139 /*
  140 uintptr_t
  141 dtrace_caller(int aframes)
  142 */
  143 ENTRY(dtrace_caller)
  144         mov     x0, #-1
  145         RET
  146 END(dtrace_caller)
  147 
  148 /*
  149 uint32_t
  150 dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
  151 */
  152 ENTRY(dtrace_cas32)
  153 1:      ldxr    w3, [x0]        /* Load target */
  154         cmp     w3, w1          /* Check if *target == cmp */
  155         bne     2f              /* No, return */
  156         stxr    w12, w2, [x0]   /* Store new to target */
  157         cbnz    w12, 1b         /* Try again if store not succeed */
  158 2:      mov     w0, w3          /* Return the value loaded from target */
  159         RET
  160 END(dtrace_cas32)
  161 
  162 /*
  163 void *
  164 dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new)
  165 */
  166 ENTRY(dtrace_casptr)
  167 1:      ldxr    x3, [x0]        /* Load target */
  168         cmp     x3, x1          /* Check if *target == cmp */
  169         bne     2f              /* No, return */
  170         stxr    w12, x2, [x0]   /* Store new to target */
  171         cbnz    w12, 1b         /* Try again if store not succeed */
  172 2:      mov     x0, x3          /* Return the value loaded from target */
  173         RET
  174 END(dtrace_casptr)

Cache object: 3a71cc24f36128dcf0a94ee5c1904b3b


[ 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.