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 x18
26// x18 is not preserved by aapcs64, save it on xETR(External Thread reg) for restore and later use.
27#define xETR x21
28// Frame Pointer
29#define xFP   x29
30// Link Register
31#define xLR   x30
32// Define the intraprocedural linkage temporary registers.
33#define xIP0 x16
34#define wIP0 w16
35#define xIP1 x17
36#define wIP1 w17
37
38
39.macro ENTRY name
40    .type \name, #function
41    .hidden \name  // Hide this as a global symbol, so we do not incur plt calls.
42    .global \name
43    /* Cache alignment for function entry */
44    .balign 16
45\name:
46    .cfi_startproc
47.endm
48
49.macro END name
50    .cfi_endproc
51    .size \name, .-\name
52.endm
53
54.macro UNIMPLEMENTED name
55    ENTRY \name
56    brk 0
57    END \name
58.endm
59
60#endif  // ART_RUNTIME_ARCH_ARM64_ASM_SUPPORT_ARM64_S_
61