xref: /netbsd-src/external/gpl3/gcc/dist/libgcc/generic-morestack.h (revision b1e838363e3c6fc78a55519254d99869742dd33c)
148fb7bfaSmrg /* Library support for -fsplit-stack.  */
2*b1e83836Smrg /* Copyright (C) 2009-2022 Free Software Foundation, Inc.
348fb7bfaSmrg    Contributed by Ian Lance Taylor <iant@google.com>.
448fb7bfaSmrg 
548fb7bfaSmrg This file is part of GCC.
648fb7bfaSmrg 
748fb7bfaSmrg GCC is free software; you can redistribute it and/or modify it under
848fb7bfaSmrg the terms of the GNU General Public License as published by the Free
948fb7bfaSmrg Software Foundation; either version 3, or (at your option) any later
1048fb7bfaSmrg version.
1148fb7bfaSmrg 
1248fb7bfaSmrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
1348fb7bfaSmrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
1448fb7bfaSmrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1548fb7bfaSmrg for more details.
1648fb7bfaSmrg 
1748fb7bfaSmrg Under Section 7 of GPL version 3, you are granted additional
1848fb7bfaSmrg permissions described in the GCC Runtime Library Exception, version
1948fb7bfaSmrg 3.1, as published by the Free Software Foundation.
2048fb7bfaSmrg 
2148fb7bfaSmrg You should have received a copy of the GNU General Public License and
2248fb7bfaSmrg a copy of the GCC Runtime Library Exception along with this program;
2348fb7bfaSmrg see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2448fb7bfaSmrg <http://www.gnu.org/licenses/>.  */
2548fb7bfaSmrg 
2648fb7bfaSmrg /* This is a libgcc internal header file for functions shared between
2748fb7bfaSmrg    generic-morestack.c and generic-morestack-thread.c.  The latter
2848fb7bfaSmrg    file is only used when linking with the pthread library.  */
2948fb7bfaSmrg 
3048fb7bfaSmrg /* The stack segment structure, defined in generic-morestack.c.  */
3148fb7bfaSmrg 
3248fb7bfaSmrg struct stack_segment;
3348fb7bfaSmrg 
3448fb7bfaSmrg /* The list of stack segments for this thread.  */
3548fb7bfaSmrg 
3648fb7bfaSmrg extern __thread struct stack_segment *__morestack_segments;
3748fb7bfaSmrg 
3848fb7bfaSmrg /* Print the string MSG/LEN, the errno number ERR, and a newline on
3948fb7bfaSmrg    stderr, without using printf.  Then crash.  */
4048fb7bfaSmrg 
4148fb7bfaSmrg extern void __morestack_fail (const char *msg, size_t len, int err)
4248fb7bfaSmrg   __attribute__ ((noreturn, visibility ("hidden")));
4348fb7bfaSmrg 
4448fb7bfaSmrg /* Release stack segments.  */
4548fb7bfaSmrg 
4648fb7bfaSmrg extern struct dynamic_allocation_blocks *
4748fb7bfaSmrg   __morestack_release_segments (struct stack_segment **, int)
4848fb7bfaSmrg   __attribute__ ((visibility ("hidden")));
4948fb7bfaSmrg 
5048fb7bfaSmrg /* Store the stack information in a processor dependent manner.  */
5148fb7bfaSmrg 
5248fb7bfaSmrg extern void __stack_split_initialize (void)
5348fb7bfaSmrg   __attribute__ ((visibility ("hidden")));
54