From d143075adc1b95a2760fa9d81c9de39b0b803091 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Tue, 2 Feb 2010 16:40:28 -0500 Subject: [PATCH] Update __set_cr27() to mark r31 clobbered. The function __set_cr27() uses the `ble` instruction without marking the link register r31 as clobbered. This change adds r31 to the list of clobbers. The TLS thread register is cr27 and is set by calling __set_cr27(). --- ChangeLog.hppa | 5 +++++ sysdeps/hppa/nptl/tls.h | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog.hppa b/ChangeLog.hppa index ef389099c3..4ddd2c353c 100644 --- a/ChangeLog.hppa +++ b/ChangeLog.hppa @@ -1,5 +1,10 @@ 2010-02-02 Carlos O'Donell + * sysdeps/hppa/nptl/tls.h (__set_cr27): Clobber + link register r31. + +2010-02-02 Carlos O'Donell + * sysdeps/unix/sysv/linux/hppa/makecontext.c (__makecontext): Support more than 8 arguments. diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h index 2810d713fd..389cbb9494 100644 --- a/sysdeps/hppa/nptl/tls.h +++ b/sysdeps/hppa/nptl/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/hppa version. - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2010 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 @@ -140,11 +140,13 @@ static inline struct pthread *__get_cr27(void) return (struct pthread *) cr27; } +/* We write to cr27, clobber r26 as the input argument, and clobber + r31 as the link register. */ static inline void __set_cr27(struct pthread *cr27) { asm ( "ble 0xe0(%%sr2, %%r0)\n\t" "copy %0, %%r26" - : : "r" (cr27) : "r26" ); + : : "r" (cr27) : "r26", "r31" ); } /* Get and set the global scope generation counter in struct pthread. */ -- 2.11.4.GIT