aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-02-05 01:01:39 +0000
committerUlrich Drepper <drepper@redhat.com>2009-02-05 01:01:39 +0000
commit0899b8897c1bcec464c0e220dd118f293bab05eb (patch)
treea3c9ec843b443ac85b2b3bc23913385c498bd59b
parent22cc3f7580c97122906e147addbc798e43081079 (diff)
downloadglibc-0899b8897c1bcec464c0e220dd118f293bab05eb.tar
glibc-0899b8897c1bcec464c0e220dd118f293bab05eb.tar.gz
glibc-0899b8897c1bcec464c0e220dd118f293bab05eb.tar.bz2
glibc-0899b8897c1bcec464c0e220dd118f293bab05eb.zip
* sysdeps/sh/sh4/dl-trampoline.S: Only set HAVE_FPU if __SH_FPU_ANY__
is set. * sysdeps/sh/sh4/setjmp.S: Support SH4-NOFPU. * sysdeps/sh/sh4/__longjmp.S: Likewise. * sysdeps/unix/sysv/linux/sh/sh4/getcontext.S: Likewise. * sysdeps/unix/sysv/linux/sh/sh4/setcontext.S: Likewise. * sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S: Likewise. * sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Likewise.
-rw-r--r--ChangeLog11
-rw-r--r--sysdeps/sh/sh4/__longjmp.S7
-rw-r--r--sysdeps/sh/sh4/dl-trampoline.S4
-rw-r--r--sysdeps/sh/sh4/setjmp.S4
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/getcontext.S6
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/register-dump.h20
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/setcontext.S6
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S12
8 files changed, 50 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ac917298c..100de90670 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-02-03 Andrew Stubbs <ams@codesourcery.com>
+
+ * sysdeps/sh/sh4/dl-trampoline.S: Only set HAVE_FPU if __SH_FPU_ANY__
+ is set.
+ * sysdeps/sh/sh4/setjmp.S: Support SH4-NOFPU.
+ * sysdeps/sh/sh4/__longjmp.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sh4/getcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sh4/setcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S: Likewise.
+ * sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Likewise.
+
2009-02-04 Ulrich Drepper <drepper@redhat.com>
* po/ru.po: Update from translation team.
diff --git a/sysdeps/sh/sh4/__longjmp.S b/sysdeps/sh/sh4/__longjmp.S
index 320a7d11f7..2fd137bcba 100644
--- a/sysdeps/sh/sh4/__longjmp.S
+++ b/sysdeps/sh/sh4/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for SH.
- Copyright (C) 1999, 2000, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2005, 2006, 2009 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
@@ -52,6 +52,7 @@ ENTRY (__longjmp)
mov.l @r4+, r15
lds.l @r4+, pr
#endif
+#ifdef __SH_FPU_ANY__
ldc.l @r4+, gbr
lds.l @r4+, fpscr
fmov.s @r4+, fr12
@@ -59,4 +60,8 @@ ENTRY (__longjmp)
fmov.s @r4+, fr14
rts
fmov.s @r4+, fr15
+#else
+ rts
+ ldc.l @r4+, gbr
+#endif /* !__SH_FPU_ANY__ */
END (__longjmp)
diff --git a/sysdeps/sh/sh4/dl-trampoline.S b/sysdeps/sh/sh4/dl-trampoline.S
index f9529851a1..bd9bb7e5bd 100644
--- a/sysdeps/sh/sh4/dl-trampoline.S
+++ b/sysdeps/sh/sh4/dl-trampoline.S
@@ -1,2 +1,4 @@
-#define HAVE_FPU
+#ifdef __SH_FPU_ANY__
+# define HAVE_FPU
+#endif
#include <sysdeps/sh/dl-trampoline.S>
diff --git a/sysdeps/sh/sh4/setjmp.S b/sysdeps/sh/sh4/setjmp.S
index f9a4f0a8ce..03f0b08dcd 100644
--- a/sysdeps/sh/sh4/setjmp.S
+++ b/sysdeps/sh/sh4/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for SH4.
- Copyright (C) 1999, 2000, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2005, 2006, 2009 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
@@ -23,11 +23,13 @@
ENTRY (__sigsetjmp)
/* Save registers */
add #JB_SIZE, r4
+#ifdef __SH_FPU_ANY__
fmov.s fr15, @-r4
fmov.s fr14, @-r4
fmov.s fr13, @-r4
fmov.s fr12, @-r4
sts.l fpscr, @-r4
+#endif /* __SH_FPU_ANY__ */
stc.l gbr, @-r4
#ifdef PTR_MANGLE
sts pr, r2
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
index 68bc235bcf..3432dca5d1 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009 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
@@ -61,6 +61,7 @@ ENTRY(__getcontext)
mov.l r9, @-r0
mov.l r8, @-r0
+#ifdef __SH_FPU_ANY__
mov r4, r0
/* We need 2 add instruction because oFPUL+4 > 127. */
add #124,r0
@@ -101,6 +102,7 @@ ENTRY(__getcontext)
fmov.s fr2, @-r0
fmov.s fr1, @-r0
fmov.s fr0, @-r0
+#endif /* __SH_FPU_ANY__ */
/* sigprocmask (SIG_BLOCK, NULL, &uc->uc_sigmask). */
mov r4, r6
@@ -117,7 +119,7 @@ ENTRY(__getcontext)
not r1, r1 // r1=0 means r0 = -1 to -4095
tst r1, r1 // i.e. error in linux
bf .Lgetcontext_end
-.Lsyscall_error:
+.Lsyscall_error:
SYSCALL_ERROR_HANDLER
.Lgetcontext_end:
/* All done, return 0 for success. */
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
index d09ad2a373..e3c9c0e639 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
+++ b/sysdeps/unix/sysv/linux/sh/sh4/register-dump.h
@@ -1,5 +1,5 @@
/* Dump registers.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2009 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
@@ -31,15 +31,15 @@ MACL: XXXXXXXX MACH: XXXXXXXX
PC: XXXXXXXX PR: XXXXXXXX GBR: XXXXXXXX SR: XXXXXXXX
- FR0: XXXXXXXX FR1: XXXXXXXX FR2: XXXXXXXX FR3: XXXXXXXX
- FR4: XXXXXXXX FR5: XXXXXXXX FR6: XXXXXXXX FR7: XXXXXXXX
- FR8: XXXXXXXX FR9: XXXXXXXX FR10: XXXXXXXX FR11: XXXXXXXX
-FR12: XXXXXXXX FR13: XXXXXXXX FR14: XXXXXXXX FR15: XXXXXXXX
+ FR0: XXXXXXXX FR1: XXXXXXXX FR2: XXXXXXXX FR3: XXXXXXXX
+ FR4: XXXXXXXX FR5: XXXXXXXX FR6: XXXXXXXX FR7: XXXXXXXX
+ FR8: XXXXXXXX FR9: XXXXXXXX FR10: XXXXXXXX FR11: XXXXXXXX
+FR12: XXXXXXXX FR13: XXXXXXXX FR14: XXXXXXXX FR15: XXXXXXXX
- XR0: XXXXXXXX XR1: XXXXXXXX XR2: XXXXXXXX XR3: XXXXXXXX
- XR4: XXXXXXXX XR5: XXXXXXXX XR6: XXXXXXXX XR7: XXXXXXXX
- XR8: XXXXXXXX XR9: XXXXXXXX XR10: XXXXXXXX XR11: XXXXXXXX
-XR12: XXXXXXXX XR13: XXXXXXXX XR14: XXXXXXXX XR15: XXXXXXXX
+ XR0: XXXXXXXX XR1: XXXXXXXX XR2: XXXXXXXX XR3: XXXXXXXX
+ XR4: XXXXXXXX XR5: XXXXXXXX XR6: XXXXXXXX XR7: XXXXXXXX
+ XR8: XXXXXXXX XR9: XXXXXXXX XR10: XXXXXXXX XR11: XXXXXXXX
+XR12: XXXXXXXX XR13: XXXXXXXX XR14: XXXXXXXX XR15: XXXXXXXX
FPSCR: XXXXXXXX FPUL: XXXXXXXX
@@ -144,6 +144,7 @@ register_dump (int fd, struct sigcontext *ctx)
ADD_STRING ("\n");
+#ifdef __SH_FPU_ANY__
if (ctx->sc_ownedfp != NULL)
{
hexvalue (ctx->sc_fpregs[0], fpregs[0], 8);
@@ -253,6 +254,7 @@ register_dump (int fd, struct sigcontext *ctx)
ADD_STRING ("\n");
}
+#endif /* __SH_FPU_ANY__ */
/* Write the stuff out. */
writev (fd, iov, nr);
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
index 2bc546d1a1..48f6d4c721 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009 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
@@ -43,13 +43,14 @@ ENTRY(__setcontext)
not r1, r1 // r1=0 means r0 = -1 to -4095
tst r1, r1 // i.e. error in linux
bf .Lsetcontext_restore
-.Lsyscall_error:
+.Lsyscall_error:
SYSCALL_ERROR_HANDLER
.Lpseudo_end:
rts
nop
.Lsetcontext_restore:
+#ifdef __SH_FPU_ANY__
mov r8, r0
add #(oFR0),r0
fmov.s @r0+, fr0
@@ -88,6 +89,7 @@ ENTRY(__setcontext)
frchg
lds.l @r0+, fpscr
lds.l @r0+, fpul
+#endif /* __SH_FPU_ANY__ */
mov r8, r0
add #(oPC), r0
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
index 1aeca1b1a7..1f1b69baee 100644
--- a/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009 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
@@ -61,6 +61,7 @@ ENTRY(__swapcontext)
mov.l r9, @-r0
mov.l r8, @-r0
+#ifdef __SH_FPU_ANY__
mov r4, r0
/* We need 2 add instruction because oFPUL+4 >= 127. */
add #124,r0
@@ -101,6 +102,7 @@ ENTRY(__swapcontext)
fmov.s fr2, @-r0
fmov.s fr1, @-r0
fmov.s fr0, @-r0
+#endif /* __SH_FPU_ANY__ */
mov r5, r8
@@ -119,12 +121,13 @@ ENTRY(__swapcontext)
not r1, r1 // r1=0 means r0 = -1 to -4095
tst r1, r1 // i.e. error in linux
bf .Lswapcontext_restore
-.Lsyscall_error:
+.Lsyscall_error:
SYSCALL_ERROR_HANDLER
.Lpseudo_end:
rts
nop
-.Lswapcontext_restore:
+.Lswapcontext_restore:
+#ifdef __SH_FPU_ANY__
mov r8, r0
add #(oFR0),r0
fmov.s @r0+, fr0
@@ -163,6 +166,7 @@ ENTRY(__swapcontext)
frchg
lds.l @r0+, fpscr
lds.l @r0+, fpul
+#endif /* __SH_FPU_ANY__ */
mov r8, r0
add #(oPC), r0
@@ -208,7 +212,7 @@ ENTRY(__swapcontext)
mov.l @r15+, r0
jmp @r0
mov.l @r15+, r0
-
+
PSEUDO_END(__swapcontext)
weak_alias (__swapcontext, swapcontext)