12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- From 05c65dd1e572b489bbd85488c2897af76a143a01 Mon Sep 17 00:00:00 2001
- From: Vincent Chen <vincent.chen@sifive.com>
- Date: Mon, 13 Sep 2021 09:41:17 +0800
- Subject: [PATCH 4/8] RISC-V: Extend MINSIGSTKSZ and SIGSTKSZ to backup RVV
- registers
- As using RVV extension, the original MINSIGSTKSZ is not enough to
- back up all RVV registers for the normal case. Therefore, the MINSIGSTKSZ
- is expanded to about 5K and the SIGSTKSZ is expanded to about 16K. This
- space is enough for the case that the VLENB of a vector register is 128
- bytes. For the case that VLENB > 128 bytes, users can use
- sysconf (_SC_MINSIGSTKSZ) and sysconf (_SC_SIGSTKSZ) to get the
- appropriate signal stack size.
- Signed-off-by: max.ma <max.ma@starfivetech.com>
- ---
- sysdeps/unix/sysv/linux/riscv/bits/sigstack.h | 32 +++++++++++++++++++
- 1 file changed, 32 insertions(+)
- create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/sigstack.h
- diff --git a/sysdeps/unix/sysv/linux/riscv/bits/sigstack.h b/sysdeps/unix/sysv/linux/riscv/bits/sigstack.h
- new file mode 100644
- index 0000000000..c18512f083
- --- /dev/null
- +++ b/sysdeps/unix/sysv/linux/riscv/bits/sigstack.h
- @@ -0,0 +1,32 @@
- +/* sigstack, sigaltstack definitions.
- + Copyright (C) 2021 Free Software Foundation, Inc.
- + This file is part of the GNU C Library.
- +
- + The GNU C Library is free software; you can redistribute it and/or
- + modify it under the terms of the GNU Lesser General Public
- + License as published by the Free Software Foundation; either
- + version 2.1 of the License, or (at your option) any later version.
- +
- + The GNU C Library is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + Lesser General Public License for more details.
- +
- + You should have received a copy of the GNU Lesser General Public
- + License along with the GNU C Library; if not, see
- + <https://www.gnu.org/licenses/>. */
- +
- +#ifndef _BITS_SIGSTACK_H
- +#define _BITS_SIGSTACK_H 1
- +
- +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
- +# error "Never include this file directly. Use <signal.h> instead"
- +#endif
- +
- +/* Minimum stack size (5k+256 bytes) for a signal handler. */
- +#define MINSIGSTKSZ 5376
- +
- +/* System default stack size. */
- +#define SIGSTKSZ 16384
- +
- +#endif /* bits/sigstack.h */
- --
- 2.33.1
|