From owner-p4-projects@FreeBSD.ORG Sun Apr 13 03:57:57 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 570941065677; Sun, 13 Apr 2008 03:57:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00503106564A for ; Sun, 13 Apr 2008 03:57:56 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D78608FC1C for ; Sun, 13 Apr 2008 03:57:56 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m3D3vurM066864 for ; Sun, 13 Apr 2008 03:57:56 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m3D3vuVr066862 for perforce@freebsd.org; Sun, 13 Apr 2008 03:57:56 GMT (envelope-from imp@freebsd.org) Date: Sun, 13 Apr 2008 03:57:56 GMT Message-Id: <200804130357.m3D3vuVr066862@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 139955 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2008 03:57:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=139955 Change 139955 by imp@imp_paco-paco on 2008/04/13 03:57:31 IFC @139952 Affected files ... .. //depot/projects/mips2/src/lib/libc/gdtoa/Makefile.inc#2 integrate .. //depot/projects/mips2/src/lib/libc/gdtoa/_hdtoa.c#4 integrate .. //depot/projects/mips2/src/lib/libc/gdtoa/_hldtoa.c#1 branch .. //depot/projects/mips2/src/lib/libc/sparc64/fpu/fpu_qp.c#2 integrate .. //depot/projects/mips2/src/lib/libc/sparc64/fpu/fpu_sqrt.c#3 integrate .. //depot/projects/mips2/src/lib/libc/stdio/printf.3#3 integrate .. //depot/projects/mips2/src/sbin/restore/dirs.c#4 integrate .. //depot/projects/mips2/src/sbin/restore/tape.c#3 integrate .. //depot/projects/mips2/src/share/man/man4/Makefile#17 integrate .. //depot/projects/mips2/src/share/man/man4/ddb.4#6 integrate .. //depot/projects/mips2/src/share/man/man4/k8temp.4#1 branch .. //depot/projects/mips2/src/share/man/man9/lock.9#10 integrate .. //depot/projects/mips2/src/sys/amd64/conf/NOTES#12 integrate .. //depot/projects/mips2/src/sys/cddl/contrib/opensolaris/common/atomic/sparc64/atomic.S#1 branch .. //depot/projects/mips2/src/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h#2 integrate .. //depot/projects/mips2/src/sys/conf/files.amd64#12 integrate .. //depot/projects/mips2/src/sys/conf/files.i386#13 integrate .. //depot/projects/mips2/src/sys/dev/acpica/acpi_cpu.c#7 integrate .. //depot/projects/mips2/src/sys/dev/asmc/asmc.c#4 integrate .. //depot/projects/mips2/src/sys/dev/asmc/asmcvar.h#3 integrate .. //depot/projects/mips2/src/sys/dev/ata/ata-all.c#6 integrate .. //depot/projects/mips2/src/sys/dev/ata/ata-chipset.c#13 integrate .. //depot/projects/mips2/src/sys/dev/ata/ata-pci.c#6 integrate .. //depot/projects/mips2/src/sys/dev/ata/ata-pci.h#10 integrate .. //depot/projects/mips2/src/sys/dev/bce/if_bce.c#8 integrate .. //depot/projects/mips2/src/sys/dev/bce/if_bcefw.h#5 integrate .. //depot/projects/mips2/src/sys/dev/bce/if_bcereg.h#6 integrate .. //depot/projects/mips2/src/sys/dev/k8temp/k8temp.c#1 branch .. //depot/projects/mips2/src/sys/ia64/ia64/interrupt.c#8 integrate .. //depot/projects/mips2/src/sys/kern/kern_lock.c#12 integrate .. //depot/projects/mips2/src/sys/kern/subr_witness.c#12 integrate .. //depot/projects/mips2/src/sys/modules/Makefile#14 integrate .. //depot/projects/mips2/src/sys/modules/zfs/Makefile#7 integrate .. //depot/projects/mips2/src/sys/sys/rwlock.h#7 integrate .. //depot/projects/mips2/src/tools/regression/lib/libc/stdio/test-printfloat.c#3 integrate Differences ... ==== //depot/projects/mips2/src/lib/libc/gdtoa/Makefile.inc#2 (text+ko) ==== @@ -1,9 +1,9 @@ -# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.9 2006/03/13 01:14:56 deischen Exp $ +# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.10 2008/04/12 03:11:36 das Exp $ # netlib gdtoa sources .PATH: ${.CURDIR}/gdtoa -MISRCS+=_hdtoa.c _ldtoa.c glue.c +MISRCS+=_hdtoa.c _hldtoa.c _ldtoa.c glue.c GDTOASRCS+=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \ hd_init.c hexnan.c misc.c smisc.c \ strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c ==== //depot/projects/mips2/src/lib/libc/gdtoa/_hdtoa.c#4 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004, 2005 David Schultz + * Copyright (c) 2004-2008 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,11 +25,13 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/gdtoa/_hdtoa.c,v 1.5 2007/05/08 02:59:37 das Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/gdtoa/_hdtoa.c,v 1.7 2008/04/12 14:53:52 das Exp $"); #include #include #include + +#include "../stdio/floatio.h" #include "fpmath.h" #include "gdtoaimp.h" @@ -37,63 +39,10 @@ #define INFSTR "Infinity" #define NANSTR "NaN" -#define DBL_ADJ (DBL_MAX_EXP - 2 + ((DBL_MANT_DIG - 1) % 4)) -#define LDBL_ADJ (LDBL_MAX_EXP - 2 + ((LDBL_MANT_DIG - 1) % 4)) +#define DBL_ADJ (DBL_MAX_EXP - 2) +#define SIGFIGS ((DBL_MANT_DIG + 3) / 4 + 1) -/* - * Round up the given digit string. If the digit string is fff...f, - * this procedure sets it to 100...0 and returns 1 to indicate that - * the exponent needs to be bumped. Otherwise, 0 is returned. - */ -static int -roundup(char *s0, int ndigits) -{ - char *s; - - for (s = s0 + ndigits - 1; *s == 0xf; s--) { - if (s == s0) { - *s = 1; - return (1); - } - *s = 0; - } - ++*s; - return (0); -} - -/* - * Round the given digit string to ndigits digits according to the - * current rounding mode. Note that this could produce a string whose - * value is not representable in the corresponding floating-point - * type. The exponent pointed to by decpt is adjusted if necessary. - */ -static void -dorounding(char *s0, int ndigits, int sign, int *decpt) -{ - int adjust = 0; /* do we need to adjust the exponent? */ - - switch (FLT_ROUNDS) { - case 0: /* toward zero */ - default: /* implementation-defined */ - break; - case 1: /* to nearest, halfway rounds to even */ - if ((s0[ndigits] > 8) || - (s0[ndigits] == 8 && s0[ndigits + 1] & 1)) - adjust = roundup(s0, ndigits); - break; - case 2: /* toward +inf */ - if (sign == 0) - adjust = roundup(s0, ndigits); - break; - case 3: /* toward -inf */ - if (sign != 0) - adjust = roundup(s0, ndigits); - break; - } - - if (adjust) - *decpt += 4; -} +static const float one[] = { 1.0f, -1.0f }; /* * This procedure converts a double-precision number in IEEE format @@ -112,9 +61,9 @@ * * Note that the C99 standard does not specify what the leading digit * should be for non-zero numbers. For instance, 0x1.3p3 is the same - * as 0x2.6p2 is the same as 0x4.cp3. This implementation chooses the - * first digit so that subsequent digits are aligned on nibble - * boundaries (before rounding). + * as 0x2.6p2 is the same as 0x4.cp3. This implementation always makes + * the leading digit a 1. This ensures that the exponent printed is the + * actual base-2 exponent, i.e., ilogb(d). * * Inputs: d, xdigs, ndigits * Outputs: decpt, sign, rve @@ -123,10 +72,10 @@ __hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve) { - static const int sigfigs = (DBL_MANT_DIG + 3) / 4; union IEEEd2bits u; char *s, *s0; int bufsize; + uint32_t manh, manl; u.d = d; *sign = u.bits.sign; @@ -145,11 +94,9 @@ case FP_INFINITE: *decpt = INT_MAX; return (nrv_alloc(INFSTR, rve, sizeof(INFSTR) - 1)); - case FP_NAN: + default: /* FP_NAN or unrecognized */ *decpt = INT_MAX; return (nrv_alloc(NANSTR, rve, sizeof(NANSTR) - 1)); - default: - abort(); } /* FP_NORMAL or FP_SUBNORMAL */ @@ -158,162 +105,40 @@ ndigits = 1; /* - * For simplicity, we generate all the digits even if the - * caller has requested fewer. + * If ndigits < 0, we are expected to auto-size, so we allocate + * enough space for all the digits. */ - bufsize = (sigfigs > ndigits) ? sigfigs : ndigits; + bufsize = (ndigits > 0) ? ndigits : SIGFIGS; s0 = rv_alloc(bufsize); - /* - * We work from right to left, first adding any requested zero - * padding, then the least significant portion of the - * mantissa, followed by the most significant. The buffer is - * filled with the byte values 0x0 through 0xf, which are - * converted to xdigs[0x0] through xdigs[0xf] after the - * rounding phase. - */ - for (s = s0 + bufsize - 1; s > s0 + sigfigs - 1; s--) - *s = 0; - for (; s > s0 + sigfigs - (DBL_MANL_SIZE / 4) - 1 && s > s0; s--) { - *s = u.bits.manl & 0xf; - u.bits.manl >>= 4; - } - for (; s > s0; s--) { - *s = u.bits.manh & 0xf; - u.bits.manh >>= 4; + /* Round to the desired number of digits. */ + if (SIGFIGS > ndigits && ndigits > 0) { + float redux = one[u.bits.sign]; + int offset = 4 * ndigits + DBL_MAX_EXP - 4 - DBL_MANT_DIG; + u.bits.exp = offset; + u.d += redux; + u.d -= redux; + *decpt += u.bits.exp - offset; } - /* - * At this point, we have snarfed all the bits in the - * mantissa, with the possible exception of the highest-order - * (partial) nibble, which is dealt with by the next - * statement. We also tack on the implicit normalization bit. - */ - *s = u.bits.manh | (1U << ((DBL_MANT_DIG - 1) % 4)); - - /* If ndigits < 0, we are expected to auto-size the precision. */ - if (ndigits < 0) { - for (ndigits = sigfigs; s0[ndigits - 1] == 0; ndigits--) - ; - } - - if (sigfigs > ndigits && s0[ndigits] != 0) - dorounding(s0, ndigits, u.bits.sign, decpt); - - s = s0 + ndigits; - if (rve != NULL) - *rve = s; - *s-- = '\0'; - for (; s >= s0; s--) - *s = xdigs[(unsigned int)*s]; - - return (s0); -} - -#if (LDBL_MANT_DIG > DBL_MANT_DIG) - -/* - * This is the long double version of __hdtoa(). - */ -char * -__hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, - char **rve) -{ - static const int sigfigs = (LDBL_MANT_DIG + 3) / 4; - union IEEEl2bits u; - char *s, *s0; - int bufsize; - - u.e = e; - *sign = u.bits.sign; - - switch (fpclassify(e)) { - case FP_NORMAL: - *decpt = u.bits.exp - LDBL_ADJ; - break; - case FP_ZERO: - *decpt = 1; - return (nrv_alloc("0", rve, 1)); - case FP_SUBNORMAL: - u.e *= 0x1p514L; - *decpt = u.bits.exp - (514 + LDBL_ADJ); - break; - case FP_INFINITE: - *decpt = INT_MAX; - return (nrv_alloc(INFSTR, rve, sizeof(INFSTR) - 1)); - case FP_NAN: - *decpt = INT_MAX; - return (nrv_alloc(NANSTR, rve, sizeof(NANSTR) - 1)); - default: - abort(); + manh = u.bits.manh; + manl = u.bits.manl; + *s0 = '1'; + for (s = s0 + 1; s < s0 + bufsize; s++) { + *s = xdigs[(manh >> (DBL_MANH_SIZE - 4)) & 0xf]; + manh = (manh << 4) | (manl >> (DBL_MANL_SIZE - 4)); + manl <<= 4; } - /* FP_NORMAL or FP_SUBNORMAL */ - - if (ndigits == 0) /* dtoa() compatibility */ - ndigits = 1; - - /* - * For simplicity, we generate all the digits even if the - * caller has requested fewer. - */ - bufsize = (sigfigs > ndigits) ? sigfigs : ndigits; - s0 = rv_alloc(bufsize); - - /* - * We work from right to left, first adding any requested zero - * padding, then the least significant portion of the - * mantissa, followed by the most significant. The buffer is - * filled with the byte values 0x0 through 0xf, which are - * converted to xdigs[0x0] through xdigs[0xf] after the - * rounding phase. - */ - for (s = s0 + bufsize - 1; s > s0 + sigfigs - 1; s--) - *s = 0; - for (; s > s0 + sigfigs - (LDBL_MANL_SIZE / 4) - 1 && s > s0; s--) { - *s = u.bits.manl & 0xf; - u.bits.manl >>= 4; - } - for (; s > s0; s--) { - *s = u.bits.manh & 0xf; - u.bits.manh >>= 4; - } - - /* - * At this point, we have snarfed all the bits in the - * mantissa, with the possible exception of the highest-order - * (partial) nibble, which is dealt with by the next - * statement. We also tack on the implicit normalization bit. - */ - *s = u.bits.manh | (1U << ((LDBL_MANT_DIG - 1) % 4)); - /* If ndigits < 0, we are expected to auto-size the precision. */ if (ndigits < 0) { - for (ndigits = sigfigs; s0[ndigits - 1] == 0; ndigits--) + for (ndigits = SIGFIGS; s0[ndigits - 1] == '0'; ndigits--) ; } - if (sigfigs > ndigits && s0[ndigits] != 0) - dorounding(s0, ndigits, u.bits.sign, decpt); - s = s0 + ndigits; + *s = '\0'; if (rve != NULL) *rve = s; - *s-- = '\0'; - for (; s >= s0; s--) - *s = xdigs[(unsigned int)*s]; - return (s0); } - -#else /* (LDBL_MANT_DIG == DBL_MANT_DIG) */ - -char * -__hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, - char **rve) -{ - - return (__hdtoa((double)e, xdigs, ndigits, decpt, sign, rve)); -} - -#endif /* (LDBL_MANT_DIG == DBL_MANT_DIG) */ ==== //depot/projects/mips2/src/lib/libc/sparc64/fpu/fpu_qp.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_qp.c,v 1.8 2006/04/16 14:32:53 marius Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_qp.c,v 1.9 2008/04/12 03:09:51 das Exp $"); #include #include @@ -41,6 +41,7 @@ struct fpemu fe; \ struct fpn *r; \ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); \ + fe.fe_cx = 0; \ fe.fe_f1.fp_sign = a[0] >> 31; \ fe.fe_f1.fp_sticky = 0; \ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, a[0], a[1], a[2], a[3]); \ @@ -49,6 +50,8 @@ fe.fe_f2.fp_class = __fpu_qtof(&fe.fe_f2, b[0], b[1], b[2], b[3]); \ r = __fpu_ ## op(&fe); \ c[0] = __fpu_ftoq(&fe, r, c); \ + fe.fe_fsr |= fe.fe_cx << FSR_AEXC_SHIFT; \ + __asm __volatile("ldx %0, %%fsr" : : "m" (fe.fe_fsr)); \ } #define _QP_TTOQ(qname, fname, ntype, signpos, atype, ...) \ @@ -59,10 +62,13 @@ struct fpemu fe; \ union { atype a[2]; ntype n; } u = { .n = n }; \ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); \ + fe.fe_cx = 0; \ fe.fe_f1.fp_sign = (signpos >= 0) ? u.a[0] >> signpos : 0; \ fe.fe_f1.fp_sticky = 0; \ fe.fe_f1.fp_class = __fpu_ ## fname ## tof(&fe.fe_f1, __VA_ARGS__); \ c[0] = __fpu_ftoq(&fe, &fe.fe_f1, c); \ + fe.fe_fsr |= fe.fe_cx << FSR_AEXC_SHIFT; \ + __asm __volatile("ldx %0, %%fsr" : : "m" (fe.fe_fsr)); \ } #define _QP_QTOT(qname, fname, type, ...) \ @@ -73,10 +79,13 @@ struct fpemu fe; \ union { u_int a; type n; } u; \ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); \ + fe.fe_cx = 0; \ fe.fe_f1.fp_sign = c[0] >> 31; \ fe.fe_f1.fp_sticky = 0; \ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, c[0], c[1], c[2], c[3]); \ u.a = __fpu_fto ## fname(&fe, &fe.fe_f1, ## __VA_ARGS__); \ + fe.fe_fsr |= fe.fe_cx << FSR_AEXC_SHIFT; \ + __asm __volatile("ldx %0, %%fsr" : : "m" (fe.fe_fsr)); \ return (u.n); \ } @@ -95,6 +104,7 @@ { \ struct fpemu fe; \ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); \ + fe.fe_cx = 0; \ fe.fe_f1.fp_sign = a[0] >> 31; \ fe.fe_f1.fp_sticky = 0; \ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, a[0], a[1], a[2], a[3]); \ @@ -102,6 +112,8 @@ fe.fe_f2.fp_sticky = 0; \ fe.fe_f2.fp_class = __fpu_qtof(&fe.fe_f2, b[0], b[1], b[2], b[3]); \ __fpu_compare(&fe, cmpe, 0); \ + fe.fe_fsr |= fe.fe_cx << FSR_AEXC_SHIFT; \ + __asm __volatile("ldx %0, %%fsr" : : "m" (fe.fe_fsr)); \ return (test(FSR_GET_FCC0(fe.fe_fsr))); \ } @@ -112,11 +124,14 @@ struct fpemu fe; struct fpn *r; __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); + fe.fe_cx = 0; fe.fe_f1.fp_sign = a[0] >> 31; fe.fe_f1.fp_sticky = 0; fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, a[0], a[1], a[2], a[3]); r = __fpu_sqrt(&fe); c[0] = __fpu_ftoq(&fe, r, c); + fe.fe_fsr |= fe.fe_cx << FSR_AEXC_SHIFT; + __asm __volatile("ldx %0, %%fsr" : : "m" (fe.fe_fsr)); } _QP_OP(add) ==== //depot/projects/mips2/src/lib/libc/sparc64/fpu/fpu_sqrt.c#3 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_sqrt.c,v 1.4 2007/01/09 00:28:05 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_sqrt.c,v 1.5 2008/04/12 03:10:13 das Exp $"); /* * Perform an FPU square root (return sqrt(x)). @@ -334,7 +334,7 @@ FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { x0 = d0, x1 = d1, x2 = d2; - q |= bit; + q = bit; y1 |= 1; /* now t1, y1 are set in concrete */ } ODD_DOUBLE; @@ -366,12 +366,12 @@ FPU_SUBCS(d2, x2, t2); FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); - ODD_DOUBLE; if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; - q |= bit; + x0 = d0, x1 = d1, x2 = d2; x3 = d3; + q = bit; y2 |= 1; } + ODD_DOUBLE; while ((bit >>= 1) != 0) { EVEN_DOUBLE; t3 = y3 | bit; @@ -380,7 +380,7 @@ FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; + x0 = d0, x1 = d1, x2 = d2; x3 = d3; q |= bit; y3 |= bit << 1; } ==== //depot/projects/mips2/src/lib/libc/stdio/printf.3#3 (text+ko) ==== @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/stdio/printf.3,v 1.60 2007/01/09 00:28:07 imp Exp $ +.\" $FreeBSD: src/lib/libc/stdio/printf.3,v 1.61 2008/04/12 03:11:56 das Exp $ .\" .Dd October 16, 2004 .Dt PRINTF 3 @@ -549,13 +549,14 @@ Note that there may be multiple valid ways to represent floating-point numbers in this hexadecimal format. For example, -.Li 0x3.24p+0 , 0x6.48p-1 +.Li 0x1.92p+1 , 0x3.24p+0 , 0x6.48p-1 , and .Li 0xc.9p-2 are all equivalent. -The format chosen depends on the internal representation of the -number, but the implementation guarantees that the length of the -mantissa will be minimized. +.Fx 8.0 +and later always prints finite non-zero numbers using +.Ql 1 +as the digit before the hexadecimal point. Zeroes are always represented with a mantissa of 0 (preceded by a .Ql - if appropriate) and an exponent of ==== //depot/projects/mips2/src/sbin/restore/dirs.c#4 (text+ko) ==== @@ -37,7 +37,7 @@ static char sccsid[] = "@(#)dirs.c 8.7 (Berkeley) 5/1/95"; #endif static const char rcsid[] = - "$FreeBSD: src/sbin/restore/dirs.c,v 1.32 2008/04/03 20:37:38 imp Exp $"; + "$FreeBSD: src/sbin/restore/dirs.c,v 1.33 2008/04/11 21:48:13 mckusick Exp $"; #endif /* not lint */ #include @@ -558,6 +558,7 @@ char *cp, *buf; const char *tmpdir; int bufsize; + uid_t myuid; vprintf(stdout, "Set directory mode, owner, and times.\n"); if ((tmpdir = getenv("TMPDIR")) == NULL || tmpdir[0] == '\0') @@ -578,6 +579,7 @@ } clearerr(mf); bufsize = 0; + myuid = getuid(); for (;;) { (void) fread((char *)&node, 1, sizeof(struct modeinfo), mf); if (feof(mf)) @@ -624,7 +626,10 @@ "extended attributes for ", cp); } } - (void) chown(cp, node.uid, node.gid); + if (myuid != 0) + (void) chown(cp, myuid, node.gid); + else + (void) chown(cp, node.uid, node.gid); (void) chmod(cp, node.mode); utimes(cp, node.ctimep); utimes(cp, node.mtimep); ==== //depot/projects/mips2/src/sbin/restore/tape.c#3 (text+ko) ==== @@ -39,7 +39,7 @@ #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/sbin/restore/tape.c,v 1.49 2007/03/06 08:13:20 mckusick Exp $"); +__FBSDID("$FreeBSD: src/sbin/restore/tape.c,v 1.51 2008/04/11 21:51:53 mckusick Exp $"); #include #include @@ -582,7 +582,9 @@ ctimep[1].tv_sec = curfile.birthtime_sec; ctimep[1].tv_usec = curfile.birthtime_nsec / 1000; extsize = curfile.extsize; - uid = curfile.uid; + uid = getuid(); + if (uid == 0) + uid = curfile.uid; gid = curfile.gid; mode = curfile.mode; flags = curfile.file_flags; @@ -1377,7 +1379,7 @@ } if (checksum((int *)buf) == FAIL) return (FAIL); - if (_time64_to_time(buf->c_date) != dumpdate) + if (dumpdate != 0 && _time64_to_time(buf->c_date) != dumpdate) fprintf(stderr, "Header with wrong dumpdate.\n"); if (Bcvt) { swabst((u_char *)"8l4s1q8l2q17l", (u_char *)buf); ==== //depot/projects/mips2/src/share/man/man4/Makefile#17 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 -# $FreeBSD: src/share/man/man4/Makefile,v 1.413 2008/04/01 07:20:04 weongyo Exp $ +# $FreeBSD: src/share/man/man4/Makefile,v 1.414 2008/04/12 14:08:24 rpaulo Exp $ MAN= aac.4 \ acpi.4 \ @@ -139,6 +139,7 @@ iwi.4 \ ixgb.4 \ joy.4 \ + k8temp.4 \ kbdmux.4 \ keyboard.4 \ kld.4 \ ==== //depot/projects/mips2/src/share/man/man4/ddb.4#6 (text+ko) ==== @@ -58,7 +58,7 @@ .\" Created. .\" [90/08/30 dbg] .\" -.\" $FreeBSD: src/share/man/man4/ddb.4,v 1.48 2008/03/07 18:14:29 rwatson Exp $ +.\" $FreeBSD: src/share/man/man4/ddb.4,v 1.49 2008/04/12 05:49:05 pjd Exp $ .\" .Dd December 26, 2007 .Dt DDB 4 @@ -908,7 +908,7 @@ .Xr kgdb 1 , .Xr acpi 4 , .Xr CAM 4 , -.Xr mac_text 4 , +.Xr mac_test 4 , .Xr ndis 4 , .Xr netgraph 4 , .Xr textdump 4 , ==== //depot/projects/mips2/src/share/man/man9/lock.9#10 (text+ko) ==== @@ -24,9 +24,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.\" $FreeBSD: src/share/man/man9/lock.9,v 1.32 2008/04/06 21:22:12 attilio Exp $ +.\" $FreeBSD: src/share/man/man9/lock.9,v 1.33 2008/04/12 20:18:02 attilio Exp $ .\" -.Dd April 6, 2008 +.Dd April 12, 2008 .Dt LOCK 9 .Os .Sh NAME @@ -178,6 +178,10 @@ .It Dv LK_NOWAIT Do not allow the call to sleep. This can be used to test the lock. +.It Dv LK_NOWITNESS +Skip the +.Xr witness 4 +checks for this instance. .It Dv LK_CANRECURSE Allow recursion on an exclusive lock. For every lock there must be a release. ==== //depot/projects/mips2/src/sys/amd64/conf/NOTES#12 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.77 2008/03/26 22:11:58 phk Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.78 2008/04/12 14:20:22 rpaulo Exp $ # # @@ -444,8 +444,10 @@ # Temperature sensors: # # coretemp: on-die sensor on Intel Core and newer CPUs +# k8temp: on-die sensor on AMD K8 CPUs # device coretemp +device k8temp #--------------------------------------------------------------------------- # ISDN4BSD ==== //depot/projects/mips2/src/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h#2 (text+ko) ==== @@ -24,8 +24,8 @@ * Use is subject to license terms. */ -#ifndef _IA32_SYS_ASM_LINKAGE_H -#define _IA32_SYS_ASM_LINKAGE_H +#ifndef _SYS_ASM_LINKAGE_H +#define _SYS_ASM_LINKAGE_H #ifdef __cplusplus extern "C" { @@ -41,6 +41,17 @@ #define ASM_ENTRY_ALIGN 16 +#elif defined(__sparc64__) + +/* GCC uses 32-byte function alignment for UltraSPARC CPUs. */ +#define ASM_ENTRY_ALIGN 32 + +#else + +#error Unsupported architecture. + +#endif + /* * ENTRY provides the standard procedure entry code and an easy way to * insert the calls to mcount for profiling. ENTRY_NP is identical, but @@ -67,40 +78,6 @@ #define SET_SIZE(x) \ .size x, [.-x] -#elif defined(__sparc64__) - -/* - * ENTRY provides the standard procedure entry code and an easy way to - * insert the calls to mcount for profiling. ENTRY_NP is identical, but - * never calls mcount. - */ -#define ENTRY(x) \ - .section ".text"; \ - .align 4; \ - .global x; \ - .type x, @function; \ -x: - -/* - * ALTENTRY provides for additional entry points. - */ -#define ALTENTRY(x) \ - .global x; \ - .type x, @function; \ -x: - -/* - * SET_SIZE trails a function and set the size for the ELF symbol table. - */ -#define SET_SIZE(x) \ - .size x, (.-x) - -#else - -#error Unsupported architecture. - -#endif - #endif /* _ASM */ #ifdef __cplusplus ==== //depot/projects/mips2/src/sys/conf/files.amd64#12 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.118 2008/02/03 07:07:29 scottl Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.119 2008/04/12 14:20:22 rpaulo Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -189,6 +189,7 @@ dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/k8temp/k8temp.c optional k8temp dev/kbd/kbd.c optional atkbd | sc | ukbd dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci ==== //depot/projects/mips2/src/sys/conf/files.i386#13 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.592 2008/02/03 07:07:29 scottl Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.593 2008/04/12 20:46:06 phk Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -445,8 +445,10 @@ # isa/syscons_isa.c optional sc isa/vga_isa.c optional vga +kern/clock_if.m standard kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip +kern/subr_rtc.c standard libkern/divdi3.c standard libkern/ffsl.c standard libkern/flsl.c standard ==== //depot/projects/mips2/src/sys/dev/acpica/acpi_cpu.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.71 2008/03/09 11:19:03 rpaulo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.72 2008/04/12 12:06:00 rpaulo Exp $"); #include "opt_acpi.h" #include @@ -157,6 +157,7 @@ static int acpi_cpu_cx_cst(struct acpi_cpu_softc *sc); static void acpi_cpu_startup(void *arg); static void acpi_cpu_startup_cx(struct acpi_cpu_softc *sc); +static void acpi_cpu_cx_list(struct acpi_cpu_softc *sc); static void acpi_cpu_idle(void); static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(void); @@ -801,7 +802,7 @@ } static void -acpi_cpu_startup_cx(struct acpi_cpu_softc *sc) +acpi_cpu_cx_list(struct acpi_cpu_softc *sc) { struct sbuf sb; int i; @@ -819,7 +820,13 @@ } sbuf_trim(&sb); sbuf_finish(&sb); +} +static void +acpi_cpu_startup_cx(struct acpi_cpu_softc *sc) +{ + acpi_cpu_cx_list(sc); + SYSCTL_ADD_STRING(&sc->cpu_sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), OID_AUTO, "cx_supported", CTLFLAG_RD, @@ -998,12 +1005,25 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context; - + struct acpi_cpu_softc *isc; + int i; + if (notify != ACPI_NOTIFY_CX_STATES) return; - device_printf(sc->cpu_dev, "Cx states changed\n"); - /* acpi_cpu_cx_cst(sc); */ + /* Update the list of Cx states. */ + acpi_cpu_cx_cst(sc); + acpi_cpu_cx_list(sc); + + /* Update the new lowest useable Cx state for all CPUs. */ + ACPI_SERIAL_BEGIN(cpu); + cpu_cx_count = 0; + for (i = 0; i < cpu_ndevices; i++) { + isc = device_get_softc(cpu_devices[i]); + if (isc->cpu_cx_count > cpu_cx_count) + cpu_cx_count = isc->cpu_cx_count; + } + ACPI_SERIAL_END(cpu); } static int ==== //depot/projects/mips2/src/sys/dev/asmc/asmc.c#4 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/asmc/asmc.c,v 1.8 2008/04/11 17:16:19 rpaulo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/asmc/asmc.c,v 1.9 2008/04/12 12:04:09 rpaulo Exp $"); #include #include @@ -114,9 +114,9 @@ int (*smc_light_left)(SYSCTL_HANDLER_ARGS); int (*smc_light_right)(SYSCTL_HANDLER_ARGS); - const char *smc_temps[8]; - const char *smc_tempnames[8]; - const char *smc_tempdescs[8]; + const char *smc_temps[ASMC_TEMP_MAX]; + const char *smc_tempnames[ASMC_TEMP_MAX]; + const char *smc_tempdescs[ASMC_TEMP_MAX]; }; static struct asmc_model *asmc_match(device_t dev); @@ -189,6 +189,15 @@ ASMC_MM_TEMPS, ASMC_MM_TEMPNAMES, ASMC_MM_TEMPDESCS }, + /* Idem for the MacPro */ + { + "MacPro2", "Apple SMC Mac Pro (8-core)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, + ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS + }, + { NULL, NULL } }; ==== //depot/projects/mips2/src/sys/dev/asmc/asmcvar.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/asmc/asmcvar.h,v 1.5 2008/04/07 12:58:43 rpaulo Exp $ + * $FreeBSD: src/sys/dev/asmc/asmcvar.h,v 1.6 2008/04/12 12:04:09 rpaulo Exp $ * */ @@ -126,9 +126,12 @@ /* * Temperatures. * - * First for MacBook, second for MacBook Pro, then for Intel Mac Mini. - * + * First for MacBook, second for MacBook Pro, third for Intel Mac Mini and + * last Mac Pro 8-core. + * */ +/* maximum array size for temperatures including the last NULL */ +#define ASMC_TEMP_MAX 36 #define ASMC_MB_TEMPS { "TB0T", "TN0P", "TN1P", "Th0H", "Th1H", \ "TM0P", NULL } #define ASMC_MB_TEMPNAMES { "enclosure", "northbridge1", \ @@ -156,3 +159,30 @@ #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ "Northbridge Point 2" } + +#define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ + "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ + "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ + "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ + "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ + "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ + NULL } + +#define ASMC_MP_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ + "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ + "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ + "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ + "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ + "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ + NULL } + +#define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ + "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ + "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ + "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ + "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ + "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ + NULL } ==== //depot/projects/mips2/src/sys/dev/ata/ata-all.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.283 2008/04/11 11:30:27 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.284 2008/04/11 22:56:27 sos Exp $"); #include "opt_ata.h" #include @@ -1014,12 +1014,14 @@ NULL, NULL, PAGE_SIZE, 1, PAGE_SIZE, 0, NULL, NULL, &request->dma.sg_tag)) { device_printf(ch->dev, "FAILURE - create sg_tag\n"); >>> TRUNCATED FOR MAIL (1000 lines) <<<