From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3344 invoked by alias); 20 Apr 2004 04:00:46 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 3318 invoked from network); 20 Apr 2004 04:00:45 -0000 Received: from unknown (HELO r-rr.iij4u.or.jp) (210.130.0.76) by sources.redhat.com with SMTP; 20 Apr 2004 04:00:45 -0000 Received: from localhost (frgw.3in.ne.jp [210.251.121.226]) by r-rr.iij4u.or.jp (8.11.6+IIJ/8.11.6) with ESMTP id i3K40gu06521 for ; Tue, 20 Apr 2004 13:00:42 +0900 (JST) Date: Tue, 20 Apr 2004 04:00:00 -0000 Message-Id: <20040420.125734.35680772.kkojima@rr.iij4u.or.jp> To: libc-hacker@sources.redhat.com Subject: [PATCH] Fix SH linuxthreads From: Kaz Kojima Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00064.txt.bz2 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 * 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