Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [Patch] Fix lookup_dcookie for MIPS o32
@ 2005-10-17 21:44 David Daney
  2005-10-18 11:45 ` Ralf Baechle
       [not found] ` <20051018115155.GD2656@linux-mips.org>
  0 siblings, 2 replies; 11+ messages in thread
From: David Daney @ 2005-10-17 21:44 UTC (permalink / raw)
  To: oprofile-list; +Cc: linux-mips


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.

David Daney.


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))
 static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
 {
 	return syscall(__NR_lookup_dcookie, (unsigned long)(cookie >> 32),
 		       (unsigned long)(cookie & 0xffffffff), buf, size);
 }
+#elif (defined(__mips__) && (_MIPS_SIM == _MIPS_SIM_ABI32)) /*_MIPSEL */
+static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
+{
+	return syscall(__NR_lookup_dcookie,
+		       (unsigned long)(cookie & 0xffffffff),
+		       (unsigned long)(cookie >> 32), buf, size);
+}
 #else
 static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
 {

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-10-19 16:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-17 21:44 [Patch] Fix lookup_dcookie for MIPS o32 David Daney
2005-10-18 11:45 ` Ralf Baechle
2005-10-18 23:24   ` John Levon
2005-10-18 23:35     ` David Daney
2005-10-18 23:36       ` John Levon
2005-10-19  9:07         ` Geert Uytterhoeven
2005-10-19 10:40           ` Ralf Baechle
2005-10-19 11:21             ` Geert Uytterhoeven
2005-10-19 15:48   ` Thiemo Seufer
2005-10-19 15:55     ` Ralf Baechle
     [not found] ` <20051018115155.GD2656@linux-mips.org>
     [not found]   ` <43551D21.3010500@avtrex.com>
     [not found]     ` <20051018202654.GB2659@linux-mips.org>
2005-10-19 16:13       ` David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox