Re: svn commit: r209116 - head/sys/dev/cxgb

2010-06-13 Thread Navdeep Parhar
On Sun, Jun 13, 2010 at 03:03:16PM +1000, Lawrence Stewart wrote:
 Hi Navdeep,
 
 On 06/13/10 08:33, Navdeep Parhar wrote:
 Log:
cxgb(4): add knob to get packet timestamps from the hardware.
 
The T3 ASIC can provide an incoming packet's timestamp instead of its 
RSS hash.
The timestamp is just a counter running off the card's clock.  With a 
175MHz
clock an increment represents ~5.7ns and the 32 bit value wraps around 
in ~25s.
 
# sysctl -d dev.cxgbc.0.pkt_timestamp
dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of 
connection hash
 
# sysctl -d dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: core clock frequency (in KHz)
# sysctl dev.cxgbc.0.core_clock
dev.cxgbc.0.core_clock: 175000
 
 Is this really a one or the other feature, or is it technically 
 possible to support both simultaneously at some point in the future if 
 additional work was done?
 
 Just curious...

Both hash+timestamp will be supported in the future.  If the kernel is
going to grow the ability to let a NIC driver pass up a timestamp it
should allow both simultaneously.  This one or the other just happens
to be the way this particular generation of this particular chip does
it.

By the way, the packet is still hashed so RSS based load distribution
works even with timestamping enabled, just that the hash itself is not
provided.

Regards,
Navdeep
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Pawel Jakub Dawidek
On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:
 Author: lstewart
 Date: Sun Jun 13 02:39:55 2010
 New Revision: 209119
 URL: http://svn.freebsd.org/changeset/base/209119
 
 Log:
   Add a utility macro to simplify calculating an aggregate sum from a DPCPU
   counter variable.
   
   Sponsored by:   FreeBSD Foundation
   Reviewed by:jhb, rpaulo, rwatson (previous version of patch)
   MFC after:  1 week
 
 Modified:
   head/sys/sys/pcpu.h
 
 Modified: head/sys/sys/pcpu.h
 ==
 --- head/sys/sys/pcpu.h   Sun Jun 13 01:27:29 2010(r209118)
 +++ head/sys/sys/pcpu.h   Sun Jun 13 02:39:55 2010(r209119)
 @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  #define  DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
  #define  DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)
  
 +/*
 + * Utility macros.
 + */
 +#define DPCPU_SUM(n, var, sum)   
 \
 +do { \
 + (sum) = 0;  \
 + u_int i;\
 + CPU_FOREACH(i)  \
 + (sum) += (DPCPU_ID_PTR(i, n))-var; \
 +} while (0)

I'd suggest first swapping variable declaration and '(sum) = 0;'.
Also using 'i' as a counter in macro can easly lead to name collision.
If you need to do it, I'd suggest '_i' or something.
Maybe it would be better to make it an inline function rather than macro?

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
p...@freebsd.org   http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!


pgpbjHSnXke2k.pgp
Description: PGP signature


Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Gabor Kovesdan




+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum) \
+do {   \
+   (sum) = 0;  \
+   u_int i;\
+   CPU_FOREACH(i)  \
+   (sum) += (DPCPU_ID_PTR(i, n))-var;  \
+} while (0)
 

I'd suggest first swapping variable declaration and '(sum) = 0;'.
Also using 'i' as a counter in macro can easly lead to name collision.
If you need to do it, I'd suggest '_i' or something.
Maybe it would be better to make it an inline function rather than macro?
   

And why using old BSD-stlye u_int? style(9) also suggest using ISO C types.

--
Gabor Kovesdan
FreeBSD Volunteer

EMAIL: ga...@freebsd.org .:|:. ga...@kovesdan.org
WEB:   http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209122 - head/lib/libelf

2010-06-13 Thread Kai Wang
Author: kaiw
Date: Sun Jun 13 10:58:50 2010
New Revision: 209122
URL: http://svn.freebsd.org/changeset/base/209122

Log:
  * Improve compatibility with existing application code by permitting the
use of `elf_getbase()` on non-archive members. This change is needed
for gcc LTO (-flto) to work properly.
  * Style fix: paranthesize returned values.
  * Document the current behaviour of `elf_getbase()`.
  
  Tested by:gerald, Steve Kargl (original patch)
  Obtained from:elftoolchain
  MFC after:3 days

Modified:
  head/lib/libelf/elf_getbase.3
  head/lib/libelf/elf_getbase.c

Modified: head/lib/libelf/elf_getbase.3
==
--- head/lib/libelf/elf_getbase.3   Sun Jun 13 07:30:51 2010
(r209121)
+++ head/lib/libelf/elf_getbase.3   Sun Jun 13 10:58:50 2010
(r209122)
@@ -1,4 +1,4 @@
-.\ Copyright (c) 2006 Joseph Koshy.  All rights reserved.
+.\ Copyright (c) 2006,2008,2010 Joseph Koshy.  All rights reserved.
 .\
 .\ Redistribution and use in source and binary forms, with or without
 .\ modification, are permitted provided that the following conditions
@@ -23,7 +23,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 11, 2006
+.Dd June 6, 2010
 .Dt ELF_GETBASE 3
 .Os
 .Sh NAME
@@ -38,17 +38,21 @@
 .Sh DESCRIPTION
 Function
 .Fn elf_getbase
-returns the file offset in the containing archive of the first byte of
-the file referenced by ELF descriptor
+returns the file offset to the first byte of the object referenced by ELF
+descriptor
 .Ar elf .
+.Pp
+For descriptors referencing members of archives, the returned offset is
+the file offset of the member in its containing archive.
+For descriptors to regular objects, the returned offset is (vacuously)
+zero.
 .Sh RETURN VALUES
 Function
 .Fn elf_getbase
-returns a valid file offset into the containing archive if successful.
-It returns -1 if argument
-.Ar elf
-is NULL or is not a member of an
-archive.
+returns a valid file offset if successful, or
+.Pq Vt off_t
+.Li -1
+in case of an error.
 .Sh ERRORS
 Function
 .Fn elf_getbase
@@ -57,7 +61,7 @@ may fail with the following errors:
 .It Bq Er ELF_E_ARGUMENT
 Argument
 .Ar elf
-is not an ELF descriptor for an archive member.
+was NULL.
 .El
 .Sh SEE ALSO
 .Xr elf 3 ,

Modified: head/lib/libelf/elf_getbase.c
==
--- head/lib/libelf/elf_getbase.c   Sun Jun 13 07:30:51 2010
(r209121)
+++ head/lib/libelf/elf_getbase.c   Sun Jun 13 10:58:50 2010
(r209122)
@@ -34,12 +34,14 @@ __FBSDID($FreeBSD$);
 off_t
 elf_getbase(Elf *e)
 {
-   if (e == NULL ||
-   e-e_parent == NULL) {
+   if (e == NULL) {
LIBELF_SET_ERROR(ARGUMENT, 0);
-   return (off_t) -1;
+   return ((off_t) -1);
}
 
+   if (e-e_parent == NULL)
+   return ((off_t) 0);
+
return ((off_t) ((uintptr_t) e-e_rawfile -
(uintptr_t) e-e_parent-e_rawfile));
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209123 - head/usr.sbin/sysinstall

2010-06-13 Thread Ed Schouten
Author: ed
Date: Sun Jun 13 11:27:44 2010
New Revision: 209123
URL: http://svn.freebsd.org/changeset/base/209123

Log:
  Unbreak the build on less common architectures.
  
  Submitted by: Andreas Tobler andreast list fgznet ch

Modified:
  head/usr.sbin/sysinstall/install.c

Modified: head/usr.sbin/sysinstall/install.c
==
--- head/usr.sbin/sysinstall/install.c  Sun Jun 13 10:58:50 2010
(r209122)
+++ head/usr.sbin/sysinstall/install.c  Sun Jun 13 11:27:44 2010
(r209123)
@@ -628,8 +628,11 @@ installExpress(dialogMenuItem *self)
 int
 installStandard(dialogMenuItem *self)
 {
-int i, tries = 0;
+int i;
+#ifdef WITH_SLICES
+int tries = 0;
 Device **devs;
+#endif
 
 variable_set2(SYSTEM_STATE, standard, 0);
 dialog_clear_norefresh();
@@ -874,7 +877,9 @@ installConfigure(void)
 int
 installFixupBase(dialogMenuItem *self)
 {
+#if defined(__i386__) || defined(__amd64__)
 FILE *fp;
+#endif
 #ifdef __ia64__
 const char *efi_mntpt;
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209124 - in head/lib/clang: . include/llvm/Config

2010-06-13 Thread Ed Schouten
Author: ed
Date: Sun Jun 13 12:39:22 2010
New Revision: 209124
URL: http://svn.freebsd.org/changeset/base/209124

Log:
  Disable usage of posix_spawn() inside LLVM.
  
  Even though it's nice to use posix_spawn() instead of manually using
  fork()/exec(), it's better to disable this. FreeBSD 7 doesn't support
  this interface. When enabled, we can't build tblgen, which prevents us
  from building FreeBSD 9 on 7.
  
  Tested by:raj

Modified:
  head/lib/clang/clang.build.mk
  head/lib/clang/include/llvm/Config/config.h

Modified: head/lib/clang/clang.build.mk
==
--- head/lib/clang/clang.build.mk   Sun Jun 13 11:27:44 2010
(r209123)
+++ head/lib/clang/clang.build.mk   Sun Jun 13 12:39:22 2010
(r209124)
@@ -12,7 +12,7 @@ TARGET_ARCH?= ${MACHINE_ARCH}
 # XXX: 8.0, to keep __FreeBSD_cc_version happy
 CFLAGS+=-DLLVM_HOSTTRIPLE=\${TARGET_ARCH}-undermydesk-freebsd9.0\ \
-DCLANG_VENDOR=\FreeBSD\ \ -DSVN_REVISION=\104832\ \
-   -DCLANG_VENDOR_SUFFIX=\\ 20100612\
+   -DCLANG_VENDOR_SUFFIX=\\ 20100613\
 
 .PATH: ${LLVM_SRCS}/${SRCDIR}
 

Modified: head/lib/clang/include/llvm/Config/config.h
==
--- head/lib/clang/include/llvm/Config/config.h Sun Jun 13 11:27:44 2010
(r209123)
+++ head/lib/clang/include/llvm/Config/config.h Sun Jun 13 12:39:22 2010
(r209124)
@@ -270,7 +270,7 @@
 #define HAVE_OPENDIR 1
 
 /* Define to 1 if you have the `posix_spawn' function. */
-#define HAVE_POSIX_SPAWN 1
+/* #undef HAVE_POSIX_SPAWN */
 
 /* Define to 1 if you have the `powf' function. */
 #define HAVE_POWF 1
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209125 - in head/sys/boot: arm/uboot powerpc/uboot uboot/common

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 12:46:32 2010
New Revision: 209125
URL: http://svn.freebsd.org/changeset/base/209125

Log:
  Fix conditional FDT support in loader(8).

Modified:
  head/sys/boot/arm/uboot/Makefile
  head/sys/boot/powerpc/uboot/Makefile
  head/sys/boot/uboot/common/metadata.c

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileSun Jun 13 12:39:22 2010
(r209124)
+++ head/sys/boot/arm/uboot/MakefileSun Jun 13 12:46:32 2010
(r209125)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include bsd.own.mk
+
 PROG=  ubldr
 NEWVERSWHAT=   U-Boot loader ${MACHINE_ARCH}
 BINDIR?=   /boot
@@ -18,7 +20,7 @@ LOADER_NFS_SUPPORT?=  yes
 LOADER_TFTP_SUPPORT?=  no
 LOADER_GZIP_SUPPORT?=  no
 LOADER_BZIP2_SUPPORT?= no
-.if defined(WITH_FDT)
+.if ${MK_FDT} != no
 LOADER_FDT_SUPPORT=yes
 .else
 LOADER_FDT_SUPPORT=no

Modified: head/sys/boot/powerpc/uboot/Makefile
==
--- head/sys/boot/powerpc/uboot/MakefileSun Jun 13 12:39:22 2010
(r209124)
+++ head/sys/boot/powerpc/uboot/MakefileSun Jun 13 12:46:32 2010
(r209125)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include bsd.own.mk
+
 PROG=  ubldr
 NEWVERSWHAT=   U-Boot loader ${MACHINE_ARCH}
 BINDIR?=   /boot
@@ -18,7 +20,7 @@ LOADER_NFS_SUPPORT?=  yes
 LOADER_TFTP_SUPPORT?=  no
 LOADER_GZIP_SUPPORT?=  no
 LOADER_BZIP2_SUPPORT?= no
-.if defined(WITH_FDT)
+.if ${MK_FDT} != no
 LOADER_FDT_SUPPORT=yes
 .else
 LOADER_FDT_SUPPORT=no

Modified: head/sys/boot/uboot/common/metadata.c
==
--- head/sys/boot/uboot/common/metadata.c   Sun Jun 13 12:39:22 2010
(r209124)
+++ head/sys/boot/uboot/common/metadata.c   Sun Jun 13 12:46:32 2010
(r209125)
@@ -36,7 +36,9 @@ __FBSDID($FreeBSD$);
 
 #include machine/elf.h
 #include machine/metadata.h
+#if !defined(LOADER_FDT_SUPPORT)
 #include machine/bootinfo.h
+#endif
 
 #include api_public.h
 #include bootstrap.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209126 - head/share/mk

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 12:53:44 2010
New Revision: 209126
URL: http://svn.freebsd.org/changeset/base/209126

Log:
  Do not set WITH_FDT by default based on arch, as this does not work for
  a bootstrap stage tool.
  
  FDT-enabled platforms will have to specify WITH_FDT explicitly at buildworld
  time for now until TBEMD is complete, which is going to provide means for such
  arch based selection of build components.
  
  Discussed with:   imp

Modified:
  head/share/mk/bsd.own.mk

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkSun Jun 13 12:46:32 2010(r209125)
+++ head/share/mk/bsd.own.mkSun Jun 13 12:53:44 2010(r209126)
@@ -278,15 +278,6 @@ WITH_HESIOD=
 WITH_IDEA=
 .endif
 
-# Enable FDT by default for selected platforms.
-.if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == powerpc
-# XXX this is temporarily disabled until all FDT support code is in place.
-#_fdt= FDT
-_no_fdt= FDT
-.else
-_no_fdt= FDT
-.endif
-
 #
 # Default behaviour of MK_CLANG depends on the architecture.
 #
@@ -335,7 +326,6 @@ _clang_no=CLANG
 DICT \
 DYNAMICROOT \
 EXAMPLES \
-${_fdt} \
 FLOPPY \
 FORTH \
 FP_LIBC \
@@ -431,7 +421,7 @@ MK_${var}:= yes
 BIND_SIGCHASE \
 BIND_XML \
 ${_clang_no} \
-${_no_fdt} \
+FDT \
 HESIOD \
 IDEA
 .if defined(WITH_${var})  defined(WITHOUT_${var})
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209127 - head/sys/dev/fdt

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 12:58:31 2010
New Revision: 209127
URL: http://svn.freebsd.org/changeset/base/209127

Log:
  Provide identify method for the fdtbus(4).
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/fdt/fdtbus.c

Modified: head/sys/dev/fdt/fdtbus.c
==
--- head/sys/dev/fdt/fdtbus.c   Sun Jun 13 12:53:44 2010(r209126)
+++ head/sys/dev/fdt/fdtbus.c   Sun Jun 13 12:58:31 2010(r209127)
@@ -77,6 +77,7 @@ struct fdtbus_softc {
 /*
  * Prototypes.
  */
+static void fdtbus_identify(driver_t *, device_t);
 static int fdtbus_probe(device_t);
 static int fdtbus_attach(device_t);
 
@@ -109,6 +110,7 @@ static void newbus_device_from_fdt_node(
  */
 static device_method_t fdtbus_methods[] = {
/* Device interface */
+   DEVMETHOD(device_identify,  fdtbus_identify),
DEVMETHOD(device_probe, fdtbus_probe),
DEVMETHOD(device_attach,fdtbus_attach),
DEVMETHOD(device_detach,bus_generic_detach),
@@ -144,6 +146,14 @@ devclass_t fdtbus_devclass;
 
 DRIVER_MODULE(fdtbus, nexus, fdtbus_driver, fdtbus_devclass, 0, 0);
 
+static void
+fdtbus_identify(driver_t *driver, device_t parent)
+{
+
+   if (device_find_child(parent, fdtbus, -1) == NULL)
+   BUS_ADD_CHILD(parent, 0, fdtbus, -1);
+}
+
 static int
 fdtbus_probe(device_t dev)
 {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209128 - in head: . gnu/usr.bin sys/conf

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 13:02:43 2010
New Revision: 209128
URL: http://svn.freebsd.org/changeset/base/209128

Log:
  Connect FDT infrastructure to the build system.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile
  head/Makefile.inc1
  head/gnu/usr.bin/Makefile
  head/sys/conf/files

Modified: head/Makefile
==
--- head/Makefile   Sun Jun 13 12:58:31 2010(r209127)
+++ head/Makefile   Sun Jun 13 13:02:43 2010(r209128)
@@ -89,7 +89,8 @@ TGTS= all all-man buildenv buildenvvars 
obj objlink regress rerelease showconfig tags toolchain update \
_worldtmp _legacy _bootstrap-tools _cleanobj _obj \
_build-tools _cross-tools _includes _libraries _depend \
-   build32 distribute32 install32 xdev xdev-build xdev-install
+   build32 builddtb distribute32 install32 xdev xdev-build xdev-install \
+
 TGTS+= ${SUBDIR_TARGETS}
 
 BITGTS=files includes

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Jun 13 12:58:31 2010(r209127)
+++ head/Makefile.inc1  Sun Jun 13 13:02:43 2010(r209128)
@@ -968,6 +968,10 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/
 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
 .endif
 
+.if ${MK_FDT} != no
+_dtc= gnu/usr.bin/dtc
+.endif
+
 bootstrap-tools:
 .for _tool in \
 ${_clang_tblgen} \
@@ -976,6 +980,7 @@ bootstrap-tools:
 ${_gperf} \
 ${_groff} \
 ${_ar} \
+${_dtc} \
 usr.bin/lorder \
 usr.bin/makewhatis \
 ${_mklocale} \
@@ -1448,3 +1453,39 @@ _xi-links:
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
done
 .endif
+
+.if !empty(KRNLOBJDIR)  !empty(KERNCONF)
+DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
+
+.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
+FDT_DTS_FILE!=  grep ^makeoptions[[:space:]]\+FDT_DTS_FILE \
+   ${KERNCONFDIR}/${KERNCONF} 2 /dev/null | cut -d= -f2
+.endif
+
+.endif
+
+.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
+DTBOUTPUTPATH= ${.CURDIR}
+.endif
+
+#
+# Build 'standalone' Device Tree Blob
+#
+builddtb:
+   @if [ ${FDT_DTS_FILE} =  ]; then \
+   echo ERROR: FDT_DTS_FILE must be specified!; \
+   exit 1; \
+   fi; \
+   if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \
+   echo ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \
+   exist!; \
+   exit 1; \
+   fi; \
+   if [ ${DTBOUTPUTPATH} = ${.CURDIR} ]; then  \
+   echo WARNING: DTB will be placed in the current working \
+   directory; \
+   fi
+   @PATH=${TMPPATH} \
+   dtc -O dtb -o \
+   ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \
+   -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE}

Modified: head/gnu/usr.bin/Makefile
==
--- head/gnu/usr.bin/Makefile   Sun Jun 13 12:58:31 2010(r209127)
+++ head/gnu/usr.bin/Makefile   Sun Jun 13 13:02:43 2010(r209128)
@@ -8,6 +8,7 @@ SUBDIR= ${_binutils} \
dialog \
diff \
diff3 \
+   ${_dtc} \
${_gdb} \
${_gperf} \
${_grep} \
@@ -31,6 +32,10 @@ _groff=  groff
 _cvs=  cvs
 .endif
 
+.if ${MK_FDT}  != no
+_dtc=  dtc
+.endif
+
 .if ${MK_GNU_GREP} != no
 _grep= grep
 .endif

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sun Jun 13 12:58:31 2010(r209127)
+++ head/sys/conf/files Sun Jun 13 13:02:43 2010(r209128)
@@ -55,6 +55,18 @@ emu10k1-alsa%diked.h optional snd_emu10
compile-withCC='${CC}' AWK=${AWK} sh 
$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h 
emu10k1-alsa%diked.h \
no-obj no-implicit-rule before-depend  \
clean   emu10k1-alsa%diked.h
+#
+# The 'fdt_dtb_file' target covers an actual DTB file name, which is derived
+# from the specified source (DTS) file: platform.dts - platform.dtb
+#
+fdt_dtb_file   optional fdt \
+   compile-with if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O 
dtb -o `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 -p 1024 
$S/boot/fdt/dts/${FDT_DTS_FILE}; fi \
+   no-obj no-implicit-rule before-depend   \
+   clean   `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb
+fdt_static_dtb.h   optional fdt fdt_dtb_static \
+   compile-with sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} . \
+   no-obj no-implicit-rule before-depend \
+   clean   fdt_static_dtb.h
 p16v-alsa%diked.h  optional snd_emu10kx pci
   \

svn commit: r209129 - head/sys/arm/arm

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 13:08:23 2010
New Revision: 209129
URL: http://svn.freebsd.org/changeset/base/209129

Log:
  Improve style.

Modified:
  head/sys/arm/arm/nexus.c

Modified: head/sys/arm/arm/nexus.c
==
--- head/sys/arm/arm/nexus.cSun Jun 13 13:02:43 2010(r209128)
+++ head/sys/arm/arm/nexus.cSun Jun 13 13:08:23 2010(r209129)
@@ -107,6 +107,7 @@ static devclass_t nexus_devclass;
 static int
 nexus_probe(device_t dev)
 {
+
device_quiet(dev);  /* suppress attach message for neatness */
 
mem_rman.rm_start = 0;
@@ -116,7 +117,7 @@ nexus_probe(device_t dev)
if (rman_init(mem_rman) || rman_manage_region(mem_rman, 0, ~0u))
panic(nexus_probe mem_rman);
 
-   return (0);
+   return (BUS_PROBE_DEFAULT);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209130 - in head/sys: arm/include dev/fdt

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 13:12:52 2010
New Revision: 209130
URL: http://svn.freebsd.org/changeset/base/209130

Log:
  Initial FDT infrastructure elements for ARM.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/arm/include/fdt.h   (contents, props changed)
  head/sys/arm/include/ofw_machdep.h   (contents, props changed)
  head/sys/dev/fdt/fdt_arm.c   (contents, props changed)

Added: head/sys/arm/include/fdt.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/include/fdt.h  Sun Jun 13 13:12:52 2010(r209130)
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2010 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Semihalf under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_FDT_H_
+#define _MACHINE_FDT_H_
+
+#include dev/ofw/openfirm.h
+
+#include vm/vm.h
+#include vm/pmap.h
+
+#include machine/pmap.h
+#include machine/intr.h
+
+#include arm/mv/mvvar.h
+#include arm/mv/mvwin.h
+
+/*
+ * This is the base virtual address the internal mem-mapped registers (IMMR)
+ * range is available at.
+ */
+#define FDT_IMMR_VAMV_BASE
+
+/* Max interrupt number */
+#define FDT_INTR_MAX   NIRQ
+
+/*
+ * Bus space tag. XXX endianess info needs to be derived from the blob.
+ */
+extern bus_space_tag_t fdtbus_bs_tag;
+
+struct mem_region {
+   vm_offset_t mr_start;
+   vm_size_t   mr_size;
+};
+
+int fdt_pci_devmap(phandle_t, struct pmap_devmap *devmap, vm_offset_t,
+vm_offset_t);
+
+#endif /* _MACHINE_FDT_H_ */

Added: head/sys/arm/include/ofw_machdep.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/include/ofw_machdep.h  Sun Jun 13 13:12:52 2010
(r209130)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2009 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Semihalf under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_OFW_MACHDEP_H_
+#define _MACHINE_OFW_MACHDEP_H_
+
+typedefuint32_tcell_t;
+
+#endif /* _MACHINE_OFW_MACHDEP_H_ */

Added: head/sys/dev/fdt/fdt_arm.c

Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Lawrence Stewart

On 06/13/10 20:20, Gabor Kovesdan wrote:




+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum) \
+do { \
+ (sum) = 0; \
+ u_int i; \
+ CPU_FOREACH(i) \
+ (sum) += (DPCPU_ID_PTR(i, n))-var; \
+} while (0)

I'd suggest first swapping variable declaration and '(sum) = 0;'.
Also using 'i' as a counter in macro can easly lead to name collision.
If you need to do it, I'd suggest '_i' or something.
Maybe it would be better to make it an inline function rather than macro?

And why using old BSD-stlye u_int? style(9) also suggest using ISO C types.


From sys/smp.h

extern u_int mp_maxid;
...
#define CPU_FOREACH(i)  \
for ((i) = 0; (i) = mp_maxid; (i)++)   \
if (!CPU_ABSENT((i)))

Made sense to keep the types for i and mp_maxid the same. Happy to 
change if you have a better suggestion.


Cheers,
Lawrence
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209131 - in head/sys: arm/conf arm/include arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion conf dev/mge dev/uart dev/usb/controller

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 13:28:53 2010
New Revision: 209131
URL: http://svn.freebsd.org/changeset/base/209131

Log:
  Convert Marvell ARM platforms to FDT convention.
  
  The following systems are involved:
  
- DB-88F5182
- DB-88F5281
- DB-88F6281
- DB-78100
- SheevaPlug
  
  This overhaul covers the following major changes:
  
- All integrated peripherals drivers for Marvell ARM SoC, which are
  currently in the FreeBSD source tree are reworked and adjusted so they
  derive config data out of the device tree blob (instead of hard coded /
  tabelarized values).
  
- Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say
  good by to obio / mbus drivers and numerous hard-coded config data.
  
  Note that world needs to be built WITH_FDT for the affected platforms.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation.

Added:
  head/sys/dev/usb/controller/ehci_mv.c   (contents, props changed)
Deleted:
  head/sys/arm/include/bootinfo.h
  head/sys/arm/mv/discovery/db78xxx.c
  head/sys/arm/mv/kirkwood/db88f6xxx.c
  head/sys/arm/mv/kirkwood/files.db88f6xxx
  head/sys/arm/mv/obio.c
  head/sys/dev/uart/uart_bus_mbus.c
  head/sys/dev/uart/uart_cpu_mv.c
  head/sys/dev/usb/controller/ehci_mbus.c
Modified:
  head/sys/arm/conf/DB-78XXX
  head/sys/arm/conf/DB-88F5XXX
  head/sys/arm/conf/DB-88F6XXX
  head/sys/arm/conf/SHEEVAPLUG
  head/sys/arm/include/metadata.h
  head/sys/arm/mv/bus_space.c
  head/sys/arm/mv/common.c
  head/sys/arm/mv/discovery/discovery.c
  head/sys/arm/mv/discovery/files.db78xxx
  head/sys/arm/mv/files.mv
  head/sys/arm/mv/gpio.c
  head/sys/arm/mv/ic.c
  head/sys/arm/mv/kirkwood/kirkwood.c
  head/sys/arm/mv/kirkwood/sheevaplug.c
  head/sys/arm/mv/kirkwood/std.db88f6xxx
  head/sys/arm/mv/kirkwood/std.sheevaplug
  head/sys/arm/mv/mv_machdep.c
  head/sys/arm/mv/mv_pci.c
  head/sys/arm/mv/mv_sata.c
  head/sys/arm/mv/mvreg.h
  head/sys/arm/mv/mvvar.h
  head/sys/arm/mv/mvwin.h
  head/sys/arm/mv/orion/db88f5xxx.c
  head/sys/arm/mv/orion/orion.c
  head/sys/arm/mv/rtc.c
  head/sys/arm/mv/timer.c
  head/sys/arm/mv/twsi.c
  head/sys/conf/Makefile.arm
  head/sys/conf/files.arm
  head/sys/conf/options.arm
  head/sys/dev/mge/if_mge.c
  head/sys/dev/mge/if_mgevar.h

Modified: head/sys/arm/conf/DB-78XXX
==
--- head/sys/arm/conf/DB-78XXX  Sun Jun 13 13:12:52 2010(r209130)
+++ head/sys/arm/conf/DB-78XXX  Sun Jun 13 13:28:53 2010(r209131)
@@ -83,3 +83,7 @@ deviceds133x
 # SATA
 device ata
 device atadisk
+
+# Flattened Device Tree
+optionsFDT
+makeoptionsFDT_DTS_FILE=db78100.dts

Modified: head/sys/arm/conf/DB-88F5XXX
==
--- head/sys/arm/conf/DB-88F5XXXSun Jun 13 13:12:52 2010
(r209130)
+++ head/sys/arm/conf/DB-88F5XXXSun Jun 13 13:28:53 2010
(r209131)
@@ -85,3 +85,7 @@ deviceda
 # SATA
 device ata
 device atadisk
+
+# Flattened Device Tree
+optionsFDT
+makeoptionsFDT_DTS_FILE=db88f5281.dts

Modified: head/sys/arm/conf/DB-88F6XXX
==
--- head/sys/arm/conf/DB-88F6XXXSun Jun 13 13:12:52 2010
(r209130)
+++ head/sys/arm/conf/DB-88F6XXXSun Jun 13 13:28:53 2010
(r209131)
@@ -82,3 +82,7 @@ deviceiicbus
 # SATA
 device ata
 device atadisk
+
+# Flattened Device Tree
+optionsFDT
+makeoptionsFDT_DTS_FILE=db88f6281.dts

Modified: head/sys/arm/conf/SHEEVAPLUG
==
--- head/sys/arm/conf/SHEEVAPLUGSun Jun 13 13:12:52 2010
(r209130)
+++ head/sys/arm/conf/SHEEVAPLUGSun Jun 13 13:28:53 2010
(r209131)
@@ -69,3 +69,7 @@ devicescbus
 device pass
 device da
 
+# Flattened Device Tree
+optionsFDT
+optionsFDT_DTB_STATIC
+makeoptionsFDT_DTS_FILE=sheevaplug.dts

Modified: head/sys/arm/include/metadata.h
==
--- head/sys/arm/include/metadata.h Sun Jun 13 13:12:52 2010
(r209130)
+++ head/sys/arm/include/metadata.h Sun Jun 13 13:28:53 2010
(r209131)
@@ -29,7 +29,6 @@
 #ifndef _MACHINE_METADATA_H_
 #define_MACHINE_METADATA_H_
 
-#defineMODINFOMD_BOOTINFO  0x1001
-#defineMODINFOMD_DTBP  0x1002
+#defineMODINFOMD_DTBP  0x1001
 
 #endif /* !_MACHINE_METADATA_H_ */

Modified: head/sys/arm/mv/bus_space.c
==
--- head/sys/arm/mv/bus_space.c Sun Jun 13 13:12:52 2010(r209130)
+++ head/sys/arm/mv/bus_space.c Sun Jun 13 13:28:53 2010(r209131)
@@ -49,7 

svn commit: r209132 - head/usr.sbin

2010-06-13 Thread Rafal Jaworowski
Author: raj
Date: Sun Jun 13 13:30:26 2010
New Revision: 209132
URL: http://svn.freebsd.org/changeset/base/209132

Log:
  Enable ofwdump(8) on ARM as this is a useful tool to inspect a flattened
  device tree.

Modified:
  head/usr.sbin/Makefile

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Sun Jun 13 13:28:53 2010(r209131)
+++ head/usr.sbin/Makefile  Sun Jun 13 13:30:26 2010(r209132)
@@ -498,6 +498,10 @@ _spkrtest= spkrtest
 _zzz=  zzz
 .endif
 
+.if ${MACHINE_ARCH} == arm
+_ofwdump=  ofwdump
+.endif
+
 .if ${MACHINE_ARCH} == ia64
 .if ${MK_ACPI} != no
 _acpi= acpi
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Lawrence Stewart

On 06/13/10 20:10, Pawel Jakub Dawidek wrote:

On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:

Author: lstewart
Date: Sun Jun 13 02:39:55 2010
New Revision: 209119
URL: http://svn.freebsd.org/changeset/base/209119

Log:
   Add a utility macro to simplify calculating an aggregate sum from a DPCPU
   counter variable.

   Sponsored by:FreeBSD Foundation
   Reviewed by: jhb, rpaulo, rwatson (previous version of patch)
   MFC after:   1 week

Modified:
   head/sys/sys/pcpu.h

Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010(r209118)
+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010(r209119)
@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  #define   DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
  #define   DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)

+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum) \
+do {   \
+   (sum) = 0;  \
+   u_int i;\
+   CPU_FOREACH(i)  \
+   (sum) += (DPCPU_ID_PTR(i, n))-var;  \
+} while (0)


I'd suggest first swapping variable declaration and '(sum) = 0;'.


Can do (will wait until consensus on other issues is reached first 
before tweaking though).



Also using 'i' as a counter in macro can easly lead to name collision.


I had a similar concern but after chatting with John on IRC felt it 
wasn't such a big deal in this case.



If you need to do it, I'd suggest '_i' or something.


Could do... is it worth it?


Maybe it would be better to make it an inline function rather than macro?


Inlining it could be annoying with respect to the types used in the 
function prototype, no? I suspect it would be more useful keeping it as 
a macro if possible.


Cheers,
Lawrence
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread mdf
On Sun, Jun 13, 2010 at 10:10 AM, Pawel Jakub Dawidek p...@freebsd.org wrote:
 On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:
 Author: lstewart
 Date: Sun Jun 13 02:39:55 2010
 New Revision: 209119
 URL: http://svn.freebsd.org/changeset/base/209119

 Log:
   Add a utility macro to simplify calculating an aggregate sum from a DPCPU
   counter variable.

   Sponsored by:       FreeBSD Foundation
   Reviewed by:        jhb, rpaulo, rwatson (previous version of patch)
   MFC after:  1 week

 Modified:
   head/sys/sys/pcpu.h

 Modified: head/sys/sys/pcpu.h
 ==
 --- head/sys/sys/pcpu.h       Sun Jun 13 01:27:29 2010        (r209118)
 +++ head/sys/sys/pcpu.h       Sun Jun 13 02:39:55 2010        (r209119)
 @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  #define      DPCPU_ID_GET(i, n)      (*DPCPU_ID_PTR(i, n))
  #define      DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)

 +/*
 + * Utility macros.
 + */
 +#define DPCPU_SUM(n, var, sum)                                              
  \
 +do {                                                                 \
 +     (sum) = 0;                                                      \
 +     u_int i;                                                        \
 +     CPU_FOREACH(i)                                                  \
 +             (sum) += (DPCPU_ID_PTR(i, n))-var;                     \
 +} while (0)

 I'd suggest first swapping variable declaration and '(sum) = 0;'.
 Also using 'i' as a counter in macro can easly lead to name collision.
 If you need to do it, I'd suggest '_i' or something.
 Maybe it would be better to make it an inline function rather than macro?

(Relevant but almost a thread hijack):

At Isilon we've run into a lot of problems with variable declarations
in macros, especially with -Wshadow turned on.  We ended up
backporting __COUNTER__ from later versions of gcc and then using it
to make unique variable names.

 - is the backport (or a fresh implementation) something that could be
done within the scope of the GPL license?
 - is it something FreeBSD would be interested in?
 - is __COUNTER__ supported by clang?
 - if not, could it be?

-Wshadow found several nasty bugs in our code, and apart from a few
spurious warnings it has been handy to have when building our
filesystem.

Thanks,
matthew
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209134 - head/etc

2010-06-13 Thread Warner Losh
Author: imp
Date: Sun Jun 13 16:35:20 2010
New Revision: 209134
URL: http://svn.freebsd.org/changeset/base/209134

Log:
  Merge from tbemd, with minor tweaks:
  
  Search from most specific ($MACHINE) to least specific
  ($MACHINE_CPUARCH) when looking for the tty file to use.  Also add an
  .error case if none exist.

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Sun Jun 13 16:27:43 2010(r209133)
+++ head/etc/Makefile   Sun Jun 13 16:35:20 2010(r209134)
@@ -22,8 +22,12 @@ BIN1=auth.conf \
 
 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
 BIN1+= etc.${MACHINE}/ttys
-.else
+.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
 BIN1+= etc.${MACHINE_ARCH}/ttys
+.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
+BIN1+= etc.${MACHINE_CPUARCH}/ttys
+.else
+.error etc.MACHINE/ttys missing
 .endif
 
 OPENBSMDIR=${.CURDIR}/../contrib/openbsm
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209122 - head/lib/libelf

2010-06-13 Thread Steve Kargl
On Sun, Jun 13, 2010 at 10:58:50AM +, Kai Wang wrote:
 Author: kaiw
 Date: Sun Jun 13 10:58:50 2010
 New Revision: 209122
 URL: http://svn.freebsd.org/changeset/base/209122
 
 Log:
   * Improve compatibility with existing application code by permitting the
 use of `elf_getbase()` on non-archive members. This change is needed
 for gcc LTO (-flto) to work properly.
   * Style fix: paranthesize returned values.
   * Document the current behaviour of `elf_getbase()`.
   
   Tested by:  gerald, Steve Kargl (original patch)
   Obtained from:  elftoolchain
   MFC after:  3 days
 
 Modified:
   head/lib/libelf/elf_getbase.3
   head/lib/libelf/elf_getbase.c

Thanks.  Unfortunately without the patch to elf_update.c,
gcc LTO will not work (ie., 'gcc -flto -o z a.o b.o' will
segfault).  Any chance that the elf_update.c patch will be
committed; possibly as a conditional compilation.

-- 
Steve
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209135 - head/usr.sbin/config

2010-06-13 Thread Warner Losh
Author: imp
Date: Sun Jun 13 16:54:11 2010
New Revision: 209135
URL: http://svn.freebsd.org/changeset/base/209135

Log:
  style(9) fixes:
  
  o make cmd scoped to the whole do_rules function, since it really is
scoped to the whole fucnion.  Making it static was the wrong way to
fix referencing it outside of the block in which it was declared
(and conforms to the style of the rest of the file).
  o remove a couple of meaningless blank lines
  o properly wrap one line.

Modified:
  head/usr.sbin/config/mkmakefile.c

Modified: head/usr.sbin/config/mkmakefile.c
==
--- head/usr.sbin/config/mkmakefile.c   Sun Jun 13 16:35:20 2010
(r209134)
+++ head/usr.sbin/config/mkmakefile.c   Sun Jun 13 16:54:11 2010
(r209135)
@@ -683,6 +683,7 @@ do_rules(FILE *f)
char *cp, *np, och;
struct file_list *ftp;
char *compilewith;
+   char cmd[128];
 
STAILQ_FOREACH(ftp, ftab, f_next) {
if (ftp-f_warn)
@@ -720,25 +721,22 @@ do_rules(FILE *f)
compilewith = ftp-f_compilewith;
if (compilewith == 0) {
const char *ftype = NULL;
-   static char cmd[128];
 
switch (ftp-f_type) {
-
case NORMAL:
ftype = NORMAL;
break;
-
case PROFILING:
if (!profiling)
continue;
ftype = PROFILE;
break;
-
default:
printf(config: don't know rules for %s\n, np);
break;
}
-   snprintf(cmd, sizeof(cmd), 
${%s_%c%s}\...@${normal_ctfconvert}, ftype,
+   snprintf(cmd, sizeof(cmd),
+   ${%s_%c%s}\...@${normal_ctfconvert}, ftype,
toupper(och),
ftp-f_flags  NOWERROR ? _NOWERROR : );
compilewith = cmd;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209136 - in head: include lib/libedit

2010-06-13 Thread Jilles Tjoelker
Author: jilles
Date: Sun Jun 13 17:04:42 2010
New Revision: 209136
URL: http://svn.freebsd.org/changeset/base/209136

Log:
  libedit: Add basic filename completion code from NetBSD.
  
  This will be used to provide filename completion in sh(1).
  
  Changes from the NetBSD code:
  * wide character support disabled, as in the rest of libedit
  * config.h and related portability stuff reduced/disabled, as in the rest
of libedit
  
  Submitted by: Guy Yur
  Obtained from:NetBSD

Added:
  head/lib/libedit/filecomplete.c   (contents, props changed)
  head/lib/libedit/filecomplete.h   (contents, props changed)
Modified:
  head/include/histedit.h
  head/lib/libedit/Makefile

Modified: head/include/histedit.h
==
--- head/include/histedit.h Sun Jun 13 16:54:11 2010(r209135)
+++ head/include/histedit.h Sun Jun 13 17:04:42 2010(r209136)
@@ -105,9 +105,7 @@ int  el_parse(EditLine *, int, const ch
  */
 int el_set(EditLine *, int, ...);
 int el_get(EditLine *, int, ...);
-#if 0
 unsigned char  _el_fn_complete(EditLine *, int);
-#endif
 
 /*
  * el_set/el_get parameters

Modified: head/lib/libedit/Makefile
==
--- head/lib/libedit/Makefile   Sun Jun 13 16:54:11 2010(r209135)
+++ head/lib/libedit/Makefile   Sun Jun 13 17:04:42 2010(r209136)
@@ -6,7 +6,8 @@ LIB=edit
 SHLIB_MAJOR=   7
 SHLIBDIR?= /lib
 
-OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \
+OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
+   hist.c key.c map.c \
parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
 
 DPADD= ${LIBNCURSES}

Added: head/lib/libedit/filecomplete.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libedit/filecomplete.c Sun Jun 13 17:04:42 2010
(r209136)
@@ -0,0 +1,541 @@
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $NetBSD: filecomplete.c,v 1.19 2010/06/01 18:20:26 christos Exp $
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/types.h
+#include sys/stat.h
+#include stdio.h
+#include dirent.h
+#include string.h
+#include pwd.h
+#include ctype.h
+#include stdlib.h
+#include unistd.h
+#include limits.h
+#include errno.h
+#include fcntl.h
+#include vis.h
+#include el.h
+#include fcns.h  /* for EL_NUM_FCNS */
+#include histedit.h
+#include filecomplete.h
+
+static char break_chars[] = { ' ', '\t', '\n', '', '\\', '\'', '`', '@',
+'$', '', '', '=', ';', '|', '', '{', '(', '\0' };
+
+
+//
+/* completion functions */
+
+/*
+ * does tilde expansion of strings of type ``~user/foo''
+ * if ``user'' isn't valid user name or ``txt'' doesn't start
+ * w/ '~', returns pointer to strdup()ed copy of ``txt''
+ *
+ * it's callers's responsibility to free() returned string
+ */
+char *
+fn_tilde_expand(const char *txt)
+{
+   struct passwd pwres, *pass;
+   char *temp;
+   size_t len = 0;
+   char pwbuf[1024];
+
+   if (txt[0] != '~')
+   return (strdup(txt));
+
+   temp = strchr(txt + 1, '/');
+   if (temp == NULL) {
+   temp = strdup(txt + 1);
+   if (temp == NULL)
+   return NULL;
+   } else {
+   len = 

Re: svn commit: r209122 - head/lib/libelf

2010-06-13 Thread Kai Wang
On Sun, Jun 13, 2010 at 09:37:10AM -0700, Steve Kargl wrote:
 On Sun, Jun 13, 2010 at 10:58:50AM +, Kai Wang wrote:
  Author: kaiw
  Date: Sun Jun 13 10:58:50 2010
  New Revision: 209122
  URL: http://svn.freebsd.org/changeset/base/209122
  
  Log:
* Improve compatibility with existing application code by permitting the
  use of `elf_getbase()` on non-archive members. This change is needed
  for gcc LTO (-flto) to work properly.
* Style fix: paranthesize returned values.
* Document the current behaviour of `elf_getbase()`.

Tested by:gerald, Steve Kargl (original patch)
Obtained from:elftoolchain
MFC after:3 days
  
  Modified:
head/lib/libelf/elf_getbase.3
head/lib/libelf/elf_getbase.c
 
 Thanks.  Unfortunately without the patch to elf_update.c,
 gcc LTO will not work (ie., 'gcc -flto -o z a.o b.o' will
 segfault).  Any chance that the elf_update.c patch will be
 committed; possibly as a conditional compilation.

The patch to elf_update.c needs some more work before it can be
committed. We've concluded that our libelf is indeed overly strict
about data alignment inside sections, so the problem will be fixed
eventually. A ticket[1] has been created to track this issue.

Thanks,
Kai

[1] http://sourceforge.net/apps/trac/elftoolchain/ticket/264
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Roman Divacky
On Sun, Jun 13, 2010 at 01:59:11PM +, m...@freebsd.org wrote:
 On Sun, Jun 13, 2010 at 10:10 AM, Pawel Jakub Dawidek p...@freebsd.org 
 wrote:
  On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:
  Author: lstewart
  Date: Sun Jun 13 02:39:55 2010
  New Revision: 209119
  URL: http://svn.freebsd.org/changeset/base/209119
 
  Log:
  ? Add a utility macro to simplify calculating an aggregate sum from a DPCPU
  ? counter variable.
 
  ? Sponsored by: ? ? ? FreeBSD Foundation
  ? Reviewed by: ? ? ? ?jhb, rpaulo, rwatson (previous version of patch)
  ? MFC after: ?1 week
 
  Modified:
  ? head/sys/sys/pcpu.h
 
  Modified: head/sys/sys/pcpu.h
  ==
  --- head/sys/sys/pcpu.h ? ? ? Sun Jun 13 01:27:29 2010 ? ? ? ?(r209118)
  +++ head/sys/sys/pcpu.h ? ? ? Sun Jun 13 02:39:55 2010 ? ? ? ?(r209119)
  @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  ?#define ? ? ?DPCPU_ID_GET(i, n) ? ? ?(*DPCPU_ID_PTR(i, n))
  ?#define ? ? ?DPCPU_ID_SET(i, n, v) ? (*DPCPU_ID_PTR(i, n) = v)
 
  +/*
  + * Utility macros.
  + */
  +#define DPCPU_SUM(n, var, sum) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 
  ? ? \
  +do { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
  + ? ? (sum) = 0; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
  + ? ? u_int i; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
  + ? ? CPU_FOREACH(i) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
  + ? ? ? ? ? ? (sum) += (DPCPU_ID_PTR(i, n))-var; ? ? ? ? ? ? ? ? ? ? \
  +} while (0)
 
  I'd suggest first swapping variable declaration and '(sum) = 0;'.
  Also using 'i' as a counter in macro can easly lead to name collision.
  If you need to do it, I'd suggest '_i' or something.
  Maybe it would be better to make it an inline function rather than macro?
 
 (Relevant but almost a thread hijack):
 
 At Isilon we've run into a lot of problems with variable declarations
 in macros, especially with -Wshadow turned on.  We ended up
 backporting __COUNTER__ from later versions of gcc and then using it
 to make unique variable names.
 
  - is the backport (or a fresh implementation) something that could be
 done within the scope of the GPL license?
  - is it something FreeBSD would be interested in?
  - is __COUNTER__ supported by clang?

__COUNTER__ is supported by clang
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209137 - head/contrib/wpa

2010-06-13 Thread Rui Paulo
Author: rpaulo
Date: Sun Jun 13 20:16:41 2010
New Revision: 209137
URL: http://svn.freebsd.org/changeset/base/209137

Log:
  Bootstrap mergeinfo in preparation for import.

Modified:
Directory Properties:
  head/contrib/wpa/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209138 - head/sys/sparc64/sparc64

2010-06-13 Thread Marius Strobl
Author: marius
Date: Sun Jun 13 20:29:55 2010
New Revision: 209138
URL: http://svn.freebsd.org/changeset/base/209138

Log:
  Update a branch missed in r207537.
  
  MFC after:3 days

Modified:
  head/sys/sparc64/sparc64/mp_locore.S

Modified: head/sys/sparc64/sparc64/mp_locore.S
==
--- head/sys/sparc64/sparc64/mp_locore.SSun Jun 13 20:16:41 2010
(r209137)
+++ head/sys/sparc64/sparc64/mp_locore.SSun Jun 13 20:29:55 2010
(r209138)
@@ -207,7 +207,7 @@ ENTRY(mp_startup)
bl  %icc, 2f
 nop
cmp %l1, CPU_IMPL_ULTRASPARCIII
-   bl  %icc, 3f
+   bl  %icc, 4f
 nop
 2: mov CPU_STICKSYNC, %l2
membar  #StoreLoad
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209139 - in vendor/wpa/dist: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius src...

2010-06-13 Thread Rui Paulo
Author: rpaulo
Date: Sun Jun 13 20:32:04 2010
New Revision: 209139
URL: http://svn.freebsd.org/changeset/base/209139

Log:
  Import wpa_supplicant  hostapd 0.6.9.

Added:
  vendor/wpa/dist/hostapd/Makefile
  vendor/wpa/dist/hostapd/driver_atheros.c
  vendor/wpa/dist/hostapd/driver_bsd.c
  vendor/wpa/dist/hostapd/driver_hostap.c
  vendor/wpa/dist/hostapd/driver_madwifi.c
  vendor/wpa/dist/hostapd/driver_nl80211.c
  vendor/wpa/dist/hostapd/driver_none.c
  vendor/wpa/dist/hostapd/driver_prism54.c
  vendor/wpa/dist/hostapd/driver_test.c
  vendor/wpa/dist/hostapd/driver_wired.c
  vendor/wpa/dist/hostapd/prism54.h
  vendor/wpa/dist/hostapd/priv_netlink.h
  vendor/wpa/dist/hostapd/radiotap.c
  vendor/wpa/dist/hostapd/radiotap.h
  vendor/wpa/dist/hostapd/radiotap_iter.h
  vendor/wpa/dist/src/common/nl80211_copy.h
  vendor/wpa/dist/src/common/wireless_copy.h
  vendor/wpa/dist/src/drivers/Apple80211.h
  vendor/wpa/dist/src/drivers/Makefile
  vendor/wpa/dist/src/drivers/MobileApple80211.c
  vendor/wpa/dist/src/drivers/MobileApple80211.h
  vendor/wpa/dist/src/drivers/driver_atmel.c
  vendor/wpa/dist/src/drivers/driver_broadcom.c
  vendor/wpa/dist/src/drivers/driver_bsd.c
  vendor/wpa/dist/src/drivers/driver_hostap.c
  vendor/wpa/dist/src/drivers/driver_hostap.h
  vendor/wpa/dist/src/drivers/driver_iphone.m
  vendor/wpa/dist/src/drivers/driver_ipw.c
  vendor/wpa/dist/src/drivers/driver_madwifi.c
  vendor/wpa/dist/src/drivers/driver_ndis_.c
  vendor/wpa/dist/src/drivers/driver_ndiswrapper.c
  vendor/wpa/dist/src/drivers/driver_nl80211.c
  vendor/wpa/dist/src/drivers/driver_osx.m
  vendor/wpa/dist/src/drivers/driver_prism54.c
  vendor/wpa/dist/src/drivers/driver_privsep.c
  vendor/wpa/dist/src/drivers/driver_ps3.c
  vendor/wpa/dist/src/drivers/driver_ralink.c
  vendor/wpa/dist/src/drivers/driver_ralink.h
  vendor/wpa/dist/src/drivers/driver_roboswitch.c
  vendor/wpa/dist/src/drivers/driver_test.c
  vendor/wpa/dist/src/drivers/driver_wext.c
  vendor/wpa/dist/src/drivers/driver_wext.h
  vendor/wpa/dist/src/drivers/driver_wired.c
  vendor/wpa/dist/src/drivers/ndis_events.c
  vendor/wpa/dist/src/drivers/priv_netlink.h
  vendor/wpa/dist/src/drivers/radiotap.c
  vendor/wpa/dist/src/drivers/radiotap.h
  vendor/wpa/dist/src/drivers/radiotap_iter.h
  vendor/wpa/dist/src/l2_packet/Makefile
  vendor/wpa/dist/src/l2_packet/l2_packet_freebsd.c
  vendor/wpa/dist/src/l2_packet/l2_packet_linux.c
  vendor/wpa/dist/src/l2_packet/l2_packet_ndis.c
  vendor/wpa/dist/src/l2_packet/l2_packet_none.c
  vendor/wpa/dist/src/l2_packet/l2_packet_pcap.c
  vendor/wpa/dist/src/l2_packet/l2_packet_privsep.c
  vendor/wpa/dist/src/l2_packet/l2_packet_winpcap.c
  vendor/wpa/dist/src/utils/eloop_none.c
  vendor/wpa/dist/src/utils/eloop_win.c
  vendor/wpa/dist/src/utils/os_none.c
  vendor/wpa/dist/src/utils/os_win32.c
  vendor/wpa/dist/wpa_supplicant/Makefile
  vendor/wpa/dist/wpa_supplicant/README-Windows.txt
  vendor/wpa/dist/wpa_supplicant/config_winreg.c
  vendor/wpa/dist/wpa_supplicant/ctrl_iface_named_pipe.c
  vendor/wpa/dist/wpa_supplicant/main_none.c
  vendor/wpa/dist/wpa_supplicant/main_symbian.cpp
  vendor/wpa/dist/wpa_supplicant/main_winmain.c
  vendor/wpa/dist/wpa_supplicant/main_winsvc.c
  vendor/wpa/dist/wpa_supplicant/nmake.mak
  vendor/wpa/dist/wpa_supplicant/symbian/
  vendor/wpa/dist/wpa_supplicant/symbian/README.symbian
  vendor/wpa/dist/wpa_supplicant/symbian/bld.inf
  vendor/wpa/dist/wpa_supplicant/symbian/wpa_supplicant.mmp
  vendor/wpa/dist/wpa_supplicant/vs2005/
  vendor/wpa/dist/wpa_supplicant/vs2005/eapol_test/
  vendor/wpa/dist/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj   
(contents, props changed)
  vendor/wpa/dist/wpa_supplicant/vs2005/win_if_list/
  vendor/wpa/dist/wpa_supplicant/vs2005/win_if_list/win_if_list.vcproj   
(contents, props changed)
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_cli/
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_cli/wpa_cli.vcproj   (contents, 
props changed)
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_passphrase/
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_passphrase/wpa_passphrase.vcproj   
(contents, props changed)
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_supplicant/
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_supplicant.sln   (contents, props 
changed)
  vendor/wpa/dist/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj   
(contents, props changed)
  vendor/wpa/dist/wpa_supplicant/vs2005/wpasvc/
  vendor/wpa/dist/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj   (contents, props 
changed)
  vendor/wpa/dist/wpa_supplicant/win_example.reg   (contents, props changed)
  vendor/wpa/dist/wpa_supplicant/win_if_list.c
  vendor/wpa/dist/wpa_supplicant/wpa_gui/
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/addinterface.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/addinterface.h
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/eventhistory.cpp
  vendor/wpa/dist/wpa_supplicant/wpa_gui-qt4/eventhistory.h
  

svn commit: r209140 - vendor/wpa/0.6.9

2010-06-13 Thread Rui Paulo
Author: rpaulo
Date: Sun Jun 13 20:32:45 2010
New Revision: 209140
URL: http://svn.freebsd.org/changeset/base/209140

Log:
  Tag wpa_supplicant  hostapd 0.6.9.

Added:
  vendor/wpa/0.6.9/
 - copied from r209139, vendor/wpa/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Stefan Farfeleder
On Sun, Jun 13, 2010 at 01:59:11PM +, m...@freebsd.org wrote:
 
 (Relevant but almost a thread hijack):
 
 At Isilon we've run into a lot of problems with variable declarations
 in macros, especially with -Wshadow turned on.  We ended up
 backporting __COUNTER__ from later versions of gcc and then using it
 to make unique variable names.
 
  - is the backport (or a fresh implementation) something that could be
 done within the scope of the GPL license?
  - is it something FreeBSD would be interested in?
  - is __COUNTER__ supported by clang?
  - if not, could it be?
 
 -Wshadow found several nasty bugs in our code, and apart from a few
 spurious warnings it has been handy to have when building our
 filesystem.

In my opinion using non-standard C features just to work around warnings
is a bit questionable.  A more useful feature would be an attribute that
avoids -Wshadow warnings.

Regards,
Stefan
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209141 - vendor/wpa/0.6.10

2010-06-13 Thread Rui Paulo
Author: rpaulo
Date: Sun Jun 13 21:03:53 2010
New Revision: 209141
URL: http://svn.freebsd.org/changeset/base/209141

Log:
  Tag wpa_supplicant  hostapd 0.6.10.

Added:
  vendor/wpa/0.6.10/
 - copied from r209140, vendor/wpa/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209142 - vendor/wpa/0.6.9

2010-06-13 Thread Rui Paulo
Author: rpaulo
Date: Sun Jun 13 21:04:09 2010
New Revision: 209142
URL: http://svn.freebsd.org/changeset/base/209142

Log:
  Remove wrong tag.

Deleted:
  vendor/wpa/0.6.9/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r209130 - in head/sys: arm/include dev/fdt

2010-06-13 Thread Andrew Turner
On Sun, 13 Jun 2010 13:12:52 + (UTC)
Rafal Jaworowski r...@freebsd.org wrote:

 Author: raj
 Date: Sun Jun 13 13:12:52 2010
 New Revision: 209130
 URL: http://svn.freebsd.org/changeset/base/209130
 
 Log:
   Initial FDT infrastructure elements for ARM.
   
   Reviewed by:imp
   Sponsored by:   The FreeBSD Foundation
 
 Added:
   head/sys/arm/include/fdt.h   (contents, props changed)
   head/sys/arm/include/ofw_machdep.h   (contents, props changed)
   head/sys/dev/fdt/fdt_arm.c   (contents, props changed)
 
 Added: head/sys/arm/include/fdt.h
 ==
 --- /dev/null 00:00:00 1970   (empty, because file is
 newly added)
 +++ head/sys/arm/include/fdt.hSun Jun 13
 13:12:52 2010 (r209130)
 @@ -0,0 +1,68 @@
 +/*-
 + * Copyright (c) 2010 The FreeBSD Foundation
 + * All rights reserved.
 + *
 + * This software was developed by Semihalf under sponsorship from
 + * the FreeBSD Foundation.
 + *
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions
 + * are met:
 + * 1. Redistributions of source code must retain the above copyright
 + *notice, this list of conditions and the following disclaimer.
 + * 2. Redistributions in binary form must reproduce the above
 copyright
 + *notice, this list of conditions and the following disclaimer
 in the
 + *documentation and/or other materials provided with the
 distribution.
 + *
 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS
 IS'' AND
 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 THE
 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 PARTICULAR PURPOSE
 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
 LIABLE
 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL
 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 GOODS
 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION)
 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT
 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 ANY WAY
 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF
 + * SUCH DAMAGE.
 + *
 + * $FreeBSD$
 + */
 +
 +#ifndef _MACHINE_FDT_H_
 +#define _MACHINE_FDT_H_
 +
 +#include dev/ofw/openfirm.h
 +
 +#include vm/vm.h
 +#include vm/pmap.h
 +
 +#include machine/pmap.h
 +#include machine/intr.h
 +
 +#include arm/mv/mvvar.h
 +#include arm/mv/mvwin.h
Are the mv headders supposed to be here? They are including a soc
specific file from an ARM header.

Andrew
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209143 - head/usr.sbin/sysinstall

2010-06-13 Thread Marcel Moolenaar
Author: marcel
Date: Sun Jun 13 23:37:16 2010
New Revision: 209143
URL: http://svn.freebsd.org/changeset/base/209143

Log:
  Fix build breakages on ia64 introduced some commits ago.

Modified:
  head/usr.sbin/sysinstall/disks.c
  head/usr.sbin/sysinstall/install.c

Modified: head/usr.sbin/sysinstall/disks.c
==
--- head/usr.sbin/sysinstall/disks.cSun Jun 13 21:04:09 2010
(r209142)
+++ head/usr.sbin/sysinstall/disks.cSun Jun 13 23:37:16 2010
(r209143)
@@ -79,7 +79,6 @@ static struct chunk *chunk_info[CHUNK_IN
 static int current_chunk;
 
 static voiddiskPartitionNonInteractive(Device *dev);
-static u_char *bootalloc(char *name, size_t *size);
 
 static void
 record_chunks(Disk *d)
@@ -217,6 +216,41 @@ print_command_summary(void)
 move(0, 0);
 }
 
+#if !defined(__ia64__)
+static u_char *
+bootalloc(char *name, size_t *size)
+{
+char buf[FILENAME_MAX];
+struct stat sb;
+
+snprintf(buf, sizeof buf, /boot/%s, name);
+if (stat(buf, sb) != -1) {
+   int fd;
+
+   fd = open(buf, O_RDONLY);
+   if (fd != -1) {
+   u_char *cp;
+
+   cp = malloc(sb.st_size);
+   if (read(fd, cp, sb.st_size) != sb.st_size) {
+   free(cp);
+   close(fd);
+   msgDebug(bootalloc: couldn't read %ld bytes from %s\n, 
(long)sb.st_size, buf);
+   return NULL;
+   }
+   close(fd);
+   if (size != NULL)
+   *size = sb.st_size;
+   return cp;
+   }
+   msgDebug(bootalloc: couldn't open %s\n, buf);
+}
+else
+   msgDebug(bootalloc: can't stat %s\n, buf);
+return NULL;
+}
+#endif
+
 #ifdef PC98
 static void
 getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size,
@@ -732,39 +766,6 @@ diskPartition(Device *dev)
 }
 #endif /* WITH_SLICES */
 
-static u_char *
-bootalloc(char *name, size_t *size)
-{
-char buf[FILENAME_MAX];
-struct stat sb;
-
-snprintf(buf, sizeof buf, /boot/%s, name);
-if (stat(buf, sb) != -1) {
-   int fd;
-
-   fd = open(buf, O_RDONLY);
-   if (fd != -1) {
-   u_char *cp;
-
-   cp = malloc(sb.st_size);
-   if (read(fd, cp, sb.st_size) != sb.st_size) {
-   free(cp);
-   close(fd);
-   msgDebug(bootalloc: couldn't read %ld bytes from %s\n, 
(long)sb.st_size, buf);
-   return NULL;
-   }
-   close(fd);
-   if (size != NULL)
-   *size = sb.st_size;
-   return cp;
-   }
-   msgDebug(bootalloc: couldn't open %s\n, buf);
-}
-else
-   msgDebug(bootalloc: can't stat %s\n, buf);
-return NULL;
-}
-
 #ifdef WITH_SLICES 
 static int
 partitionHook(dialogMenuItem *selected)
@@ -874,7 +875,9 @@ diskPartitionWrite(dialogMenuItem *self)
msgDebug(diskPartitionWrite: Examining %d devices\n, 
deviceCount(devs));
 for (i = 0; devs[i]; i++) {
Disk *d = (Disk *)devs[i]-private;
+#if !defined(__ia64__)
static u_char *boot1;
+#endif
 #if defined(__i386__) || defined(__amd64__)
static u_char *boot2;
 #endif

Modified: head/usr.sbin/sysinstall/install.c
==
--- head/usr.sbin/sysinstall/install.c  Sun Jun 13 21:04:09 2010
(r209142)
+++ head/usr.sbin/sysinstall/install.c  Sun Jun 13 23:37:16 2010
(r209143)
@@ -1191,9 +1191,7 @@ installFilesystems(dialogMenuItem *self)
}
 #if defined(__ia64__)
else if (c1-type == efi  c1-private_data) {
-   char bootdir[FILENAME_MAX];
PartInfo *pi = (PartInfo *)c1-private_data;
-   char *p;
 
sprintf(dname, %s/dev/%s, RunningAsInit ? /mnt : ,
c1-name);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209144 - head/sys/dev/usb/wlan

2010-06-13 Thread Andrew Thompson
Author: thompsa
Date: Mon Jun 14 00:40:23 2010
New Revision: 209144
URL: http://svn.freebsd.org/changeset/base/209144

Log:
  - Because hostapd calls iv_key_set() before if_init(), make sure key_set
callback function will be executed, and that the key won't be deleted during
the init process.
  - txmic and rxmic are written into the chip the same place regardless of
opmode.
  - Make the hardware generate 802.11 sequence numbers.
  
  Submitted by: Akinori Furukoshi
  Obtained from:git://gitorious.org/run/run.git

Modified:
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_runvar.h

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Sun Jun 13 23:37:16 2010
(r209143)
+++ head/sys/dev/usb/wlan/if_run.c  Mon Jun 14 00:40:23 2010
(r209144)
@@ -717,6 +717,10 @@ run_detach(device_t self)
usbd_transfer_unsetup(sc-sc_xfer, RUN_N_XFER);
 
RUN_LOCK(sc);
+
+   sc-ratectl_run = RUN_RATECTL_OFF;
+   sc-cmdq_run = sc-cmdq_key_set = RUN_CMDQ_ABORT;
+
/* free TX list, if any */
for (i = 0; i != RUN_EP_QUEUES; i++)
run_unsetup_tx_list(sc, sc-sc_epq[i]);
@@ -826,6 +830,9 @@ run_vap_create(struct ieee80211com *ic,
if(sc-rvp_cnt++ == 0)
ic-ic_opmode = opmode;
 
+   if(opmode == IEEE80211_M_HOSTAP)
+   sc-cmdq_run = RUN_CMDQ_GO;
+
DPRINTF(rvp_id=%d bmap=%x rvp_cnt=%d\n,
rvp-rvp_id, sc-rvp_bmap, sc-rvp_cnt);
 
@@ -1951,19 +1958,14 @@ run_key_set_cb(void *arg)
struct ieee80211_node *ni;
uint32_t attr;
uint16_t base, associd;
-   uint8_t mode, wcid, txmic, rxmic, iv[8];
+   uint8_t mode, wcid, iv[8];
 
RUN_LOCK_ASSERT(sc, MA_OWNED);
 
-   if(vap-iv_opmode == IEEE80211_M_HOSTAP){
+   if(vap-iv_opmode == IEEE80211_M_HOSTAP)
ni = ieee80211_find_vap_node(ic-ic_sta, vap, cmdq-mac);
-   txmic = 24;
-   rxmic = 16;
-   } else {
+   else
ni = vap-iv_bss;
-   txmic = 16;
-   rxmic = 24;
-   }
associd = (ni != NULL) ? ni-ni_associd : 0;
 
/* map net80211 cipher to RT2860 security mode */
@@ -2002,9 +2004,9 @@ run_key_set_cb(void *arg)
if (k-wk_cipher-ic_cipher == IEEE80211_CIPHER_TKIP) {
if(run_write_region_1(sc, base, k-wk_key, 16))
return;
-   if(run_write_region_1(sc, base + 16, k-wk_key[txmic], 8)) 
/* wk_txmic */
+   if(run_write_region_1(sc, base + 16, k-wk_key[16], 8))
/* wk_txmic */
return;
-   if(run_write_region_1(sc, base + 24, k-wk_key[rxmic], 8)) 
/* wk_rxmic */
+   if(run_write_region_1(sc, base + 24, k-wk_key[24], 8))
/* wk_rxmic */
return;
} else {
/* roundup len to 16-bit: XXX fix write_region_1() instead */
@@ -2085,6 +2087,16 @@ run_key_set(struct ieee80211vap *vap, st
IEEE80211_ADDR_COPY(sc-cmdq[i].mac, mac);
ieee80211_runtask(ic, sc-cmdq_task);
 
+   /*
+* To make sure key will be set when hostapd
+* calls iv_key_set() before if_init().
+*/
+   if(vap-iv_opmode == IEEE80211_M_HOSTAP){
+   RUN_LOCK(sc);
+   sc-cmdq_key_set = RUN_CMDQ_GO;
+   RUN_UNLOCK(sc);
+   }
+
return(1);
 }
 
@@ -2895,6 +2907,9 @@ run_set_tx_desc(struct run_softc *sc, st
txwi-txop |= RT2860_TX_TXOP_HT;
else
txwi-txop |= RT2860_TX_TXOP_BACKOFF;
+
+   if(vap-iv_opmode != IEEE80211_M_STA  !IEEE80211_QOS_HAS_SEQ(wh))
+   txwi-xflags |= RT2860_TX_NSEQ;
 }
 
 /* This function must be called locked */
@@ -2974,7 +2989,7 @@ run_tx(struct run_softc *sc, struct mbuf
if (!IEEE80211_IS_MULTICAST(wh-i_addr1) 
(!hasqos || (qos  IEEE80211_QOS_ACKPOLICY) !=
 IEEE80211_QOS_ACKPOLICY_NOACK)) {
-   xflags = RT2860_TX_ACK;
+   xflags |= RT2860_TX_ACK;
if (ic-ic_flags  IEEE80211_F_SHPREAMBLE)
dur = rt2860_rates[ctl_ridx].sp_ack_dur;
else
@@ -2996,8 +3011,8 @@ run_tx(struct run_softc *sc, struct mbuf
txd-flags = qflags;
txwi = (struct rt2860_txwi *)(txd + 1);
txwi-xflags = xflags;
-   txwi-wcid = (type == IEEE80211_FC0_TYPE_DATA) ?
-   RUN_AID2WCID(ni-ni_associd) : 0xff;
+   txwi-wcid = IEEE80211_IS_MULTICAST(wh-i_addr1) ?
+   0 : RUN_AID2WCID(ni-ni_associd);
/* clear leftover garbage bits */
txwi-flags = 0;
txwi-txop = 0;
@@ -3920,6 +3935,7 @@ run_update_beacon_cb(void *arg)
txwi.phy |= htole16(RT2860_PHY_OFDM);
txwi.txop = RT2860_TX_TXOP_HT;
txwi.flags = RT2860_TX_TS;
+   txwi.xflags = 

Re: svn commit: r209119 - head/sys/sys

2010-06-13 Thread Lawrence Stewart

On 06/13/10 20:10, Pawel Jakub Dawidek wrote:

On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:

[snip]


Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010(r209118)
+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010(r209119)
@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  #define   DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
  #define   DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)

+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum) \
+do {   \
+   (sum) = 0;  \
+   u_int i;\
+   CPU_FOREACH(i)  \
+   (sum) += (DPCPU_ID_PTR(i, n))-var;  \
+} while (0)


I'd suggest first swapping variable declaration and '(sum) = 0;'.
Also using 'i' as a counter in macro can easly lead to name collision.
If you need to do it, I'd suggest '_i' or something.


Given that the DPCPU variable name space is flat and variable names have 
to be unique, perhaps something like the following would address the 
concerns raised?


#define DPCPU_SUM(n, var, sum) \
do {   \
u_int _##n##_i;\
(sum) = 0; \
CPU_FOREACH(_##n##_i)  \
(sum) += (DPCPU_ID_PTR(_##n##_i, n))-var; \
} while (0)


Cheers,
Lawrence
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209145 - releng/8.1

2010-06-13 Thread Ken Smith
Author: kensmith
Date: Mon Jun 14 02:09:06 2010
New Revision: 209145
URL: http://svn.freebsd.org/changeset/base/209145

Log:
  Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
  
  Approved by:  re (implicit)

Added:
 - copied from r209144, stable/8/
Directory Properties:
  releng/8.1/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209146 - stable/8/sys/sys

2010-06-13 Thread Ken Smith
Author: kensmith
Date: Mon Jun 14 02:21:43 2010
New Revision: 209146
URL: http://svn.freebsd.org/changeset/base/209146

Log:
  Adjust __FreeBSD_version to reflect releng/8.1 has been created.
  
  Approved by:  re (implicit)

Modified:
  stable/8/sys/sys/param.h

Modified: stable/8/sys/sys/param.h
==
--- stable/8/sys/sys/param.hMon Jun 14 02:09:06 2010(r209145)
+++ stable/8/sys/sys/param.hMon Jun 14 02:21:43 2010(r209146)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800505   /* Master, propagated to newvers */
+#define __FreeBSD_version 801500   /* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include sys/types.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209147 - head/lib/libc/posix1e

2010-06-13 Thread Tim Kientzle
Author: kientzle
Date: Mon Jun 14 02:26:13 2010
New Revision: 209147
URL: http://svn.freebsd.org/changeset/base/209147

Log:
  Separate _posix1e_acl_id_to_name() into a separate file, to
  break an unnecessary dependency on getpwuid() and getgrgid().
  
  MFC after: 1 month

Added:
  head/lib/libc/posix1e/acl_id_to_name.c   (contents, props changed)
Modified:
  head/lib/libc/posix1e/Makefile.inc
  head/lib/libc/posix1e/acl_support.c

Modified: head/lib/libc/posix1e/Makefile.inc
==
--- head/lib/libc/posix1e/Makefile.inc  Mon Jun 14 02:21:43 2010
(r209146)
+++ head/lib/libc/posix1e/Makefile.inc  Mon Jun 14 02:26:13 2010
(r209147)
@@ -20,6 +20,7 @@ SRCS+=acl_branding.c  \
acl_from_text.c \
acl_from_text_nfs4.c\
acl_get.c   \
+   acl_id_to_name.c\
acl_init.c  \
acl_perm.c  \
acl_set.c   \

Added: head/lib/libc/posix1e/acl_id_to_name.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/posix1e/acl_id_to_name.c  Mon Jun 14 02:26:13 2010
(r209147)
@@ -0,0 +1,100 @@
+/*-
+ * Copyright (c) 1999-2001, 2008 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+ * Support functionality for the POSIX.1e ACL interface
+ * These calls are intended only to be called within the library.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/types.h
+#include namespace.h
+#include sys/acl.h
+#include un-namespace.h
+#include errno.h
+#include grp.h
+#include pwd.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include assert.h
+
+#include acl_support.h
+
+/*
+ * Given a uid/gid, return a username/groupname for the text form of an ACL.
+ * Note that we truncate user and group names, rather than error out, as
+ * this is consistent with other tools manipulating user and group names.
+ * XXX NOT THREAD SAFE, RELIES ON GETPWUID, GETGRGID
+ * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE
+ * MAY HAVE SIDE-EFFECTS
+ */
+int
+_posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, char *buf,
+int flags)
+{
+   struct group*g;
+   struct passwd   *p;
+   int i;
+
+   switch(tag) {
+   case ACL_USER:
+   if (flags  ACL_TEXT_NUMERIC_IDS)
+   p = NULL;
+   else
+   p = getpwuid(id);
+   if (!p)
+   i = snprintf(buf, buf_len, %d, id);
+   else
+   i = snprintf(buf, buf_len, %s, p-pw_name);
+
+   if (i  0) {
+   errno = ENOMEM;
+   return (-1);
+   }
+   return (0);
+
+   case ACL_GROUP:
+   if (flags  ACL_TEXT_NUMERIC_IDS)
+   g = NULL;
+   else
+   g = getgrgid(id);
+   if (g == NULL)
+   i = snprintf(buf, buf_len, %d, id);
+   else
+   i = snprintf(buf, buf_len, %s, g-gr_name);
+
+   if (i  0) {
+   errno = ENOMEM;
+   return (-1);
+   }
+   return (0);
+
+   default:
+   return (EINVAL);
+   }
+}

Modified: head/lib/libc/posix1e/acl_support.c
==
--- 

svn commit: r209148 - releng/8.1

2010-06-13 Thread Ken Smith
Author: kensmith
Date: Mon Jun 14 02:26:33 2010
New Revision: 209148
URL: http://svn.freebsd.org/changeset/base/209148

Log:
  Adjust the cvs branch for 'make update'.
  
  Approved by:  re (implicit)

Modified:
  releng/8.1/Makefile.inc1

Modified: releng/8.1/Makefile.inc1
==
--- releng/8.1/Makefile.inc1Mon Jun 14 02:26:13 2010(r209147)
+++ releng/8.1/Makefile.inc1Mon Jun 14 02:26:33 2010(r209148)
@@ -93,7 +93,7 @@ CLEANDIR= cleandir
 .endif
 
 CVS?=  cvs
-CVSFLAGS?= -r RELENG_8 -P -d -I!
+CVSFLAGS?= -r RELENG_8_1 -P -d -I!
 SVN?=  svn
 SVNFLAGS?= -r HEAD
 SUP?=  /usr/bin/csup
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209149 - releng/8.1/share/examples/cvsup

2010-06-13 Thread Ken Smith
Author: kensmith
Date: Mon Jun 14 02:29:25 2010
New Revision: 209149
URL: http://svn.freebsd.org/changeset/base/209149

Log:
  Adjust cvs branch tag.
  
  Approved by:  re (implicit)

Modified:
  releng/8.1/share/examples/cvsup/standard-supfile

Modified: releng/8.1/share/examples/cvsup/standard-supfile
==
--- releng/8.1/share/examples/cvsup/standard-supfileMon Jun 14 02:26:33 
2010(r209148)
+++ releng/8.1/share/examples/cvsup/standard-supfileMon Jun 14 02:29:25 
2010(r209149)
@@ -49,7 +49,7 @@
 *default host=CHANGE_THIS.FreeBSD.org
 *default base=/var/db
 *default prefix=/usr
-*default release=cvs tag=RELENG_8
+*default release=cvs tag=RELENG_8_1
 *default delete use-rel-suffix
 
 # If you seem to be limited by CPU rather than network or disk bandwidth, try
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209150 - releng/8.1/sys/sys

2010-06-13 Thread Ken Smith
Author: kensmith
Date: Mon Jun 14 02:30:59 2010
New Revision: 209150
URL: http://svn.freebsd.org/changeset/base/209150

Log:
  Adjust __FreeBSD_version to reflect this is the 8.1 release branch.
  
  Approved by:  re (implicit)

Modified:
  releng/8.1/sys/sys/param.h

Modified: releng/8.1/sys/sys/param.h
==
--- releng/8.1/sys/sys/param.h  Mon Jun 14 02:29:25 2010(r209149)
+++ releng/8.1/sys/sys/param.h  Mon Jun 14 02:30:59 2010(r209150)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800505   /* Master, propagated to newvers */
+#define __FreeBSD_version 801000   /* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include sys/types.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209151 - releng/8.1/sys/conf

2010-06-13 Thread Ken Smith
Author: kensmith
Date: Mon Jun 14 02:31:53 2010
New Revision: 209151
URL: http://svn.freebsd.org/changeset/base/209151

Log:
  Ready for 8.1-RC1.
  
  Approved by:  re (implicit)

Modified:
  releng/8.1/sys/conf/newvers.sh

Modified: releng/8.1/sys/conf/newvers.sh
==
--- releng/8.1/sys/conf/newvers.sh  Mon Jun 14 02:30:59 2010
(r209150)
+++ releng/8.1/sys/conf/newvers.sh  Mon Jun 14 02:31:53 2010
(r209151)
@@ -32,7 +32,7 @@
 
 TYPE=FreeBSD
 REVISION=8.1
-BRANCH=PRERELEASE
+BRANCH=RC1
 if [ X${BRANCH_OVERRIDE} != X ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209152 - head/usr.bin/tar

2010-06-13 Thread Tim Kientzle
Author: kientzle
Date: Mon Jun 14 02:56:45 2010
New Revision: 209152
URL: http://svn.freebsd.org/changeset/base/209152

Log:
  If the compressed data is larger than the uncompressed,
  report the compression ratio as 0% instead of displaying
  nonsense triggered by numeric overflow.  This is common
  when dealing with uncompressed files when the I/O blocking
  causes there to be small transient differences in the
  accounting.
  
  Thanks to:  Boris Samorodov

Modified:
  head/usr.bin/tar/read.c
  head/usr.bin/tar/write.c

Modified: head/usr.bin/tar/read.c
==
--- head/usr.bin/tar/read.c Mon Jun 14 02:31:53 2010(r209151)
+++ head/usr.bin/tar/read.c Mon Jun 14 02:56:45 2010(r209152)
@@ -103,6 +103,7 @@ progress_func(void *cookie)
struct archive *a = progress_data-archive;
struct archive_entry *entry = progress_data-entry;
uint64_t comp, uncomp;
+   int compression;
 
if (!need_report())
return;
@@ -112,9 +113,13 @@ progress_func(void *cookie)
if (a != NULL) {
comp = archive_position_compressed(a);
uncomp = archive_position_uncompressed(a);
+   if (comp  uncomp)
+   compression = 0;
+   else
+   compression = (int)((uncomp - comp) * 100 / uncomp);
fprintf(stderr,
In: %s bytes, compression %d%%;,
-   tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp));
+   tar_i64toa(comp), compression);
fprintf(stderr,   Out: %d files, %s bytes\n,
archive_file_count(a), tar_i64toa(uncomp));
}

Modified: head/usr.bin/tar/write.c
==
--- head/usr.bin/tar/write.cMon Jun 14 02:31:53 2010(r209151)
+++ head/usr.bin/tar/write.cMon Jun 14 02:56:45 2010(r209152)
@@ -965,15 +965,21 @@ report_write(struct bsdtar *bsdtar, stru
 struct archive_entry *entry, int64_t progress)
 {
uint64_t comp, uncomp;
+   int compression;
+
if (bsdtar-verbose)
fprintf(stderr, \n);
comp = archive_position_compressed(a);
uncomp = archive_position_uncompressed(a);
fprintf(stderr, In: %d files, %s bytes;,
archive_file_count(a), tar_i64toa(uncomp));
+   if (comp  uncomp)
+   compression = 0;
+   else
+   compression = (int)((uncomp - comp) * 100 / uncomp);
fprintf(stderr,
 Out: %s bytes, compression %d%%\n,
-   tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp));
+   tar_i64toa(comp), compression);
/* Can't have two calls to tar_i64toa() pending, so split the output. */
safe_fprintf(stderr, Current: %s (%s,
archive_entry_pathname(entry),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org