public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix SH linuxthreads
@ 2004-04-20  4:00 Kaz Kojima
  2004-04-20  4:15 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Kaz Kojima @ 2004-04-20  4:00 UTC (permalink / raw)
  To: libc-hacker

Hi,

The appended patch is an SH-portion of the change of sysdep-cancel.h
for linuxthreads.  I've noticed also that I forgot to fix a silly bug
in CENABLE and CDISABLE which was fixed already in nptl.

Regards,
	kaz
--
2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Define
        for librt.  Save the return value to a safe register.
        (CDISABLE): Define for librt.  Set the function argument correctly.

diff -u3prN ORIG/libc/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h LOCAL/libc/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
--- ORIG/libc/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h	Thu Jul  3 13:49:24 2003
+++ LOCAL/libc/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h	Mon Apr 19 12:01:40 2004
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -101,25 +101,57 @@
 #  define __local_disable_asynccancel	__librt_disable_asynccancel
 # endif
 
-# define CENABLE \
+# if defined IS_IN_librt && defined PIC
+#  define CENABLE \
+	mov.l r12,@-r15; \
+	mov.l 1f,r12; \
+	mova 1f,r0; \
+	add r0,r12; \
+	mov.l 2f,r0; \
+	bsrf r0; \
+	 nop; \
+     0: bra 3f; \
+	 mov r0,r2; \
+	.align 2; \
+     1: .long _GLOBAL_OFFSET_TABLE_; \
+     2: .long __local_enable_asynccancel@PLT - (0b+2-.); \
+     3: mov.l @r15+,r12
+
+#  define CDISABLE \
+	mov.l r12,@-r15; \
+	mov.l 1f,r12; \
+	mova 1f,r0; \
+	add r0,r12; \
+	mov.l 2f,r0; \
+	bsrf r0; \
+	 mov r2,r4; \
+     0: bra 3f; \
+	 nop; \
+	.align 2; \
+     1: .long _GLOBAL_OFFSET_TABLE_; \
+     2: .long __local_disable_asynccancel@PLT - (0b+2-.); \
+     3: mov.l @r15+,r12
+# else
+#  define CENABLE \
 	mov.l 1f,r0; \
 	bsrf r0; \
 	 nop; \
      0: bra 2f; \
-	 nop; \
+	 mov r0,r2; \
 	.align 2; \
      1: .long __local_enable_asynccancel - 0b; \
      2:
 
-# define CDISABLE \
+#  define CDISABLE \
 	mov.l 1f,r0; \
 	bsrf r0; \
-	 nop; \
+	 mov r2,r4; \
      0: bra 2f; \
 	 nop; \
 	.align 2; \
      1: .long __local_disable_asynccancel - 0b; \
      2:
+# endif
 
 # ifndef __ASSEMBLER__
 #  if defined FLOATING_STACKS && USE___THREAD && defined PIC

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

* Re: [PATCH] Fix SH linuxthreads
  2004-04-20  4:00 [PATCH] Fix SH linuxthreads Kaz Kojima
@ 2004-04-20  4:15 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2004-04-20  4:15 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

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

end of thread, other threads:[~2004-04-20  4:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-20  4:00 [PATCH] Fix SH linuxthreads Kaz Kojima
2004-04-20  4:15 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).