]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h
cfa65644e445ce712927a814c61c2744a46f56ef
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / riscv / rv64 / jmp_buf-macros.h
1 /* jump buffer constants for RISC-V
2 Copyright (C) 2017-2019 Free Software Foundation, Inc.
3
4 This file is part of the GNU C Library.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library. If not, see
18 <http://www.gnu.org/licenses/>. */
19
20 /* Produced by this program:
21
22 #include <stdio.h>
23 #include <unistd.h>
24 #include <setjmp.h>
25 #include <stddef.h>
26
27 int main (int argc, char **argv)
28 {
29 printf ("#define JMP_BUF_SIZE %d\n", sizeof (jmp_buf));
30 printf ("#define JMP_BUF_ALIGN %d\n", __alignof__ (jmp_buf));
31 printf ("#define SIGJMP_BUF_SIZE %d\n", sizeof (sigjmp_buf));
32 printf ("#define SIGJMP_BUF_ALIGN %d\n", __alignof__ (sigjmp_buf));
33 printf ("#define MASK_WAS_SAVED_OFFSET %d\n", offsetof (struct __jmp_buf_tag, __mask_was_saved));
34 printf ("#define SAVED_MASK_OFFSET %d\n", offsetof (struct __jmp_buf_tag, __saved_mask));
35 } */
36
37 #if defined __riscv_float_abi_soft
38 # define JMP_BUF_SIZE 248
39 # define JMP_BUF_ALIGN 8
40 # define SIGJMP_BUF_SIZE 248
41 # define SIGJMP_BUF_ALIGN 8
42 # define MASK_WAS_SAVED_OFFSET 112
43 # define SAVED_MASK_OFFSET 120
44 #elif defined __riscv_float_abi_double
45 # define JMP_BUF_SIZE 344
46 # define JMP_BUF_ALIGN 8
47 # define SIGJMP_BUF_SIZE 344
48 # define SIGJMP_BUF_ALIGN 8
49 # define MASK_WAS_SAVED_OFFSET 208
50 # define SAVED_MASK_OFFSET 216
51 #else
52 # error "Unknown RISC-V floating-point ABI"
53 #endif