Introduce get_rt_sigframe_addr function

Add get_rt_sigframe_addr function for all supported architectures.
It is going to be used in a parser of rt_sigreturn syscall.

* defs.h (get_rt_sigframe_addr): New function prototype.
* rt_sigframe.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/aarch64/arch_rt_sigframe.c: New file.
* linux/alpha/arch_rt_sigframe.c: Likewise.
* linux/arc/arch_rt_sigframe.c: Likewise.
* linux/arm/arch_rt_sigframe.c: Likewise.
* linux/avr32/arch_rt_sigframe.c: Likewise.
* linux/bfin/arch_rt_sigframe.c: Likewise.
* linux/crisv10/arch_rt_sigframe.c: Likewise.
* linux/crisv32/arch_rt_sigframe.c: Likewise.
* linux/hppa/arch_rt_sigframe.c: Likewise.
* linux/i386/arch_rt_sigframe.c: Likewise.
* linux/ia64/arch_rt_sigframe.c: Likewise.
* linux/m68k/arch_rt_sigframe.c: Likewise.
* linux/metag/arch_rt_sigframe.c: Likewise.
* linux/microblaze/arch_rt_sigframe.c: Likewise.
* linux/mips/arch_rt_sigframe.c: Likewise.
* linux/nios2/arch_rt_sigframe.c: Likewise.
* linux/or1k/arch_rt_sigframe.c: Likewise.
* linux/powerpc/arch_rt_sigframe.c: Likewise.
* linux/powerpc64/arch_rt_sigframe.c: Likewise.
* linux/riscv/arch_rt_sigframe.c: Likewise.
* linux/s390/arch_rt_sigframe.c: Likewise.
* linux/s390x/arch_rt_sigframe.c: Likewise.
* linux/sh/arch_rt_sigframe.c: Likewise.
* linux/sh64/arch_rt_sigframe.c: Likewise.
* linux/sparc/arch_rt_sigframe.c: Likewise.
* linux/sparc64/arch_rt_sigframe.c: Likewise.
* linux/tile/arch_rt_sigframe.c: Likewise.
* linux/x32/arch_rt_sigframe.c: Likewise.
* linux/x86_64/arch_rt_sigframe.c: Likewise.
* linux/xtensa/arch_rt_sigframe.c: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
This commit is contained in:
Дмитрий Левин 2017-03-11 21:49:06 +00:00
parent 23f2891d4c
commit c57cf9acf5
33 changed files with 939 additions and 1 deletions

View File

@ -209,6 +209,7 @@ strace_SOURCES = \
regs.h \
renameat.c \
resource.c \
rt_sigframe.c \
rtc.c \
sched.c \
sched_attr.h \
@ -316,6 +317,7 @@ EXTRA_DIST = \
linux/64/syscallent.h \
linux/aarch64/arch_regs.c \
linux/aarch64/arch_regs.h \
linux/aarch64/arch_rt_sigframe.c\
linux/aarch64/arch_sigreturn.c \
linux/aarch64/errnoent1.h \
linux/aarch64/get_error.c \
@ -333,6 +335,7 @@ EXTRA_DIST = \
linux/alpha/arch_getrval2.c \
linux/alpha/arch_regs.c \
linux/alpha/arch_regs.h \
linux/alpha/arch_rt_sigframe.c \
linux/alpha/arch_sigreturn.c \
linux/alpha/errnoent.h \
linux/alpha/get_error.c \
@ -348,6 +351,7 @@ EXTRA_DIST = \
linux/alpha/userent.h \
linux/arc/arch_regs.c \
linux/arc/arch_regs.h \
linux/arc/arch_rt_sigframe.c \
linux/arc/get_error.c \
linux/arc/get_scno.c \
linux/arc/get_syscall_args.c \
@ -360,6 +364,7 @@ EXTRA_DIST = \
linux/arch_sigreturn.c \
linux/arm/arch_regs.c \
linux/arm/arch_regs.h \
linux/arm/arch_rt_sigframe.c \
linux/arm/arch_sigreturn.c \
linux/arm/get_error.c \
linux/arm/get_scno.c \
@ -372,6 +377,7 @@ EXTRA_DIST = \
linux/arm/userent.h \
linux/avr32/arch_regs.c \
linux/avr32/arch_regs.h \
linux/avr32/arch_rt_sigframe.c \
linux/avr32/get_error.c \
linux/avr32/get_scno.c \
linux/avr32/get_syscall_args.c \
@ -382,6 +388,7 @@ EXTRA_DIST = \
linux/avr32/syscallent.h \
linux/avr32/userent.h \
linux/bfin/arch_regs.c \
linux/bfin/arch_rt_sigframe.c \
linux/bfin/get_error.c \
linux/bfin/get_scno.c \
linux/bfin/get_syscall_args.c \
@ -394,6 +401,7 @@ EXTRA_DIST = \
linux/bfin/syscallent.h \
linux/bfin/userent.h \
linux/crisv10/arch_regs.c \
linux/crisv10/arch_rt_sigframe.c\
linux/crisv10/arch_sigreturn.c \
linux/crisv10/get_error.c \
linux/crisv10/get_scno.c \
@ -405,6 +413,7 @@ EXTRA_DIST = \
linux/crisv10/syscallent.h \
linux/crisv10/userent.h \
linux/crisv32/arch_regs.c \
linux/crisv32/arch_rt_sigframe.c\
linux/crisv32/arch_sigreturn.c \
linux/crisv32/get_error.c \
linux/crisv32/get_scno.c \
@ -420,6 +429,7 @@ EXTRA_DIST = \
linux/getregs_old.h \
linux/hppa/arch_regs.c \
linux/hppa/arch_regs.h \
linux/hppa/arch_rt_sigframe.c \
linux/hppa/errnoent.h \
linux/hppa/get_error.c \
linux/hppa/get_scno.c \
@ -434,6 +444,7 @@ EXTRA_DIST = \
linux/hppa/syscallent.h \
linux/i386/arch_regs.c \
linux/i386/arch_regs.h \
linux/i386/arch_rt_sigframe.c \
linux/i386/arch_sigreturn.c \
linux/i386/get_error.c \
linux/i386/get_scno.c \
@ -449,6 +460,7 @@ EXTRA_DIST = \
linux/ia64/arch_getrval2.c \
linux/ia64/arch_regs.c \
linux/ia64/arch_regs.h \
linux/ia64/arch_rt_sigframe.c \
linux/ia64/arch_sigreturn.c \
linux/ia64/get_error.c \
linux/ia64/get_scno.c \
@ -463,6 +475,7 @@ EXTRA_DIST = \
linux/inet_diag.h \
linux/m68k/arch_regs.c \
linux/m68k/arch_regs.h \
linux/m68k/arch_rt_sigframe.c \
linux/m68k/arch_sigreturn.c \
linux/m68k/get_error.c \
linux/m68k/get_scno.c \
@ -476,6 +489,7 @@ EXTRA_DIST = \
linux/m68k/userent.h \
linux/metag/arch_regs.c \
linux/metag/arch_regs.h \
linux/metag/arch_rt_sigframe.c \
linux/metag/get_error.c \
linux/metag/get_scno.c \
linux/metag/get_syscall_args.c \
@ -485,6 +499,7 @@ EXTRA_DIST = \
linux/metag/set_scno.c \
linux/metag/syscallent.h \
linux/microblaze/arch_regs.c \
linux/microblaze/arch_rt_sigframe.c\
linux/microblaze/arch_sigreturn.c \
linux/microblaze/get_error.c \
linux/microblaze/get_scno.c \
@ -499,6 +514,7 @@ EXTRA_DIST = \
linux/mips/arch_getrval2.c \
linux/mips/arch_regs.c \
linux/mips/arch_regs.h \
linux/mips/arch_rt_sigframe.c \
linux/mips/arch_sigreturn.c \
linux/mips/errnoent.h \
linux/mips/genstub.sh \
@ -521,6 +537,7 @@ EXTRA_DIST = \
linux/netlink_diag.h \
linux/nios2/arch_regs.c \
linux/nios2/arch_regs.h \
linux/nios2/arch_rt_sigframe.c \
linux/nios2/get_error.c \
linux/nios2/get_scno.c \
linux/nios2/get_syscall_args.c \
@ -531,6 +548,7 @@ EXTRA_DIST = \
linux/nios2/syscallent.h \
linux/or1k/arch_regs.c \
linux/or1k/arch_regs.h \
linux/or1k/arch_rt_sigframe.c \
linux/or1k/get_error.c \
linux/or1k/get_scno.c \
linux/or1k/get_syscall_args.c \
@ -543,6 +561,7 @@ EXTRA_DIST = \
linux/personality.h \
linux/powerpc/arch_regs.c \
linux/powerpc/arch_regs.h \
linux/powerpc/arch_rt_sigframe.c\
linux/powerpc/arch_sigreturn.c \
linux/powerpc/errnoent.h \
linux/powerpc/get_error.c \
@ -558,6 +577,7 @@ EXTRA_DIST = \
linux/powerpc/userent.h \
linux/powerpc64/arch_regs.c \
linux/powerpc64/arch_regs.h \
linux/powerpc64/arch_rt_sigframe.c\
linux/powerpc64/arch_sigreturn.c \
linux/powerpc64/errnoent.h \
linux/powerpc64/errnoent1.h \
@ -580,6 +600,7 @@ EXTRA_DIST = \
linux/ptp_clock.h \
linux/riscv/arch_regs.c \
linux/riscv/arch_regs.h \
linux/riscv/arch_rt_sigframe.c \
linux/riscv/errnoent1.h \
linux/riscv/get_error.c \
linux/riscv/get_scno.c \
@ -596,6 +617,7 @@ EXTRA_DIST = \
linux/rt_sigframe.h \
linux/s390/arch_regs.c \
linux/s390/arch_regs.h \
linux/s390/arch_rt_sigframe.c \
linux/s390/arch_sigreturn.c \
linux/s390/get_error.c \
linux/s390/get_scno.c \
@ -611,6 +633,7 @@ EXTRA_DIST = \
linux/s390/userent1.h \
linux/s390x/arch_regs.c \
linux/s390x/arch_regs.h \
linux/s390x/arch_rt_sigframe.c \
linux/s390x/arch_sigreturn.c \
linux/s390x/get_error.c \
linux/s390x/get_scno.c \
@ -624,6 +647,7 @@ EXTRA_DIST = \
linux/s390x/userent.h \
linux/sh/arch_getrval2.c \
linux/sh/arch_regs.c \
linux/sh/arch_rt_sigframe.c \
linux/sh/get_error.c \
linux/sh/get_scno.c \
linux/sh/get_syscall_args.c \
@ -637,6 +661,7 @@ EXTRA_DIST = \
linux/sh/userent0.h \
linux/sh64/arch_regs.c \
linux/sh64/arch_regs.h \
linux/sh64/arch_rt_sigframe.c \
linux/sh64/get_error.c \
linux/sh64/get_scno.c \
linux/sh64/get_syscall_args.c \
@ -653,6 +678,7 @@ EXTRA_DIST = \
linux/sparc/arch_getrval2.c \
linux/sparc/arch_regs.c \
linux/sparc/arch_regs.h \
linux/sparc/arch_rt_sigframe.c \
linux/sparc/arch_sigreturn.c \
linux/sparc/errnoent.h \
linux/sparc/gen.pl \
@ -670,6 +696,7 @@ EXTRA_DIST = \
linux/sparc64/arch_getrval2.c \
linux/sparc64/arch_regs.c \
linux/sparc64/arch_regs.h \
linux/sparc64/arch_rt_sigframe.c\
linux/sparc64/arch_sigreturn.c \
linux/sparc64/errnoent.h \
linux/sparc64/errnoent1.h \
@ -692,6 +719,7 @@ EXTRA_DIST = \
linux/syscall.h \
linux/tile/arch_regs.c \
linux/tile/arch_regs.h \
linux/tile/arch_rt_sigframe.c \
linux/tile/arch_sigreturn.c \
linux/tile/errnoent1.h \
linux/tile/get_error.c \
@ -714,6 +742,7 @@ EXTRA_DIST = \
linux/userent0.h \
linux/x32/arch_regs.c \
linux/x32/arch_regs.h \
linux/x32/arch_rt_sigframe.c \
linux/x32/arch_sigreturn.c \
linux/x32/errnoent1.h \
linux/x32/get_error.c \
@ -732,6 +761,7 @@ EXTRA_DIST = \
linux/x32/userent.h \
linux/x86_64/arch_regs.c \
linux/x86_64/arch_regs.h \
linux/x86_64/arch_rt_sigframe.c \
linux/x86_64/arch_sigreturn.c \
linux/x86_64/errnoent1.h \
linux/x86_64/errnoent2.h \
@ -757,6 +787,7 @@ EXTRA_DIST = \
linux/x86_64/syscallent2.h \
linux/x86_64/userent.h \
linux/xtensa/arch_regs.c \
linux/xtensa/arch_rt_sigframe.c \
linux/xtensa/get_error.c \
linux/xtensa/get_scno.c \
linux/xtensa/get_syscall_args.c \

4
defs.h
View File

@ -411,7 +411,9 @@ extern void call_summary(FILE *);
extern void clear_regs(void);
extern void get_regs(pid_t pid);
extern int get_scno(struct tcb *tcp);
extern int get_scno(struct tcb *);
extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
/**
* Convert syscall number to syscall name.
*

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#undef FUNC_GET_RT_SIGFRAME_ADDR
#define FUNC_GET_RT_SIGFRAME_ADDR \
static kernel_ulong_t arm_get_rt_sigframe_addr(struct tcb *tcp)
#include "arm/arch_rt_sigframe.c"
#undef FUNC_GET_RT_SIGFRAME_ADDR
#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
FUNC_GET_RT_SIGFRAME_ADDR
{
return tcp->currpers == 1 ? arm_get_rt_sigframe_addr(tcp)
: *aarch64_sp_ptr;
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, REG_FP, &addr) ? 0 : addr;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *arc_sp_ptr;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *arm_sp_ptr;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *avr32_sp_ptr;
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, PT_USP, &addr) ? 0 : addr;
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, 4 * PT_USP, &addr) ? 0 : addr;
}

View File

@ -0,0 +1 @@
#include "crisv10/arch_rt_sigframe.c"

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#include "rt_sigframe.h"
#define SIGFRAME (sizeof(long) * 16)
#define FUNCTIONCALLFRAME (sizeof(long) * 12)
#define RT_SIGFRAME_SIZE \
(((sizeof(struct_rt_sigframe) + FUNCTIONCALLFRAME)) & -SIGFRAME)
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, 4 * 30, &addr)
? 0 : (addr & ~1UL) - RT_SIGFRAME_SIZE;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *i386_esp_ptr - 4;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *ia64_frame_ptr + 16;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *m68k_usp_ptr - 4;
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#include "rt_sigframe.h"
FUNC_GET_RT_SIGFRAME_ADDR
{
return *metag_sp_ptr - sizeof(struct_rt_sigframe);
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, 4 * 1, &addr) ? 0 : addr;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return mips_REG_SP;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *nios2_sp_ptr;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *or1k_sp_ptr;
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#define SIGNAL_FRAMESIZE32 64
FUNC_GET_RT_SIGFRAME_ADDR
{
return ppc_regs.gpr[1] + SIGNAL_FRAMESIZE32 + 16;
}

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#undef FUNC_GET_RT_SIGFRAME_ADDR
#define FUNC_GET_RT_SIGFRAME_ADDR \
static kernel_ulong_t ppc_get_rt_sigframe_addr(struct tcb *tcp)
#include "powerpc/arch_rt_sigframe.c"
#undef FUNC_GET_RT_SIGFRAME_ADDR
#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
FUNC_GET_RT_SIGFRAME_ADDR
{
return tcp->currpers == 1
? ppc_get_rt_sigframe_addr(tcp) : ppc_regs.gpr[1];
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *riscv_sp_ptr;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return *s390_frame_ptr;
}

View File

@ -0,0 +1 @@
#include "s390/arch_rt_sigframe.c"

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, sizeof(long) * 15, &addr) ? 0 : addr;
}

View File

@ -0,0 +1 @@
#include "sh/arch_rt_sigframe.c"

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return sparc_regs.u_regs[U_REG_FP];
}

View File

@ -0,0 +1,34 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#define STACK_BIAS 2047
FUNC_GET_RT_SIGFRAME_ADDR
{
return tcp->currpers == 1 ? sparc_regs.u_regs[U_REG_FP] & 0xffffffffUL
: sparc_regs.u_regs[U_REG_FP] + STACK_BIAS;
}

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
return tile_regs.sp;
}

View File

@ -0,0 +1 @@
#include "x86_64/arch_rt_sigframe.c"

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#undef FUNC_GET_RT_SIGFRAME_ADDR
#define FUNC_GET_RT_SIGFRAME_ADDR \
static kernel_ulong_t i386_get_rt_sigframe_addr(struct tcb *tcp)
#include "i386/arch_rt_sigframe.c"
#undef FUNC_GET_RT_SIGFRAME_ADDR
#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
FUNC_GET_RT_SIGFRAME_ADDR
{
return tcp->currpers == 1 ? i386_get_rt_sigframe_addr(tcp)
: *x86_64_rsp_ptr - sizeof(kernel_ulong_t);
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
FUNC_GET_RT_SIGFRAME_ADDR
{
unsigned long addr;
return upeek(tcp->pid, REG_A_BASE + 3, &addr) ? 0 : addr;
}

36
rt_sigframe.c Normal file
View File

@ -0,0 +1,36 @@
/*
* Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
* 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.
*/
#include "defs.h"
#include "regs.h"
#include "ptrace.h"
#define DEF_FUNC_GET_RT_SIGFRAME_ADDR \
kernel_ulong_t get_rt_sigframe_addr(struct tcb *tcp)
#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
#include "arch_rt_sigframe.c"