1 /* libunwind - a platform-independent unwind library 2 Copyright (C) 2004 Hewlett-Packard Co 3 Contributed by Zhaofeng Li <hello@zhaofeng.li> 4 5 This file is part of libunwind. 6 7 Permission is hereby granted, free of charge, to any person obtaining 8 a copy of this software and associated documentation files (the 9 "Software"), to deal in the Software without restriction, including 10 without limitation the rights to use, copy, modify, merge, publish, 11 distribute, sublicense, and/or sell copies of the Software, and to 12 permit persons to whom the Software is furnished to do so, subject to 13 the following conditions: 14 15 The above copyright notice and this permission notice shall be 16 included in all copies or substantial portions of the Software. 17 18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 25 26 #if defined __linux__ 27 28 /* https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/setjmp.S;h=0b92016b311b11aa9eeb62b38c670a262f1924c9;hb=HEAD */ 29 #define JB_SP 13 30 #define JB_RP 0 31 32 #if __riscv_xlen == 64 33 34 /* GCC's internal structure for this depends on the floating-point ABI: 35 https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h;h=be9199e514bf4f15f0612327b8b762e29a2b7862;hb=HEAD 36 */ 37 38 #if defined __riscv_float_abi_double 39 # define JB_MASK_SAVED (208>>3) 40 # define JB_MASK (216>>3) 41 #else 42 # error "Unsupported RISC-V floating point ABI" 43 #endif /* __riscv_float_abi_double */ 44 45 #else 46 # error "Add offsets here" 47 #endif /* __riscv_xlen */ 48 49 #endif 50