Commit 32020eff authored by Chris Metcalf's avatar Chris Metcalf

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: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 749dc6f2
...@@ -59,9 +59,7 @@ ...@@ -59,9 +59,7 @@
* The ABI requires callers to allocate a caller state save area of * The ABI requires callers to allocate a caller state save area of
* this many bytes at the bottom of each stack frame. * this many bytes at the bottom of each stack frame.
*/ */
#ifdef __tile__ #define C_ABI_SAVE_AREA_SIZE (2 * (CHIP_WORD_SIZE() / 8))
#define C_ABI_SAVE_AREA_SIZE (2 * __SIZEOF_POINTER__)
#endif
/** /**
* The operand to an 'info' opcode directing the backtracer to not * The operand to an 'info' opcode directing the backtracer to not
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
#define __ARCH_SI_TRAPNO #define __ARCH_SI_TRAPNO
#ifdef __LP64__
# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
#endif
#include <asm-generic/siginfo.h> #include <asm-generic/siginfo.h>
/* /*
......
...@@ -56,13 +56,15 @@ struct compat_ucontext { ...@@ -56,13 +56,15 @@ struct compat_ucontext {
sigset_t uc_sigmask; /* mask last for extensibility */ sigset_t uc_sigmask; /* mask last for extensibility */
}; };
#define COMPAT_SI_PAD_SIZE ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int))
struct compat_siginfo { struct compat_siginfo {
int si_signo; int si_signo;
int si_errno; int si_errno;
int si_code; int si_code;
union { union {
int _pad[SI_PAD_SIZE]; int _pad[COMPAT_SI_PAD_SIZE];
/* kill() */ /* kill() */
struct { struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment