signal.c (17deb9c2db01c7813611291d251d8c7dbdfd3c9d) signal.c (574e2b5111e13827da501771b27d92e6e3f2e3d7)
1/*
2 * linux/arch/arm/kernel/signal.c
3 *
4 * Copyright (C) 1995-2009 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.

--- 7 unchanged lines hidden (view full) ---

16
17#include <asm/elf.h>
18#include <asm/cacheflush.h>
19#include <asm/traps.h>
20#include <asm/ucontext.h>
21#include <asm/unistd.h>
22#include <asm/vfp.h>
23
1/*
2 * linux/arch/arm/kernel/signal.c
3 *
4 * Copyright (C) 1995-2009 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.

--- 7 unchanged lines hidden (view full) ---

16
17#include <asm/elf.h>
18#include <asm/cacheflush.h>
19#include <asm/traps.h>
20#include <asm/ucontext.h>
21#include <asm/unistd.h>
22#include <asm/vfp.h>
23
24/*
25 * For ARM syscalls, we encode the syscall number into the instruction.
26 */
27#define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE))
28#define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE))
24extern const unsigned long sigreturn_codes[7];
29
25
30/*
31 * With EABI, the syscall number has to be loaded into r7.
32 */
33#define MOV_R7_NR_SIGRETURN (0xe3a07000 | (__NR_sigreturn - __NR_SYSCALL_BASE))
34#define MOV_R7_NR_RT_SIGRETURN (0xe3a07000 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE))
35
36/*
37 * For Thumb syscalls, we pass the syscall number via r7. We therefore
38 * need two 16-bit instructions.
39 */
40#define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE))
41#define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE))
42
43static const unsigned long sigreturn_codes[7] = {
44 MOV_R7_NR_SIGRETURN, SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN,
45 MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN,
46};
47
48static unsigned long signal_return_offset;
49
50#ifdef CONFIG_CRUNCH
51static int preserve_crunch_context(struct crunch_sigframe __user *frame)
52{
53 char kbuf[sizeof(*frame) + 8];
54 struct crunch_sigframe *kframe;
55

--- 593 unchanged lines hidden ---
26static unsigned long signal_return_offset;
27
28#ifdef CONFIG_CRUNCH
29static int preserve_crunch_context(struct crunch_sigframe __user *frame)
30{
31 char kbuf[sizeof(*frame) + 8];
32 struct crunch_sigframe *kframe;
33

--- 593 unchanged lines hidden ---