From 23f2891d4c5f4c20f85215be95f5cdff6c0c4973 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 11 Mar 2017 21:26:22 +0000 Subject: [PATCH] Introduce struct_rt_sigframe type Add rt_sigframe.h files with definitions of struct_rt_sigframe type for all supported architectures. These definitions are going to be used in a parser of rt_sigreturn syscall. * linux/rt_sigframe.h: New file. * linux/bfin/rt_sigframe.h: Likewise. * linux/crisv10/rt_sigframe.h: Likewise. * linux/crisv32/rt_sigframe.h: Likewise. * linux/hppa/rt_sigframe.h: Likewise. * linux/i386/rt_sigframe.h: Likewise. * linux/ia64/rt_sigframe.h: Likewise. * linux/m68k/rt_sigframe.h: Likewise. * linux/mips/rt_sigframe.h: Likewise. * linux/powerpc64/rt_sigframe.h: Likewise. * linux/s390/rt_sigframe.h: Likewise. * linux/s390x/rt_sigframe.h: Likewise. * linux/sh64/rt_sigframe.h: Likewise. * linux/sparc/rt_sigframe.h: Likewise. * linux/sparc64/rt_sigframe.h: Likewise. * linux/tile/rt_sigframe.h: Likewise. * linux/x32/rt_sigframe.h: Likewise. * linux/x86_64/rt_sigframe.h: Likewise. * Makefile.am (EXTRA_DIST): Add them. --- Makefile.am | 18 +++++++++++++ linux/bfin/rt_sigframe.h | 42 +++++++++++++++++++++++++++++ linux/crisv10/rt_sigframe.h | 41 ++++++++++++++++++++++++++++ linux/crisv32/rt_sigframe.h | 1 + linux/hppa/rt_sigframe.h | 39 +++++++++++++++++++++++++++ linux/i386/rt_sigframe.h | 43 +++++++++++++++++++++++++++++ linux/ia64/rt_sigframe.h | 45 +++++++++++++++++++++++++++++++ linux/m68k/rt_sigframe.h | 43 +++++++++++++++++++++++++++++ linux/mips/rt_sigframe.h | 39 +++++++++++++++++++++++++++ linux/powerpc64/rt_sigframe.h | 42 +++++++++++++++++++++++++++++ linux/rt_sigframe.h | 41 ++++++++++++++++++++++++++++ linux/s390/rt_sigframe.h | 40 +++++++++++++++++++++++++++ linux/s390x/rt_sigframe.h | 1 + linux/sh64/rt_sigframe.h | 41 ++++++++++++++++++++++++++++ linux/sparc/rt_sigframe.h | 45 +++++++++++++++++++++++++++++++ linux/sparc64/rt_sigframe.h | 51 +++++++++++++++++++++++++++++++++++ linux/tile/rt_sigframe.h | 39 +++++++++++++++++++++++++++ linux/x32/rt_sigframe.h | 1 + linux/x86_64/rt_sigframe.h | 43 +++++++++++++++++++++++++++++ 19 files changed, 655 insertions(+) create mode 100644 linux/bfin/rt_sigframe.h create mode 100644 linux/crisv10/rt_sigframe.h create mode 100644 linux/crisv32/rt_sigframe.h create mode 100644 linux/hppa/rt_sigframe.h create mode 100644 linux/i386/rt_sigframe.h create mode 100644 linux/ia64/rt_sigframe.h create mode 100644 linux/m68k/rt_sigframe.h create mode 100644 linux/mips/rt_sigframe.h create mode 100644 linux/powerpc64/rt_sigframe.h create mode 100644 linux/rt_sigframe.h create mode 100644 linux/s390/rt_sigframe.h create mode 100644 linux/s390x/rt_sigframe.h create mode 100644 linux/sh64/rt_sigframe.h create mode 100644 linux/sparc/rt_sigframe.h create mode 100644 linux/sparc64/rt_sigframe.h create mode 100644 linux/tile/rt_sigframe.h create mode 100644 linux/x32/rt_sigframe.h create mode 100644 linux/x86_64/rt_sigframe.h diff --git a/Makefile.am b/Makefile.am index c023a84e..23da49b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -388,6 +388,7 @@ EXTRA_DIST = \ linux/bfin/get_syscall_result.c \ linux/bfin/ioctls_arch0.h \ linux/bfin/ioctls_inc0.h \ + linux/bfin/rt_sigframe.h \ linux/bfin/set_error.c \ linux/bfin/set_scno.c \ linux/bfin/syscallent.h \ @@ -398,6 +399,7 @@ EXTRA_DIST = \ linux/crisv10/get_scno.c \ linux/crisv10/get_syscall_args.c \ linux/crisv10/get_syscall_result.c \ + linux/crisv10/rt_sigframe.h \ linux/crisv10/set_error.c \ linux/crisv10/set_scno.c \ linux/crisv10/syscallent.h \ @@ -408,6 +410,7 @@ EXTRA_DIST = \ linux/crisv32/get_scno.c \ linux/crisv32/get_syscall_args.c \ linux/crisv32/get_syscall_result.c \ + linux/crisv32/rt_sigframe.h \ linux/crisv32/set_error.c \ linux/crisv32/set_scno.c \ linux/crisv32/syscallent.h \ @@ -424,6 +427,7 @@ EXTRA_DIST = \ linux/hppa/get_syscall_result.c \ linux/hppa/ioctls_arch0.h \ linux/hppa/ioctls_inc0.h \ + linux/hppa/rt_sigframe.h \ linux/hppa/set_error.c \ linux/hppa/set_scno.c \ linux/hppa/signalent.h \ @@ -436,6 +440,7 @@ EXTRA_DIST = \ linux/i386/get_syscall_args.c \ linux/i386/ioctls_arch0.h \ linux/i386/ioctls_inc0.h \ + linux/i386/rt_sigframe.h \ linux/i386/set_error.c \ linux/i386/set_scno.c \ linux/i386/syscallent.h \ @@ -450,6 +455,7 @@ EXTRA_DIST = \ linux/ia64/get_syscall_args.c \ linux/ia64/ioctls_arch0.h \ linux/ia64/ioctls_inc0.h \ + linux/ia64/rt_sigframe.h \ linux/ia64/set_error.c \ linux/ia64/set_scno.c \ linux/ia64/syscallent.h \ @@ -463,6 +469,7 @@ EXTRA_DIST = \ linux/m68k/get_syscall_args.c \ linux/m68k/ioctls_arch0.h \ linux/m68k/ioctls_inc0.h \ + linux/m68k/rt_sigframe.h \ linux/m68k/set_error.c \ linux/m68k/set_scno.c \ linux/m68k/syscallent.h \ @@ -500,6 +507,7 @@ EXTRA_DIST = \ linux/mips/get_syscall_args.c \ linux/mips/ioctls_arch0.h \ linux/mips/ioctls_inc0.h \ + linux/mips/rt_sigframe.h \ linux/mips/set_error.c \ linux/mips/set_scno.c \ linux/mips/signalent.h \ @@ -562,6 +570,7 @@ EXTRA_DIST = \ linux/powerpc64/ioctls_arch1.h \ linux/powerpc64/ioctls_inc0.h \ linux/powerpc64/ioctls_inc1.h \ + linux/powerpc64/rt_sigframe.h \ linux/powerpc64/set_error.c \ linux/powerpc64/set_scno.c \ linux/powerpc64/signalent1.h \ @@ -584,6 +593,7 @@ EXTRA_DIST = \ linux/riscv/signalent1.h \ linux/riscv/syscallent.h \ linux/riscv/syscallent1.h \ + linux/rt_sigframe.h \ linux/s390/arch_regs.c \ linux/s390/arch_regs.h \ linux/s390/arch_sigreturn.c \ @@ -592,6 +602,7 @@ EXTRA_DIST = \ linux/s390/get_syscall_args.c \ linux/s390/ioctls_arch0.h \ linux/s390/ioctls_inc0.h \ + linux/s390/rt_sigframe.h \ linux/s390/set_error.c \ linux/s390/set_scno.c \ linux/s390/syscallent.h \ @@ -606,6 +617,7 @@ EXTRA_DIST = \ linux/s390x/get_syscall_args.c \ linux/s390x/ioctls_arch0.h \ linux/s390x/ioctls_inc0.h \ + linux/s390x/rt_sigframe.h \ linux/s390x/set_error.c \ linux/s390x/set_scno.c \ linux/s390x/syscallent.h \ @@ -631,6 +643,7 @@ EXTRA_DIST = \ linux/sh64/get_syscall_result.c \ linux/sh64/ioctls_arch0.h \ linux/sh64/ioctls_inc0.h \ + linux/sh64/rt_sigframe.h \ linux/sh64/set_error.c \ linux/sh64/set_scno.c \ linux/sh64/syscallent.h \ @@ -648,6 +661,7 @@ EXTRA_DIST = \ linux/sparc/get_syscall_args.c \ linux/sparc/ioctls_arch0.h \ linux/sparc/ioctls_inc0.h \ + linux/sparc/rt_sigframe.h \ linux/sparc/set_error.c \ linux/sparc/set_scno.c \ linux/sparc/signalent.h \ @@ -666,6 +680,7 @@ EXTRA_DIST = \ linux/sparc64/ioctls_arch1.h \ linux/sparc64/ioctls_inc0.h \ linux/sparc64/ioctls_inc1.h \ + linux/sparc64/rt_sigframe.h \ linux/sparc64/set_error.c \ linux/sparc64/set_scno.c \ linux/sparc64/signalent.h \ @@ -686,6 +701,7 @@ EXTRA_DIST = \ linux/tile/ioctls_arch1.h \ linux/tile/ioctls_inc0.h \ linux/tile/ioctls_inc1.h \ + linux/tile/rt_sigframe.h \ linux/tile/set_error.c \ linux/tile/set_scno.c \ linux/tile/signalent1.h \ @@ -707,6 +723,7 @@ EXTRA_DIST = \ linux/x32/ioctls_arch1.h \ linux/x32/ioctls_inc0.h \ linux/x32/ioctls_inc1.h \ + linux/x32/rt_sigframe.h \ linux/x32/set_error.c \ linux/x32/set_scno.c \ linux/x32/signalent1.h \ @@ -730,6 +747,7 @@ EXTRA_DIST = \ linux/x86_64/ioctls_inc0.h \ linux/x86_64/ioctls_inc1.h \ linux/x86_64/ioctls_inc2.h \ + linux/x86_64/rt_sigframe.h \ linux/x86_64/set_error.c \ linux/x86_64/set_scno.c \ linux/x86_64/signalent1.h \ diff --git a/linux/bfin/rt_sigframe.h b/linux/bfin/rt_sigframe.h new file mode 100644 index 00000000..7b63cb12 --- /dev/null +++ b/linux/bfin/rt_sigframe.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + int sig; + siginfo_t *pinfo; + void *puc; + char retcode[8]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/crisv10/rt_sigframe.h b/linux/crisv10/rt_sigframe.h new file mode 100644 index 00000000..6080baef --- /dev/null +++ b/linux/crisv10/rt_sigframe.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + siginfo_t *pinfo; + void *puc; + siginfo_t info; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/crisv32/rt_sigframe.h b/linux/crisv32/rt_sigframe.h new file mode 100644 index 00000000..bfe07d4b --- /dev/null +++ b/linux/crisv32/rt_sigframe.h @@ -0,0 +1 @@ +#include "crisv10/rt_sigframe.h" diff --git a/linux/hppa/rt_sigframe.h b/linux/hppa/rt_sigframe.h new file mode 100644 index 00000000..56b3bdbf --- /dev/null +++ b/linux/hppa/rt_sigframe.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + unsigned int tramp[9]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/i386/rt_sigframe.h b/linux/i386/rt_sigframe.h new file mode 100644 index 00000000..9157ea43 --- /dev/null +++ b/linux/i386/rt_sigframe.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + uint32_t pretcode; + int sig; + uint32_t pinfo; + uint32_t puc; + siginfo_t info; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/ia64/rt_sigframe.h b/linux/ia64/rt_sigframe.h new file mode 100644 index 00000000..954237f3 --- /dev/null +++ b/linux/ia64/rt_sigframe.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + unsigned long arg0; + unsigned long arg1; + unsigned long arg2; + void *handler; + siginfo_t info; + struct sigcontext sc; +} struct_rt_sigframe; + +#define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, sc.sc_mask) + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/m68k/rt_sigframe.h b/linux/m68k/rt_sigframe.h new file mode 100644 index 00000000..6bb909c4 --- /dev/null +++ b/linux/m68k/rt_sigframe.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + char *pretcode; + int sig; + siginfo_t *pinfo; + void *puc; + char retcode[8]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/mips/rt_sigframe.h b/linux/mips/rt_sigframe.h new file mode 100644 index 00000000..e07bcd14 --- /dev/null +++ b/linux/mips/rt_sigframe.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + uint32_t pad[6]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/powerpc64/rt_sigframe.h b/linux/powerpc64/rt_sigframe.h new file mode 100644 index 00000000..979dbd7d --- /dev/null +++ b/linux/powerpc64/rt_sigframe.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __powerpc64__ +# include "../rt_sigframe.h" +#else +# ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +# endif /* !STRACE_RT_SIGFRAME_H */ +#endif /* !__powerpc64__ */ diff --git a/linux/rt_sigframe.h b/linux/rt_sigframe.h new file mode 100644 index 00000000..04b895bf --- /dev/null +++ b/linux/rt_sigframe.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +/* This is a generic definition for compatible architectures. */ + +typedef struct { + siginfo_t info; + ucontext_t uc; + /* more data might follow */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/s390/rt_sigframe.h b/linux/s390/rt_sigframe.h new file mode 100644 index 00000000..7e8743e9 --- /dev/null +++ b/linux/s390/rt_sigframe.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + uint8_t callee_used_stack[__SIGNAL_FRAMESIZE]; + uint16_t svc_insn; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/s390x/rt_sigframe.h b/linux/s390x/rt_sigframe.h new file mode 100644 index 00000000..fc9b2247 --- /dev/null +++ b/linux/s390x/rt_sigframe.h @@ -0,0 +1 @@ +#include "s390/rt_sigframe.h" diff --git a/linux/sh64/rt_sigframe.h b/linux/sh64/rt_sigframe.h new file mode 100644 index 00000000..6080baef --- /dev/null +++ b/linux/sh64/rt_sigframe.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + siginfo_t *pinfo; + void *puc; + siginfo_t info; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/sparc/rt_sigframe.h b/linux/sparc/rt_sigframe.h new file mode 100644 index 00000000..ef44e5c9 --- /dev/null +++ b/linux/sparc/rt_sigframe.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include "ptrace.h" +#include + +typedef struct { + struct sparc_stackf ss; + siginfo_t info; + struct pt_regs regs; + sigset_t mask; + /* more data follows */ +} struct_rt_sigframe; + +#define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, mask) + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/sparc64/rt_sigframe.h b/linux/sparc64/rt_sigframe.h new file mode 100644 index 00000000..285801a4 --- /dev/null +++ b/linux/sparc64/rt_sigframe.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __arch64__ +# include "sparc/rt_sigframe.h" +#else +# ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include "ptrace.h" +# include + +typedef struct { + struct sparc_stackf ss; + siginfo_t info; + struct pt_regs regs; + void *fpu_save; + stack_t stack; + sigset_t mask; + /* more data follows */ +} struct_rt_sigframe; + +# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, mask) + +# endif /* !STRACE_RT_SIGFRAME_H */ +#endif /* __arch64__ */ diff --git a/linux/tile/rt_sigframe.h b/linux/tile/rt_sigframe.h new file mode 100644 index 00000000..e8adf1ef --- /dev/null +++ b/linux/tile/rt_sigframe.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef STRACE_RT_SIGFRAME_H +#define STRACE_RT_SIGFRAME_H + +#include + +typedef struct { + unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/x32/rt_sigframe.h b/linux/x32/rt_sigframe.h new file mode 100644 index 00000000..8452e890 --- /dev/null +++ b/linux/x32/rt_sigframe.h @@ -0,0 +1 @@ +#include "x86_64/rt_sigframe.h" diff --git a/linux/x86_64/rt_sigframe.h b/linux/x86_64/rt_sigframe.h new file mode 100644 index 00000000..36655a40 --- /dev/null +++ b/linux/x86_64/rt_sigframe.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef __i386__ +# include "i386/rt_sigframe.h" +#else +# ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + kernel_ulong_t pretcode; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +# endif /* !STRACE_RT_SIGFRAME_H */ +#endif /* !__i386__ */ -- 2.50.1