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 suspend check count down.
     25 // 32-bit is enough for the suspend register.
     26 #define wSUSPEND w19
     27 // xSUSPEND is 64-bit view of wSUSPEND.
     28 // Used to save/restore the register scratched by managed code.
     29 #define xSUSPEND x19
     30 // Register holding Thread::Current().
     31 #define xSELF x18
     32 // x18 is not preserved by aapcs64, save it on xETR(External Thread reg) for restore and later use.
     33 #define xETR x21
     34 // Frame Pointer
     35 #define xFP   x29
     36 // Link Register
     37 #define xLR   x30
     38 // Define the intraprocedural linkage temporary registers.
     39 #define xIP0 x16
     40 #define wIP0 w16
     41 #define xIP1 x17
     42 #define wIP1 w17
     43 
     44 
     45 .macro ENTRY name
     46     .type \name, #function
     47     .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
     48     .global \name
     49     /* Cache alignment for function entry */
     50     .balign 16
     51 \name:
     52     .cfi_startproc
     53 .endm
     54 
     55 .macro ENTRY_NO_HIDE name
     56     .type \name, #function
     57     .global \name
     58     /* Cache alignment for function entry */
     59     .balign 16
     60 \name:
     61     .cfi_startproc
     62 .endm
     63 
     64 .macro END name
     65     .cfi_endproc
     66     .size \name, .-\name
     67 .endm
     68 
     69 .macro UNIMPLEMENTED name
     70     ENTRY \name
     71     brk 0
     72     END \name
     73 .endm
     74 
     75 .macro UNIMPLEMENTED_NO_HIDE name
     76     ENTRY_NO_HIDE \name
     77     brk 0
     78     END \name
     79 .endm
     80 
     81 #endif  // ART_RUNTIME_ARCH_ARM64_ASM_SUPPORT_ARM64_S_
     82