Home | History | Annotate | Download | only in arm64
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef ART_RUNTIME_ARCH_ARM64_ASM_SUPPORT_ARM64_S_
     18 #define ART_RUNTIME_ARCH_ARM64_ASM_SUPPORT_ARM64_S_
     19 
     20 #include "asm_support_arm64.h"
     21 
     22 // Define special registers.
     23 
     24 // Register holding Thread::Current().
     25 #define xSELF x19
     26 // Frame Pointer
     27 #define xFP   x29
     28 // Link Register
     29 #define xLR   x30
     30 // Define the intraprocedural linkage temporary registers.
     31 #define xIP0 x16
     32 #define wIP0 w16
     33 #define xIP1 x17
     34 #define wIP1 w17
     35 
     36 
     37 .macro ENTRY name
     38     .type \name, #function
     39     .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
     40     .global \name
     41     /* Cache alignment for function entry */
     42     .balign 16
     43 \name:
     44     .cfi_startproc
     45 .endm
     46 
     47 .macro END name
     48     .cfi_endproc
     49     .size \name, .-\name
     50 .endm
     51 
     52 .macro UNIMPLEMENTED name
     53     ENTRY \name
     54     brk 0
     55     END \name
     56 .endm
     57 
     58 // Macros to poison (negate) the reference for heap poisoning.
     59 .macro POISON_HEAP_REF rRef
     60 #ifdef USE_HEAP_POISONING
     61     neg \rRef, \rRef
     62 #endif  // USE_HEAP_POISONING
     63 .endm
     64 
     65 // Macros to unpoison (negate) the reference for heap poisoning.
     66 .macro UNPOISON_HEAP_REF rRef
     67 #ifdef USE_HEAP_POISONING
     68     neg \rRef, \rRef
     69 #endif  // USE_HEAP_POISONING
     70 .endm
     71 
     72 #endif  // ART_RUNTIME_ARCH_ARM64_ASM_SUPPORT_ARM64_S_
     73