linux-mips
[Top] [All Lists]

Re: [Patch] Fix lookup_dcookie for MIPS o32

To: David Daney <ddaney@avtrex.com>
Subject: Re: [Patch] Fix lookup_dcookie for MIPS o32
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 18 Oct 2005 12:45:26 +0100
Cc: oprofile-list@lists.sourceforge.net, linux-mips@linux-mips.org
In-reply-to: <17236.6951.865559.479107@dl2.hq2.avtrex.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <17236.6951.865559.479107@dl2.hq2.avtrex.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Mon, Oct 17, 2005 at 02:44:07PM -0700, David Daney wrote:

> This patch fixes the lookup_dcookie for the MIPS o32 ABI.  Although I
> only tested with little-endian, the big-endian case needed fixing as
> well but is untested (but what are the chances that this is not the
> correct fix?).
> 
> This is the only patch I needed to get the user space oprofile
> programs to work for mipsel-linux.
> 
> I am CCing the linux-mips list as this may be of interest there as well.

Good catch.

> 2005-10-17  David Daney  <ddaney@avtrex.com>
> 
>       * daemon/opd_cookie.c (lookup_dcookie): Handle MIPS o32 for both big
>       and little endian.
> 
> Index: oprofile/daemon/opd_cookie.c
> ===================================================================
> RCS file: /cvsroot/oprofile/oprofile/daemon/opd_cookie.c,v
> retrieving revision 1.19
> diff -p -a -u -r1.19 opd_cookie.c
> --- oprofile/daemon/opd_cookie.c      26 May 2005 00:00:02 -0000      1.19
> +++ oprofile/daemon/opd_cookie.c      17 Oct 2005 21:29:13 -0000
> @@ -60,12 +60,21 @@
>  #endif /* __NR_lookup_dcookie */
>  
>  #if (defined(__powerpc__) && !defined(__powerpc64__)) || defined(__hppa__)\
> -     || (defined(__s390__) && !defined(__s390x__))
> +     || (defined(__s390__) && !defined(__s390x__)) \
> +     || (defined(__mips__) && (_MIPS_SIM == _MIPS_SIM_ABI32) \
> +         && defined(_MIPSEB))

Small nit - please use __MIPSEB__ rsp. __MIPSEL__; I think there are
some compilers floating around that don't define the single underscore
variant.

Thanks,

  Ralf

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