linux-mips
[Top] [All Lists]

Re: [RFC] User stack pointer randomisation

To: Franck Bui-Huu <vagabon.xyz@gmail.com>
Subject: Re: [RFC] User stack pointer randomisation
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 19 Jul 2007 13:01:30 +0100
Cc: linux-mips <linux-mips@linux-mips.org>
In-reply-to: <cda58cb80707190447m1cd9b37fye7d330b50331b199@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <469F0E5F.4050005@innova-card.com> <20070719111440.GA19916@linux-mips.org> <cda58cb80707190447m1cd9b37fye7d330b50331b199@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.14 (2007-02-12)
On Thu, Jul 19, 2007 at 01:47:19PM +0200, Franck Bui-Huu wrote:

> this is weird I would have defined them like this instead:
> 
> #if (_MIPS_SIM == _MIPS_SIM_ABI32)
> #define ALSZ 8
> #elif (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
> #define ALSZ 16
> #endif
> 
> #define ALMASK (~(ALSZ-1))

<asm/asm.h> which is fairly similar to it's userspace equivalent <sys/asm.h>
contains definitions which are some sort of pseudo-standard in the MIPS
world, including ALSZ and ALMASK.  If I had choosen them I'd have set
ALSZ to 8 rsp. 16, just like you ...  Anyway, having similar macros makes
porting of assembler code easier.  This also is why <asm/regdef.h> and
<asm/fpregdef.h> are as they are.  RISC/os, IRIX, some of the BSD variants,
even the non-Linux SDE variants for example for baremetal use a similar
set of macros and headers.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>