summaryrefslogtreecommitdiff
path: root/arch/x32/bits/signal.h
AgeCommit message (Collapse)AuthorLines
2017-01-04reduce impact of REG_* namespace pollution in x86[_64] signal.hRich Felker-23/+46
when _GNU_SOURCE is defined, which is always the case when compiling c++ with gcc, these macros for the the indices in gregset_t are exposed and likely to clash with applications. by using enum constants rather than macros defined with integer literals, we can make the clash slightly less likely to break software. the macros are still defined in case anything checks for them with #ifdef, but they're defined to expand to themselves so that non-file-scope (e.g. namespaced) identifiers by the same names still work. for the sake of avoiding mistakes, the changes were generated with sed via the command: sed -i -e 's/#define *\(REG_[A-Z_0-9]\{1,\}\) *\([0-9]\{1,\}\)'\ '/enum { \1 = \2 };\n#define \1 \1/' \ arch/i386/bits/signal.h arch/x86_64/bits/signal.h arch/x32/bits/signal.h
2015-03-18fix MINSIGSTKSZ values for archs with large signal contextsRich Felker-0/+5
the previous values (2k min and 8k default) were too small for some archs. aarch64 reserves 4k in the signal context for future extensions and requires about 4.5k total, and powerpc reportedly uses over 2k. the new minimums are chosen to fit the saved context and also allow a minimal signal handler to run. since the default (SIGSTKSZ) has always been 6k larger than the minimum, it is also increased to maintain the 6k usable by the signal handler. this happens to be able to store one pathname buffer and should be sufficient for calling any function in libc that doesn't involve conversion between floating point and decimal representations. x86 (both 32-bit and 64-bit variants) may also need a larger minimum (around 2.5k) in the future to support avx-512, but the values on these archs are left alone for now pending further analysis. the value for PTHREAD_STACK_MIN is not increased to match MINSIGSTKSZ at this time. this is so as not to preclude applications from using extremely small thread stacks when they know they will not be handling signals. unfortunately cancellation and multi-threaded set*id() use signals as an implementation detail and therefore require a stack large enough for a signal context, so applications which use extremely small thread stacks may still need to avoid using these features.
2014-03-18fix signal.h breakage from moving stack_t to arch-specific bitsRich Felker-6/+6
in the previous changes, I missed the fact that both the prototype of the sigaltstack function and the definition of ucontext_t depend on stack_t.
2014-03-18move signal.h definition of stack_t to arch-specific bitsRich Felker-0/+6
it's different at least on mips. mips version will be fixed in a separate commit to show the change.
2014-02-23x32 port (diff against vanilla x86_64)rofl0r-6/+6
2014-02-23import vanilla x86_64 code as x32rofl0r-0/+119