diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 08:32:21 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 08:32:21 -0400 |
commit | 32020effaf713c0c669864301bcd5dac6b9bb9e0 (patch) | |
tree | 86bca127e785fe2170bfec548ebc6be549a842b8 /arch | |
parent | 749dc6f252b57d5cb9c1f4c1c4aafe4c92a28207 (diff) |
arch/tile: Fix a couple of issues with the COMPAT code for TILE-Gx.
First, the siginfo preamble wasn't quite right; we need to indicate
that we are padding up to 4 ints of preamble for 64-bit code, and
then for compat mode we need to pad differently, using only 3 ints.
Second, the C ABI requires a save area of two registers, not two
pointers, since in compat mode we have 64-bit registers all of which
we need to save, even though we only have 32-bit VAs.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/tile/include/arch/abi.h | 4 | ||||
-rw-r--r-- | arch/tile/include/asm/siginfo.h | 4 | ||||
-rw-r--r-- | arch/tile/kernel/compat_signal.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/arch/tile/include/arch/abi.h b/arch/tile/include/arch/abi.h index da8df5b9d914..8affc76f771a 100644 --- a/arch/tile/include/arch/abi.h +++ b/arch/tile/include/arch/abi.h | |||
@@ -59,9 +59,7 @@ | |||
59 | * The ABI requires callers to allocate a caller state save area of | 59 | * The ABI requires callers to allocate a caller state save area of |
60 | * this many bytes at the bottom of each stack frame. | 60 | * this many bytes at the bottom of each stack frame. |
61 | */ | 61 | */ |
62 | #ifdef __tile__ | 62 | #define C_ABI_SAVE_AREA_SIZE (2 * (CHIP_WORD_SIZE() / 8)) |
63 | #define C_ABI_SAVE_AREA_SIZE (2 * __SIZEOF_POINTER__) | ||
64 | #endif | ||
65 | 63 | ||
66 | /** | 64 | /** |
67 | * The operand to an 'info' opcode directing the backtracer to not | 65 | * The operand to an 'info' opcode directing the backtracer to not |
diff --git a/arch/tile/include/asm/siginfo.h b/arch/tile/include/asm/siginfo.h index 0c12d1b9ddf2..56d661bb010b 100644 --- a/arch/tile/include/asm/siginfo.h +++ b/arch/tile/include/asm/siginfo.h | |||
@@ -17,6 +17,10 @@ | |||
17 | 17 | ||
18 | #define __ARCH_SI_TRAPNO | 18 | #define __ARCH_SI_TRAPNO |
19 | 19 | ||
20 | #ifdef __LP64__ | ||
21 | # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | ||
22 | #endif | ||
23 | |||
20 | #include <asm-generic/siginfo.h> | 24 | #include <asm-generic/siginfo.h> |
21 | 25 | ||
22 | /* | 26 | /* |
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index d5efb215dd5f..9c710db43f13 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
@@ -56,13 +56,15 @@ struct compat_ucontext { | |||
56 | sigset_t uc_sigmask; /* mask last for extensibility */ | 56 | sigset_t uc_sigmask; /* mask last for extensibility */ |
57 | }; | 57 | }; |
58 | 58 | ||
59 | #define COMPAT_SI_PAD_SIZE ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int)) | ||
60 | |||
59 | struct compat_siginfo { | 61 | struct compat_siginfo { |
60 | int si_signo; | 62 | int si_signo; |
61 | int si_errno; | 63 | int si_errno; |
62 | int si_code; | 64 | int si_code; |
63 | 65 | ||
64 | union { | 66 | union { |
65 | int _pad[SI_PAD_SIZE]; | 67 | int _pad[COMPAT_SI_PAD_SIZE]; |
66 | 68 | ||
67 | /* kill() */ | 69 | /* kill() */ |
68 | struct { | 70 | struct { |