klibc-bot for Ben Hutchings
2023-Jan-14 22:03 UTC
[klibc] [klibc:time64] i386, m68k, s390: signal: Switch to RT signal API
Commit-ID: 213ca3d1a7de314dc61a02bb7619295f5b14f8a5 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=213ca3d1a7de314dc61a02bb7619295f5b14f8a5 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 14 Jan 2023 04:09:21 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 14 Jan 2023 18:09:10 +0100 [klibc] i386,m68k,s390: signal: Switch to RT signal API These are the last 3 architectures not using the RT signal system calls and structures. Change them over so that we won't need to keep support the old API. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/arch/i386/klibc/archconfig.h | 3 +- usr/include/arch/i386/klibc/archsignal.h | 15 +++++--- usr/include/arch/m68k/klibc/archconfig.h | 1 + usr/include/arch/m68k/klibc/archsignal.h | 64 +++++++++++++++++++++++++++++++- usr/include/arch/s390/klibc/archconfig.h | 1 + usr/include/arch/s390/klibc/archsignal.h | 9 ++++- 6 files changed, 82 insertions(+), 11 deletions(-) diff --git a/usr/include/arch/i386/klibc/archconfig.h b/usr/include/arch/i386/klibc/archconfig.h index f070f5bb..3e52a6b6 100644 --- a/usr/include/arch/i386/klibc/archconfig.h +++ b/usr/include/arch/i386/klibc/archconfig.h @@ -9,8 +9,7 @@ #ifndef _KLIBC_ARCHCONFIG_H #define _KLIBC_ARCHCONFIG_H -/* The i386 <asm/signal.h> is still not clean enough for this... */ -#define _KLIBC_USE_RT_SIG 0 +#define _KLIBC_USE_RT_SIG 1 /* We have klibc/archinit.h and __libc_archinit() */ #define _KLIBC_HAS_ARCHINIT 1 diff --git a/usr/include/arch/i386/klibc/archsignal.h b/usr/include/arch/i386/klibc/archsignal.h index 661131bc..a80eca80 100644 --- a/usr/include/arch/i386/klibc/archsignal.h +++ b/usr/include/arch/i386/klibc/archsignal.h @@ -7,8 +7,13 @@ #ifndef _KLIBC_ARCHSIGNAL_H #define _KLIBC_ARCHSIGNAL_H -#define NSIG 32 -typedef unsigned long sigset_t; +#define _NSIG 64 +#define _NSIG_BPW 32 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW) + +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} sigset_t; #define SIGHUP 1 #define SIGINT 2 @@ -59,9 +64,9 @@ struct sigaction { __sighandler_t _sa_handler; void (*_sa_sigaction)(int, struct siginfo *, void *); } _u; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer)(void); + unsigned int sa_flags; + __sigrestore_t sa_restorer; + sigset_t sa_mask; /* mask last for extensibility */ }; #define sa_handler _u._sa_handler diff --git a/usr/include/arch/m68k/klibc/archconfig.h b/usr/include/arch/m68k/klibc/archconfig.h index 10ef62e6..6213277b 100644 --- a/usr/include/arch/m68k/klibc/archconfig.h +++ b/usr/include/arch/m68k/klibc/archconfig.h @@ -11,5 +11,6 @@ /* On m68k, sys_mmap2 uses the current page size as the shift factor */ #define _KLIBC_MMAP2_SHIFT __getpageshift() +#define _KLIBC_USE_RT_SIG 1 #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/m68k/klibc/archsignal.h b/usr/include/arch/m68k/klibc/archsignal.h index bf7912ae..64613466 100644 --- a/usr/include/arch/m68k/klibc/archsignal.h +++ b/usr/include/arch/m68k/klibc/archsignal.h @@ -8,7 +8,67 @@ #ifndef _KLIBC_ARCHSIGNAL_H #define _KLIBC_ARCHSIGNAL_H -#include <asm/signal.h> -/* No special stuff for this architecture */ +#define _NSIG 64 +#define _NSIG_BPW 32 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW) + +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} sigset_t; + +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT 6 +#define SIGBUS 7 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGUSR1 10 +#define SIGSEGV 11 +#define SIGUSR2 12 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGSTKFLT 16 +#define SIGCHLD 17 +#define SIGCONT 18 +#define SIGSTOP 19 +#define SIGTSTP 20 +#define SIGTTIN 21 +#define SIGTTOU 22 +#define SIGURG 23 +#define SIGXCPU 24 +#define SIGXFSZ 25 +#define SIGVTALRM 26 +#define SIGPROF 27 +#define SIGWINCH 28 +#define SIGIO 29 +#define SIGPOLL SIGIO +#define SIGPWR 30 +#define SIGSYS 31 +#define SIGUNUSED 31 + +#define SIGRTMIN 32 +#define SIGRTMAX _NSIG + +#include <asm-generic/signal-defs.h> + +struct siginfo; + +struct sigaction { + union { + __sighandler_t _sa_handler; + void (*_sa_sigaction)(int, struct siginfo *, void *); + } _u; + unsigned int sa_flags; + __sigrestore_t sa_restorer; + sigset_t sa_mask; /* mask last for extensibility */ +}; + +#define sa_handler _u._sa_handler +#define sa_sigaction _u._sa_sigaction #endif diff --git a/usr/include/arch/s390/klibc/archconfig.h b/usr/include/arch/s390/klibc/archconfig.h index b08bbb3f..52d324c9 100644 --- a/usr/include/arch/s390/klibc/archconfig.h +++ b/usr/include/arch/s390/klibc/archconfig.h @@ -16,5 +16,6 @@ #define _KLIBC_NEEDS_SA_RESTORER 1 /* Our restorer will call rt_sigreturn() */ #define _KLIBC_NEEDS_SA_SIGINFO 1 +#define _KLIBC_USE_RT_SIG 1 #endif /* _KLIBC_ARCHCONFIG_H */ diff --git a/usr/include/arch/s390/klibc/archsignal.h b/usr/include/arch/s390/klibc/archsignal.h index a79b166b..06c23960 100644 --- a/usr/include/arch/s390/klibc/archsignal.h +++ b/usr/include/arch/s390/klibc/archsignal.h @@ -8,8 +8,13 @@ #ifndef _KLIBC_ARCHSIGNAL_H #define _KLIBC_ARCHSIGNAL_H -#define NSIG 32 -typedef unsigned long sigset_t; +#define _NSIG 64 +#define _NSIG_BPW 64 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW) + +typedef struct { + unsigned long sig[_NSIG_WORDS]; +} sigset_t; #define SIGHUP 1 #define SIGINT 2