Skip to content

Commit

Permalink
* sysdeps/unix/sysv/linux/sh/sysdep.h: Include tls.h.
Browse files Browse the repository at this point in the history
	(PTR_MANGLE, PTR_DEMANGLE): Define.
	(SYSCALL_ERROR_HANDLER): Fix typo.
	* sysdeps/sh/sh4/__longjmp.S: Use PTR_DEMANGLE if defined.
	* sysdeps/sh/sh3/__longjmp.S: Likewise.
	* sysdeps/sh/sh4/setjmp.S: Use PTR_MANGLE if defined.
	* sysdeps/sh/sh3/setjmp.S: Likewise.
  • Loading branch information
Ulrich Drepper committed Dec 20, 2005
1 parent 3525901 commit d9038ff
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 44 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2005-12-19 Kaz Kojima <kkojima@rr.iij4u.or.jp>

* sysdeps/unix/sysv/linux/sh/sysdep.h: Include tls.h.
(PTR_MANGLE, PTR_DEMANGLE): Define.
(SYSCALL_ERROR_HANDLER): Fix typo.
* sysdeps/sh/sh4/__longjmp.S: Use PTR_DEMANGLE if defined.
* sysdeps/sh/sh3/__longjmp.S: Likewise.
* sysdeps/sh/sh4/setjmp.S: Use PTR_MANGLE if defined.
* sysdeps/sh/sh3/setjmp.S: Likewise.

2005-12-20 Jakub Jelinek <jakub@redhat.com>

* sysdeps/ia64/fpu/libm-test-ulps: Update for GCC 4.1 prerelease.
Expand Down
1 change: 1 addition & 0 deletions nptl/sysdeps/sh/tcb-offsets.sym
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf)
MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads)
TLS_PRE_TCB_SIZE sizeof (struct pthread)
MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
POINTER_GUARD offsetof (tcbhead_t, pointer_guard)
15 changes: 14 additions & 1 deletion nptl/sysdeps/sh/tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ typedef union dtv
typedef struct
{
dtv_t *dtv;
void *private;
uintptr_t pointer_guard;
} tcbhead_t;

# define TLS_MULTIPLE_THREADS_IN_TCB 1
Expand Down Expand Up @@ -140,6 +140,19 @@ typedef struct
# define THREAD_SETMEM_NC(descr, member, idx, value) \
descr->member[idx] = (value)

#define THREAD_GET_POINTER_GUARD() \
({ tcbhead_t *__tcbp; \
__asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \
__tcbp->pointer_guard;})
#define THREAD_SET_POINTER_GUARD(value) \
({ tcbhead_t *__tcbp; \
__asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \
__tcbp->pointer_guard = (value);})
#define THREAD_COPY_POINTER_GUARD(descr) \
({ tcbhead_t *__tcbp; \
__asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \
((tcbhead_t *) (descr + 1))->pointer_guard = __tcbp->pointer_guard;})

#endif /* __ASSEMBLER__ */

#endif /* tls.h */
86 changes: 58 additions & 28 deletions sysdeps/ia64/fpu/libm-test-ulps
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ double: 1
float: 4
idouble: 1
ifloat: 4
ildouble: 1
ldouble: 1
ildouble: 6
ldouble: 6
Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
ildouble: 1
ldouble: 1
Expand Down Expand Up @@ -451,21 +451,26 @@ ifloat: 1
# j0
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
float: 2
idouble: 1
ifloat: 1
ifloat: 2
ildouble: 2
ldouble: 2
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
double: 2
double: 3
float: 1
idouble: 2
idouble: 3
ifloat: 1
ildouble: 1
ldouble: 1
Test "j0 (2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
float: 2
idouble: 1
ifloat: 1
ifloat: 2
ildouble: 2
ldouble: 2
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
Expand All @@ -488,21 +493,26 @@ idouble: 1
# jn
Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
float: 2
idouble: 1
ifloat: 1
ifloat: 2
ildouble: 2
ldouble: 2
Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
double: 2
double: 3
float: 1
idouble: 2
idouble: 3
ifloat: 1
ildouble: 1
ldouble: 1
Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
float: 2
idouble: 1
ifloat: 1
ifloat: 2
ildouble: 2
ldouble: 2
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
Expand Down Expand Up @@ -543,8 +553,8 @@ ifloat: 1
ildouble: 2
ldouble: 2
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
float: 3
ifloat: 3
float: 4
ifloat: 4
ildouble: 1
ldouble: 1
Test "jn (3, -1.0) == -0.0195633539826684059189053216217515083":
Expand All @@ -563,16 +573,16 @@ ildouble: 1
ldouble: 1
Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
double: 3
float: 1
float: 2
idouble: 3
ifloat: 1
ifloat: 2
ildouble: 1
ldouble: 1
Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
double: 1
float: 1
float: 2
idouble: 1
ifloat: 1
ifloat: 2
ildouble: 1
ldouble: 1

Expand Down Expand Up @@ -685,13 +695,20 @@ ldouble: 1

# y1
Test "y1 (0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
Test "y1 (10.0) == 0.249015424206953883923283474663222803":
double: 3
float: 1
idouble: 3
ifloat: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323";
float: 1
ifloat: 1
ildouble: 1
ldouble: 1
Test "y1 (2.0) == -0.107032431540937546888370772277476637":
double: 1
float: 1
Expand Down Expand Up @@ -737,13 +754,20 @@ ifloat: 1
ildouble: 1
ldouble: 1
Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
double: 3
float: 1
idouble: 3
ifloat: 1
Test "yn (1, 1.5) == -0.412308626973911295952829820633445323";
float: 1
ifloat: 1
ldouble: 1
ildouble: 1
Test "yn (1, 2.0) == -0.107032431540937546888370772277476637":
double: 1
float: 1
Expand All @@ -757,6 +781,8 @@ float: 2
idouble: 1
ifloat: 2
Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
double: 1
idouble: 1
ildouble: 2
ldouble: 2
Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
Expand All @@ -769,13 +795,17 @@ float: 2
ifloat: 2
Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
double: 2
float: 2
idouble: 2
ifloat: 2
Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
double: 3
float: 1
idouble: 3
ifloat: 1
Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
Expand Down Expand Up @@ -926,8 +956,8 @@ double: 2
float: 5
idouble: 2
ifloat: 5
ildouble: 3
ldouble: 3
ildouble: 6
ldouble: 6

Function: Imaginary part of "cpow":
double: 2
Expand Down Expand Up @@ -1028,10 +1058,10 @@ float: 1
ifloat: 1

Function: "j0":
double: 2
float: 1
idouble: 2
ifloat: 1
double: 3
float: 2
idouble: 3
ifloat: 2
ildouble: 2
ldouble: 2

Expand All @@ -1045,9 +1075,9 @@ ldouble: 1

Function: "jn":
double: 3
float: 3
float: 4
idouble: 3
ifloat: 3
ifloat: 4
ildouble: 2
ldouble: 2

Expand Down
12 changes: 9 additions & 3 deletions sysdeps/sh/sh3/__longjmp.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* longjmp for SH.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2005 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
Expand Down Expand Up @@ -32,13 +32,19 @@ ENTRY (__longjmp)
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
mov r5, r0 /* get the return value in place */
tst r0, r0
bf.s 1f
lds.l @r4+, pr
mov.l @r4+, r15
mov #1,r0 /* can't let setjmp() return zero! */
1:
#ifdef PTR_DEMANGLE
mov.l @r4+, r2
PTR_DEMANGLE (r2)
lds r2, pr
#else
lds.l @r4+, pr
#endif
rts
ldc.l @r4+, gbr
END (__longjmp)
18 changes: 15 additions & 3 deletions sysdeps/sh/sh3/setjmp.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* setjmp for SH3.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2005 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
Expand All @@ -26,7 +26,13 @@ ENTRY (__sigsetjmp)
/* Save registers */
add #(JB_SIZE - 4 * 5), r4
stc.l gbr, @-r4
#ifdef PTR_MANGLE
sts pr, r2
PTR_MANGLE (r2)
mov.l r2, @-r4
#else
sts.l pr, @-r4
#endif
mov.l r15, @-r4
mov.l r14, @-r4
mov.l r13, @-r4
Expand All @@ -36,8 +42,13 @@ ENTRY (__sigsetjmp)
mov.l r9, @-r4
mov.l r8, @-r4

#if defined NOT_IN_libc && defined IS_IN_rtld
/* In ld.so we never save the signal mask. */
rts
mov #0, r0
#else
/* Make a tail call to __sigjmp_save; it takes the same args. */
#ifdef SHARED
# ifdef SHARED
mov.l 1f, r1
mova 1f, r0
bra 2f
Expand All @@ -53,12 +64,13 @@ ENTRY (__sigsetjmp)
.align 2
.L1:
.long C_SYMBOL_NAME(__sigjmp_save@GOT)
#else
# else
mov.l .L1, r1
jmp @r1
nop
.align 2
.L1:
.long C_SYMBOL_NAME(__sigjmp_save)
# endif
#endif
END (__sigsetjmp)
12 changes: 9 additions & 3 deletions sysdeps/sh/sh4/__longjmp.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* longjmp for SH.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2005 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
Expand Down Expand Up @@ -32,13 +32,19 @@ ENTRY (__longjmp)
mov.l @r4+, r12
mov.l @r4+, r13
mov.l @r4+, r14
mov.l @r4+, r15
mov r5, r0 /* get the return value in place */
tst r0, r0
bf.s 1f
lds.l @r4+, pr
mov.l @r4+, r15
mov #1,r0 /* can't let setjmp() return zero! */
1:
#ifdef PTR_DEMANGLE
mov.l @r4+, r2
PTR_DEMANGLE (r2)
lds r2, pr
#else
lds.l @r4+, pr
#endif
ldc.l @r4+, gbr
lds.l @r4+, fpscr
fmov.s @r4+, fr12
Expand Down
Loading

0 comments on commit d9038ff

Please sign in to comment.