[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] E500 port adjustments



I've applied this patch to make some adjustments to the E500 port.

* Roland requested changes to how the [gs]etcontext changes were done for 
the FSF submission 
<http://sourceware.org/ml/libc-ports/2007-03/msg00007.html>, so I've 
changed it along those lines in preparation for a revised FSF submission.

* I'd made some changes to use __NO_FPRS__ instead of _SOFT_FLOAT, but 
checking _SOFT_FLOAT as well allows things to work with users of pre-4.1 
compilers (such compilers can't be used to compile EGLIBC, but can be used 
to compile programs using its system headers).

Index: ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/swapcontext.S
===================================================================
--- ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/swapcontext.S	(revision 1997)
+++ ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/swapcontext.S	(working copy)
@@ -1,5 +1,5 @@
 /* Save current context and jump to a new context.
-   Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2007 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
@@ -28,7 +28,8 @@
 #define __CONTEXT_FUNC_NAME __swapcontext
 #undef __CONTEXT_ENABLE_FPRS
 #undef __CONTEXT_ENABLE_VRS
-#define __CONTEXT_EXTRA
+#include "getcontext-extra.S"
+#include "setcontext-extra.S"
 
 # include "swapcontext-common.S"
 
Index: ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext.S
===================================================================
--- ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext.S	(revision 1997)
+++ ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext.S	(working copy)
@@ -1,5 +1,5 @@
 /* Jump to a new context.
-   Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2007 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
@@ -28,7 +28,7 @@
 #define __CONTEXT_FUNC_NAME __setcontext
 #undef __CONTEXT_ENABLE_FPRS
 #undef __CONTEXT_ENABLE_VRS
-#define __CONTEXT_EXTRA
+#include "setcontext-extra.S"
 
 #include "setcontext-common.S"
 
Index: ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext-extra.S
===================================================================
--- ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext-extra.S	(revision 1997)
+++ ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext-extra.S	(working copy)
@@ -1,5 +1,5 @@
 /* Jump to a new context.  Support for restoring high parts of registers.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Joseph Myers <joseph@xxxxxxxxxxxxxxxx>, 2006.
 
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+.macro setcontext_extra
 	lwz	r3,_UC_VREGS+(0*4)(r31)
 	evmergelo	r0,r3,r0
 	lwz	r3,_UC_VREGS+(1*4)(r31)
@@ -88,3 +89,5 @@
 	evmergelo	r31,r3,r31
 	lwz	r3,_UC_VREGS+(32*4)(r31)
 	mtspefscr	r3
+.endm
+#define __SETCONTEXT_EXTRA setcontext_extra
Index: ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext.S
===================================================================
--- ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext.S	(revision 1997)
+++ ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext.S	(working copy)
@@ -1,5 +1,5 @@
 /* Save current context.
-   Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2007 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
@@ -28,7 +28,7 @@
 #define __CONTEXT_FUNC_NAME __getcontext
 #undef __CONTEXT_ENABLE_FPRS
 #undef __CONTEXT_ENABLE_VRS
-#define __CONTEXT_EXTRA
+#include "getcontext-extra.S"
 
 #include "getcontext-common.S"
 
Index: ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext-extra.S
===================================================================
--- ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext-extra.S	(revision 1997)
+++ ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext-extra.S	(working copy)
@@ -1,5 +1,5 @@
 /* Save current context.  Support for saving high parts of registers.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Joseph Myers <joseph@xxxxxxxxxxxxxxxx>, 2006.
 
@@ -21,6 +21,7 @@
 /* We follow the kernel's layout, which saves the high parts of the
    SPE registers in the vregs area, immediately followed by the
    SPEFSCR value.  */
+.macro getcontext_extra
 	la	r10,(_UC_VREGS)(r3)
 	evstwwe	r0,(0*4)(r10)
 	evstwwe	r1,(1*4)(r10)
@@ -56,3 +57,5 @@
 	evstwwe	r31,(31*4)(r10)
 	mfspefscr	r9
 	stw	r9,(32*4)(r10)
+.endm
+#define __GETCONTEXT_EXTRA getcontext_extra
Index: ports/ChangeLog.eglibc
===================================================================
--- ports/ChangeLog.eglibc	(revision 1997)
+++ ports/ChangeLog.eglibc	(working copy)
@@ -1,3 +1,16 @@
+2007-04-16  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext-extra.S:
+	Put contents in a gas macro.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext-extra.S:
+	Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/getcontext.S:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/setcontext.S:
+	Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/fpu/swapcontext.S:
+	Update.
+
 2006-03-28  Paul Brook  <paul@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/arm/machine-gmon.h (MCOUNT): Add Thumb-2 implementation.
Index: libc/sysdeps/powerpc/fpu/bits/fenvinline.h
===================================================================
--- libc/sysdeps/powerpc/fpu/bits/fenvinline.h	(revision 1997)
+++ libc/sysdeps/powerpc/fpu/bits/fenvinline.h	(working copy)
@@ -18,7 +18,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#if defined __GNUC__ && !defined __NO_FPRS__ && !defined __NO_MATH_INLINES
+#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__ \
+  && !defined __NO_MATH_INLINES
 
 /* Inline definition for fegetround.  */
 # define fegetround() \
Index: libc/sysdeps/powerpc/fpu/bits/mathinline.h
===================================================================
--- libc/sysdeps/powerpc/fpu/bits/mathinline.h	(revision 1997)
+++ libc/sysdeps/powerpc/fpu/bits/mathinline.h	(working copy)
@@ -28,7 +28,7 @@
 # define __MATH_INLINE __extern_inline
 #endif  /* __cplusplus */
 
-#if defined __GNUC__ && !defined __NO_FPRS__
+#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__
 
 #ifdef __USE_ISOC99
 # if !__GNUC_PREREQ (2,97)
Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
===================================================================
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S	(revision 1997)
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S	(working copy)
@@ -233,8 +233,8 @@
 	lfd	fp31,_UC_FREGS+(31*8)(r31)
 #endif /* __CONTEXT_ENABLE_FPRS */
 
-#ifdef __CONTEXT_EXTRA
-#include <setcontext-extra.S>
+#ifdef __SETCONTEXT_EXTRA
+	__SETCONTEXT_EXTRA
 #endif
 
 	/* Restore LR and CCR, and set CTR to the NIP value */
Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
===================================================================
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S	(revision 1997)
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S	(working copy)
@@ -270,8 +270,8 @@
 # endif /* __CONTEXT_ENABLE_VRS */
 #endif /* __CONTEXT_ENABLE_FPRS */
 
-#ifdef __CONTEXT_EXTRA
-#include <getcontext-extra.S>
+#ifdef __GETCONTEXT_EXTRA
+	__GETCONTEXT_EXTRA
 #endif
 
 /* Restore ucontext (parm1) from stack.  */
@@ -463,8 +463,8 @@
 	lfd	fp31,_UC_FREGS+(31*8)(r31)
 #endif /* __CONTEXT_ENABLE_FPRS */
 
-#ifdef __CONTEXT_EXTRA
-#include <setcontext-extra.S>
+#ifdef __SETCONTEXT_EXTRA
+	__SETCONTEXT_EXTRA
 #endif
 
 	/* Restore LR and CCR, and set CTR to the NIP value */
Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
===================================================================
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S	(revision 1997)
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S	(working copy)
@@ -268,8 +268,8 @@
 # endif
 #endif
 
-#ifdef __CONTEXT_EXTRA
-#include <getcontext-extra.S>
+#ifdef __GETCONTEXT_EXTRA
+	__GETCONTEXT_EXTRA
 #endif
 
 /* We need to set up parms and call sigprocmask which will clobber
Index: libc/ChangeLog.eglibc
===================================================================
--- libc/ChangeLog.eglibc	(revision 1997)
+++ libc/ChangeLog.eglibc	(working copy)
@@ -1,3 +1,16 @@
+2007-04-16  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/powerpc/fpu/bits/fenvinline.h: Test _SOFT_FLOAT together
+	with __NO_FPRS__.
+	* sysdeps/powerpc/fpu/bits/mathinline.h: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S:
+	Use __GETCONTEXT_EXTRA instead of __CONTEXT_EXTRA.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
+	Use __SETCONTEXT_EXTRA instead of __CONTEXT_EXTRA.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
+	Use __GETCONTEXT_EXTRA and __SETCONTEXT_EXTRA instead of
+	__CONTEXT_EXTRA.
+
 2007-04-13  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>
 
 	* EGLIBC.option-groups: Doc fixes.

-- 
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx