From 5a6a773f6c388e7740afb495fcd03d3b500f30cb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 28 Mar 2006 09:36:28 +0000 Subject: Updated to fedora-glibc-20060328T0900 --- sysdeps/ieee754/ldbl-128ibm/s_llrintl.c | 168 ++++++++++++--------- sysdeps/ieee754/ldbl-128ibm/s_llroundl.c | 158 +++++++++---------- sysdeps/powerpc/powerpc32/fpu/fprsave.S | 18 +++ sysdeps/powerpc/powerpc32/gprsave0.S | 19 +++ sysdeps/powerpc/powerpc64/dl-trampoline.S | 2 + sysdeps/powerpc/powerpc64/fpu/s_llrintl.S | 94 ------------ sysdeps/powerpc/powerpc64/fpu/s_llroundl.S | 167 -------------------- sysdeps/powerpc/powerpc64/fpu/s_lrintl.S | 2 - sysdeps/powerpc/powerpc64/fpu/s_lroundl.S | 2 - sysdeps/powerpc/powerpc64/memcpy.S | 3 +- sysdeps/sparc/sparc32/bits/atomic.h | 2 +- sysdeps/sparc/sparc32/sparcv9/bits/atomic.h | 4 +- sysdeps/sparc/sparc64/bits/atomic.h | 6 +- sysdeps/unix/sysv/linux/alpha/getcontext.S | 4 +- sysdeps/unix/sysv/linux/bits/poll.h | 6 +- sysdeps/unix/sysv/linux/kernel-features.h | 39 ++--- .../linux/powerpc/powerpc32/setcontext-common.S | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 4 + .../unix/sysv/linux/powerpc/powerpc64/getcontext.S | 1 + .../unix/sysv/linux/powerpc/powerpc64/setcontext.S | 4 + .../sysv/linux/powerpc/powerpc64/swapcontext.S | 5 + sysdeps/unix/sysv/linux/sparc/bits/poll.h | 9 +- 22 files changed, 265 insertions(+), 453 deletions(-) delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_llrintl.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_llroundl.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_lrintl.S delete mode 100644 sysdeps/powerpc/powerpc64/fpu/s_lroundl.S (limited to 'sysdeps') diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c index bacf1bee0d..7228489098 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c @@ -22,6 +22,7 @@ when it's coded in C. */ #include +#include #include #include #include @@ -36,89 +37,114 @@ __llrintl (x) long double x; #endif { - static const double TWO52 = 4503599627370496.0L; - union ibm_extended_long_double u; - long long result = __LONG_LONG_MAX__; + double xh, xl; + long long res, hi, lo; + int save_round; - u.d = x; + ldbl_unpack (x, &xh, &xl); - if (fabs (u.dd[0]) < TWO52) + /* Limit the range of values handled by the conversion to long long. + We do this because we aren't sure whether that conversion properly + raises FE_INVALID. */ + if (__builtin_expect + ((__builtin_fabs (xh) <= -(double) (-__LONG_LONG_MAX__ - 1)), 1) +#if !defined (FE_INVALID) + || 1 +#endif + ) { - double high = u.dd[0]; - if (high > 0.0) - { - high += TWO52; - high -= TWO52; - if (high == -0.0) high = 0.0; - } - else if (high < 0.0) + save_round = fegetround (); + + if (__builtin_expect ((xh == -(double) (-__LONG_LONG_MAX__ - 1)), 0)) { - high -= TWO52; - high += TWO52; - if (high == 0.0) high = -0.0; + /* When XH is 9223372036854775808.0, converting to long long will + overflow, resulting in an invalid operation. However, XL might + be negative and of sufficient magnitude that the overall long + double is in fact in range. Avoid raising an exception. In any + case we need to convert this value specially, because + the converted value is not exactly represented as a double + thus subtracting HI from XH suffers rounding error. */ + hi = __LONG_LONG_MAX__; + xh = 1.0; } - result = high; - } - else if (fabs (u.dd[1]) < TWO52 && u.dd[1] != 0.0) - { - double high, low, tau; - long long lowint; - /* In this case we have to round the low double and handle any - adjustment to the high double that may be caused by rounding - (up). This is complicated by the fact that the high double - may already be rounded and the low double may have the - opposite sign to compensate. */ - if (u.dd[0] > 0.0) + else { - if (u.dd[1] > 0.0) - { - /* If the high/low doubles are the same sign then simply - round the low double. */ - high = u.dd[0]; - low = u.dd[1]; - } - else if (u.dd[1] < 0.0) - { - /* Else the high double is pre rounded and we need to - adjust for that. */ - - tau = nextafter (u.dd[0], 0.0); - tau = (u.dd[0] - tau) * 2.0; - high = u.dd[0] - tau; - low = u.dd[1] + tau; - } - low += TWO52; - low -= TWO52; + hi = (long long) xh; + xh -= hi; } - else if (u.dd[0] < 0.0) + ldbl_canonicalize (&xh, &xl); + + lo = (long long) xh; + + /* Peg at max/min values, assuming that the above conversions do so. + Strictly speaking, we can return anything for values that overflow, + but this is more useful. */ + res = hi + lo; + + /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */ + if (__builtin_expect (((~(hi ^ lo) & (res ^ hi)) < 0), 0)) + goto overflow; + + xh -= lo; + ldbl_canonicalize (&xh, &xl); + + hi = res; + switch (save_round) { - if (u.dd[1] < 0.0) - { - /* If the high/low doubles are the same sign then simply - round the low double. */ - high = u.dd[0]; - low = u.dd[1]; - } - else if (u.dd[1] > 0.0) - { - /* Else the high double is pre rounded and we need to - adjust for that. */ - tau = nextafter (u.dd[0], 0.0); - tau = (u.dd[0] - tau) * 2.0; - high = u.dd[0] - tau; - low = u.dd[1] + tau; - } - low = TWO52 - low; - low = -(low - TWO52); + case FE_TONEAREST: + if (fabs (xh) < 0.5 + || (fabs (xh) == 0.5 + && ((xh > 0.0 && xl < 0.0) + || (xh < 0.0 && xl > 0.0) + || (xl == 0.0 && (res & 1) == 0)))) + return res; + + if (xh < 0.0) + res -= 1; + else + res += 1; + break; + + case FE_TOWARDZERO: + if (res > 0 && (xh < 0.0 || (xh == 0.0 && xl < 0.0))) + res -= 1; + else if (res < 0 && (xh > 0.0 || (xh == 0.0 && xl > 0.0))) + res += 1; + return res; + break; + + case FE_UPWARD: + if (xh > 0.0 || (xh == 0.0 && xl > 0.0)) + res += 1; + break; + + case FE_DOWNWARD: + if (xh < 0.0 || (xh == 0.0 && xl < 0.0)) + res -= 1; + break; } - lowint = low; - result = high; - result += lowint; + + if (__builtin_expect (((~(hi ^ (res - hi)) & (res ^ hi)) < 0), 0)) + goto overflow; + + return res; } else - result = u.dd[0]; + { + if (xh > 0.0) + hi = __LONG_LONG_MAX__; + else if (xh < 0.0) + hi = -__LONG_LONG_MAX__ - 1; + else + /* Nan */ + hi = 0; + } - return result; +overflow: +#ifdef FE_INVALID + feraiseexcept (FE_INVALID); +#endif + return hi; } long_double_symbol (libm, __llrintl, llrintl); diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c index 567e7ecc07..103529d5a1 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c @@ -22,12 +22,11 @@ when it's coded in C. */ #include -#include +#include #include #include #include - #ifdef __STDC__ long long __llroundl (long double x) @@ -37,92 +36,95 @@ __llroundl (x) long double x; #endif { - static const double TWO52 = 4503599627370496.0; - static const double HALF = 0.5; - int mode = fegetround(); - union ibm_extended_long_double u; - long long result = __LONG_LONG_MAX__; - - u.d = x; - - if (fabs (u.dd[0]) < TWO52) - { - fesetround(FE_TOWARDZERO); - if (u.dd[0] > 0.0) + double xh, xl; + long long res, hi, lo; + + ldbl_unpack (x, &xh, &xl); + + /* Limit the range of values handled by the conversion to long long. + We do this because we aren't sure whether that conversion properly + raises FE_INVALID. */ + if (__builtin_expect + ((__builtin_fabs (xh) <= -(double) (-__LONG_LONG_MAX__ - 1)), 1) +#if !defined (FE_INVALID) + || 1 +#endif + ) + { + if (__builtin_expect ((xh == -(double) (-__LONG_LONG_MAX__ - 1)), 0)) { - u.dd[0] += HALF; - u.dd[0] += TWO52; - u.dd[0] -= TWO52; + /* When XH is 9223372036854775808.0, converting to long long will + overflow, resulting in an invalid operation. However, XL might + be negative and of sufficient magnitude that the overall long + double is in fact in range. Avoid raising an exception. In any + case we need to convert this value specially, because + the converted value is not exactly represented as a double + thus subtracting HI from XH suffers rounding error. */ + hi = __LONG_LONG_MAX__; + xh = 1.0; } - else if (u.dd[0] < 0.0) + else { - u.dd[0] = TWO52 - (u.dd[0] - HALF); - u.dd[0] = -(u.dd[0] - TWO52); + hi = (long long) xh; + xh -= hi; } - fesetround(mode); - result = u.dd[0]; - } - else if (fabs (u.dd[1]) < TWO52 && u.dd[1] != 0.0) - { - double high, low; - long long lowint; - /* In this case we have to round the low double and handle any - adjustment to the high double that may be caused by rounding - (up). This is complicated by the fact that the high double - may already be rounded and the low double may have the - opposite sign to compensate. */ - if (u.dd[0] > 0.0) + ldbl_canonicalize (&xh, &xl); + + lo = (long long) xh; + + /* Peg at max/min values, assuming that the above conversions do so. + Strictly speaking, we can return anything for values that overflow, + but this is more useful. */ + res = hi + lo; + + /* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */ + if (__builtin_expect (((~(hi ^ lo) & (res ^ hi)) < 0), 0)) + goto overflow; + + xh -= lo; + ldbl_canonicalize (&xh, &xl); + + hi = res; + if (xh > 0.5) + { + res += 1; + } + else if (xh == 0.5) { - if (u.dd[1] > 0.0) - { - /* If the high/low doubles are the same sign then simply - round the low double. */ - high = u.dd[0]; - low = u.dd[1]; - } - else if (u.dd[1] < 0.0) - { - /* Else the high double is pre rounded and we need to - adjust for that. */ - high = nextafter (u.dd[0], 0.0); - low = u.dd[1] + (u.dd[0] - high); - } - fesetround(FE_TOWARDZERO); - low += HALF; - low += TWO52; - low -= TWO52; + if (xl > 0.0 || (xl == 0.0 && res >= 0)) + res += 1; } - else if (u.dd[0] < 0.0) + else if (-xh > 0.5) { - if (u.dd[1] < 0.0) - { - /* If the high/low doubles are the same sign then simply - round the low double. */ - high = u.dd[0]; - low = u.dd[1]; - } - else if (u.dd[1] > 0.0) - { - /* Else the high double is pre rounded and we need to - adjust for that. */ - high = nextafter (u.dd[0], 0.0); - low = u.dd[1] + (u.dd[0] - high); - } - fesetround(FE_TOWARDZERO); - low -= HALF; - low = TWO52 - low; - low = -(low - TWO52); + res -= 1; } - fesetround(mode); - lowint = low; - result = high; - result += lowint; + else if (-xh == 0.5) + { + if (xl < 0.0 || (xl == 0.0 && res <= 0)) + res -= 1; + } + + if (__builtin_expect (((~(hi ^ (res - hi)) & (res ^ hi)) < 0), 0)) + goto overflow; + + return res; } else - { - result = u.dd[0]; - } - return result; + { + if (xh > 0.0) + hi = __LONG_LONG_MAX__; + else if (xh < 0.0) + hi = -__LONG_LONG_MAX__ - 1; + else + /* Nan */ + hi = 0; + } + +overflow: +#ifdef FE_INVALID + feraiseexcept (FE_INVALID); +#endif + return hi; } long_double_symbol (libm, __llroundl, llroundl); diff --git a/sysdeps/powerpc/powerpc32/fpu/fprsave.S b/sysdeps/powerpc/powerpc32/fpu/fprsave.S index 597c3e611f..c05178775d 100644 --- a/sysdeps/powerpc/powerpc32/fpu/fprsave.S +++ b/sysdeps/powerpc/powerpc32/fpu/fprsave.S @@ -27,68 +27,86 @@ ENTRY(_savefpr_all) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_14) C_TEXT(_savef14): C_TEXT(_savefpr_14): stfd fp14,-144(r1) + cfi_offset(fp14,-144) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef15) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_15) C_TEXT(_savef15): C_TEXT(_savefpr_15): stfd fp15,-136(r1) + cfi_offset(fp15,-136) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef16) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_16) C_TEXT(_savef16): C_TEXT(_savefpr_16): stfd fp16,-128(r1) + cfi_offset(fp16,-128) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef17) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_17) C_TEXT(_savef17): C_TEXT(_savefpr_17): stfd fp17,-120(r1) + cfi_offset(fp17,-120) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef18) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_18) C_TEXT(_savef18): C_TEXT(_savefpr_18): stfd fp18,-112(r1) + cfi_offset(fp18,-112) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef19) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_19) C_TEXT(_savef19): C_TEXT(_savefpr_19): stfd fp19,-104(r1) + cfi_offset(fp19,-104) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef20) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_20) C_TEXT(_savef20): C_TEXT(_savefpr_20): stfd fp20,-96(r1) + cfi_offset(fp20,-96) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef21) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_21) C_TEXT(_savef21): C_TEXT(_savefpr_21): stfd fp21,-88(r1) + cfi_offset(fp21,-88) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef22) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_22) C_TEXT(_savef22): C_TEXT(_savefpr_22): stfd fp22,-80(r1) + cfi_offset(fp22,-80) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef23) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_23) C_TEXT(_savef23): C_TEXT(_savefpr_23): stfd fp23,-72(r1) + cfi_offset(fp23,-72) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef24) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_24) C_TEXT(_savef24): C_TEXT(_savefpr_24): stfd fp24,-64(r1) + cfi_offset(fp24,-64) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef25) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_25) C_TEXT(_savef25): C_TEXT(_savefpr_25): stfd fp25,-56(r1) + cfi_offset(fp25,-56) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef26) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_26) C_TEXT(_savef26): C_TEXT(_savefpr_26): stfd fp26,-48(r1) + cfi_offset(fp26,-48) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef27) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_27) C_TEXT(_savef27): C_TEXT(_savefpr_27): stfd fp27,-40(r1) + cfi_offset(fp27,-40) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef28) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_28) C_TEXT(_savef28): C_TEXT(_savefpr_28): stfd fp28,-32(r1) + cfi_offset(fp28,-32) ASM_GLOBAL_DIRECTIVE C_TEXT(_savef29) ASM_GLOBAL_DIRECTIVE C_TEXT(_savefpr_29) C_TEXT(_savef29): C_TEXT(_savefpr_29): stfd fp29,-24(r1) #save f29 stfd fp30,-16(r1) #save f30 stfd fp31,-8(r1) #save f31 + cfi_offset(fp29,-24) + cfi_offset(fp30,-16) + cfi_offset(fp31,-8) stw r0,8(r1) #save LR in callers frame blr #return END (_savefpr_all) diff --git a/sysdeps/powerpc/powerpc32/gprsave0.S b/sysdeps/powerpc/powerpc32/gprsave0.S index 8b81647dd7..c74272b56d 100644 --- a/sysdeps/powerpc/powerpc32/gprsave0.S +++ b/sysdeps/powerpc/powerpc32/gprsave0.S @@ -30,40 +30,59 @@ ENTRY(_savegpr0_all) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_13) C_TEXT(_savegpr0_13): stw r13,-76(r1) + cfi_offset(r13,-76) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_14) C_TEXT(_savegpr0_14): stw r14,-72(r1) + cfi_offset(r14,-72) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_15) C_TEXT(_savegpr0_15): stw r15,-68(r1) + cfi_offset(r15,-68) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_16) C_TEXT(_savegpr0_16): stw r16,-64(r1) + cfi_offset(r16,-64) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_17) C_TEXT(_savegpr0_17): stw r17,-60(r1) + cfi_offset(r17,-60) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_18) C_TEXT(_savegpr0_18): stw r18,-56(r1) + cfi_offset(r18,-56) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_19) C_TEXT(_savegpr0_19): stw r19,-52(r1) + cfi_offset(r19,-52) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_20) C_TEXT(_savegpr0_20): stw r20,-48(r1) + cfi_offset(r20,-48) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_21) C_TEXT(_savegpr0_21): stw r21,-44(r1) + cfi_offset(r21,-44) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_22) C_TEXT(_savegpr0_22): stw r22,-40(r1) + cfi_offset(r22,-40) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_23) C_TEXT(_savegpr0_23): stw r23,-36(r1) + cfi_offset(r23,-36) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_24) C_TEXT(_savegpr0_24): stw r24,-32(r1) + cfi_offset(r24,-32) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_25) C_TEXT(_savegpr0_25): stw r25,-28(r1) + cfi_offset(r25,-28) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_26) C_TEXT(_savegpr0_26): stw r26,-24(r1) + cfi_offset(r26,-24) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_27) C_TEXT(_savegpr0_27): stw r27,-20(r1) + cfi_offset(r27,-20) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_28) C_TEXT(_savegpr0_28): stw r28,-16(r1) + cfi_offset(r28,-16) ASM_GLOBAL_DIRECTIVE C_TEXT(_savegpr0_29) C_TEXT(_savegpr0_29): stw r29,-12(r1) #save r29 stw r30,-8(r1) #save r30 stw r31,-4(r1) #save r31 + cfi_offset(r29,-12) + cfi_offset(r30,-8) + cfi_offset(r31,-4) stw r0,8(r1) #save LR in callers frame blr #return END (_savegpr0_all) diff --git a/sysdeps/powerpc/powerpc64/dl-trampoline.S b/sysdeps/powerpc/powerpc64/dl-trampoline.S index c5afe5a3fa..9ca394dda2 100644 --- a/sysdeps/powerpc/powerpc64/dl-trampoline.S +++ b/sysdeps/powerpc/powerpc64/dl-trampoline.S @@ -176,7 +176,9 @@ EALIGN(_dl_profile_resolve, 4, 0) /* Spill r30, r31 to preserve the link_map* and reloc_addr, in case we need to call _dl_call_pltexit. */ std r31,-8(r1) + cfi_offset(r31,-8) std r30,-16(r1) + cfi_offset(r30,-16) /* We need to save the registers used to pass parameters, ie. r3 thru r10; the registers are saved in a stack frame. */ stdu r1,-FRAME_SIZE(r1) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llrintl.S b/sysdeps/powerpc/powerpc64/fpu/s_llrintl.S deleted file mode 100644 index aa487775d4..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_llrintl.S +++ /dev/null @@ -1,94 +0,0 @@ -/* Round long double to long int. - IBM extended format long double version. - Copyright (C) 2004,2006 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - - .section ".toc","aw" -.LC0: /* 2**52 */ - .tc FD_43300000_0[TC],0x4330000000000000 -.LC1: /* 2**63 */ - .tc FD_43E00000_0[TC],0x43e0000000000000 - .section ".text" - -/* long long int[r3] __llrintl (long double x[fp1,fp2]) */ -ENTRY (__llrintl) - lfd fp13,.LC0@toc(2) - lfd fp10,.LC1@toc(2) - fabs fp0,fp1 - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ - fcmpu cr6,fp0,fp10 /* if (fabs(x) > TWO63) */ - beq- cr6,.L2 - fctid fp11,fp1 /* must delay this opperation to here */ - fctid fp12,fp2 /* and avoid setting "invalid operation". */ - li r0,0 - stfd fp11,-16(r1) - bgt- cr6,.L9 /* if > TWO63 return "invalid operation". */ - ble+ cr7,.L9 /* If < TWO52 only thy high double is used. */ - stfd fp12,-8(r1) - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop -.L8: - ld r0,-8(r1) -.L9: - ld r3,-16(r1) - add r3,r3,r0 - blr - -/* The high double is >= TWO63 so it looks like we are "out of range". - But this may be caused by rounding of the high double and the - negative low double may bring it back into range. So we need to - de-round the high double and invert the low double without changing - the effective long double value. To do this we compute a special - value (tau) that we can subtract from the high double and add to - the low double before conversion. The resulting integers can be - summed to get the total value. - - tau = floor(x_high/TWO52); - x0 = x_high - tau; - x1 = x_low + tau; */ -.L2: - fdiv fp8,fp1,fp13 /* x_high/TWO52 */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ - fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ - fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ - fctid fp11,fp3 - fctid fp12,fp4 - stfd fp11,-16(r1) - stfd fp12,-8(r1) - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop - ld r3,-16(r1) - ld r0,-8(r1) - addo. r3,r3,r0 - bnslr+ cr0 /* if the sum does not overflow, return. */ - fctid fp11,fp1 /* Otherwise we want to set "invalid operation". */ - li r0,0 - stfd fp11,-16(r1) - b .L9 - -END (__llrintl) - -strong_alias (__llrintl, __lrintl) -long_double_symbol (libm, __llrintl, llrintl) -long_double_symbol (libm, __lrintl, lrintl) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_llroundl.S b/sysdeps/powerpc/powerpc64/fpu/s_llroundl.S deleted file mode 100644 index 29eca11093..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_llroundl.S +++ /dev/null @@ -1,167 +0,0 @@ -/* llroundl function. - IBM extended format long double version. - Copyright (C) 2004, 2006 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - - .section ".toc","aw" -.LC0: /* 0.0 */ - .tc FD_00000000_0[TC],0x0000000000000000 -.LC1: /* 0.5 */ - .tc FD_3fe00000_0[TC],0x3fe0000000000000 -.LC2: /* 2**52 */ - .tc FD_43300000_0[TC],0x4330000000000000 -.LC3: /* 2**63 */ - .tc FD_43E00000_0[TC],0x43e0000000000000 - .section ".text" - -/* long long [r3] llround (long double x [fp1,fp2]) - IEEE 1003.1 llroundl function. IEEE specifies "round to the nearest - integer value, rounding halfway cases away from zero, regardless of - the current rounding mode." However PowerPC Architecture defines - "round to Nearest" as "Choose the best approximation. In case of a - tie, choose the one that is even (least significant bit o).". - So we can't use the PowerPC "round to Nearest" mode. Instead we set - "round toward Zero" mode and round by adding +-0.5 before rounding - toward zero. The "Floating Convert To Integer Doubleword with round - toward zero" instruction handles the conversion including the - overflow cases and signalling "Invalid Operation". - - PowerPC64 long double uses the IBM extended format which is - represented two 64-floating point double values. The values are - non-overlapping giving an effective precision of 106 bits. The first - double contains the high order bits of mantisa and is always rounded - to represent a normal rounding of long double to double. Since the - long double value is sum of the high and low values, the low double - normally has the opposite sign to compensate for the this rounding. - - For long double there is 4 cases: - 1) |x| < 2**52, all the integer bits are in the high double. - Round and convert the high double to long long. - 2) 2**52 <= |x|< 2**63, Still fits but need bits from both doubles. - Round the low double, convert both, then sum the long long values. - 3) |x| == 2**63, Looks like an overflow but may not be due to rounding - of the high double. - See the description following lable L2. - 4) |x| > 2**63, This will overflow the 64-bit signed integer. - Treat like case #1. The fctidz instruction will generate the - appropriate and signal "invalid operation". - - */ - -ENTRY (__llroundl) - mffs fp7 /* Save current FPU rounding mode. */ - fabs fp0,fp1 - lfd fp13,.LC2@toc(2) /* 2**52 */ - lfd fp12,.LC3@toc(2) /* 2**63 */ - lfd fp11,.LC0@toc(2) /* 0.0 */ - lfd fp10,.LC1@toc(2) /* 0.5 */ - fabs fp9,fp2 - fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ - fcmpu cr6,fp1,fp11 /* if (x > 0.0) */ - bnl- cr7,.L2 - mtfsfi 7,1 /* Set rounding mode toward 0. */ - ble- cr6,.L1 - fadd fp9,fp1,fp10 /* x+= 0.5; */ - b .L0 -.L1: - fsub fp9,fp1,fp10 /* x-= 0.5; */ -.L0: - fctid fp0,fp9 - stfd fp0,-16(r1) - mtfsf 0x01,fp7 /* restore previous rounding mode. */ - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop - ld r3,-16(r1) - blr - -/* The high double is > TWO52 so we need to round the low double and - perhaps the high double. In this case we have to round the low - double and handle any adjustment to the high double that may be - caused by rounding (up). This is complicated by the fact that the - high double may already be rounded and the low double may have the - opposite sign to compensate.This gets a bit tricky so we use the - following algorithm: - - tau = trunc(x_high/TWO52); - x0 = x_high - tau; - x1 = x_low + tau; - r1 = round(x1); - y_high = x0 + r1; - y_low = x0 - y_high + r1; - return y; */ -.L2: - fcmpu cr7,fp0,fp12 /* if (|x_high| > TWO63) */ - fcmpu cr0,fp9,fp11 /* || (|x_low| == 0.0) */ - fmr fp9,fp1 - fcmpu cr5,fp2,fp11 /* if (x_low > 0.0) */ - bgt- cr7,.L0 /* return llround(x); */ - mtfsfi 7,1 /* Set rounding mode toward 0. */ - fdiv fp8,fp1,fp13 /* x_high/TWO52 */ - - bng- cr6,.L6 /* if (x > 0.0) */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = trunc(x_high/TWO52); */ - bng cr5,.L4 /* if (x_low > 0.0) */ - fmr fp3,fp1 - fmr fp4,fp2 - b .L5 -.L4: /* if (x_low < 0.0) */ - fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ - fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ -.L5: - fadd fp5,fp4,fp10 /* r1 = x1 + 0.5; */ - b .L9 -.L6: /* if (x < 0.0) */ - fctidz fp0,fp8 - fcfid fp8,fp0 /* tau = trunc(x_high/TWO52); */ - bnl cr5,.L7 /* if (x_low < 0.0) */ - fmr fp3,fp1 - fmr fp4,fp2 - b .L8 -.L7: /* if (x_low > 0.0) */ - fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ - fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ -.L8: - fsub fp5,fp4,fp10 /* r1 = x1 - 0.5; */ -.L9: - fctid. fp11,fp3 - fctid fp12,fp5 - stfd fp11,-16(r1) - stfd fp12,-8(r1) - mtfsf 0x01,fp7 /* restore previous rounding mode. */ - nop /* Insure the following load is in a different dispatch group */ - nop /* to avoid pipe stall on POWER4&5. */ - nop - ld r3,-16(r1) - bunlr cr1 /* if not overflow, return. */ - ld r0,-8(r1) - addo. r3,r3,r0 - bnslr cr0 - fmr fp9,fp12 - bng cr6,.L0 - fneg fp9,fp12 - b .L0 -END (__llroundl) - -strong_alias (__llroundl, __lroundl) -long_double_symbol (libm, __llroundl, llroundl) -long_double_symbol (libm, __lroundl, lroundl) diff --git a/sysdeps/powerpc/powerpc64/fpu/s_lrintl.S b/sysdeps/powerpc/powerpc64/fpu/s_lrintl.S deleted file mode 100644 index 6c82d2e222..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_lrintl.S +++ /dev/null @@ -1,2 +0,0 @@ -/* __lrintl is in s_llrintl.c */ -/* __lrintl is in s_llrintl.c */ diff --git a/sysdeps/powerpc/powerpc64/fpu/s_lroundl.S b/sysdeps/powerpc/powerpc64/fpu/s_lroundl.S deleted file mode 100644 index b24dfd8ded..0000000000 --- a/sysdeps/powerpc/powerpc64/fpu/s_lroundl.S +++ /dev/null @@ -1,2 +0,0 @@ -/* __lroundl is in s_llroundl.S */ -/* __lroundl is in s_llroundl.S */ diff --git a/sysdeps/powerpc/powerpc64/memcpy.S b/sysdeps/powerpc/powerpc64/memcpy.S index 9df5bb42b6..f395de9066 100644 --- a/sysdeps/powerpc/powerpc64/memcpy.S +++ b/sysdeps/powerpc/powerpc64/memcpy.S @@ -1,5 +1,5 @@ /* Optimized memcpy implementation for PowerPC64. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 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,6 +43,7 @@ EALIGN (BP_SYM (memcpy), 5, 0) neg 0,3 std 3,-16(1) std 31,-8(1) + cfi_offset(31,-8) andi. 11,3,7 /* check alignement of dst. */ clrldi 0,0,61 /* Number of bytes until the 1st doubleword of dst. */ clrldi 10,4,61 /* check alignement of src. */ diff --git a/sysdeps/sparc/sparc32/bits/atomic.h b/sysdeps/sparc/sparc32/bits/atomic.h index 707a4b0a52..ef553f7270 100644 --- a/sysdeps/sparc/sparc32/bits/atomic.h +++ b/sysdeps/sparc/sparc32/bits/atomic.h @@ -122,7 +122,7 @@ volatile unsigned char __sparc32_atomic_locks[64] __asm __volatile (".word 0xcde05005" \ : "+r" (__acev_tmp), "=m" (*__acev_mem) \ : "r" (__acev_oldval), "m" (*__acev_mem), \ - "r" (__acev_mem)); \ + "r" (__acev_mem) : "memory"); \ __acev_tmp; }) #endif diff --git a/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h b/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h index 36959a9926..7b9d61d468 100644 --- a/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h +++ b/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h @@ -59,7 +59,7 @@ typedef uintmax_t uatomic_max_t; __asm __volatile ("cas [%4], %2, %0" \ : "=r" (__acev_tmp), "=m" (*__acev_mem) \ : "r" (oldval), "m" (*__acev_mem), "r" (__acev_mem), \ - "0" (newval)); \ + "0" (newval) : "memory"); \ __acev_tmp; }) /* This can be implemented if needed. */ @@ -74,7 +74,7 @@ typedef uintmax_t uatomic_max_t; if (sizeof (*(mem)) == 4) \ __asm ("swap %0, %1" \ : "=m" (*__memp), "=r" (__oldval) \ - : "m" (*__memp), "1" (__value)); \ + : "m" (*__memp), "1" (__value) : "memory"); \ else \ abort (); \ __oldval; }) diff --git a/sysdeps/sparc/sparc64/bits/atomic.h b/sysdeps/sparc/sparc64/bits/atomic.h index 2fb377810e..d0a64afce8 100644 --- a/sysdeps/sparc/sparc64/bits/atomic.h +++ b/sysdeps/sparc/sparc64/bits/atomic.h @@ -59,7 +59,7 @@ typedef uintmax_t uatomic_max_t; __asm __volatile ("cas [%4], %2, %0" \ : "=r" (__acev_tmp), "=m" (*__acev_mem) \ : "r" (oldval), "m" (*__acev_mem), "r" (__acev_mem), \ - "0" (newval)); \ + "0" (newval) : "memory"); \ __acev_tmp; }) #define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ @@ -69,7 +69,7 @@ typedef uintmax_t uatomic_max_t; __asm __volatile ("casx [%4], %2, %0" \ : "=r" (__acev_tmp), "=m" (*__acev_mem) \ : "r" ((long) (oldval)), "m" (*__acev_mem), \ - "r" (__acev_mem), "0" ((long) (newval))); \ + "r" (__acev_mem), "0" ((long) (newval)) : "memory"); \ __acev_tmp; }) #define atomic_exchange_acq(mem, newvalue) \ @@ -80,7 +80,7 @@ typedef uintmax_t uatomic_max_t; if (sizeof (*(mem)) == 4) \ __asm ("swap %0, %1" \ : "=m" (*__memp), "=r" (__oldval) \ - : "m" (*__memp), "1" (__value)); \ + : "m" (*__memp), "1" (__value) : "memory"); \ else \ { \ __val = *__memp; \ diff --git a/sysdeps/unix/sysv/linux/alpha/getcontext.S b/sysdeps/unix/sysv/linux/alpha/getcontext.S index bf9820ac73..f010f337e6 100644 --- a/sysdeps/unix/sysv/linux/alpha/getcontext.S +++ b/sysdeps/unix/sysv/linux/alpha/getcontext.S @@ -1,5 +1,5 @@ /* Save current context. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2006 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 @@ -57,6 +57,8 @@ weak_alias (__getcontext, getcontext) __getcontext_x: cfi_register (64, 0) + .set noat + /* Return value of getcontext. $0 is the only register whose value is not preserved. */ stq $31, UC_SIGCTX+SC_REGS($16) diff --git a/sysdeps/unix/sysv/linux/bits/poll.h b/sysdeps/unix/sysv/linux/bits/poll.h index dccb8b6665..d7996b46c5 100644 --- a/sysdeps/unix/sysv/linux/bits/poll.h +++ b/sysdeps/unix/sysv/linux/bits/poll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001, 2006 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 @@ -36,8 +36,10 @@ #endif #ifdef __USE_GNU -/* This is an extension for Linux. */ +/* These are extensions for Linux. */ # define POLLMSG 0x400 +# define POLLREMOVE 0x1000 +# define POLLRDHUP 0x2000 #endif /* Event types always implicitly polled for. These bits need not be set in diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 9f3f3965f4..37d25b1a5c 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -105,10 +105,10 @@ # define __ASSUME_STAT64_SYSCALL 1 #endif -/* On sparc and ARM the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64 +/* On sparc the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64 syscalls were introduced in 2.3.35. */ #if __LINUX_KERNEL_VERSION >= 131875 \ - && ((defined __sparc__ && !defined __arch64__) || defined __arm__) + && (defined __sparc__ && !defined __arch64__) # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 @@ -191,7 +191,7 @@ don't know when it got introduced). But PowerPC64 does not support separate FCNTL64 call, FCNTL is already 64-bit */ #if __LINUX_KERNEL_VERSION >= 132100 \ - && (defined __arm__ || defined __powerpc__ || defined __sh__) \ + && (defined __powerpc__ || defined __sh__) \ && !defined __powerpc64__ # define __ASSUME_FCNTL64 1 #endif @@ -260,24 +260,10 @@ #endif /* The vfork syscall on x86 and arm was definitely available in 2.4. */ -#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __arm__) +#if __LINUX_KERNEL_VERSION >= 132097 && defined __i386__ # define __ASSUME_VFORK_SYSCALL 1 #endif -/* There are an infinite number of PA-RISC kernel versions numbered - 2.4.0. But they've not really been released as such. We require - and expect the final version here. */ -#ifdef __hppa__ -# define __ASSUME_32BITUIDS 1 -# define __ASSUME_TRUNCATE64_SYSCALL 1 -# define __ASSUME_MMAP2_SYSCALL 1 -# define __ASSUME_STAT64_SYSCALL 1 -# define __ASSUME_IPC64 1 -# define __ASSUME_ST_INO_64_BIT 1 -# define __ASSUME_FCNTL64 1 -# define __ASSUME_GETDENTS64_SYSCALL 1 -#endif - /* Alpha switched to a 64-bit timeval sometime before 2.2.0. */ #if __LINUX_KERNEL_VERSION >= 131584 && defined __alpha__ # define __ASSUME_TIMEVAL64 1 @@ -296,15 +282,6 @@ # define __ASSUME_CLONE_THREAD_FLAGS 1 #endif -/* These features were surely available with 2.4.12. */ -#if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__ -# define __ASSUME_MMAP2_SYSCALL 1 -# define __ASSUME_TRUNCATE64_SYSCALL 1 -# define __ASSUME_STAT64_SYSCALL 1 -# define __ASSUME_FCNTL64 1 -# define __ASSUME_VFORK_SYSCALL 1 -#endif - /* Beginning with 2.5.63 support for realtime and monotonic clocks and timers based on them is available. */ #if __LINUX_KERNEL_VERSION >= 132415 @@ -359,7 +336,7 @@ /* The utimes syscall has been available for some architectures forever. For x86 it was introduced after 2.5.75, for x86-64, ppc, and ppc64 it was introduced in 2.6.0-test3. */ -#if defined __alpha__ || defined __ia64__ || defined __hppa__ \ +#if defined __alpha__ || defined __ia64__ \ || defined __sparc__ \ || (__LINUX_KERNEL_VERSION > 132427 && defined __i386__) \ || (__LINUX_KERNEL_VERSION > 132609 && defined __x86_64__) \ @@ -468,3 +445,9 @@ && (defined __i386__ || defined __x86_64__) # define __ASSUME_ATFCTS 1 #endif + +/* Support for inter-process robust mutexes was added in 2.6.17. */ +#if __LINUX_KERNEL_VERSION >= 0x020611 \ + && (defined __i386__ || defined __x86_64__) +# define __ASSUME_SET_ROBUST_LIST 1 +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S index 1a5251d100..40a7a24f19 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S @@ -45,6 +45,7 @@ ENTRY(__CONTEXT_FUNC_NAME) stw r0,20(r1) cfi_offset (lr, _FRAME_LR_SAVE) stw r31,12(r1) + cfi_offset(r31,-4) lwz r31,_UC_REGS_PTR(r3) /* diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S index a0f018ba41..366206d286 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -52,8 +52,12 @@ ENTRY (BP_SYM (__clone)) std r29,56(r1) std r30,64(r1) std r31,72(r1) + cfi_offset(r29,-56) + cfi_offset(r30,-64) + cfi_offset(r31,-72) #ifdef RESET_PID std r28,48(r1) + cfi_offset(r28,-48) #endif /* Set up stack frame for child. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S index 98b49ba1dc..8d7c959ff9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S @@ -144,6 +144,7 @@ ENTRY(__novec_getcontext) std r0,FRAME_LR_SAVE(r1) cfi_offset (lr, FRAME_LR_SAVE) stdu r1,-128(r1) + cfi_adjust_cfa_offset(128) li r3,ENOSYS bl JUMPTARGET(__syscall_error) nop diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S index 68fec9d2aa..48e9af363d 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S @@ -33,6 +33,7 @@ ENTRY(__novec_setcontext) #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL mflr r0 std r31,-8(1) + cfi_offset(r31,-8) std r0,FRAME_LR_SAVE(r1) cfi_offset (lr, FRAME_LR_SAVE) stdu r1,-128(r1) @@ -169,7 +170,9 @@ L(nv_do_sigret): /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */ mflr r0 std r0,FRAME_LR_SAVE(r1) + cfi_offset(lr,FRAME_LR_SAVE) stdu r1,-128(r1) + cfi_adjust_cfa_offset(128) li r3,ENOSYS bl JUMPTARGET(__syscall_error) nop @@ -201,6 +204,7 @@ ENTRY(__setcontext) #ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL mflr r0 std r31,-8(1) + cfi_offset(r31,-8) std r0,FRAME_LR_SAVE(r1) cfi_offset (lr, FRAME_LR_SAVE) stdu r1,-128(r1) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S index 5a128606ad..936d641b6b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S @@ -35,6 +35,7 @@ ENTRY(__novec_swapcontext) std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3) mflr r0 std r31,-8(1) + cfi_offset(r31,-8) std r2,(SIGCONTEXT_GP_REGS+(PT_R2*8))(r3) std r0,FRAME_LR_SAVE(r1) cfi_offset (lr, FRAME_LR_SAVE) @@ -264,6 +265,7 @@ L(nv_do_sigret): /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub. */ mflr r0 std r0,FRAME_LR_SAVE(r1) + cfi_offset(lr,FRAME_LR_SAVE) stdu r1,-128(r1) li r3,ENOSYS bl JUMPTARGET(__syscall_error) @@ -298,11 +300,14 @@ ENTRY(__swapcontext) std r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3) mflr r0 std r31,-8(1) + cfi_offset(r31,-8) std r2,(SIGCONTEXT_GP_REGS+(PT_R2*8))(r3) std r0,FRAME_LR_SAVE(r1) + cfi_offset (lr, FRAME_LR_SAVE) std r0,(SIGCONTEXT_GP_REGS+(PT_LNK*8))(r3) std r0,(SIGCONTEXT_GP_REGS+(PT_NIP*8))(r3) stdu r1,-128(r1) + cfi_adjust_cfa_offset(128) std r4,(SIGCONTEXT_GP_REGS+(PT_R4*8))(r3) std r5,(SIGCONTEXT_GP_REGS+(PT_R5*8))(r3) std r6,(SIGCONTEXT_GP_REGS+(PT_R6*8))(r3) diff --git a/sysdeps/unix/sysv/linux/sparc/bits/poll.h b/sysdeps/unix/sysv/linux/sparc/bits/poll.h index f7a7393154..53b94bc50e 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/poll.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/poll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001, 2006 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 @@ -35,6 +35,13 @@ # define POLLWRBAND 0x100 /* Priority data may be written. */ #endif +#ifdef __USE_GNU +/* These are extensions for Linux. */ +# define POLLMSG 0x200 +# define POLLREMOVE 0x400 +# define POLLRDHUP 0x800 +#endif + /* Event types always implicitly polled for. These bits need not be set in `events', but they will appear in `revents' to indicate the status of the file descriptor. */ -- cgit 1.4.1