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>

+8 -4
+1 -3
arch/tile/include/arch/abi.h
··· 59 * The ABI requires callers to allocate a caller state save area of 60 * this many bytes at the bottom of each stack frame. 61 */ 62 - #ifdef __tile__ 63 - #define C_ABI_SAVE_AREA_SIZE (2 * __SIZEOF_POINTER__) 64 - #endif 65 66 /** 67 * The operand to an 'info' opcode directing the backtracer to not
··· 59 * The ABI requires callers to allocate a caller state save area of 60 * this many bytes at the bottom of each stack frame. 61 */ 62 + #define C_ABI_SAVE_AREA_SIZE (2 * (CHIP_WORD_SIZE() / 8)) 63 64 /** 65 * The operand to an 'info' opcode directing the backtracer to not
+4
arch/tile/include/asm/siginfo.h
··· 17 18 #define __ARCH_SI_TRAPNO 19 20 #include <asm-generic/siginfo.h> 21 22 /*
··· 17 18 #define __ARCH_SI_TRAPNO 19 20 + #ifdef __LP64__ 21 + # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 22 + #endif 23 + 24 #include <asm-generic/siginfo.h> 25 26 /*
+3 -1
arch/tile/kernel/compat_signal.c
··· 56 sigset_t uc_sigmask; /* mask last for extensibility */ 57 }; 58 59 struct compat_siginfo { 60 int si_signo; 61 int si_errno; 62 int si_code; 63 64 union { 65 - int _pad[SI_PAD_SIZE]; 66 67 /* kill() */ 68 struct {
··· 56 sigset_t uc_sigmask; /* mask last for extensibility */ 57 }; 58 59 + #define COMPAT_SI_PAD_SIZE ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int)) 60 + 61 struct compat_siginfo { 62 int si_signo; 63 int si_errno; 64 int si_code; 65 66 union { 67 + int _pad[COMPAT_SI_PAD_SIZE]; 68 69 /* kill() */ 70 struct {