1 /* 2 * Copyright (C) 2023 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_RISCV64_ASM_SUPPORT_RISCV64_H_ 18 #define ART_RUNTIME_ARCH_RISCV64_ASM_SUPPORT_RISCV64_H_ 19 20 #include "asm_support.h" 21 #include "entrypoints/entrypoint_asm_constants.h" 22 23 // Each frame size constant must be a whole multiple of 16 to ensure 16-byte alignment on the stack. 24 25 // clang-format off 26 // S0, S2 - S11, RA, ArtMethod*, and padding, 27 // total 8*(11 + 1 + 1 + 1) = 112 28 #define FRAME_SIZE_SAVE_REFS_ONLY 112 29 30 // A0 - A7, FA0 - FA7, total 8*(8 + 8) = 128 31 #define FRAME_SIZE_SAVE_ARGS_ONLY 128 32 33 // FS0 - FS11, S0, S2 - S11, RA, ArtMethod* and padding, 34 // total 8*(12 + 11 + 1 + 1 + 1) = 208 35 #define FRAME_SIZE_SAVE_ALL_CALLEE_SAVES 208 36 37 // FA0 - FA7, A1 - A7, S0, S2 - S11, RA and ArtMethod*, 38 // total 8*(8 + 7 + 11 + 1 + 1) = 224 39 // Excluded GPRs are: A0 (ArtMethod*), S1/TR (ART thread register). 40 #define FRAME_SIZE_SAVE_REFS_AND_ARGS 224 41 42 // All 32 FPRs, 27 GPRs and ArtMethod*, 43 // total 8*(32 + 27 + 1) = 480 44 // Excluded GPRs are: SP, Zero, TP, GP, S1/TR (ART thread register). 45 #define FRAME_SIZE_SAVE_EVERYTHING 480 46 47 // FS0 - FS11, S0, S2 - S11, RA, 48 // total 8*(12 + 1 + 10 + 1) = 192 49 #define NTERP_SIZE_SAVE_CALLEE_SAVES 192 50 // clang-format on 51 52 #endif // ART_RUNTIME_ARCH_RISCV64_ASM_SUPPORT_RISCV64_H_ 53