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_MIPS64_ASM_SUPPORT_MIPS64_S_ 18 #define ART_RUNTIME_ARCH_MIPS64_ASM_SUPPORT_MIPS64_S_ 19 20 #include "asm_support_mips64.h" 21 22 // Define special registers. 23 24 // Register holding suspend check count down. 25 #define rSUSPEND $s0 26 // Register holding Thread::Current(). 27 #define rSELF $s1 28 29 30 // Declare a function called name, sets up $gp. 31 // This macro modifies t8. 32 .macro ENTRY name 33 .type \name, %function 34 .global \name 35 // Cache alignment for function entry. 36 .balign 16 37 \name: 38 .cfi_startproc 39 // Set up $gp and store the previous $gp value to $t8. It will be pushed to the 40 // stack after the frame has been constructed. 41 .cpsetup $t9, $t8, \name 42 // Ensure we get a sane starting CFA. 43 .cfi_def_cfa $sp,0 44 // Declare a local convenience label to be branched to when $gp is already set up. 45 .L\name\()_gp_set: 46 .endm 47 48 // Declare a function called name, doesn't set up $gp. 49 .macro ENTRY_NO_GP name 50 .type \name, %function 51 .global \name 52 // Cache alignment for function entry. 53 .balign 16 54 \name: 55 .cfi_startproc 56 // Ensure we get a sane starting CFA. 57 .cfi_def_cfa $sp,0 58 .endm 59 60 .macro END name 61 .cfi_endproc 62 .size \name, .-\name 63 .endm 64 65 .macro UNIMPLEMENTED name 66 ENTRY \name 67 break 68 break 69 END \name 70 .endm 71 72 73 #endif // ART_RUNTIME_ARCH_MIPS64_ASM_SUPPORT_MIPS64_S_ 74