svn commit: r258039 - in head/sys: kern vm

2013-11-12 Thread Konstantin Belousov
Author: kib
Date: Tue Nov 12 08:47:58 2013
New Revision: 258039
URL: http://svnweb.freebsd.org/changeset/base/258039

Log:
  Avoid overflow for the page counts.
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/vfs_vnops.c
  head/sys/vm/vm_fault.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Tue Nov 12 08:32:10 2013(r258038)
+++ head/sys/kern/vfs_vnops.c   Tue Nov 12 08:47:58 2013(r258039)
@@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio 
void *rl_cookie;
struct mount *mp;
vm_page_t *prev_td_ma;
-   int cnt, error, save, saveheld, prev_td_ma_cnt;
+   int error, save, saveheld, prev_td_ma_cnt;
vm_offset_t addr, end;
+   vm_size_t cnt;
vm_prot_t prot;
size_t len, resid;
ssize_t adv;

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Tue Nov 12 08:32:10 2013(r258038)
+++ head/sys/vm/vm_fault.c  Tue Nov 12 08:47:58 2013(r258039)
@@ -1074,7 +1074,7 @@ vm_fault_quick_hold_pages(vm_map_t map, 
 {
vm_offset_t end, va;
vm_page_t *mp;
-   int count;
+   vm_size_t count;
boolean_t pmap_failed;
 
if (len == 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r258016 - head/sys/i386/conf

2013-11-12 Thread Bruce Evans

On Mon, 11 Nov 2013, Dimitry Andric wrote:


Log:
 Disable building the ctl module for the i386 XEN kernel configuration
 for now, since it causes gcc warnings about casting 64 bit bus_addr_t's
 to 32 bit pointers, and vice versa.


Why not disable clang, since it is incompatible? :-)/2

The warning is needed because detecting invalid conversions between pointers
and integers is difficult without it.  You have to cast to prevent errors,
but it is too easy to use a cast that doesn't work.

Similarly for -Wcast-qual, except an error for it is less needed.  This
is broken in clang too:

void *p;
const void *q;

/* Constraint error (C90 6.3.16.1): */
p = q;
/*
 * This is correctly handled by TenDRA (4.2*).  It is an error, and
 * TenDRA tells you the C90 section.
 *
 * This is incorrectly handled by gcc.  It is only a warning (even
 * with -pedantic).  gcc doesn't tell you the standard section.
 *
 * This is incorrectly handled by clang.  It is only a warning (even
 * with -pedantic).  clang doesn't tell you the standard section.
 * It prints more verbose and less useful message telling you that
 * this is controlled by
 * -Wincompatible-pointer-types-discards-qualifiers.  Turning this
 * off gives a non-C compiler that doesn't even warn for the error.
 */

/* Cast to prevent the error: */
p = (void *)q;
/*
 * This quietens TenDRA, gcc and clang.
 *
 * This can be be too quiet, so gcc has a -Wcast-qual feature to
 * turn the warning back on.  FreeBSD uses this excessively, and
 * this has resulted in some correct const poisoning and some
 * abominations like __DECONST() and its use.
 *
 * But -Wcast-qual is just broken in clang.  It has no effect for
 * the above, even with -pedantic.  I don't know of any
 * -Wno-broken-cast-qual flag to fix this.
 */

/* The error can also be prevented by casting through an integer: */
p = (void *)(void *)(uintptr_t)(const volatile void *)q;
/*
 * First we cast to (const volatile void *) to get a pointer on which
 * uintptr_t is useful (in case q is not already a qualified void *).
 * Then we cast to uintptr_t.  This exploits the bug that -Wcast-qual
 * is broken for conversions to integers even for gcc.  There should
 * be a way to avoid -Wcast-qual, but not this normal cast.  The
 * __DE*() abominations use this.  Then we cast to (void *) to get
 * the same result as casting the original pointer to (void *) without
 * the -Wcast-qual warning.  The __DE*() abominations are ugly, but
 * not ugly enough to do this correctly.  They assume that all pointers
 * have the same representation.  Finally, we cast to the lvalue's
 * type, in case this is not (void *).  __DE*() has a parameter for
 * this.  Actually, this step is not needed, except in C++ or when
 * the final type is an integer (this integer type must be either
 * intptr_t or uintptr_t to work and to avoid warnings from gcc).
 */

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


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

2013-11-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Nov 12 10:44:41 2013
New Revision: 258041
URL: http://svnweb.freebsd.org/changeset/base/258041

Log:
  Mention acl_get_brand_np(3).
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/posix1e/acl.3

Modified: head/lib/libc/posix1e/acl.3
==
--- head/lib/libc/posix1e/acl.3 Tue Nov 12 10:40:50 2013(r258040)
+++ head/lib/libc/posix1e/acl.3 Tue Nov 12 10:44:41 2013(r258041)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 25, 2009
+.Dd November 12, 2013
 .Dt ACL 3
 .Os
 .Sh NAME
@@ -131,6 +131,10 @@ This function is described in
 .Xr acl_from_text 3 ,
 and may be used to convert a text-form ACL into working ACL state, if
 the ACL has POSIX.1e or NFSv4 semantics.
+.It Fn acl_get_brand_np
+This function is described in
+.Xr acl_get_brand_np 3
+and may be used to determine whether the ACL has POSIX.1e or NFSv4 semantics.
 .It Fn acl_get_entry
 This function is described in
 .Xr acl_get_entry 3 ,
@@ -248,6 +252,7 @@ library.
 .Xr acl_free 3 ,
 .Xr acl_from_text 3 ,
 .Xr acl_get 3 ,
+.Xr acl_get_brand_np 3 ,
 .Xr acl_get_entry_type_np 3 ,
 .Xr acl_get_flagset_np 3 ,
 .Xr acl_get_permset 3 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r258039 - in head/sys: kern vm

2013-11-12 Thread Bruce Evans

On Tue, 12 Nov 2013, Konstantin Belousov wrote:


Log:
 Avoid overflow for the page counts.

 Reported and tested by:pho
 Sponsored by:  The FreeBSD Foundation
 MFC after: 1 week



Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Tue Nov 12 08:32:10 2013(r258038)
+++ head/sys/kern/vfs_vnops.c   Tue Nov 12 08:47:58 2013(r258039)
@@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio
void *rl_cookie;
struct mount *mp;
vm_page_t *prev_td_ma;
-   int cnt, error, save, saveheld, prev_td_ma_cnt;
+   int error, save, saveheld, prev_td_ma_cnt;
vm_offset_t addr, end;
+   vm_size_t cnt;


int was correct for a count.  You can't possibly have the 8TB
of physical memory needed to overflow a 32-bit int page count.
It is reasonably to assume 32-bit ints.

vm mostly uses u_int for page count (starting with cnt.v_page_count
for the total number of pages in the system).  This will need to be fixed
when you have 16TB of physical memory.  This is worse than int because
it asks for sign extension bugs and for not trapping on overflow.

vm_size_t is a very bogus type for a page count.  It is the type for
(virtual only?) sizes in bytes.  Since sizes are in bytes, 32-bit
int isn't quite large enough even on 32-bit systems.

The signeness change in this asks for sign extension bugs.  In this
function, cnt is still compared with -1 after first assigning the
int result returned by vm_fault_quick_hold_pages.  vm_size_t is an
unsuitable type for holding this result, but the comparison still
works because -1 gets converted to vm_size_t and there are no sign
extension bugs in this case.

If there is an overflow error, then it is for inadequate conversion
of types in expressions like (cnt * PAGE_SIZE).  Here the only
problem seems to be in the error checking:

%   addr = (vm_offset_t)uio_clone-uio_iov-iov_base;
%   end = round_page(addr + len);
%   cnt = howmany(end - trunc_page(addr), PAGE_SIZE);
%   /*
%* A perfectly misaligned address and length could cause
%* both the start and the end of the chunk to use partial
%* page.  +2 accounts for such a situation.
%*/
%   if (cnt  io_hold_cnt + 2) {

If the parameters are untrusted, then howmany() can be almost anything,
including negative.  Assigning it to int cnt overflows it before it
can be checked.  I would also worry about round_page(addr + len)
overflowing.  This can overflow for even the valid range:

addr = base of highest page in address space
len = 1
end of page = end of address space
end = 0 (overflow)

io_hold_count is the constant 12, so cnt is limited to 14 if it doesn't
overflow before checking it.

There was no check for negative values.  Now there is a bogus one.  The
int could hold negative values and the range check was only from above,
so if a negative value occurred then it caused worse problems later.
Now, if howmany() is negative then the negative value is corrupted to
a large unsigned one.  This exceeds 14, so it is reduced to 12 and doesn't
cause further problems, at least from its size.  Checking for negative
values in the old version and converting them to 12 would have worked
much the same.


vm_prot_t prot;
size_t len, resid;
ssize_t adv;

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Tue Nov 12 08:32:10 2013(r258038)
+++ head/sys/vm/vm_fault.c  Tue Nov 12 08:47:58 2013(r258039)
@@ -1074,7 +1074,7 @@ vm_fault_quick_hold_pages(vm_map_t map,
{
vm_offset_t end, va;
vm_page_t *mp;
-   int count;
+   vm_size_t count;
boolean_t pmap_failed;

if (len == 0)



This has similar code, but more robust checking and I think it can almost
rule out bad args:

%   if (len == 0)
%   return (0);
%   end = round_page(addr + len);
%   addr = trunc_page(addr);
% 
% 	/*

%* Check for illegal addresses.
%*/
%   if (addr  vm_map_min(map) || addr  end || end  vm_map_max(map))
%   return (-1);
% 
% 	count = howmany(end - addr, PAGE_SIZE);

%   if (count  max_count)
%   panic(vm_fault_quick_hold_pages: count  max_count);

It checks for illegal addresses after allowing round_page() to overflow.
I think trunc_page() can't overflow.  The check detects overflow in
round_page(addr + len).  So howmany() can't be negative, and the
end  vm_map_max(map) check should prevent it overflowing to 0.  It
can only be very large if we will panic anyway.  But it is technically
incorrect to assign it to int count before checking that it fits in
an int.  There are no problems with breaking the type of 'count', since
the above 

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

2013-11-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Nov 12 12:22:52 2013
New Revision: 258042
URL: http://svnweb.freebsd.org/changeset/base/258042

Log:
  Fix description to actually make sense.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/posix1e/acl_is_trivial_np.3

Modified: head/lib/libc/posix1e/acl_is_trivial_np.3
==
--- head/lib/libc/posix1e/acl_is_trivial_np.3   Tue Nov 12 10:44:41 2013
(r258041)
+++ head/lib/libc/posix1e/acl_is_trivial_np.3   Tue Nov 12 12:22:52 2013
(r258042)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 13, 2010
+.Dd November 12, 2013
 .Dt ACL_STRIP_NP 3
 .Os
 .Sh NAME
@@ -56,9 +56,8 @@ ACL is trivial if it can be fully expres
 any access rules.
 For POSIX.1e ACLs, ACL is trivial if it has the three required entries,
 one for owner, one for owning group, and one for other.
-For NFSv4 ACLs, ACL is trivial if is identical to the ACL generated by
-.Fn acl_strip_np 3
-from the file mode.
+For NFSv4 ACLs, ACL is trivial if it is identical to the ACL generated by
+.Fn acl_strip_np 3 .
 Files that have non-trivial ACL have a plus sign appended after mode bits
 in ls -l output.
 .Sh RETURN VALUES
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2013-11-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Nov 12 12:23:54 2013
New Revision: 258043
URL: http://svnweb.freebsd.org/changeset/base/258043

Log:
  Fix typo.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/posix1e/acl.3

Modified: head/lib/libc/posix1e/acl.3
==
--- head/lib/libc/posix1e/acl.3 Tue Nov 12 12:22:52 2013(r258042)
+++ head/lib/libc/posix1e/acl.3 Tue Nov 12 12:23:54 2013(r258043)
@@ -206,7 +206,7 @@ This function is described in
 .Xr acl_set_tag_type 3 ,
 and may be used to set the tag type of an ACL.
 .It Fn acl_strip_np
-This function is describe din
+This function is described in
 .Xr acl-strip_np 3 ,
 and may be used to remove extended entries from an ACL.
 .It Xo
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258044 - in head: share/man/man4 usr.sbin/gpioctl

2013-11-12 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Nov 12 12:44:59 2013
New Revision: 258044
URL: http://svnweb.freebsd.org/changeset/base/258044

Log:
  Adds gpioiic.4 and gpioled.4 man pages.  Moves some of the information that
  was previously available on gpio.4 to their respectives pages.  Add the
  cross references on gpioctl.8.
  
  Approved by:  adrian (mentor)

Added:
  head/share/man/man4/gpioiic.4   (contents, props changed)
  head/share/man/man4/gpioled.4   (contents, props changed)
Modified:
  head/share/man/man4/gpio.4
  head/usr.sbin/gpioctl/gpioctl.8

Modified: head/share/man/man4/gpio.4
==
--- head/share/man/man4/gpio.4  Tue Nov 12 12:23:54 2013(r258043)
+++ head/share/man/man4/gpio.4  Tue Nov 12 12:44:59 2013(r258044)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 13, 2013
+.Dd November 5, 2013
 .Dt GPIO 4
 .Os
 .Sh NAME
@@ -34,10 +34,9 @@
 To compile these devices into your kernel and use the device hints, place the
 following lines in your kernel configuration file:
 .Bd -ragged -offset indent
-.Cd device gpiobus
-.Cd device gpioiic
 .Cd device gpio
 .Cd device gpioc
+.Cd device gpioiic
 .Cd device gpioled
 .Ed
 .Pp
@@ -76,8 +75,9 @@ architecure include:
 .Sh DESCRIPTION
 The
 .Em gpiobus
-system provides a simple interface to the bit banging style GPIO bus
-found on embedded architectures.
+system provides a simple interface to the GPIO pins that are usually
+available on embedded architectures and can provide bit banging style
+devices to the system.
 .Pp
 The acronym
 .Li GPIO
@@ -88,36 +88,20 @@ The BUS physically consists of multiple 
 for input/output, IRQ delivery, SDA/SCL
 .Em iicbus
 use, etc.
-On most embedded architechtures (mips/arm), discovery of the bus and
+.Pp
+On some embedded architechtures (like MIPS), discovery of the bus and
 configuration of the pins is done via
 .Xr device.hints 5
 in the platform's kernel
 .Xr config 5
 file.
 .Pp
-Assignment of
-.Xr gpioiic 4
-bus variables is done via:
-.Bl -tag -width .Va hint.gpioiic.%d.atXXX
-.It Va hint.gpioiic.%d.at
-Normally just gpiobus0.
-.It Va hint.gpioiic.%d.pins
-This is a bitmask of the pins on the gpio board that are to be used for
-SCLOCK and SDATA from the IIC bus.
-To configure pin 0 and 7, use the bitmask of
-1001 and convert it to a hexadecimal value of 0x0081.
-Should only ever have two bits set in mask.
-.It Va hint.gpioiic.%d.scl
-Indicates which bit in the
-.Va hint.gpioiic.%d.pins
-should be used as the SCLOCK
-source.
-.It Va hint.gpioiic.%d.sda
-Indicates which bit in the
-.Va hint.gpioiic.%d.pins
-should be used as the SDATA
-source.
-.El
+On some others (like ARM), where
+.Xr FDT 4
+is used to describe the device tree, the bus discovery is done via the DTS
+passed to the kernel, being either statically compiled in, or by a variety
+of ways where the boot loader (or Open Firmware enabled system) passes the
+DTS blob to kernel at boot.
 .Pp
 The following are only provided by the
 .Cd ar71xx_gpio
@@ -141,28 +125,11 @@ This is mainly used to set/clear functio
 not setup by uBoot.
 .El
 .Pp
-These values are configureable from the
-.Xr gpioled 4
-interface and help create
-.Xr led 4
-compatible devices in
-.Pa /dev/led/name .
-.Bl -tag -width .Va hint.gpioiic.%d.atXXX
-.It Va hint.gpioled.%d.at
-Normally assigned to gpiobus0.
-.It Va hint.gpioled.%d.name
-Arbitrary name of device in
-.Pa /dev/led/
-to create for
-.Xr led 4
-interfaces.
-.It Va hint.gpioled.%d.pins
-Which pin on the GPIO interface to map to this instance.
-.El
-.Pp
 Simply put, each pin of the GPIO interface is connected to an input/output
 of some device in a system.
 .Sh SEE ALSO
+.Xr gpioiic 4 ,
+.Xr gpioled 4 ,
 .Xr iicbus 4 ,
 .Xr gpioctl 8
 .Sh HISTORY

Added: head/share/man/man4/gpioiic.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/gpioiic.4   Tue Nov 12 12:44:59 2013
(r258044)
@@ -0,0 +1,96 @@
+.\ Copyright (c) 2013, Luiz Otavio O Souza l...@freebsd.org
+.\ 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, 

svn commit: r258045 - head/sys/arm/broadcom/bcm2835

2013-11-12 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Nov 12 13:34:07 2013
New Revision: 258045
URL: http://svnweb.freebsd.org/changeset/base/258045

Log:
  As all the IIC controllers on system uses the same 'iichb' prefix we cannot
  rely only on checking the device unit to indentify the BSC unit we are
  attaching to.  Make use of the device base address to identify our BSC unit.
  
  Approved by:  adrian (mentor)

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c
  head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Tue Nov 12 12:44:59 2013
(r258044)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Tue Nov 12 13:34:07 2013
(r258045)
@@ -234,31 +234,13 @@ static int
 bcm_bsc_attach(device_t dev)
 {
struct bcm_bsc_softc *sc;
+   unsigned long start;
device_t gpio;
-   int rid;
-
-   if (device_get_unit(dev)  1) {
-   device_printf(dev, only bsc0 and bsc1 are supported\n);
-   return (ENXIO);
-   }
+   int i, rid;
 
sc = device_get_softc(dev);
sc-sc_dev = dev;
 
-   /*
-* Configure the GPIO pins to ALT0 function to enable BSC control
-* over the pins.
-*/
-   gpio = devclass_get_device(devclass_find(gpio), 0);
-   if (!gpio) {
-   device_printf(dev, cannot find gpio0\n);
-   return (ENXIO);
-   }
-   bcm_gpio_set_alternate(gpio, bcm_bsc_pins[device_get_unit(dev)].sda,
-   BCM_GPIO_ALT0);
-   bcm_gpio_set_alternate(gpio, bcm_bsc_pins[device_get_unit(dev)].scl,
-   BCM_GPIO_ALT0);
-
rid = 0;
sc-sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, rid,
RF_ACTIVE);
@@ -270,6 +252,29 @@ bcm_bsc_attach(device_t dev)
sc-sc_bst = rman_get_bustag(sc-sc_mem_res);
sc-sc_bsh = rman_get_bushandle(sc-sc_mem_res);
 
+   /* Check the unit we are attaching by its base address. */
+   start = rman_get_start(sc-sc_mem_res);
+   for (i = 0; i  nitems(bcm_bsc_pins); i++) {
+   if (bcm_bsc_pins[i].start == start)
+   break;
+   }
+   if (i == nitems(bcm_bsc_pins)) {
+   device_printf(dev, only bsc0 and bsc1 are supported\n);
+   return (ENXIO);
+   }
+
+   /*
+* Configure the GPIO pins to ALT0 function to enable BSC control
+* over the pins.
+*/
+   gpio = devclass_get_device(devclass_find(gpio), 0);
+   if (!gpio) {
+   device_printf(dev, cannot find gpio0\n);
+   return (ENXIO);
+   }
+   bcm_gpio_set_alternate(gpio, bcm_bsc_pins[i].sda, BCM_GPIO_ALT0);
+   bcm_gpio_set_alternate(gpio, bcm_bsc_pins[i].scl, BCM_GPIO_ALT0);
+
rid = 0;
sc-sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, rid,
RF_ACTIVE | RF_SHAREABLE);

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h  Tue Nov 12 12:44:59 
2013(r258044)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h  Tue Nov 12 13:34:07 
2013(r258045)
@@ -33,9 +33,10 @@
 struct {
uint32_tsda;
uint32_tscl;
+   unsigned long   start;
 } bcm_bsc_pins[] = {
-   { 0, 1 },   /* BSC0 GPIO pins. */
-   { 2, 3 }/* BSC1 GPIO pins. */
+   { 0, 1, 0x20205000 },   /* BSC0 GPIO pins and base address. */
+   { 2, 3, 0x20804000 }/* BSC1 GPIO pins and base address. */
 };
 
 struct bcm_bsc_softc {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258046 - head/sys/dev/ofw

2013-11-12 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Nov 12 13:44:50 2013
New Revision: 258046
URL: http://svnweb.freebsd.org/changeset/base/258046

Log:
  Fix a typo on a comment in ofw_bus_if.m, the default method will return -1
  when a node doesn't exist.
  
  Reviewed by:  nwhitehorn
  Approved by:  adrian (mentor)

Modified:
  head/sys/dev/ofw/ofw_bus_if.m

Modified: head/sys/dev/ofw/ofw_bus_if.m
==
--- head/sys/dev/ofw/ofw_bus_if.m   Tue Nov 12 13:34:07 2013
(r258045)
+++ head/sys/dev/ofw/ofw_bus_if.m   Tue Nov 12 13:44:50 2013
(r258046)
@@ -158,7 +158,7 @@ METHOD const char * get_name {
 } DEFAULT ofw_bus_default_get_name;
 
 # Get the firmware node for the device dev on the bus. The default method will
-# return 0, which signals that there is no such node.
+# return -1, which signals that there is no such node.
 METHOD phandle_t get_node {
device_t bus;
device_t dev;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258047 - head/sys/dev/gpio

2013-11-12 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Nov 12 13:55:19 2013
New Revision: 258047
URL: http://svnweb.freebsd.org/changeset/base/258047

Log:
  Move the KASSERT() check to the point before the increase of number of pins.
  
  Approved by:  adrian (mentor)

Modified:
  head/sys/dev/gpio/gpiobus.c

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Tue Nov 12 13:44:50 2013(r258046)
+++ head/sys/dev/gpio/gpiobus.c Tue Nov 12 13:55:19 2013(r258047)
@@ -190,13 +190,13 @@ gpiobus_attach(device_t dev)
if (res)
return (ENXIO);
 
+   KASSERT(sc-sc_npins != 0, (GPIO device with no pins));
+
/*
 * Increase to get number of pins
 */
sc-sc_npins++;
 
-   KASSERT(sc-sc_npins != 0, (GPIO device with no pins));
-
sc-sc_pins_mapped = malloc(sizeof(int) * sc-sc_npins, M_DEVBUF, 
M_NOWAIT | M_ZERO);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258049 - in head: contrib/smbfs/lib/smb lib/libsmb

2013-11-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Nov 12 15:09:28 2013
New Revision: 258049
URL: http://svnweb.freebsd.org/changeset/base/258049

Log:
  Just disable recoding support in libsmb if built WITHOUT_ICONV.

Modified:
  head/contrib/smbfs/lib/smb/nls.c
  head/lib/libsmb/Makefile

Modified: head/contrib/smbfs/lib/smb/nls.c
==
--- head/contrib/smbfs/lib/smb/nls.cTue Nov 12 15:04:11 2013
(r258048)
+++ head/contrib/smbfs/lib/smb/nls.cTue Nov 12 15:09:28 2013
(r258049)
@@ -36,7 +36,6 @@
 __FBSDID($FreeBSD$);
 
 #include sys/types.h
-#include iconv.h
 #include sys/sysctl.h
 #include ctype.h
 #include errno.h
@@ -47,10 +46,16 @@ __FBSDID($FreeBSD$);
 #include err.h
 #include netsmb/smb_lib.h
 
+#ifdef HAVE_ICONV
+#include iconv.h
+#endif
+
 u_char nls_lower[256];
 u_char nls_upper[256];
 
+#ifdef HAVE_ICONV
 static iconv_t nls_toext, nls_toloc;
+#endif
 
 int
 nls_setlocale(const char *name)
@@ -71,9 +76,7 @@ nls_setlocale(const char *name)
 int
 nls_setrecode(const char *local, const char *external)
 {
-#ifdef APPLE
-   return ENOENT;
-#else
+#ifdef HAVE_ICONV
iconv_t icd;
 
if (nls_toext)
@@ -93,12 +96,15 @@ nls_setrecode(const char *local, const c
}
nls_toloc = icd;
return 0;
+#else
+   return ENOENT;
 #endif
 }
 
 char *
 nls_str_toloc(char *dst, const char *src)
 {
+#ifdef HAVE_ICONV
char *p = dst;
size_t inlen, outlen;
 
@@ -113,11 +119,15 @@ nls_str_toloc(char *dst, const char *src
}
*p = 0;
return dst;
+#else
+   return strcpy(dst, src);
+#endif
 }
 
 char *
 nls_str_toext(char *dst, const char *src)
 {
+#ifdef HAVE_ICONV
char *p = dst;
size_t inlen, outlen;
 
@@ -132,11 +142,15 @@ nls_str_toext(char *dst, const char *src
}
*p = 0;
return dst;
+#else
+   return strcpy(dst, src);
+#endif
 }
 
 void *
 nls_mem_toloc(void *dst, const void *src, int size)
 {
+#ifdef HAVE_ICONV
char *p = dst;
const char *s = src;
size_t inlen, outlen;
@@ -154,11 +168,15 @@ nls_mem_toloc(void *dst, const void *src
outlen--;
}
return dst;
+#else
+   return memcpy(dst, src, size);
+#endif
 }
 
 void *
 nls_mem_toext(void *dst, const void *src, int size)
 {
+#ifdef HAVE_ICONV
char *p = dst;
const char *s = src;
size_t inlen, outlen;
@@ -177,6 +195,9 @@ nls_mem_toext(void *dst, const void *src
outlen--;
}
return dst;
+#else
+   return memcpy(dst, src, size);
+#endif
 }
 
 char *

Modified: head/lib/libsmb/Makefile
==
--- head/lib/libsmb/MakefileTue Nov 12 15:04:11 2013(r258048)
+++ head/lib/libsmb/MakefileTue Nov 12 15:09:28 2013(r258049)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include bsd.own.mk
+
 CONTRIBDIR=${.CURDIR}/../../contrib/smbfs
 .PATH: ${CONTRIBDIR}/lib/smb
 
@@ -16,4 +18,8 @@ SRCS= rcfile.c ctx.c cfopt.c subr.c nls.
 WARNS?=1
 CFLAGS+= -DSMB_CFG_FILE=\/etc/nsmb.conf\ -I${CONTRIBDIR}/include
 
+.if ${MK_ICONV} != no
+CFLAGS+= -DHAVE_ICONV=1
+.endif
+
 .include bsd.lib.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258050 - head/sys/dev/gpio

2013-11-12 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Nov 12 16:08:23 2013
New Revision: 258050
URL: http://svnweb.freebsd.org/changeset/base/258050

Log:
  Fix gpiobus to return BUS_PROBE_GENERIC insted of BUS_PROBE_SPECIFIC (0) so
  it can be overriden by its OFW/FDT version.
  
  Give a chance for GPIO devices that implement the device_identify method to
  attach.
  
  Approved by:  adrian (mentor)

Modified:
  head/sys/dev/gpio/gpiobus.c

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Tue Nov 12 15:09:28 2013(r258049)
+++ head/sys/dev/gpio/gpiobus.c Tue Nov 12 16:08:23 2013(r258050)
@@ -175,7 +175,8 @@ static int
 gpiobus_probe(device_t dev)
 {
device_set_desc(dev, GPIO bus);
-   return (0);
+
+   return (BUS_PROBE_GENERIC);
 }
 
 static int
@@ -209,7 +210,9 @@ gpiobus_attach(device_t dev)
/*
 * Get parent's pins and mark them as unmapped
 */
+   bus_generic_probe(dev);
bus_enumerate_hinted_children(dev);
+
return (bus_generic_attach(dev));
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258051 - head/sys/powerpc/pseries

2013-11-12 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Nov 12 16:14:45 2013
New Revision: 258051
URL: http://svnweb.freebsd.org/changeset/base/258051

Log:
  Actually add IOMMU domain to the list of known mappings. This fixes a bug
  where multiple devices in the same IOMMU domain would be allocated
  conflicting mappings unless they also shared a DMA tag.
  
  MFC after:3 days

Modified:
  head/sys/powerpc/pseries/plpar_iommu.c

Modified: head/sys/powerpc/pseries/plpar_iommu.c
==
--- head/sys/powerpc/pseries/plpar_iommu.c  Tue Nov 12 16:08:23 2013
(r258050)
+++ head/sys/powerpc/pseries/plpar_iommu.c  Tue Nov 12 16:14:45 2013
(r258051)
@@ -115,6 +115,8 @@ phyp_iommu_set_dma_tag(device_t bus, dev
(((uint64_t)(dmawindow[dma_acells + 1])  32) |
dmawindow[dma_acells + 2]);
 
+   if (bootverbose)
+   device_printf(dev, Mapping IOMMU domain %#x\n, dmawindow[0]);
window-map = NULL;
SLIST_FOREACH(i, iommu_map_head, entries) {
if (i-iobn == dmawindow[0]) {
@@ -134,6 +136,7 @@ phyp_iommu_set_dma_tag(device_t bus, dev
window-map-vmem = vmem_create(IOMMU mappings, PAGE_SIZE,
trunc_page(VMEM_ADDR_MAX) - PAGE_SIZE, PAGE_SIZE, 0,
M_BESTFIT | M_NOWAIT);
+   SLIST_INSERT_HEAD(iommu_map_head, window-map, entries);
}
 
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258052 - in head/sys: conf powerpc/ofw powerpc/pseries

2013-11-12 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Nov 12 16:15:09 2013
New Revision: 258052
URL: http://svnweb.freebsd.org/changeset/base/258052

Log:
  Following the approach with ACPI DMAR on x86, split IOMMU handling into
  a variant PCI bus instead of trying to shoehorn it into the PCI host bridge
  adapter. Besides matching better the architecture on other platforms, this
  also allows systems with multiple partitionable endpoints per PCI host
  bridge to work correctly.

Added:
  head/sys/powerpc/ofw/ofw_pcibus.h
 - copied, changed from r257990, head/sys/powerpc/ofw/ofw_pci.h
  head/sys/powerpc/pseries/plpar_pcibus.c   (contents, props changed)
Modified:
  head/sys/conf/files.powerpc
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/powerpc/pseries/rtas_pci.c

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Tue Nov 12 16:14:45 2013(r258051)
+++ head/sys/conf/files.powerpc Tue Nov 12 16:15:09 2013(r258052)
@@ -227,6 +227,7 @@ powerpc/pseries/phyp_llan.c optionallla
 powerpc/pseries/phyp_vscsi.c   optionalpseries powerpc64 scbus
 powerpc/pseries/platform_chrp.coptionalpseries
 powerpc/pseries/plpar_iommu.c  optionalpseries powerpc64
+powerpc/pseries/plpar_pcibus.c optionalpseries powerpc64 pci
 powerpc/pseries/rtas_dev.c optionalpseries
 powerpc/pseries/rtas_pci.c optionalpseries pci
 powerpc/pseries/vdevice.c  optionalpseries powerpc64

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==
--- head/sys/powerpc/ofw/ofw_pcibus.c   Tue Nov 12 16:14:45 2013
(r258051)
+++ head/sys/powerpc/ofw/ofw_pcibus.c   Tue Nov 12 16:15:09 2013
(r258052)
@@ -50,6 +50,7 @@ __FBSDID($FreeBSD$);
 #include dev/pci/pcivar.h
 #include dev/pci/pci_private.h
 
+#include ofw_pcibus.h
 #include pcib_if.h
 #include pci_if.h
 
@@ -85,12 +86,7 @@ static device_method_t ofw_pcibus_method
DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
 
-   { 0, 0 }
-};
-
-struct ofw_pcibus_devinfo {
-   struct pci_devinfo  opd_dinfo;
-   struct ofw_bus_devinfo  opd_obdinfo;
+   DEVMETHOD_END
 };
 
 static devclass_t pci_devclass;
@@ -195,6 +191,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_
pci_freecfg((struct pci_devinfo *)dinfo);
continue;
}
+   dinfo-opd_dma_tag = NULL;
pci_add_child(dev, (struct pci_devinfo *)dinfo);
 
/*
@@ -272,6 +269,7 @@ ofw_pcibus_enum_bus(device_t dev, u_int 
if (dinfo == NULL)
continue;
 
+   dinfo-opd_dma_tag = NULL;
dinfo-opd_obdinfo.obd_node = -1;
 
dinfo-opd_obdinfo.obd_name = NULL;

Copied and modified: head/sys/powerpc/ofw/ofw_pcibus.h (from r257990, 
head/sys/powerpc/ofw/ofw_pci.h)
==
--- head/sys/powerpc/ofw/ofw_pci.h  Mon Nov 11 14:08:25 2013
(r257990, copy source)
+++ head/sys/powerpc/ofw/ofw_pcibus.h   Tue Nov 12 16:15:09 2013
(r258052)
@@ -26,51 +26,26 @@
  * $FreeBSD$
  */
 
-#ifndef POWERPC_OFW_OFW_PCI_H
-#define POWERPC_OFW_OFW_PCI_H
+#ifndef POWERPC_OFW_OFW_PCIBUS_H
+#define POWERPC_OFW_OFW_PCIBUS_H
 
-/*
- * Export class definition for inheritance purposes
- */
-DECLARE_CLASS(ofw_pci_driver);
+#include sys/bus.h
+#include sys/pciio.h
 
-struct ofw_pci_range {
-   uint32_tpci_hi;
-   uint64_tpci;
-   uint64_thost;
-   uint64_tsize;
-};
+#include dev/ofw/ofw_bus.h
+#include dev/ofw/ofw_pci.h
+#include dev/pci/pcivar.h
 
 /*
- * Quirks for some adapters
+ * Export class definition for inheritance purposes
  */
-enum {
-   OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1,
-};
+DECLARE_CLASS(ofw_pcibus_driver);  /* PCI Bus Enumerators */
 
-struct ofw_pci_softc {
-   device_tsc_dev;
-   phandle_t   sc_node;
-   int sc_bus;
-   int sc_initialized;
-
-   int sc_quirks;
-
-   struct ofw_pci_register sc_pcir;
-
-   struct ofw_pci_range*sc_range;
-   int sc_nrange;
-
-   struct rman sc_io_rman;
-   struct rman sc_mem_rman;
-   bus_space_tag_t sc_memt;
-   bus_dma_tag_t   sc_dmat;
-
-   struct ofw_bus_iinfosc_pci_iinfo;
+struct ofw_pcibus_devinfo {
+struct pci_devinfo  opd_dinfo;
+struct ofw_bus_devinfo  opd_obdinfo;
+   bus_dma_tag_t   opd_dma_tag;
 };
 
-int ofw_pci_init(device_t dev);
-int ofw_pci_attach(device_t dev);
-
-#endif // POWERPC_OFW_OFW_PCI_H

svn commit: r258053 - head/usr.sbin/mfiutil

2013-11-12 Thread Sean Bruno
Author: sbruno
Date: Tue Nov 12 17:10:56 2013
New Revision: 258053
URL: http://svnweb.freebsd.org/changeset/base/258053

Log:
  Noted that the stripe_size argument was not being displayed in the usage
  message
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/mfiutil/mfiutil.c

Modified: head/usr.sbin/mfiutil/mfiutil.c
==
--- head/usr.sbin/mfiutil/mfiutil.c Tue Nov 12 16:15:09 2013
(r258052)
+++ head/usr.sbin/mfiutil/mfiutil.c Tue Nov 12 17:10:56 2013
(r258053)
@@ -78,7 +78,7 @@ usage(void)
fprintf(stderr, name volume name\n);
fprintf(stderr, volume progress volume  - display status of 
active operations\n);
fprintf(stderr, clear - clear volume 
configuration\n);
-   fprintf(stderr, create type [-v] drive[,drive[,...]] 
[drive[,drive[,...]]\n);
+   fprintf(stderr, create type [-v] [-s stripe_size] 
drive[,drive[,...]] [drive[,drive[,...]]\n);
fprintf(stderr, delete volume\n);
fprintf(stderr, add drive [volume]  - add a hot spare\n);
fprintf(stderr, remove drive- remove a hot spare\n);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258055 - head/sbin/sysctl

2013-11-12 Thread Devin Teske
Author: dteske
Date: Tue Nov 12 17:44:29 2013
New Revision: 258055
URL: http://svnweb.freebsd.org/changeset/base/258055

Log:
  Fix a typo: s/wriable/writable/

Modified:
  head/sbin/sysctl/sysctl.8

Modified: head/sbin/sysctl/sysctl.8
==
--- head/sbin/sysctl/sysctl.8   Tue Nov 12 17:25:33 2013(r258054)
+++ head/sbin/sysctl/sysctl.8   Tue Nov 12 17:44:29 2013(r258055)
@@ -130,7 +130,7 @@ to standard error.
 .It Fl T
 Display only variables that are setable via loader (CTLFLAG_TUN).
 .It Fl W
-Display only wriable variables that are not statistical.
+Display only writable variables that are not statistical.
 Useful for determining the set of runtime tunable sysctls.
 .It Fl X
 Equivalent to
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258056 - head/sys/kern

2013-11-12 Thread Alan Cox
Author: alc
Date: Tue Nov 12 17:46:11 2013
New Revision: 258056
URL: http://svnweb.freebsd.org/changeset/base/258056

Log:
  Eliminate the gratuitous use of mmap(2) flags from the implementation
  of kern_shmat().  Use a simpler approach to determine whether to pass
  VMFS_NO_SPACE or VMFS_OPTIMAL_SPACE to vm_map_find().

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cTue Nov 12 17:44:29 2013(r258055)
+++ head/sys/kern/sysv_shm.cTue Nov 12 17:46:11 2013(r258056)
@@ -342,7 +342,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
int shmflg;
 {
struct proc *p = td-td_proc;
-   int i, flags;
+   int i;
struct shmid_kernel *shmseg;
struct shmmap_state *shmmap_s = NULL;
vm_offset_t attach_va;
@@ -389,9 +389,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
prot = VM_PROT_READ;
if ((shmflg  SHM_RDONLY) == 0)
prot |= VM_PROT_WRITE;
-   flags = MAP_ANON | MAP_SHARED;
if (shmaddr) {
-   flags |= MAP_FIXED;
if (shmflg  SHM_RND) {
attach_va = (vm_offset_t)shmaddr  ~(SHMLBA-1);
} else if (((vm_offset_t)shmaddr  (SHMLBA-1)) == 0) {
@@ -413,7 +411,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
 
vm_object_reference(shmseg-object);
rv = vm_map_find(p-p_vmspace-vm_map, shmseg-object,
-   0, attach_va, size, 0, (flags  MAP_FIXED) ? VMFS_NO_SPACE :
+   0, attach_va, size, 0, shmaddr != NULL ? VMFS_NO_SPACE :
VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE);
if (rv != KERN_SUCCESS) {
vm_object_deallocate(shmseg-object);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258057 - in head/sys: arm/conf arm/freescale/vybrid boot/fdt/dts dev/uart

2013-11-12 Thread Ruslan Bukin
Author: br
Date: Tue Nov 12 18:02:56 2013
New Revision: 258057
URL: http://svnweb.freebsd.org/changeset/base/258057

Log:
  Add support for Freescale Vybrid Family VF600 heterogeneous
  ARM Cortex-A5/M4 SoC (M4 core is not used in this work).
  
  Support includes device drivers for:
  - NAND Flash Controller (NFC)
  - USB Enhanced Host Controller Interface (EHCI)
  - General-Purpose Input/Output (GPIO)
  - Universal Asynchronous Receiver/Transmitter (UART)
  
  Also supported:
  - Generic Interrupt Controller (GIC)
  - MPCore timer
  - ffec ethernet driver
  
  Reviewed by:  ray
  Approved by:  cognet (mentor)

Added:
  head/sys/arm/conf/COSMIC   (contents, props changed)
  head/sys/arm/freescale/vybrid/
  head/sys/arm/freescale/vybrid/files.vybrid   (contents, props changed)
  head/sys/arm/freescale/vybrid/std.vybrid   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_anadig.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_ccm.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_common.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_common.h   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_ehci.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_gpio.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_iomuxc.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_iomuxc.h   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_machdep.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_mscm.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_nfc.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_src.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_src.h   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_uart.c   (contents, props changed)
  head/sys/boot/fdt/dts/vybrid-cosmic.dts   (contents, props changed)
  head/sys/boot/fdt/dts/vybrid.dtsi   (contents, props changed)
Modified:
  head/sys/dev/uart/uart.h
  head/sys/dev/uart/uart_bus_fdt.c

Added: head/sys/arm/conf/COSMIC
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/conf/COSMICTue Nov 12 18:02:56 2013(r258057)
@@ -0,0 +1,139 @@
+# Kernel configuration for Cosmic Board (Freescale Vybrid Family development 
board).
+#
+# For more information on this file, please read the config(5) manual page,
+# and/or the handbook section on Kernel Configuration Files:
+#
+#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+# $FreeBSD$
+
+ident  COSMIC
+
+include../freescale/vybrid/std.vybrid
+
+makeoptionsMODULES_OVERRIDE=
+makeoptionsWITHOUT_MODULES=ahc
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+makeoptionsWERROR=-Werror
+
+optionsHZ=100 ##
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+optionsINET6   #IPv6 communications protocols
+optionsFFS #Berkeley Fast Filesystem
+optionsSOFTUPDATES
+optionsUFS_ACL #Support for access control 
lists
+optionsUFS_DIRHASH #Improve performance on big 
directories
+optionsMSDOSFS #MSDOS Filesystem
+optionsCD9660  #ISO 9660 Filesystem
+optionsPROCFS  #Process filesystem (requires 
PSEUDOFS)
+optionsPSEUDOFS#Pseudo-filesystem framework
+#options   NANDFS  #NAND Filesystem
+optionsTMPFS
+optionsCOMPAT_43   #Compatible with BSD 4.3 [KEEP 
THIS!]
+optionsSCSI_DELAY=5000 #Delay (in ms) before probing 
SCSI
+optionsKTRACE
+optionsSYSVSHM #SYSV-style shared memory
+optionsSYSVMSG #SYSV-style message queues
+optionsSYSVSEM #SYSV-style semaphores
+options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions
+optionsKBD_INSTALL_CDEV
+optionsPREEMPTION
+optionsFREEBSD_BOOT_LOADER
+optionsVFP # vfp/neon

svn commit: r258061 - head/etc

2013-11-12 Thread John Baldwin
Author: jhb
Date: Tue Nov 12 18:59:23 2013
New Revision: 258061
URL: http://svnweb.freebsd.org/changeset/base/258061

Log:
  Revert r257715.  This breaks the case where devd isn't running.  The
  real solution to this is still being discussed and probably won't look
  quite like this.

Modified:
  head/etc/network.subr

Modified: head/etc/network.subr
==
--- head/etc/network.subr   Tue Nov 12 18:43:35 2013(r258060)
+++ head/etc/network.subr   Tue Nov 12 18:59:23 2013(r258061)
@@ -1429,6 +1429,9 @@ childif_create()
fi
${IFCONFIG_CMD} $i name $child  cfg=0
fi
+   if autoif $child; then
+   ifn_start $child
+   fi
done
 
# Create vlan interfaces
@@ -1452,6 +1455,9 @@ childif_create()
${IFCONFIG_CMD} $i name $child  cfg=0
fi
fi
+   if autoif $child; then
+   ifn_start $child
+   fi
done
 
return ${cfg}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258063 - head/tools/regression/usr.sbin/etcupdate

2013-11-12 Thread John Baldwin
Author: jhb
Date: Tue Nov 12 19:15:06 2013
New Revision: 258063
URL: http://svnweb.freebsd.org/changeset/base/258063

Log:
  Add an -s option that specifies a path to an alternate etcupdate.sh script
  to test.  This allows a non-installed version of the script to be tested
  more easily.

Modified:
  head/tools/regression/usr.sbin/etcupdate/always.sh
  head/tools/regression/usr.sbin/etcupdate/conflicts.sh
  head/tools/regression/usr.sbin/etcupdate/fbsdid.sh
  head/tools/regression/usr.sbin/etcupdate/ignore.sh
  head/tools/regression/usr.sbin/etcupdate/tests.sh

Modified: head/tools/regression/usr.sbin/etcupdate/always.sh
==
--- head/tools/regression/usr.sbin/etcupdate/always.sh  Tue Nov 12 19:10:28 
2013(r258062)
+++ head/tools/regression/usr.sbin/etcupdate/always.sh  Tue Nov 12 19:15:06 
2013(r258063)
@@ -33,13 +33,17 @@ WORKDIR=work
 
 usage()
 {
-   echo Usage: always.sh [-w workdir]
+   echo Usage: always.sh [-s script] [-w workdir]
exit 1
 }
 
-# Allow the user to specify an alternate work directory.
-while getopts w: option; do
+# Allow the user to specify an alternate work directory or script.
+COMMAND=etcupdate
+while getopts s:w: option; do
case $option in
+   s)
+   COMMAND=sh $OPTARG
+   ;;
w)
WORKDIR=$OPTARG
;;
@@ -372,7 +376,7 @@ fi
 
 build_trees
 
-etcupdate -r -d $WORKDIR -D $TEST  $WORKDIR/test.out
+$COMMAND -r -d $WORKDIR -D $TEST  $WORKDIR/test.out
 
 cat  $WORKDIR/correct.out EOF
   D /dirchange/fromdir/extradir/file
@@ -492,7 +496,7 @@ fifo /dirchange/todir/difftype
 
 build_trees
 
-etcupdate -r -A '/first*' -A '/second* /*di*' -d $WORKDIR -D $TEST  \
+$COMMAND -r -A '/first*' -A '/second* /*di*' -d $WORKDIR -D $TEST  \
 $WORKDIR/test1.out
 
 cat  $WORKDIR/correct1.out EOF

Modified: head/tools/regression/usr.sbin/etcupdate/conflicts.sh
==
--- head/tools/regression/usr.sbin/etcupdate/conflicts.sh   Tue Nov 12 
19:10:28 2013(r258062)
+++ head/tools/regression/usr.sbin/etcupdate/conflicts.sh   Tue Nov 12 
19:15:06 2013(r258063)
@@ -33,13 +33,17 @@ WORKDIR=work
 
 usage()
 {
-   echo Usage: tests.sh [-w workdir]
+   echo Usage: conflicts.sh [-s script] [-w workdir]
exit 1
 }
 
-# Allow the user to specify an alternate work directory.
-while getopts w: option; do
+# Allow the user to specify an alternate work directory or script.
+COMMAND=etcupdate
+while getopts s:w: option; do
case $option in
+   s)
+   COMMAND=sh $OPTARG
+   ;;
w)
WORKDIR=$OPTARG
;;
@@ -84,7 +88,7 @@ default:\\
 :welcome=/etc/motd:
 EOF
 
-   etcupdate -r -d $WORKDIR -D $TEST /dev/null
+   $COMMAND -r -d $WORKDIR -D $TEST /dev/null
 }
 
 # This is used to verify special handling for /etc/mail/aliases and
@@ -122,7 +126,7 @@ MAILER-DAEMON: postmaster
 postmaster: foo
 EOF
 
-   etcupdate -r -d $WORKDIR -D $TEST /dev/null
+   $COMMAND -r -d $WORKDIR -D $TEST /dev/null
 }
 
 # $1 - relative path to file that should be missing from TEST
@@ -201,7 +205,7 @@ build_login_conflict
 
 # Verify that 'p' doesn't do anything.
 echo Checking 'p':
-echo 'p' | etcupdate resolve -d $WORKDIR -D $TEST /dev/null
+echo 'p' | $COMMAND resolve -d $WORKDIR -D $TEST /dev/null
 
 file /etc/login.conf  95de92ea3f1bb1bf4f612a8b5908cddd
 missing /etc/login.conf.db
@@ -209,7 +213,7 @@ conflict /etc/login.conf
 
 # Verify that 'mf' removes the conflict, but does nothing else.
 echo Checking 'mf':
-echo 'mf' | etcupdate resolve -d $WORKDIR -D $TEST /dev/null
+echo 'mf' | $COMMAND resolve -d $WORKDIR -D $TEST /dev/null
 
 file /etc/login.conf  95de92ea3f1bb1bf4f612a8b5908cddd
 missing /etc/login.conf.db
@@ -219,7 +223,7 @@ build_login_conflict
 
 # Verify that 'tf' installs the new version of the file.
 echo Checking 'tf':
-echo 'tf' | etcupdate resolve -d $WORKDIR -D $TEST /dev/null
+echo 'tf' | $COMMAND resolve -d $WORKDIR -D $TEST /dev/null
 
 file /etc/login.conf  7774a0f9a3a372c7c109c32fd31c4b6b
 file /etc/login.conf.db
@@ -238,7 +242,7 @@ default:\\
 :welcome=/etc/motd:
 EOF
 
-echo 'r' | etcupdate resolve -d $WORKDIR -D $TEST /dev/null
+echo 'r' | $COMMAND resolve -d $WORKDIR -D $TEST /dev/null
 
 file /etc/login.conf  966e25984b9b63da8eaac8479dcb0d4d
 file /etc/login.conf.db
@@ -248,12 +252,12 @@ build_aliases_conflict
 
 # Verify that 'p' and 'mf' do not generate the newaliases warning.
 echo Checking newalias warning for 'p':
-echo 'p' | etcupdate resolve -d $WORKDIR -D $TEST | grep -q newalias
+echo 'p' | $COMMAND resolve -d $WORKDIR -D $TEST | grep -q newalias
 if [ $? -eq 0 ]; then
echo + Extra warning
 fi
 echo Checking newalias 

svn commit: r258064 - head/usr.sbin/etcupdate

2013-11-12 Thread John Baldwin
Author: jhb
Date: Tue Nov 12 19:18:00 2013
New Revision: 258064
URL: http://svnweb.freebsd.org/changeset/base/258064

Log:
  Sort option flags and fix the width of the options list.  This is a purely
  mechanical change, no content changes.

Modified:
  head/usr.sbin/etcupdate/etcupdate.8

Modified: head/usr.sbin/etcupdate/etcupdate.8
==
--- head/usr.sbin/etcupdate/etcupdate.8 Tue Nov 12 19:15:06 2013
(r258063)
+++ head/usr.sbin/etcupdate/etcupdate.8 Tue Nov 12 19:18:00 2013
(r258064)
@@ -342,27 +342,7 @@ then nothing will be output.
 .Sh OPTIONS
 The following options are available.
 Note that most options do not apply to all modes.
-.Bl -tag -width .Fl d Ar workdir
-.It Fl B
-Do not build generated files in a private object tree.
-Instead,
-reuse the generated files from a previously built object tree that matches
-the source tree.
-This can be useful to avoid gratuitous conflicts in
-.Xr sendmail 8
-configuration
-files when bootstrapping.
-It can also be useful for building a tarball that matches a specific
-world build.
-.It Fl d Ar workdir
-Specify an alternate directory to use as the work directory.
-The work directory is used to store the
-.Dq current
-and
-.Dq previous
-trees as well as unresolved conflicts.
-The default work directory is
-.Pa destdir/var/db/etcupdate .
+.Bl -tag -width .Fl A Ar patterns
 .It Fl A Ar patterns
 Always install the new version of any files that match any of the patterns
 listed in
@@ -378,6 +358,17 @@ Note that ignored files specified via th
 variable or the
 .Fl I
 option will not be installed.
+.It Fl B
+Do not build generated files in a private object tree.
+Instead,
+reuse the generated files from a previously built object tree that matches
+the source tree.
+This can be useful to avoid gratuitous conflicts in
+.Xr sendmail 8
+configuration
+files when bootstrapping.
+It can also be useful for building a tarball that matches a specific
+world build.
 .It Fl D Ar destdir
 Specify an alternate destination directory as the target of a merge.
 This is analogous to the
@@ -388,6 +379,15 @@ The default destination directory is an 
 merges updating
 .Pa /etc
 on the local machine.
+.It Fl d Ar workdir
+Specify an alternate directory to use as the work directory.
+The work directory is used to store the
+.Dq current
+and
+.Dq previous
+trees as well as unresolved conflicts.
+The default work directory is
+.Pa destdir/var/db/etcupdate .
 .It Fl F
 Ignore changes in the FreeBSD ID string when comparing files in the
 destination directory to files in either of the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258065 - in head: contrib/mdocml lib lib/libnv share/mk

2013-11-12 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue Nov 12 19:39:14 2013
New Revision: 258065
URL: http://svnweb.freebsd.org/changeset/base/258065

Log:
  Bring in libnv library for managing name/value pairs. The following types
  are currently supported:
  
  - NV_TYPE_NULL - only name, no data;
  - NV_TYPE_BOOL - boolean (true or false);
  - NV_TYPE_NUMBER - 64bit unsigned integer;
  - NV_TYPE_STRING - C string;
  - NV_TYPE_NVLIST - nested nvlist;
  - NV_TYPE_DESCRIPTOR - file descriptor;
  - NV_TYPE_BINARY - binary data.
  
  For detailed documentation and examples see nv(3) manual page.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/lib/libnv/
  head/lib/libnv/Makefile   (contents, props changed)
  head/lib/libnv/common_impl.h   (contents, props changed)
  head/lib/libnv/dnv.h   (contents, props changed)
  head/lib/libnv/dnvlist.c   (contents, props changed)
  head/lib/libnv/msgio.c   (contents, props changed)
  head/lib/libnv/msgio.h   (contents, props changed)
  head/lib/libnv/nv.3   (contents, props changed)
  head/lib/libnv/nv.h   (contents, props changed)
  head/lib/libnv/nv_impl.h   (contents, props changed)
  head/lib/libnv/nvlist.c   (contents, props changed)
  head/lib/libnv/nvlist_impl.h   (contents, props changed)
  head/lib/libnv/nvpair.c   (contents, props changed)
  head/lib/libnv/nvpair_impl.h   (contents, props changed)
Modified:
  head/contrib/mdocml/lib.in
  head/lib/Makefile
  head/share/mk/bsd.libnames.mk

Modified: head/contrib/mdocml/lib.in
==
--- head/contrib/mdocml/lib.in  Tue Nov 12 19:18:00 2013(r258064)
+++ head/contrib/mdocml/lib.in  Tue Nov 12 19:39:14 2013(r258065)
@@ -67,6 +67,7 @@ LINE(libmemstat,Kernel Memory Alloca
 LINE(libmenu,Curses Menu Library (libmenu, \\-lmenu))
 LINE(libnetgraph,Netgraph User Library (libnetgraph, \\-lnetgraph))
 LINE(libnetpgp,  Netpgp signing, verification, encryption and 
decryption (libnetpgp, \\-lnetpgp))
+LINE(libnv,  Name/value pairs library (libnv, \\-lnv))
 LINE(libossaudio,OSS Audio Emulation Library (libossaudio, 
\\-lossaudio))
 LINE(libpam, Pluggable Authentication Module Library (libpam, 
\\-lpam))
 LINE(libpcap,Packet Capture Library (libpcap, \\-lpcap))

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Tue Nov 12 19:18:00 2013(r258064)
+++ head/lib/Makefile   Tue Nov 12 19:39:14 2013(r258065)
@@ -94,6 +94,7 @@ SUBDIR=   ${SUBDIR_ORDERED} \
${_libnandfs} \
libnetbsd \
${_libngatm} \
+   libnv \
libopie \
libpam \
libpcap \

Added: head/lib/libnv/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libnv/Makefile Tue Nov 12 19:39:14 2013(r258065)
@@ -0,0 +1,161 @@
+# $FreeBSD$
+
+LIB=   nv
+SHLIBDIR?= /lib
+SHLIB_MAJOR= 0
+
+SRCS=  dnvlist.c
+SRCS+= msgio.c
+SRCS+= nvlist.c
+SRCS+= nvpair.c
+
+INCS=  dnv.h
+INCS+= nv.h
+
+MAN+=  nv.3
+
+MLINKS+=nv.3 libnv.3 \
+   nv.3 nvlist.3
+MLINKS+=nv.3 nvlist_create.3 \
+   nv.3 nvlist_destroy.3 \
+   nv.3 nvlist_error.3 \
+   nv.3 nvlist_empty.3 \
+   nv.3 nvlist_clone.3 \
+   nv.3 nvlist_dump.3 \
+   nv.3 nvlist_fdump.3 \
+   nv.3 nvlist_size.3 \
+   nv.3 nvlist_pack.3 \
+   nv.3 nvlist_unpack.3 \
+   nv.3 nvlist_send.3 \
+   nv.3 nvlist_recv.3 \
+   nv.3 nvlist_xfer.3 \
+   nv.3 nvlist_next.3 \
+   nv.3 nvlist_exists.3 \
+   nv.3 nvlist_exists_type.3 \
+   nv.3 nvlist_exists_null.3 \
+   nv.3 nvlist_exists_bool.3 \
+   nv.3 nvlist_exists_number.3 \
+   nv.3 nvlist_exists_string.3 \
+   nv.3 nvlist_exists_nvlist.3 \
+   nv.3 nvlist_exists_descriptor.3 \
+   nv.3 nvlist_exists_binary.3 \
+   nv.3 nvlist_add_null.3 \
+   nv.3 nvlist_add_bool.3 \
+   nv.3 nvlist_add_number.3 \
+   nv.3 nvlist_add_string.3 \
+   nv.3 nvlist_add_stringf.3 \
+   nv.3 nvlist_add_stringv.3 \
+   nv.3 nvlist_add_nvlist.3 \
+   nv.3 nvlist_add_descriptor.3 \
+   nv.3 nvlist_add_binary.3 \
+   nv.3 nvlist_move_string.3 \
+   nv.3 nvlist_move_nvlist.3 \
+   nv.3 nvlist_move_descriptor.3 \
+   nv.3 nvlist_move_binary.3 \
+   nv.3 nvlist_get_bool.3 \
+   nv.3 nvlist_get_number.3 \
+   nv.3 nvlist_get_string.3 \
+   nv.3 nvlist_get_nvlist.3 \
+   nv.3 nvlist_get_descriptor.3 \
+   nv.3 nvlist_get_binary.3 \
+   nv.3 nvlist_take_bool.3 \
+   nv.3 nvlist_take_number.3 \
+   nv.3 nvlist_take_string.3 \
+   nv.3 nvlist_take_nvlist.3 \
+   nv.3 nvlist_take_descriptor.3 \
+   nv.3 nvlist_take_binary.3 \
+   nv.3 nvlist_free.3 \
+   nv.3 nvlist_free_type.3 \
+   nv.3 nvlist_free_null.3 \
+   nv.3 

svn commit: r258066 - in head: tools/regression/usr.sbin/etcupdate usr.sbin/etcupdate

2013-11-12 Thread John Baldwin
Author: jhb
Date: Tue Nov 12 19:44:18 2013
New Revision: 258066
URL: http://svnweb.freebsd.org/changeset/base/258066

Log:
  Add a pre-world mode of updating similar to the -p option that can be
  passed to mergemaster.  In this mode, only changes to /etc/master.passwd
  and /etc/group are merged to /etc.  In addition, it uses a temporary
  tree to stage these changes rather than overwriting the existing
  'current' and 'previous' trees so that a full update can be run after
  a normal installworld has completed.
  
  MFC after:2 weeks

Added:
  head/tools/regression/usr.sbin/etcupdate/preworld.sh   (contents, props 
changed)
Modified:
  head/usr.sbin/etcupdate/etcupdate.8
  head/usr.sbin/etcupdate/etcupdate.sh

Added: head/tools/regression/usr.sbin/etcupdate/preworld.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.sbin/etcupdate/preworld.shTue Nov 12 
19:44:18 2013(r258066)
@@ -0,0 +1,238 @@
+#!/bin/sh
+#
+# Copyright (c) 2013 Advanced Computing Technologies LLC
+# Written by: John H. Baldwin j...@freebsd.org
+# 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.
+#
+# $FreeBSD$
+
+# Regression tests for the pre-world (-p) mode 
+
+WORKDIR=work
+
+usage()
+{
+   echo Usage: preworld.sh [-s script] [-w workdir]
+   exit 1
+}
+
+# Allow the user to specify an alternate work directory or script.
+COMMAND=etcupdate
+while getopts s:w: option; do
+   case $option in
+   s)
+   COMMAND=sh $OPTARG
+   ;;
+   w)
+   WORKDIR=$OPTARG
+   ;;
+   *)
+   echo
+   usage
+   ;;
+   esac
+done
+shift $((OPTIND - 1))
+if [ $# -ne 0 ]; then
+   usage
+fi
+
+CONFLICTS=$WORKDIR/conflicts
+SRC=$WORKDIR/src
+OLD=$WORKDIR/current
+TEST=$WORKDIR/test
+
+build_trees()
+{
+
+   # Populate trees with pre-world files and an additional file
+   # that should not be touched.
+
+   rm -rf $SRC $OLD $TEST $CONFLICTS
+
+   # Create the old source tree as the starting point
+   mkdir -p $OLD/etc
+   cat  $OLD/etc/master.passwd EOF
+#
+root::0:0::0:0:Charlie :/root:/bin/csh
+toor:*:0:0::0:0:Bourne-again Superuser:/root:
+daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
+operator:*:2:5::0:0:System :/:/usr/sbin/nologin
+_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
+uucp:*:66:66::0:0:UUCP 
pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
+pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
+www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
+hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin
+nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
+EOF
+   cat  $OLD/etc/group EOF
+#
+wheel:*:0:root
+daemon:*:1:
+kmem:*:2:
+sys:*:3:
+tty:*:4:
+operator:*:5:root
+_dhcp:*:65:
+uucp:*:66:
+dialer:*:68:
+network:*:69:
+www:*:80:
+hast:*:845:
+nogroup:*:65533:
+nobody:*:65534:
+EOF
+   cat  $OLD/etc/inetd.conf EOF
+# Yet another file
+EOF
+
+   # Copy the old source tree to the test tree and make local
+   # modifications.
+   cp -R $OLD $TEST
+   sed -I  -e 's/root::/root:rpass:/' $TEST/etc/master.passwd
+   cat  $TEST/etc/master.passwd EOF
+john:password:1001:1001::0:0:John Baldwin:/home/john:/bin/tcsh
+messagebus:*:556:556::0:0:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin
+polkit:*:562:562::0:0:PolicyKit User:/nonexistent:/usr/sbin/nologin
+haldaemon:*:560:560::0:0:HAL Daemon 

Re: svn commit: r258066 - in head: tools/regression/usr.sbin/etcupdate usr.sbin/etcupdate

2013-11-12 Thread John Baldwin
On Tuesday, November 12, 2013 2:44:19 pm John Baldwin wrote:
 Author: jhb
 Date: Tue Nov 12 19:44:18 2013
 New Revision: 258066
 URL: http://svnweb.freebsd.org/changeset/base/258066
 
 Log:
   Add a pre-world mode of updating similar to the -p option that can be
   passed to mergemaster.  In this mode, only changes to /etc/master.passwd
   and /etc/group are merged to /etc.  In addition, it uses a temporary
   tree to stage these changes rather than overwriting the existing
   'current' and 'previous' trees so that a full update can be run after
   a normal installworld has completed.

I believe that this gives etcupdate feature parity with mergemaster insofar
as they have different design goals.

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


Re: svn commit: r258053 - head/usr.sbin/mfiutil

2013-11-12 Thread John Baldwin
On Tuesday, November 12, 2013 12:10:56 pm Sean Bruno wrote:
 Author: sbruno
 Date: Tue Nov 12 17:10:56 2013
 New Revision: 258053
 URL: http://svnweb.freebsd.org/changeset/base/258053
 
 Log:
   Noted that the stripe_size argument was not being displayed in the usage
   message

Does this need some wrapping to fit in 80 cols now?

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


svn commit: r258069 - in head/sys: kern sys

2013-11-12 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Nov 12 20:13:10 2013
New Revision: 258069
URL: http://svnweb.freebsd.org/changeset/base/258069

Log:
  Add VM_LAST, a special last element in enum VM_GUEST and use it in CTASSERT
  to ensure that vm_guest range is covered by vm_guest_sysctl_names.
  
  Suggested by: mjg

Modified:
  head/sys/kern/subr_param.c
  head/sys/sys/systm.h

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Tue Nov 12 20:00:51 2013(r258068)
+++ head/sys/kern/subr_param.c  Tue Nov 12 20:13:10 2013(r258069)
@@ -156,6 +156,7 @@ static const char *const vm_guest_sysctl
hv,
NULL
 };
+CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST);
 
 #ifndef XEN
 static const char *const vm_bnames[] = {

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hTue Nov 12 20:00:51 2013(r258068)
+++ head/sys/sys/systm.hTue Nov 12 20:13:10 2013(r258069)
@@ -72,7 +72,8 @@ extern int vm_guest;  /* Running as virt
  * ever implemented (e.g. vendor-specific paravirtualization features).
  * Keep in sync with vm_guest_sysctl_names[].
  */
-enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV };
+enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV,
+   VM_LAST };
 
 #if defined(WITNESS) || defined(INVARIANTS)
 void   kassert_panic(const char *fmt, ...)  __printflike(1, 2);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258070 - head/tools/regression/lib/libnv

2013-11-12 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue Nov 12 20:31:16 2013
New Revision: 258070
URL: http://svnweb.freebsd.org/changeset/base/258070

Log:
  Regression tests for the libnv library.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/tools/regression/lib/libnv/
  head/tools/regression/lib/libnv/Makefile   (contents, props changed)
  head/tools/regression/lib/libnv/nvlist_add.c   (contents, props changed)
  head/tools/regression/lib/libnv/nvlist_exists.c   (contents, props changed)
  head/tools/regression/lib/libnv/nvlist_free.c   (contents, props changed)
  head/tools/regression/lib/libnv/nvlist_get.c   (contents, props changed)
  head/tools/regression/lib/libnv/nvlist_move.c   (contents, props changed)
  head/tools/regression/lib/libnv/nvlist_send_recv.c   (contents, props changed)

Added: head/tools/regression/lib/libnv/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/lib/libnv/MakefileTue Nov 12 20:31:16 2013
(r258070)
@@ -0,0 +1,35 @@
+# $FreeBSD$
+
+TESTS= nvlist_add
+TESTS+=nvlist_exists
+TESTS+=nvlist_free
+TESTS+=nvlist_get
+TESTS+=nvlist_move
+TESTS+=nvlist_send_recv
+
+CFLAGS=-O2 -pipe -fstack-protector
+CFLAGS+=-Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter
+CFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type
+CFLAGS+=-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter
+CFLAGS+=-Wcast-align -Wchar-subscripts -Winline -Wnested-externs 
-Wredundant-decls
+CFLAGS+=-Wold-style-definition -Wno-pointer-sign -Wextra
+
+LDFLAGS+=-lnv
+
+all:   ${TESTS} ${TESTS:=.t}
+
+.for TEST in ${TESTS}
+
+${TEST}:   ${TEST}.c
+   ${CC} ${CFLAGS} ${LDFLAGS} ${@}.c -o $@
+
+${TEST}.t:   ${TEST}
+   @printf #!/bin/sh\n\n%s/%s\n ${.CURDIR} ${@:.t=}  $@
+
+.endfor
+
+test:   all
+   @prove -r ${.CURDIR}
+
+clean:
+   rm -f ${TESTS} ${TESTS:=.t}

Added: head/tools/regression/lib/libnv/nvlist_add.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/lib/libnv/nvlist_add.cTue Nov 12 20:31:16 
2013(r258070)
@@ -0,0 +1,196 @@
+/*-
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Pawel Jakub Dawidek 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 AUTHORS 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 AUTHORS 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$
+ */
+
+#include errno.h
+#include stdio.h
+#include unistd.h
+
+#include nv.h
+
+static int ntest = 1;
+
+#defineCHECK(expr) do {
\
+   if ((expr)) \
+   printf(ok # %d %s:%u\n, ntest, __FILE__, __LINE__);   \
+   else\
+   printf(not ok # %d %s:%u\n, ntest, __FILE__, __LINE__);\
+   ntest++;\
+} while (0)
+
+int
+main(void)
+{
+   const nvlist_t *cnvl;
+   nvlist_t *nvl;
+
+   printf(1..94\n);
+
+   nvl = nvlist_create(0);
+
+   CHECK(!nvlist_exists_null(nvl, nvlist/null));
+   nvlist_add_null(nvl, nvlist/null);
+   CHECK(nvlist_error(nvl) == 0);
+   CHECK(nvlist_exists_null(nvl, nvlist/null));
+
+   CHECK(!nvlist_exists_bool(nvl, nvlist/bool/true));
+   nvlist_add_bool(nvl, nvlist/bool/true, true);
+   CHECK(nvlist_error(nvl) == 0);
+   CHECK(nvlist_exists_bool(nvl, nvlist/bool/true));
+
+   

svn commit: r258071 - head/sbin/nvmecontrol

2013-11-12 Thread Jim Harris
Author: jimharris
Date: Tue Nov 12 21:14:19 2013
New Revision: 258071
URL: http://svnweb.freebsd.org/changeset/base/258071

Log:
  Check for special status code from FIRMWARE_ACTIVATE command
  signifying that a reboot is required to complete activation
  of the requested firmware image.
  
  Reported by:  Joe Golio joseph.go...@emc.com
  Sponsored by: Intel
  MFC after:3 days

Modified:
  head/sbin/nvmecontrol/firmware.c

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cTue Nov 12 20:31:16 2013
(r258070)
+++ head/sbin/nvmecontrol/firmware.cTue Nov 12 21:14:19 2013
(r258071)
@@ -141,7 +141,7 @@ update_firmware(int fd, uint8_t *payload
}
 }
 
-static void
+static int
 activate_firmware(int fd, int slot, int activate_action)
 {
struct nvme_pt_command  pt;
@@ -154,8 +154,14 @@ activate_firmware(int fd, int slot, int 
if (ioctl(fd, NVME_PASSTHROUGH_CMD, pt)  0)
err(1, firmware activate request failed);
 
+   if (pt.cpl.status.sct == NVME_SCT_COMMAND_SPECIFIC 
+   pt.cpl.status.sc == NVME_SC_FIRMWARE_REQUIRES_RESET)
+   return 1;
+
if (nvme_completion_is_error(pt.cpl))
errx(1, firmware activate request returned error);
+
+   return 0;
 }
 
 static void
@@ -171,6 +177,7 @@ firmware(int argc, char *argv[])
 {
int fd = -1, slot = 0;
int a_flag, s_flag, f_flag;
+   int activate_action, reboot_required;
charch, *p, *image = NULL;
char*controller = NULL, prompt[64];
void*buf = NULL;
@@ -287,21 +294,27 @@ firmware(int argc, char *argv[])
if (f_flag) {
update_firmware(fd, buf, size);
if (a_flag)
-   activate_firmware(fd, slot,
-   NVME_AA_REPLACE_ACTIVATE);
+   activate_action = NVME_AA_REPLACE_ACTIVATE;
else
-   activate_firmware(fd, slot,
-   NVME_AA_REPLACE_NO_ACTIVATE);
+   activate_action = NVME_AA_REPLACE_NO_ACTIVATE;
} else {
-   activate_firmware(fd, slot, NVME_AA_ACTIVATE);
+   activate_action = NVME_AA_ACTIVATE;
}
 
+   reboot_required = activate_firmware(fd, slot, activate_action);
+
if (a_flag) {
-   printf(New firmware image activated and will take 
-  effect after next controller reset.\n
-  Controller reset can be initiated via 
-  'nvmecontrol reset %s'\n,
-  controller);
+   if (reboot_required) {
+   printf(New firmware image activated but requires 
+  conventional reset (i.e. reboot) to 
+  complete activation.\n);
+   } else {
+   printf(New firmware image activated and will take 
+  effect after next controller reset.\n
+  Controller reset can be initiated via 
+  'nvmecontrol reset %s'\n,
+  controller);
+   }
}
 
close(fd);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258075 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io sys/modules/vmm usr.sbin/bhyve

2013-11-12 Thread Neel Natu
Author: neel
Date: Tue Nov 12 22:51:03 2013
New Revision: 258075
URL: http://svnweb.freebsd.org/changeset/base/258075

Log:
  Move the ioapic device model from userspace into vmm.ko. This is needed for
  upcoming in-kernel device emulations like the HPET.
  
  The ioctls VM_IOAPIC_ASSERT_IRQ and VM_IOAPIC_DEASSERT_IRQ are used to
  manipulate the ioapic pin state.
  
  Discussed with:   grehan@
  Submitted by: Tycho Nightingale (tycho.nighting...@pluribusnetworks.com)

Added:
  head/sys/amd64/vmm/io/vioapic.c   (contents, props changed)
  head/sys/amd64/vmm/io/vioapic.h   (contents, props changed)
Deleted:
  head/usr.sbin/bhyve/ioapic.c
  head/usr.sbin/bhyve/ioapic.h
Modified:
  head/lib/libvmmapi/vmmapi.c
  head/lib/libvmmapi/vmmapi.h
  head/sys/amd64/include/vmm.h
  head/sys/amd64/include/vmm_dev.h
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_dev.c
  head/sys/modules/vmm/Makefile
  head/usr.sbin/bhyve/Makefile
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/pci_emul.c
  head/usr.sbin/bhyve/pci_lpc.c
  head/usr.sbin/bhyve/pit_8254.c

Modified: head/lib/libvmmapi/vmmapi.c
==
--- head/lib/libvmmapi/vmmapi.c Tue Nov 12 22:43:27 2013(r258074)
+++ head/lib/libvmmapi/vmmapi.c Tue Nov 12 22:51:03 2013(r258075)
@@ -397,6 +397,28 @@ vm_lapic_irq(struct vmctx *ctx, int vcpu
 }
 
 int
+vm_ioapic_assert_irq(struct vmctx *ctx, int irq)
+{
+   struct vm_ioapic_irq ioapic_irq;
+
+   bzero(ioapic_irq, sizeof(struct vm_ioapic_irq));
+   ioapic_irq.irq = irq;
+
+   return (ioctl(ctx-fd, VM_IOAPIC_ASSERT_IRQ, ioapic_irq));
+}
+
+int
+vm_ioapic_deassert_irq(struct vmctx *ctx, int irq)
+{
+   struct vm_ioapic_irq ioapic_irq;
+
+   bzero(ioapic_irq, sizeof(struct vm_ioapic_irq));
+   ioapic_irq.irq = irq;
+
+   return (ioctl(ctx-fd, VM_IOAPIC_DEASSERT_IRQ, ioapic_irq));
+}
+
+int
 vm_inject_nmi(struct vmctx *ctx, int vcpu)
 {
struct vm_nmi vmnmi;

Modified: head/lib/libvmmapi/vmmapi.h
==
--- head/lib/libvmmapi/vmmapi.h Tue Nov 12 22:43:27 2013(r258074)
+++ head/lib/libvmmapi/vmmapi.h Tue Nov 12 22:51:03 2013(r258075)
@@ -67,6 +67,8 @@ int   vm_inject_event(struct vmctx *ctx, i
 intvm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type,
 int vector, int error_code);
 intvm_lapic_irq(struct vmctx *ctx, int vcpu, int vector);
+intvm_ioapic_assert_irq(struct vmctx *ctx, int irq);
+intvm_ioapic_deassert_irq(struct vmctx *ctx, int irq);
 intvm_inject_nmi(struct vmctx *ctx, int vcpu);
 intvm_capability_name2type(const char *capname);
 const char *vm_capability_type2name(int type);

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hTue Nov 12 22:43:27 2013
(r258074)
+++ head/sys/amd64/include/vmm.hTue Nov 12 22:51:03 2013
(r258075)
@@ -38,6 +38,7 @@ struct vm_memory_segment;
 struct seg_desc;
 struct vm_exit;
 struct vm_run;
+struct vioapic;
 struct vlapic;
 struct vmspace;
 struct vm_object;
@@ -116,10 +117,12 @@ int vm_nmi_pending(struct vm *vm, int vc
 void vm_nmi_clear(struct vm *vm, int vcpuid);
 uint64_t *vm_guest_msrs(struct vm *vm, int cpu);
 struct vlapic *vm_lapic(struct vm *vm, int cpu);
+struct vioapic *vm_ioapic(struct vm *vm);
 int vm_get_capability(struct vm *vm, int vcpu, int type, int *val);
 int vm_set_capability(struct vm *vm, int vcpu, int type, int val);
 int vm_get_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state *state);
 int vm_set_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state state);
+int vm_apicid2vcpuid(struct vm *vm, int apicid);
 void vm_activate_cpu(struct vm *vm, int vcpu);
 cpuset_t vm_active_cpus(struct vm *vm);
 struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid);

Modified: head/sys/amd64/include/vmm_dev.h
==
--- head/sys/amd64/include/vmm_dev.hTue Nov 12 22:43:27 2013
(r258074)
+++ head/sys/amd64/include/vmm_dev.hTue Nov 12 22:51:03 2013
(r258075)
@@ -71,6 +71,10 @@ struct vm_lapic_irq {
int vector;
 };
 
+struct vm_ioapic_irq {
+   int irq;
+};
+
 struct vm_capability {
int cpuid;
enum vm_cap_type captype;
@@ -164,6 +168,8 @@ enum {
IOCNUM_INJECT_EVENT = 30,
IOCNUM_LAPIC_IRQ = 31,
IOCNUM_INJECT_NMI = 32,
+   IOCNUM_IOAPIC_ASSERT_IRQ = 33,
+   IOCNUM_IOAPIC_DEASSERT_IRQ = 34,
 
/* PCI pass-thru */
IOCNUM_BIND_PPTDEV = 40,
@@ -199,6 +205,10 @@ enum {
_IOW('v', IOCNUM_INJECT_EVENT, struct vm_event)
 #defineVM_LAPIC_IRQ\
_IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq)
+#defineVM_IOAPIC_ASSERT_IRQ\

Re: svn commit: r258039 - in head/sys: kern vm

2013-11-12 Thread John-Mark Gurney
Bruce Evans wrote this message on Tue, Nov 12, 2013 at 22:13 +1100:
 On Tue, 12 Nov 2013, Konstantin Belousov wrote:
 
 Log:
  Avoid overflow for the page counts.
 
  Reported and tested by: pho
  Sponsored by:   The FreeBSD Foundation
  MFC after:  1 week
 
 Modified: head/sys/kern/vfs_vnops.c
 ==
 --- head/sys/kern/vfs_vnops.cTue Nov 12 08:32:10 2013
 (r258038)
 +++ head/sys/kern/vfs_vnops.cTue Nov 12 08:47:58 2013
 (r258039)
 @@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio
  void *rl_cookie;
  struct mount *mp;
  vm_page_t *prev_td_ma;
 -int cnt, error, save, saveheld, prev_td_ma_cnt;
 +int error, save, saveheld, prev_td_ma_cnt;
  vm_offset_t addr, end;
 +vm_size_t cnt;
 
 int was correct for a count.  You can't possibly have the 8TB
 of physical memory needed to overflow a 32-bit int page count.
^ today
 It is reasonably to assume 32-bit ints.

Except that the modern AMD64 arch now allows 52 bits of address for
phyiscal memory, which does mean in a few years, we will be eclipsing
8TB in a single machine...

Isn't someone running FreeBSD on a 1TB machine?  I'm pretty possitive
I remeber someone running 512GB, so only 3/4 doublings away from hitting
the limit...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258076 - head/usr.sbin/syslogd

2013-11-12 Thread Ian Lepore
Author: ian
Date: Wed Nov 13 01:01:15 2013
New Revision: 258076
URL: http://svnweb.freebsd.org/changeset/base/258076

Log:
  This fixes 3 problems in syslogd related to sizing receive buffers...
  
  - A call was misplaced at the wrong level of nested if blocks, so that
the buffers for unix domain sockets (/dev/log, /dev/klog) were never
increased at all; they remained at a way-too-small default size of 4096.
  
  - The function that was supposed to double the size of the buffer
sometimes did nothing, and sometimes installed a wildly-wrong buffer
size (either too large or too small) due to an unitialized 'slen'
variable passed to getsockopt().  Most often it doubled the UDP buffers
from 40k to 80k because accidentally there would be harmless stack
garbage in the unitialized variables.
  
  - The whole concept of blindly doubling a socket's buffer size without
knowing what size it started at is a design flaw that has to be called a
bug.  If the double_rbuf() function had worked at all (I.E., if the
other two bugs didn't exist) this would lead to UDP sockets having an
80k buffer while unix dgram sockets get an 8k buffer.  There's nothing
about the problem being solved that requires larger buffers for UDP than
for unix dgram sockets -- the buffering requirements are the same
regardless of socket type.
  
  This change renames the double_rbuf() function to increase_rbuf() and
  increases the buffer size on all types of sockets to 80k.  80k was
  chosen only because it appears to be the size the original change was
  shooting for, and it certainly seems to be reasonably large (I might
  have picked 64k in the absence of any historical guidance).
  
  PR:   160433
  Submitted by: me, in 2011.

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Tue Nov 12 22:51:03 2013
(r258075)
+++ head/usr.sbin/syslogd/syslogd.c Wed Nov 13 01:01:15 2013
(r258076)
@@ -74,6 +74,7 @@ __FBSDID($FreeBSD$);
 #defineDEFSPRI (LOG_KERN|LOG_CRIT)
 #defineTIMERINTVL  30  /* interval for checking flush, 
mark */
 #defineTTYMSGTIME  1   /* timeout passed to ttymsg */
+#defineRCVBUF_MINSIZE  (80 * 1024) /* minimum size of dgram rcv 
buffer */
 
 #include sys/param.h
 #include sys/ioctl.h
@@ -336,7 +337,7 @@ static void unmapped(struct sockaddr *);
 static voidwallmsg(struct filed *, struct iovec *, const int iovlen);
 static int waitdaemon(int, int, int);
 static voidtimedout(int);
-static voiddouble_rbuf(int);
+static voidincrease_rcvbuf(int);
 
 int
 main(int argc, char *argv[])
@@ -547,8 +548,8 @@ main(int argc, char *argv[])
STAILQ_REMOVE(funixes, fx, funix, next);
continue;
}
-   double_rbuf(fx-s);
}
+   increase_rcvbuf(fx-s);
}
if (SecureMode = 1)
finet = socksetup(family, bindhostname);
@@ -2720,7 +2721,7 @@ socksetup(int af, char *bindhostname)
}
 
if (!SecureMode)
-   double_rbuf(*s);
+   increase_rcvbuf(*s);
}
 
(*socks)++;
@@ -2741,12 +2742,16 @@ socksetup(int af, char *bindhostname)
 }
 
 static void
-double_rbuf(int fd)
+increase_rcvbuf(int fd)
 {
-   socklen_t slen, len;
+   socklen_t len, slen;
+
+   slen = sizeof(len);
 
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, len, slen) == 0) {
-   len *= 2;
-   setsockopt(fd, SOL_SOCKET, SO_RCVBUF, len, slen);
+   if (len  RCVBUF_MINSIZE) {
+   len = RCVBUF_MINSIZE;
+   setsockopt(fd, SOL_SOCKET, SO_RCVBUF, len, 
sizeof(len));
+   }
}
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258077 - head/usr.sbin/syslogd

2013-11-12 Thread Ian Lepore
Author: ian
Date: Wed Nov 13 01:04:02 2013
New Revision: 258077
URL: http://svnweb.freebsd.org/changeset/base/258077

Log:
  Add ENETUNREACH and EADDRNOTAVAIL to the list of errors that are potentially
  transient and shouldn't result in closing the socket and giving up forever.

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Wed Nov 13 01:01:15 2013
(r258076)
+++ head/usr.sbin/syslogd/syslogd.c Wed Nov 13 01:04:02 2013
(r258077)
@@ -1242,8 +1242,10 @@ fprintlog(struct filed *f, int flags, co
switch (errno) {
case ENOBUFS:
case ENETDOWN:
+   case ENETUNREACH:
case EHOSTUNREACH:
case EHOSTDOWN:
+   case EADDRNOTAVAIL:
break;
/* case EBADF: */
/* case EACCES: */
@@ -1254,7 +1256,7 @@ fprintlog(struct filed *f, int flags, co
/* case ENOBUFS: */
/* case ECONNREFUSED: */
default:
-   dprintf(removing entry\n);
+   dprintf(removing entry: errno=%d\n, 
e);
f-f_type = F_UNUSED;
break;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258078 - head/sys/powerpc/include

2013-11-12 Thread Justin Hibbits
Author: jhibbits
Date: Wed Nov 13 01:37:52 2013
New Revision: 258078
URL: http://svnweb.freebsd.org/changeset/base/258078

Log:
  Increase the stack size for ppc64 from 4 pages to 8.
  
  I found a stack overflow when a coredump was taken onto a ZFS volume with
  heavy network activity.  2 DSI traps, plus one DECR trap, along with several
  function calls in the stack, overflowed the 4 pages.  8 page stack fixes this.
  
  Discussed with: nwhitehorn
  MFC after:1 week

Modified:
  head/sys/powerpc/include/param.h

Modified: head/sys/powerpc/include/param.h
==
--- head/sys/powerpc/include/param.hWed Nov 13 01:04:02 2013
(r258077)
+++ head/sys/powerpc/include/param.hWed Nov 13 01:37:52 2013
(r258078)
@@ -104,7 +104,11 @@
 #defineMAXPAGESIZES1   /* maximum number of supported 
page sizes */
 
 #ifndef KSTACK_PAGES
-#defineKSTACK_PAGES4   /* includes pcb */
+#ifdef __powerpc64__
+#defineKSTACK_PAGES8   /* includes pcb */
+#else
+#defineKSTACK_PAGES8   /* includes pcb */
+#endif
 #endif
 #defineKSTACK_GUARD_PAGES  1   /* pages of kstack guard; 0 
disables */
 #defineUSPACE  (KSTACK_PAGES * PAGE_SIZE)  /* total size 
of pcb */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258079 - head/sys/powerpc/include

2013-11-12 Thread Justin Hibbits
Author: jhibbits
Date: Wed Nov 13 01:51:40 2013
New Revision: 258079
URL: http://svnweb.freebsd.org/changeset/base/258079

Log:
  Fix typo.
  
  Submitted by: loos

Modified:
  head/sys/powerpc/include/param.h

Modified: head/sys/powerpc/include/param.h
==
--- head/sys/powerpc/include/param.hWed Nov 13 01:37:52 2013
(r258078)
+++ head/sys/powerpc/include/param.hWed Nov 13 01:51:40 2013
(r258079)
@@ -107,7 +107,7 @@
 #ifdef __powerpc64__
 #defineKSTACK_PAGES8   /* includes pcb */
 #else
-#defineKSTACK_PAGES8   /* includes pcb */
+#defineKSTACK_PAGES4   /* includes pcb */
 #endif
 #endif
 #defineKSTACK_GUARD_PAGES  1   /* pages of kstack guard; 0 
disables */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258080 - in head: etc/rc.d share/man/man5

2013-11-12 Thread Josh Paetzel
Author: jpaetzel
Date: Wed Nov 13 03:50:31 2013
New Revision: 258080
URL: http://svnweb.freebsd.org/changeset/base/258080

Log:
  Add support for multiple instances of ftp-proxy
  and pflog devices.
  
  PR:   conf/158171
  Submitted by: Thomas Johnson t...@claimlynx.com

Modified:
  head/etc/rc.d/ftp-proxy
  head/etc/rc.d/pflog
  head/share/man/man5/rc.conf.5

Modified: head/etc/rc.d/ftp-proxy
==
--- head/etc/rc.d/ftp-proxy Wed Nov 13 01:51:40 2013(r258079)
+++ head/etc/rc.d/ftp-proxy Wed Nov 13 03:50:31 2013(r258080)
@@ -14,4 +14,62 @@ rcvar=ftpproxy_enable
 command=/usr/sbin/ftp-proxy
 
 load_rc_config $name
-run_rc_command $1
+
+#
+# manage_pid argument
+#  Create or remove a pidfile manually, for daemons that can't be bothered
+#  to do it themselves. Takes one argument, which is the argument provided
+#  to the rc script. The pidfile will be named /var/run/$name.pid,
+#  unless $pidfile is defined.
+#
+#  The method used to determine the pid is rather hacky; grep ps output to
+#  find '$procname|$command', then grep for ${name}_flags. If at all
+#  possible, use another method if at all possible, to avoid that dirty-
+#  code feeling.
+#
+manage_pid() {
+   local search_string ps_pid
+   case $1 in
+   *start)
+   cmd_string=`basename ${procname:-${command}}`
+   eval flag_string=\\$${name}_flags\
+   # Determine the pid.
+   ps_pid=`ps ax -o pid= -o command= | grep $cmd_string | 
grep -e $flag_string | grep -v grep | awk '{ print $1 }'`
+   # Write the pidfile depending on $pidfile status.
+   echo $ps_pid  ${pidfile:-/var/run/$name.pid}
+   ;;
+   stop)
+   rm $pidfile
+   ;;
+   esac
+}
+
+# Allow ftp-proxy to start up in two different ways. The typical behavior
+# is to start up one instance of ftp-proxy by setting ftpproxy_enable and
+# ftpproxy_flags. The alternate behavior allows multiple instances of ftp-
+# proxy to be started, allowing different types of proxy behavior. To use the
+# new behavior, a list of instances must be defined, and a list of flags for
+# each instance. For example, if we want to start two instances of ftp-proxy,
+# foo and bar, we would set the following vars.
+#  ftpproxy_enable=YES
+#  ftpproxy_instances=foo bar
+#  ftpproxy_foo=arguments for foo
+#  ftpproxy_bar=arguments for bar
+#
+# Starting more than one ftp-proxy?
+if [ $ftpproxy_instances ]  [ -n ${ftpproxy_instances} ]; then
+   # Iterate through instance list.
+   for i in $ftpproxy_instances; do
+   #eval ftpproxy_${i}_flags=\$ftpproxy_${i}
+   #eval name=ftpproxy_${i}
+   # Set flags for this instance.
+   eval ftpproxy_flags=\$ftpproxy_${i}
+   # Define a unique pid file name.
+   pidfile=/var/run/ftp-proxy.$i.pid
+   run_rc_command $1
+   manage_pid $1
+   done
+else
+   # Traditional single-instance behavior
+   run_rc_command $1
+fi

Modified: head/etc/rc.d/pflog
==
--- head/etc/rc.d/pflog Wed Nov 13 01:51:40 2013(r258079)
+++ head/etc/rc.d/pflog Wed Nov 13 03:50:31 2013(r258080)
@@ -24,25 +24,41 @@ pflog_prestart()
 {
load_kld pflog || return 1
 
-   # set pflog0 interface to up state
-   if ! ifconfig pflog0 up; then
-   warn 'could not bring up pflog0.'
+   # set pflog_dev interface to up state
+   if ! ifconfig $pflog_dev up; then
+   warn could not bring up $pflog_dev.
return 1
fi
 
# prepare the command line for pflogd
-   rc_flags=-f $pflog_logfile $rc_flags
+   rc_flags=-f $pflog_logfile -i $pflog_dev $rc_flags
 
# report we're ready to run pflogd
return 0
 }
 
+pflog_poststart() {
+   # Allow child pflogd to settle
+   sleep 0.10
+   # More elegant(?) method for getting a unique pid
+   if [ -f /var/run/pflogd.pid ]; then
+   mv /var/run/pflogd.pid $pidfile
+   else
+   warn /var/run/pflogd.pid does not exist. Too fast.
+   fi
+}
+
 pflog_poststop()
 {
-   if ! ifconfig pflog0 down; then
-   warn 'could not bring down pflog0.'
+   if ! ifconfig $pflog_dev down; then
+   warn could not bring down $pflog_dev.
return 1
fi
+
+   if [ $pflog_instances ]  [ -n $pflog_instances ]; then
+   rm $pidfile
+   fi
+
return 0
 }
 
@@ -53,4 +69,33 @@ pflog_resync()
 }
 
 load_rc_config $name
-run_rc_command $1
+
+# Check if spawning multiple pflogd
+echo Starting pflogd: $pflog_instances
+if [ $pflog_instances ]  

svn commit: r258081 - in head/contrib/gcc: . cp doc

2013-11-12 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Nov 13 04:31:27 2013
New Revision: 258081
URL: http://svnweb.freebsd.org/changeset/base/258081

Log:
  gcc: Backport fixes for -W parentheses in C++
  
  This fixes GCC 19564:
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00868.html
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01772.html
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00545.html
  
  The patch and its fixes are used by Google in their enhanced gcc-4.2.1
  port and predates the license switch in GCC so they are still under
  GPLv2.
  
  MFC after:3 weeks

Modified:
  head/contrib/gcc/ChangeLog.gcc43
  head/contrib/gcc/c-common.c
  head/contrib/gcc/c-common.h
  head/contrib/gcc/c-typeck.c
  head/contrib/gcc/cp/cp-tree.h
  head/contrib/gcc/cp/parser.c
  head/contrib/gcc/cp/pt.c
  head/contrib/gcc/cp/semantics.c
  head/contrib/gcc/cp/typeck.c
  head/contrib/gcc/doc/invoke.texi

Modified: head/contrib/gcc/ChangeLog.gcc43
==
--- head/contrib/gcc/ChangeLog.gcc43Wed Nov 13 03:50:31 2013
(r258080)
+++ head/contrib/gcc/ChangeLog.gcc43Wed Nov 13 04:31:27 2013
(r258081)
@@ -232,6 +232,17 @@
 
* config.gcc: Support core2 processor.
 
+2006-12-13  Ian Lance Taylor  i...@google.com (r119855)
+
+   PR c++/19564
+   PR c++/19756
+   * c-typeck.c (parser_build_binary_op): Move parentheses warnings
+   to warn_about_parentheses in c-common.c.
+   * c-common.c (warn_about_parentheses): New function.
+   * c-common.h (warn_about_parentheses): Declare.
+   * doc/invoke.texi (Warning Options): Update -Wparentheses
+   description.
+
 2006-12-02  H.J. Lu  hongjiu...@intel.com (r119454 - partial)
 
PR target/30040

Modified: head/contrib/gcc/c-common.c
==
--- head/contrib/gcc/c-common.c Wed Nov 13 03:50:31 2013(r258080)
+++ head/contrib/gcc/c-common.c Wed Nov 13 04:31:27 2013(r258081)
@@ -2585,9 +2585,13 @@ c_common_truthvalue_conversion (tree exp
   break;
 
 case MODIFY_EXPR:
-  if (!TREE_NO_WARNING (expr))
-   warning (OPT_Wparentheses,
-suggest parentheses around assignment used as truth value);
+  if (!TREE_NO_WARNING (expr)
+  warn_parentheses)
+   {
+ warning (OPT_Wparentheses,
+  suggest parentheses around assignment used as truth value);
+ TREE_NO_WARNING (expr) = 1;
+   }
   break;
 
 default:
@@ -6471,5 +6475,87 @@ warn_array_subscript_with_type_char (tre
 warning (OPT_Wchar_subscripts, array subscript has type %char%);
 }
 
+/* Implement -Wparentheses for the unexpected C precedence rules, to
+   cover cases like x + y  z which readers are likely to
+   misinterpret.  We have seen an expression in which CODE is a binary
+   operator used to combine expressions headed by CODE_LEFT and
+   CODE_RIGHT.  CODE_LEFT and CODE_RIGHT may be ERROR_MARK, which
+   means that that side of the expression was not formed using a
+   binary operator, or it was enclosed in parentheses.  */
+
+void
+warn_about_parentheses (enum tree_code code, enum tree_code code_left,
+   enum tree_code code_right)
+{
+  if (!warn_parentheses)
+return;
+
+  if (code == LSHIFT_EXPR || code == RSHIFT_EXPR)
+{
+  if (code_left == PLUS_EXPR || code_left == MINUS_EXPR
+ || code_right == PLUS_EXPR || code_right == MINUS_EXPR)
+   warning (OPT_Wparentheses,
+suggest parentheses around + or - inside shift);
+}
+
+  if (code == TRUTH_ORIF_EXPR)
+{
+  if (code_left == TRUTH_ANDIF_EXPR
+ || code_right == TRUTH_ANDIF_EXPR)
+   warning (OPT_Wparentheses,
+suggest parentheses around  within ||);
+}
+
+  if (code == BIT_IOR_EXPR)
+{
+  if (code_left == BIT_AND_EXPR || code_left == BIT_XOR_EXPR
+ || code_left == PLUS_EXPR || code_left == MINUS_EXPR
+ || code_right == BIT_AND_EXPR || code_right == BIT_XOR_EXPR
+ || code_right == PLUS_EXPR || code_right == MINUS_EXPR)
+   warning (OPT_Wparentheses,
+suggest parentheses around arithmetic in operand of |);
+  /* Check cases like x|y==z */
+  if (TREE_CODE_CLASS (code_left) == tcc_comparison
+ || TREE_CODE_CLASS (code_right) == tcc_comparison)
+   warning (OPT_Wparentheses,
+suggest parentheses around comparison in operand of |);
+}
+
+  if (code == BIT_XOR_EXPR)
+{
+  if (code_left == BIT_AND_EXPR
+ || code_left == PLUS_EXPR || code_left == MINUS_EXPR
+ || code_right == BIT_AND_EXPR
+ || code_right == PLUS_EXPR || code_right == MINUS_EXPR)
+   warning (OPT_Wparentheses,
+suggest parentheses around arithmetic in operand of ^);
+  /* Check cases like x^y==z */
+  if (TREE_CODE_CLASS (code_left) == tcc_comparison
+ || TREE_CODE_CLASS 

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

2013-11-12 Thread Kevin Lo
Author: kevlo
Date: Wed Nov 13 05:21:41 2013
New Revision: 258082
URL: http://svnweb.freebsd.org/changeset/base/258082

Log:
  - Use bit twiddling macro to set IEEE80211_MODE_11A
  - On the RT3572 chipset, there's no need to configure BBP register 86

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

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Wed Nov 13 04:31:27 2013
(r258081)
+++ head/sys/dev/usb/wlan/if_run.c  Wed Nov 13 05:21:41 2013
(r258082)
@@ -568,7 +568,7 @@ run_attach(device_t self)
struct ieee80211com *ic;
struct ifnet *ifp;
uint32_t ver;
-   int i, ntries, error;
+   int ntries, error;
uint8_t iface_index, bands;
 
device_set_usb_desc(self);
@@ -665,27 +665,11 @@ run_attach(device_t self)
bands = 0;
setbit(bands, IEEE80211_MODE_11B);
setbit(bands, IEEE80211_MODE_11G);
+   if (sc-rf_rev == RT2860_RF_2750 || sc-rf_rev == RT2860_RF_2850 ||
+   sc-rf_rev == RT3070_RF_3052)
+   setbit(bands, IEEE80211_MODE_11A);
ieee80211_init_channels(ic, NULL, bands);
 
-   /*
-* Do this by own because h/w supports
-* more channels than ieee80211_init_channels()
-*/
-   if (sc-rf_rev == RT2860_RF_2750 ||
-   sc-rf_rev == RT2860_RF_2850 ||
-   sc-rf_rev == RT3070_RF_3052) {
-   /* set supported .11a rates */
-   for (i = 14; i  nitems(rt2860_rf2850); i++) {
-   uint8_t chan = rt2860_rf2850[i].chan;
-   ic-ic_channels[ic-ic_nchans].ic_freq =
-   ieee80211_ieee2mhz(chan, IEEE80211_CHAN_A);
-   ic-ic_channels[ic-ic_nchans].ic_ieee = chan;
-   ic-ic_channels[ic-ic_nchans].ic_flags = 
IEEE80211_CHAN_A;
-   ic-ic_channels[ic-ic_nchans].ic_extieee = 0;
-   ic-ic_nchans++;
-   }
-   }
-
ieee80211_ifattach(ic, sc-sc_bssid);
 
ic-ic_scan_start = run_scan_start;
@@ -3581,7 +3565,7 @@ run_select_chan_group(struct run_softc *
run_bbp_write(sc, 62, 0x37 - sc-lna[group]);
run_bbp_write(sc, 63, 0x37 - sc-lna[group]);
run_bbp_write(sc, 64, 0x37 - sc-lna[group]);
-   if (sc-mac_ver  0x5390)
+   if (sc-mac_ver  0x3572)
run_bbp_write(sc, 86, 0x00);
 
if (group == 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2013-11-12 Thread Kevin Lo
Author: kevlo
Date: Wed Nov 13 05:22:39 2013
New Revision: 258083
URL: http://svnweb.freebsd.org/changeset/base/258083

Log:
  Remove a couple of unused macros.

Modified:
  head/sys/dev/usb/wlan/if_runreg.h

Modified: head/sys/dev/usb/wlan/if_runreg.h
==
--- head/sys/dev/usb/wlan/if_runreg.h   Wed Nov 13 05:21:41 2013
(r258082)
+++ head/sys/dev/usb/wlan/if_runreg.h   Wed Nov 13 05:22:39 2013
(r258083)
@@ -934,31 +934,6 @@ static const struct rt2860_rate {
 };
 
 /*
- * Control and status registers access macros.
- */
-#define RAL_READ(sc, reg)  \
-   bus_space_read_4((sc)-sc_st, (sc)-sc_sh, (reg))
-
-#define RAL_WRITE(sc, reg, val)
\
-   bus_space_write_4((sc)-sc_st, (sc)-sc_sh, (reg), (val))
-
-#define RAL_BARRIER_WRITE(sc)  \
-   bus_space_barrier((sc)-sc_st, (sc)-sc_sh, 0, 0x1800,  \
-   BUS_SPACE_BARRIER_WRITE)
-
-#define RAL_BARRIER_READ_WRITE(sc) \
-   bus_space_barrier((sc)-sc_st, (sc)-sc_sh, 0, 0x1800,  \
-   BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE)
-
-#define RAL_WRITE_REGION_1(sc, offset, datap, count)   \
-   bus_space_write_region_1((sc)-sc_st, (sc)-sc_sh, (offset),\
-   (datap), (count))
-
-#define RAL_SET_REGION_4(sc, offset, val, count)   \
-   bus_space_set_region_4((sc)-sc_st, (sc)-sc_sh, (offset),  \
-   (val), (count))
-
-/*
  * EEPROM access macro.
  */
 #define RT2860_EEPROM_CTL(sc, val) do {
\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258084 - head/usr.bin/svn/svn

2013-11-12 Thread Glen Barber
Author: gjb
Date: Wed Nov 13 05:25:49 2013
New Revision: 258084
URL: http://svnweb.freebsd.org/changeset/base/258084

Log:
  Somewhat mimic how the devel/subversion port prepopulates
  'Sponsored by:' in the FreeBSD commit template.
  
  Support for this has already existed ^/head/contrib/subversion
  but it was not enabled in usr.bin/svn/svn/Makefile.
  
  To use the pre-populated 'Sponsored by:' entry, set ORGANIZATION
  in make.conf(5), for example:
  
  ORGANIZATION=   The FreeBSD Foundation
  
  Reviewed by:  peter
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/svn/svn/Makefile

Modified: head/usr.bin/svn/svn/Makefile
==
--- head/usr.bin/svn/svn/Makefile   Wed Nov 13 05:22:39 2013
(r258083)
+++ head/usr.bin/svn/svn/Makefile   Wed Nov 13 05:25:49 2013
(r258084)
@@ -53,4 +53,13 @@ DPADD=   ${LIBSVN_CLIENT} ${LIBSVN_WC} ${L
${LIBBSDXML} ${LIBAPR} ${LIBSQLITE} ${LIBZ} ${LIBCRYPT} ${LIBMAGIC} \
${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD}
 
+.if(defined(ORGANIZATION)  !empty(ORGANIZATION))
+DPSRCS+=   freebsd-organization.h
+CLEANFILES+=   freebsd-organization.h
+CFLAGS+=   -I. -DHAS_ORGANIZATION_NAME
+freebsd-organization.h:
+   @echo '#define ORGANIZATION_NAME ${ORGANIZATION}' \
+freebsd-organization.h
+.endif
+
 .include bsd.prog.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r258085 - head/sys/dev/iwn

2013-11-12 Thread Adrian Chadd
Author: adrian
Date: Wed Nov 13 07:09:00 2013
New Revision: 258085
URL: http://svnweb.freebsd.org/changeset/base/258085

Log:
  Correctly initialise the 2-chain antenna mask in the link quality table.
  
  The previous code simply hard-coded IWN_ANT_AB which is only correct for
  some of the NICs.
  
  Now, if the NIC is a 1-stream TX, you need to set IWN_ANT_AB and _not_
  just a single antenna.  The Intel 5100 firmware panics the moment the
  link quality table is updated.
  
  So!
  
  * no secondary antenna? Set it to IWN_ANT_AB;
  * two-stream device? Transmit on the full transmit antenna configuration.
  
  Tested:
  
  * Intel 5100, STA
  * Intel 2200 (eadler)
  
  Obtained from:Linux iwlwifi

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Wed Nov 13 05:25:49 2013(r258084)
+++ head/sys/dev/iwn/if_iwn.c   Wed Nov 13 07:09:00 2013(r258085)
@@ -4788,11 +4788,49 @@ iwn_set_link_quality(struct iwn_softc *s
memset(linkq, 0, sizeof linkq);
linkq.id = wn-id;
linkq.antmsk_1stream = txant;
-   linkq.antmsk_2stream = IWN_ANT_AB;
+
+   /*
+* The '2 stream' setup is a bit .. odd.
+*
+* For NICs that support only 1 antenna, default to IWN_ANT_AB or
+* the firmware panics (eg Intel 5100.)
+*
+* For NICs that support two antennas, we use ANT_AB.
+*
+* For NICs that support three antennas, we use the two that
+* wasn't the default one.
+*
+* XXX TODO: if bluetooth (full concurrent) is enabled, restrict
+* this to only one antenna.
+*/
+
+   /* So - if there's no secondary antenna, assume IWN_ANT_AB */
+
+   /* Default - transmit on the other antennas */
+   linkq.antmsk_2stream = (sc-txchainmask  ~IWN_LSB(sc-txchainmask));
+
+   /* Now, if it's zero, set it to IWN_ANT_AB, so to not panic firmware */
+   if (linkq.antmsk_2stream == 0)
+   linkq.antmsk_2stream = IWN_ANT_AB;
+
+   /*
+* If the NIC is a two-stream TX NIC, configure the TX mask to
+* the default chainmask
+*/
+   else if (sc-ntxchains == 2)
+   linkq.antmsk_2stream = sc-txchainmask;
+
linkq.ampdu_max = 32;   /* XXX negotiated? */
linkq.ampdu_threshold = 3;
linkq.ampdu_limit = htole16(4000);  /* 4ms */
 
+   DPRINTF(sc, IWN_DEBUG_XMIT,
+   %s: 1stream antenna=0x%02x, 2stream antenna=0x%02x, 
ntxstreams=%d\n,
+   __func__,
+   linkq.antmsk_1stream,
+   linkq.antmsk_2stream,
+   sc-ntxchains);
+
/*
 * Are we using 11n rates? Ensure the channel is
 * 11n _and_ we have some 11n rates, or don't
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r258039 - in head/sys: kern vm

2013-11-12 Thread Konstantin Belousov
On Tue, Nov 12, 2013 at 04:29:06PM -0800, John-Mark Gurney wrote:
 Bruce Evans wrote this message on Tue, Nov 12, 2013 at 22:13 +1100:
  On Tue, 12 Nov 2013, Konstantin Belousov wrote:
  
  Log:
   Avoid overflow for the page counts.
  
   Reported and tested by:   pho
   Sponsored by: The FreeBSD Foundation
   MFC after:1 week
  
  Modified: head/sys/kern/vfs_vnops.c
  ==
  --- head/sys/kern/vfs_vnops.c  Tue Nov 12 08:32:10 2013
  (r258038)
  +++ head/sys/kern/vfs_vnops.c  Tue Nov 12 08:47:58 2013
  (r258039)
  @@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio
 void *rl_cookie;
 struct mount *mp;
 vm_page_t *prev_td_ma;
  -  int cnt, error, save, saveheld, prev_td_ma_cnt;
  +  int error, save, saveheld, prev_td_ma_cnt;
 vm_offset_t addr, end;
  +  vm_size_t cnt;
  
  int was correct for a count.  You can't possibly have the 8TB
  of physical memory needed to overflow a 32-bit int page count.
 ^ today
  It is reasonably to assume 32-bit ints.
 
 Except that the modern AMD64 arch now allows 52 bits of address for
 phyiscal memory, which does mean in a few years, we will be eclipsing
 8TB in a single machine...
 
 Isn't someone running FreeBSD on a 1TB machine?  I'm pretty possitive
 I remeber someone running 512GB, so only 3/4 doublings away from hitting
 the limit...

The variable in question has no relation to the physical memory size.
I already noted to Bruce, in the private reply, that the variable must
hold the count of the page frames covering the i/o request.  As such,
it must be sized to be able to hold the page count for the whole address
space.

The variable is clamped later, but this is an implementation detail.


pgpxEx3mpRDhO.pgp
Description: PGP signature