svn commit: r210283 - head/share/man/man4

2010-07-20 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jul 20 06:38:57 2010
New Revision: 210283
URL: http://svn.freebsd.org/changeset/base/210283

Log:
  Add reference to uhsoctl(1).

Modified:
  head/share/man/man4/uhso.4

Modified: head/share/man/man4/uhso.4
==
--- head/share/man/man4/uhso.4  Tue Jul 20 05:22:14 2010(r210282)
+++ head/share/man/man4/uhso.4  Tue Jul 20 06:38:57 2010(r210283)
@@ -23,7 +23,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 14, 2010
+.Dd July 20, 2010
 .Dt UHSO 4
 .Os
 .Sh NAME
@@ -130,6 +130,7 @@ The connection can be terminated with
 AT_OWANCALL=1,0,1
 .Ed
 .Sh SEE ALSO
+.Xr uhsoctl 1 ,
 .Xr ucom 4 ,
 .Xr usb 4
 .Sh AUTHORS
___
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: r210286 - head/sys/contrib/octeon-sdk

2010-07-20 Thread Juli Mallett
Author: jmallett
Date: Tue Jul 20 07:19:43 2010
New Revision: 210286
URL: http://svn.freebsd.org/changeset/base/210286

Log:
  Import the Cavium Simple Executive from the Cavium Octeon SDK.  The Simple
  Executive is a library that can be used by standalone applications and kernels
  to abstract access to Octeon SoC and board-specific hardware and facilities.
  The FreeBSD port to Octeon will be updated to use this where possible.

Added:
  head/sys/contrib/octeon-sdk/
 - copied from r210285, vendor-sys/octeon-sdk/dist/
___
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: r210287 - head/usr.sbin

2010-07-20 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Jul 20 07:27:36 2010
New Revision: 210287
URL: http://svn.freebsd.org/changeset/base/210287

Log:
  Build some powerpc-specific utilities on powerpc64 as well.
  
  Submitted by: Andreas Tobler

Modified:
  head/usr.sbin/Makefile

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Tue Jul 20 07:19:43 2010(r210286)
+++ head/usr.sbin/Makefile  Tue Jul 20 07:27:36 2010(r210287)
@@ -512,7 +512,7 @@ _mount_smbfs=   mount_smbfs
 _zzz=  zzz
 .endif
 
-.if ${MACHINE_ARCH} == powerpc
+.if ${MACHINE_CPUARCH} == powerpc
 _mount_smbfs=  mount_smbfs
 _nvram=nvram
 _ofwdump=  ofwdump
___
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: r210263 - head/sys/dev/bce

2010-07-20 Thread Bjoern A. Zeeb

On Mon, 19 Jul 2010, Pyun YongHyeon wrote:


Author: yongari
Date: Mon Jul 19 21:41:54 2010
New Revision: 210263
URL: http://svn.freebsd.org/changeset/base/210263

Log:
 Do not report current link state if interface is not UP.



Hmm, not sure what exactly the code change does but by your
description I think I would like to be able to see a porper (updated)
result in the media: line of ifconfig no matter if it's UP or not.

If this doesn't change that behaviour, just ignore me;)



 Reviewed by:   davidch

Modified:
 head/sys/dev/bce/if_bce.c

Modified: head/sys/dev/bce/if_bce.c
==
--- head/sys/dev/bce/if_bce.c   Mon Jul 19 21:38:15 2010(r210262)
+++ head/sys/dev/bce/if_bce.c   Mon Jul 19 21:41:54 2010(r210263)
@@ -5855,6 +5855,10 @@ bce_ifmedia_sts(struct ifnet *ifp, struc

BCE_LOCK(sc);

+   if ((ifp-if_flags  IFF_UP) == 0) {
+   BCE_UNLOCK(sc);
+   return;
+   }
mii = device_get_softc(sc-bce_miibus);

mii_pollstat(mii);



--
Bjoern A. ZeebFrom August on I will have a life.  It's now up to you
to do the maths and count to 64. -- Bondorf, Germany, 14th June 2010
___
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: r210289 - head/share/man/man4

2010-07-20 Thread Bernhard Schmidt
Author: bschmidt
Date: Tue Jul 20 10:45:05 2010
New Revision: 210289
URL: http://svn.freebsd.org/changeset/base/210289

Log:
  Update manpage to reflect changes regarding the 6050's firmware.
  
  MFC after:3 days

Modified:
  head/share/man/man4/iwn.4
  head/share/man/man4/iwnfw.4

Modified: head/share/man/man4/iwn.4
==
--- head/share/man/man4/iwn.4   Tue Jul 20 10:00:35 2010(r210288)
+++ head/share/man/man4/iwn.4   Tue Jul 20 10:45:05 2010(r210289)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 8, 2010
+.Dd July 20, 2010
 .Dt IWN 4
 .Os
 .Sh NAME
@@ -51,6 +51,7 @@ Choose one from:
 .Cd device iwn5000fw
 .Cd device iwn5150fw
 .Cd device iwn6000fw
+.Cd device iwn6050fw
 .Ed
 .Pp
 Or you can use
@@ -70,6 +71,7 @@ iwn1000fw_load=YES
 iwn5000fw_load=YES
 iwn5150fw_load=YES
 iwn6000fw_load=YES
+iwn6050fw_load=YES
 .Ed
 .Sh DESCRIPTION
 The

Modified: head/share/man/man4/iwnfw.4
==
--- head/share/man/man4/iwnfw.4 Tue Jul 20 10:00:35 2010(r210288)
+++ head/share/man/man4/iwnfw.4 Tue Jul 20 10:45:05 2010(r210289)
@@ -22,7 +22,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 7, 2010
+.Dd July 20, 2010
 .Dt IWNFW 4
 .Os
 .Sh NAME
@@ -45,6 +45,7 @@ of the following:
 .Cd device iwn5000fw
 .Cd device iwn5150fw
 .Cd device iwn6000fw
+.Cd device iwn6050fw
 .Ed
 .Pp
 Alternatively, to load the driver as a
@@ -56,6 +57,7 @@ iwn1000fw_load=YES
 iwn5000fw_load=YES
 iwn5150fw_load=YES
 iwn6000fw_load=YES
+iwn6050fw_load=YES
 .Ed
 .Sh DESCRIPTION
 This module provides access to firmware sets for 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: r210290 - in head/sys: dev/acpica kern sys x86/isa x86/x86

2010-07-20 Thread Alexander Motin
Author: mav
Date: Tue Jul 20 10:58:56 2010
New Revision: 210290
URL: http://svn.freebsd.org/changeset/base/210290

Log:
  Extend timer driver API to report also minimal and maximal supported period
  lengths. Make MI wrapper code to validate periods in request. Make kernel
  clock management code to honor these hardware limitations while choosing hz,
  stathz and profhz values.

Modified:
  head/sys/dev/acpica/acpi_hpet.c
  head/sys/kern/kern_clocksource.c
  head/sys/kern/kern_et.c
  head/sys/sys/timeet.h
  head/sys/x86/isa/atrtc.c
  head/sys/x86/isa/clock.c
  head/sys/x86/x86/local_apic.c

Modified: head/sys/dev/acpica/acpi_hpet.c
==
--- head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 10:45:05 2010
(r210289)
+++ head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 10:58:56 2010
(r210290)
@@ -154,15 +154,16 @@ hpet_start(struct eventtimer *et,
t-div = (sc-freq * (period-frac  32))  32;
if (period-sec != 0)
t-div += sc-freq * period-sec;
-   if (first == NULL)
-   first = period;
} else {
t-mode = 2;
t-div = 0;
}
-   fdiv = (sc-freq * (first-frac  32))  32;
-   if (first-sec != 0)
-   fdiv += sc-freq * first-sec;
+   if (first != NULL) {
+   fdiv = (sc-freq * (first-frac  32))  32;
+   if (first-sec != 0)
+   fdiv += sc-freq * first-sec;
+   } else
+   fdiv = t-div;
t-last = bus_read_4(sc-mem_res, HPET_MAIN_COUNTER);
if (t-mode == 1  (t-caps  HPET_TCAP_PER_INT)) {
t-caps |= HPET_TCNF_TYPE;
@@ -583,6 +584,11 @@ hpet_attach(device_t dev)
if ((t-caps  HPET_TCAP_PER_INT) == 0)
t-et.et_quality -= 10;
t-et.et_frequency = sc-freq;
+   t-et.et_min_period.sec = 0;
+   t-et.et_min_period.frac = 0x4000LL  32;
+   t-et.et_max_period.sec = 0x / sc-freq;
+   t-et.et_max_period.frac =
+   ((0xLL  32) / sc-freq)  32;
t-et.et_start = hpet_start;
t-et.et_stop = hpet_stop;
t-et.et_priv = sc-t[i];

Modified: head/sys/kern/kern_clocksource.c
==
--- head/sys/kern/kern_clocksource.cTue Jul 20 10:45:05 2010
(r210289)
+++ head/sys/kern/kern_clocksource.cTue Jul 20 10:58:56 2010
(r210290)
@@ -87,11 +87,9 @@ static DPCPU_DEFINE(tc, configtimer);
(bt)-sec = 0;  \
(bt)-frac = ((uint64_t)0x8000  / (freq))  1; \
 }
-#define BT2FREQ(bt, freq)  \
-{  \
-   *(freq) = ((uint64_t)0x8000 + ((bt)-frac  2)) /  \
-   ((bt)-frac  1);  \
-}
+#define BT2FREQ(bt)\
+   (((uint64_t)0x8000 + ((bt)-frac  2)) /   \
+   ((bt)-frac  1))
 
 /* Per-CPU timer1 handler. */
 static int
@@ -295,6 +293,26 @@ restart:
 #endif
 }
 
+static int
+round_freq(struct eventtimer *et, int freq)
+{
+   uint64_t div;
+
+   if (et-et_frequency != 0) {
+   div = (et-et_frequency + freq / 2) / freq;
+   if (et-et_flags  ET_FLAGS_POW2DIV)
+   div = 1  (flsl(div + div / 2) - 1);
+   freq = (et-et_frequency + div / 2) / div;
+   }
+   if (et-et_min_period.sec  0)
+   freq = 0;
+   else if (et-et_max_period.frac != 0)
+   freq = min(freq, BT2FREQ(et-et_min_period));
+   if (et-et_max_period.sec == 0  et-et_max_period.frac != 0)
+   freq = max(freq, BT2FREQ(et-et_max_period));
+   return (freq);
+}
+
 /*
  * Configure and start event timers.
  */
@@ -327,21 +345,25 @@ cpu_initclocks_bsp(void)
singlemul = 4;
}
if (timer[1] == NULL) {
-   base = hz * singlemul;
-   if (base  128)
+   base = round_freq(timer[0], hz * singlemul);
+   singlemul = max((base + hz / 2) / hz, 1);
+   hz = (base + singlemul / 2) / singlemul;
+   if (base = 128)
stathz = base;
else {
div = base / 128;
-   if (div % 2 == 0)
+   if (div = singlemul  (div % singlemul) == 0)
div++;
stathz = base / div;
}
profhz = stathz;
-   while ((profhz + stathz) = 8192)
+   while ((profhz + stathz) = 128 * 64)
profhz 

Re: svn commit: r210286 - head/sys/contrib/octeon-sdk

2010-07-20 Thread M. Warner Losh
In message: 201007200719.o6k7jhfj022...@svn.freebsd.org
Juli Mallett jmall...@freebsd.org writes:
: Author: jmallett
: Date: Tue Jul 20 07:19:43 2010
: New Revision: 210286
: URL: http://svn.freebsd.org/changeset/base/210286
: 
: Log:
:   Import the Cavium Simple Executive from the Cavium Octeon SDK.  The Simple
:   Executive is a library that can be used by standalone applications and 
kernels
:   to abstract access to Octeon SoC and board-specific hardware and facilities.
:   The FreeBSD port to Octeon will be updated to use this where possible.

It should be noted that this is from the Cavium User's site and has
basically a BSD license with a special disclaimer of
liability/warranty.

Cavium documents this as being compatible with the closed-source
version that Cavium makes available under NDA.

Warner

___
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: r210294 - in head/sys: i386/i386 pc98/pc98

2010-07-20 Thread Tijl Coosemans
Author: tijl
Date: Tue Jul 20 12:36:36 2010
New Revision: 210294
URL: http://svn.freebsd.org/changeset/base/210294

Log:
  Store fsbase and gsbase in the right fields of the mcontext. They were
  switched.
  
  PR:   i386/148344
  Approved by:  kib (mentor)
  MFC after:1 week

Modified:
  head/sys/i386/i386/machdep.c
  head/sys/pc98/pc98/machdep.c

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cTue Jul 20 11:46:45 2010
(r210293)
+++ head/sys/i386/i386/machdep.cTue Jul 20 12:36:36 2010
(r210294)
@@ -645,10 +645,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
/*
 * Unconditionally fill the fsbase and gsbase into the mcontext.
 */
-   sdp = td-td_pcb-pcb_gsd;
+   sdp = td-td_pcb-pcb_fsd;
sf.sf_uc.uc_mcontext.mc_fsbase = sdp-sd_hibase  24 |
sdp-sd_lobase;
-   sdp = td-td_pcb-pcb_fsd;
+   sdp = td-td_pcb-pcb_gsd;
sf.sf_uc.uc_mcontext.mc_gsbase = sdp-sd_hibase  24 |
sdp-sd_lobase;
 
@@ -3255,9 +3255,9 @@ get_mcontext(struct thread *td, mcontext
 * mcontext after mc_fpstate.
 */
get_fpcontext(td, mcp);
-   sdp = td-td_pcb-pcb_gsd;
-   mcp-mc_fsbase = sdp-sd_hibase  24 | sdp-sd_lobase;
sdp = td-td_pcb-pcb_fsd;
+   mcp-mc_fsbase = sdp-sd_hibase  24 | sdp-sd_lobase;
+   sdp = td-td_pcb-pcb_gsd;
mcp-mc_gsbase = sdp-sd_hibase  24 | sdp-sd_lobase;
 
return (0);

Modified: head/sys/pc98/pc98/machdep.c
==
--- head/sys/pc98/pc98/machdep.cTue Jul 20 11:46:45 2010
(r210293)
+++ head/sys/pc98/pc98/machdep.cTue Jul 20 12:36:36 2010
(r210294)
@@ -580,10 +580,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
/*
 * Unconditionally fill the fsbase and gsbase into the mcontext.
 */
-   sdp = td-td_pcb-pcb_gsd;
+   sdp = td-td_pcb-pcb_fsd;
sf.sf_uc.uc_mcontext.mc_fsbase = sdp-sd_hibase  24 |
sdp-sd_lobase;
-   sdp = td-td_pcb-pcb_fsd;
+   sdp = td-td_pcb-pcb_gsd;
sf.sf_uc.uc_mcontext.mc_gsbase = sdp-sd_hibase  24 |
sdp-sd_lobase;
 
@@ -2583,9 +2583,9 @@ get_mcontext(struct thread *td, mcontext
 * mcontext after mc_fpstate.
 */
get_fpcontext(td, mcp);
-   sdp = td-td_pcb-pcb_gsd;
-   mcp-mc_fsbase = sdp-sd_hibase  24 | sdp-sd_lobase;
sdp = td-td_pcb-pcb_fsd;
+   mcp-mc_fsbase = sdp-sd_hibase  24 | sdp-sd_lobase;
+   sdp = td-td_pcb-pcb_gsd;
mcp-mc_gsbase = sdp-sd_hibase  24 | sdp-sd_lobase;
 
return (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: r210254 - in head/etc: defaults periodic/security

2010-07-20 Thread Jilles Tjoelker
On Mon, Jul 19, 2010 at 08:19:14PM +, Gabor Kovesdan wrote:
 Author: gabor
 Date: Mon Jul 19 20:19:14 2010
 New Revision: 210254
 URL: http://svn.freebsd.org/changeset/base/210254

 Log:
   - Add a periodic script, which can be used to find installed ports' files 
 with
 mismatched checksum

   PR: conf/124641
   Submitted by:   Alex Kozlov s...@rm-rf.kiev.ua
   Approved by:delphij (mentor)

This seems useful, although not primarily from a security perspective
(if they can overwrite /usr/local/bin/foo, they can probably also modify
/var/db/pkg/foo/+CONTENTS accordingly), but to detect misbehaved things
that modify or delete files belonging to packages.

[snip]

 Added: head/etc/periodic/security/460.chkportsum
 ==
 --- /dev/null 00:00:00 1970   (empty, because file is newly added)
 +++ head/etc/periodic/security/460.chkportsum Mon Jul 19 20:19:14 2010
 (r210254)
 @@ -0,0 +1,68 @@
 +#!/bin/sh -
 +#
 +# Copyright (c) 2010  The FreeBSD Project
 +# 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$
 +#
 +
 +if [ -r /etc/defaults/periodic.conf ]
 +then
 +. /etc/defaults/periodic.conf
 +source_periodic_confs
 +fi
 +
 +. /etc/periodic/security/security.functions
 +
 +rc=0
 +
 +echo 
 +echo 'Checking for ports with mismatched checksums:'
 +
 +case ${daily_status_security_chkportsum_enable} in
 + [Yy][Ee][Ss])
 + pkg_info -ga 2/dev/null | \

The stderr output is also interesting, as it contains error messages
about files that are in a package but do not exist. Unfortunately,
  pkg_info -ga 21 | ...
will mix the stderr with the stdout in an unusable way. I suppose
pkg_info -g should be modified so the missing files are in the stdout.

 + while read one two three; do
 + case ${one} in
 + Information)
 + case ${two} in
 +   for) name=${three%%:} ;;
 + *) name='??' ;;

The indentation seems wrong here.

 + esac
 + ;;
 + Mismatched|'') ;;
 + *)
 + if [ -n ${name} ]; then

Note that this is true if name is empty or not set. You probably want
  [ -n ${name} ]

 + echo ${name}: ${one}

This handles pathnames with spaces incorrectly. Consider reading lines
with
  IFS= read -r line
This also collapses the nested case statements to one, for
'Information for'*, Mismatched*, '' and /*.

The variables in the echo commands should be quoted to avoid word
splitting and pathname generation.

 + fi
 + ;;
 + esac
 + done
 + ;;
 + *)
 + rc=0
 + ;;
 +esac
 +
 +exit $rc

-- 
Jilles Tjoelker
___
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: r210217 - head/sys/kern

2010-07-20 Thread John Baldwin
On Sunday, July 18, 2010 6:15:33 am Ivan Voras wrote:
 Author: ivoras
 Date: Sun Jul 18 10:15:33 2010
 New Revision: 210217
 URL: http://svn.freebsd.org/changeset/base/210217
 
 Log:
   In keeping with the Age-of-the-fruitbat theme, scale up hirunningspace on
   machines which can clearly afford the memory.
   
   This is a somewhat conservative version of the patch - more fine tuning may 
 be
   necessary.
   
   Idea from: Thread on hackers@
   Discussed with: alc
 
 Modified:
   head/sys/kern/vfs_bio.c
 
 Modified: head/sys/kern/vfs_bio.c
 ==
 --- head/sys/kern/vfs_bio.c   Sun Jul 18 08:54:31 2010(r210216)
 +++ head/sys/kern/vfs_bio.c   Sun Jul 18 10:15:33 2010(r210217)
 @@ -621,7 +621,9 @@ bufinit(void)
   lobufspace = hibufspace - MAXBSIZE;
  
   lorunningspace = 512 * 1024;
 - hirunningspace = 1024 * 1024;
 + hirunningspace = lmin(roundup(hibufspace/64, MAXBSIZE), 16*1024*1024);
 + if (hirunningspace  1024 * 1024)
 + hirunningspace = 1024 * 1024;

Presumably you could use 'lmax(lmin(..., 16 * 1024 * 1024), 1024 * 1024))'?

Also, the common style throughout the kernel is to provide spaces around
operators like '/' and '*'.

-- 
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: r210295 - head/sys/kern

2010-07-20 Thread Ivan Voras
Author: ivoras
Date: Tue Jul 20 13:59:51 2010
New Revision: 210295
URL: http://svn.freebsd.org/changeset/base/210295

Log:
  Fix expression style.
  
  Prodded by: jhb

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Jul 20 12:36:36 2010(r210294)
+++ head/sys/kern/vfs_bio.c Tue Jul 20 13:59:51 2010(r210295)
@@ -621,9 +621,8 @@ bufinit(void)
lobufspace = hibufspace - MAXBSIZE;
 
lorunningspace = 512 * 1024;
-   hirunningspace = lmin(roundup(hibufspace/64, MAXBSIZE), 16*1024*1024);
-   if (hirunningspace  1024 * 1024)
-   hirunningspace = 1024 * 1024;
+   hirunningspace = lmax(lmin(roundup(hibufspace / 64, MAXBSIZE),
+   16 * 1024 * 1024), 1024 * 1024);
 
 /*
  * Limit the amount of malloc memory since it is wired permanently into
___
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: r210296 - head/share/timedef

2010-07-20 Thread Ollivier Robert
Author: roberto
Date: Tue Jul 20 14:27:09 2010
New Revision: 210296
URL: http://svn.freebsd.org/changeset/base/210296

Log:
  Week days are all lowercase in French.
  cf. http://www.academie-francaise.fr/langue/questions.html#jourdelasemaine 
(FR)
  
  PR:   misc/148792
  Submitted by: Mathieu free...@breatheless.net
  MFC after:1 weeks

Modified:
  head/share/timedef/fr_FR.ISO8859-1.src
  head/share/timedef/fr_FR.UTF-8.src

Modified: head/share/timedef/fr_FR.ISO8859-1.src
==
--- head/share/timedef/fr_FR.ISO8859-1.src  Tue Jul 20 13:59:51 2010
(r210295)
+++ head/share/timedef/fr_FR.ISO8859-1.src  Tue Jul 20 14:27:09 2010
(r210296)
@@ -35,23 +35,23 @@ d�cembre
 #
 # Short weekday names
 #
-Dim
-Lun
-Mar
-Mer
-Jeu
-Ven
-Sam
+dim
+lun
+mar
+mer
+jeu
+ven
+sam
 #
 # Long weekday names
 #
-Dimanche
-Lundi
-Mardi
-Mercredi
-Jeudi
-Vendredi
-Samedi
+dimanche
+lundi
+mardi
+mercredi
+jeudi
+vendredi
+samedi
 #
 # X_fmt
 #

Modified: head/share/timedef/fr_FR.UTF-8.src
==
--- head/share/timedef/fr_FR.UTF-8.src  Tue Jul 20 13:59:51 2010
(r210295)
+++ head/share/timedef/fr_FR.UTF-8.src  Tue Jul 20 14:27:09 2010
(r210296)
@@ -35,23 +35,23 @@ décembre
 #
 # Short weekday names
 #
-Dim
-Lun
-Mar
-Mer
-Jeu
-Ven
-Sam
+dim
+lun
+mar
+mer
+jeu
+ven
+sam
 #
 # Long weekday names
 #
-Dimanche
-Lundi
-Mardi
-Mercredi
-Jeudi
-Vendredi
-Samedi
+dimanche
+lundi
+mardi
+mercredi
+jeudi
+vendredi
+samedi
 #
 # X_fmt
 #
___
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: r210298 - in head/sys: arm/mv dev/acpica kern x86/isa x86/x86

2010-07-20 Thread Alexander Motin
Author: mav
Date: Tue Jul 20 15:48:29 2010
New Revision: 210298
URL: http://svn.freebsd.org/changeset/base/210298

Log:
  Fix several un-/signedness bugs of r210290 and r210293. Add one more check.

Modified:
  head/sys/arm/mv/timer.c
  head/sys/dev/acpica/acpi_hpet.c
  head/sys/kern/kern_clocksource.c
  head/sys/x86/isa/atrtc.c
  head/sys/x86/isa/clock.c
  head/sys/x86/x86/local_apic.c

Modified: head/sys/arm/mv/timer.c
==
--- head/sys/arm/mv/timer.c Tue Jul 20 15:34:27 2010(r210297)
+++ head/sys/arm/mv/timer.c Tue Jul 20 15:48:29 2010(r210298)
@@ -158,10 +158,10 @@ mv_timer_attach(device_t dev)
sc-et.et_frequency = get_tclk();
sc-et.et_min_period.sec = 0;
sc-et.et_min_period.frac =
-   ((0xfLL  60) / sc-et.et_frequency)  4;
-   sc-et.et_max_period.sec = 0xfff0 / sc-et.et_frequency;
+   ((0x0002LLU  32) / sc-et.et_frequency)  32;
+   sc-et.et_max_period.sec = 0xfff0U / sc-et.et_frequency;
sc-et.et_max_period.frac =
-   ((0xfff0LL  32) / sc-et.et_frequency)  32;
+   ((0xfffeLLU  32) / sc-et.et_frequency)  32;
sc-et.et_start = mv_timer_start;
sc-et.et_stop = mv_timer_stop;
sc-et.et_priv = sc;

Modified: head/sys/dev/acpica/acpi_hpet.c
==
--- head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 15:34:27 2010
(r210297)
+++ head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 15:48:29 2010
(r210298)
@@ -585,10 +585,10 @@ hpet_attach(device_t dev)
t-et.et_quality -= 10;
t-et.et_frequency = sc-freq;
t-et.et_min_period.sec = 0;
-   t-et.et_min_period.frac = 0x4000LL  32;
-   t-et.et_max_period.sec = 0x / sc-freq;
+   t-et.et_min_period.frac = 0x4000LLU  32;
+   t-et.et_max_period.sec = 0xfffeLLU / sc-freq;
t-et.et_max_period.frac =
-   ((0xLL  32) / sc-freq)  32;
+   ((0xfffeLLU  32) / sc-freq)  32;
t-et.et_start = hpet_start;
t-et.et_stop = hpet_stop;
t-et.et_priv = sc-t[i];

Modified: head/sys/kern/kern_clocksource.c
==
--- head/sys/kern/kern_clocksource.cTue Jul 20 15:34:27 2010
(r210297)
+++ head/sys/kern/kern_clocksource.cTue Jul 20 15:48:29 2010
(r210298)
@@ -299,14 +299,14 @@ round_freq(struct eventtimer *et, int fr
uint64_t div;
 
if (et-et_frequency != 0) {
-   div = (et-et_frequency + freq / 2) / freq;
+   div = lmax((et-et_frequency + freq / 2) / freq, 1);
if (et-et_flags  ET_FLAGS_POW2DIV)
div = 1  (flsl(div + div / 2) - 1);
freq = (et-et_frequency + div / 2) / div;
}
if (et-et_min_period.sec  0)
freq = 0;
-   else if (et-et_max_period.frac != 0)
+   else if (et-et_min_period.frac != 0)
freq = min(freq, BT2FREQ(et-et_min_period));
if (et-et_max_period.sec == 0  et-et_max_period.frac != 0)
freq = max(freq, BT2FREQ(et-et_max_period));
@@ -365,6 +365,7 @@ cpu_initclocks_bsp(void)
stathz = round_freq(timer[1], 127);
profhz = round_freq(timer[1], stathz * 64);
}
+   tick = 100 / hz;
ET_LOCK();
cpu_restartclocks();
ET_UNLOCK();

Modified: head/sys/x86/isa/atrtc.c
==
--- head/sys/x86/isa/atrtc.cTue Jul 20 15:34:27 2010(r210297)
+++ head/sys/x86/isa/atrtc.cTue Jul 20 15:48:29 2010(r210298)
@@ -280,9 +280,9 @@ atrtc_attach(device_t dev)
sc-et.et_quality = 0;
sc-et.et_frequency = 32768;
sc-et.et_min_period.sec = 0;
-   sc-et.et_min_period.frac = 0x0008LL  48;
+   sc-et.et_min_period.frac = 0x0008LLU  48;
sc-et.et_max_period.sec = 0;
-   sc-et.et_max_period.frac = 0x8000LL  48;
+   sc-et.et_max_period.frac = 0x8000LLU  48;
sc-et.et_start = rtc_start;
sc-et.et_stop = rtc_stop;
sc-et.et_priv = dev;

Modified: head/sys/x86/isa/clock.c
==
--- head/sys/x86/isa/clock.cTue Jul 20 15:34:27 2010(r210297)
+++ head/sys/x86/isa/clock.cTue Jul 20 15:48:29 2010(r210298)
@@ -666,10 +666,11 @@ attimer_attach(device_t dev)
sc-et.et_quality = 100;
sc-et.et_frequency = i8254_freq;
sc-et.et_min_period.sec = 0;
-   sc-et.et_min_period.frac = ((1LL  62) / 

Re: svn commit: r210263 - head/sys/dev/bce

2010-07-20 Thread Pyun YongHyeon
On Tue, Jul 20, 2010 at 10:13:03AM +, Bjoern A. Zeeb wrote:
 On Mon, 19 Jul 2010, Pyun YongHyeon wrote:
 
 Author: yongari
 Date: Mon Jul 19 21:41:54 2010
 New Revision: 210263
 URL: http://svn.freebsd.org/changeset/base/210263
 
 Log:
  Do not report current link state if interface is not UP.
 
 
 Hmm, not sure what exactly the code change does but by your
 description I think I would like to be able to see a porper (updated)
 result in the media: line of ifconfig no matter if it's UP or not.
 
 If this doesn't change that behaviour, just ignore me;)
 

I'm afraid this change will effectively disable that feature.
Why you need to know current link state if interface is DOWN?
Note, the reported link state, when interface is in DOWN, could be
wrong because driver will restart auto-negotiation. With this
change it will just say current media.

BEFORE this change:
bce3: flags=8802BROADCAST,SIMPLEX,MULTICAST metric 0 mtu 1500

options=c01bbRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE
ether 00:10:18:3e:13:3e
media: Ethernet autoselect (none)
status: no carrier
OR if it manage to establish link:
bce3: flags=8802BROADCAST,SIMPLEX,MULTICAST metric 0 mtu 1500

options=c01bbRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE
ether 00:10:18:3e:13:3e
media: Ethernet autoselect (1000baseT full-duplex,flag1)
status: active

AFTER this change:
bce3: flags=8802BROADCAST,SIMPLEX,MULTICAST metric 0 mtu 1500

options=c01bbRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE
ether 00:10:18:3e:13:3e
media: Ethernet autoselect
___
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: r210254 - in head/etc: defaults periodic/security

2010-07-20 Thread Alex Kozlov
On Tue, Jul 20, 2010 at 05:25:05PM +0300, Alex Kozlov wrote:
   + echo ${name}: ${one}
  
  This handles pathnames with spaces incorrectly. Consider reading lines
  with
IFS= read -r line
  This also collapses the nested case statements to one, for
  'Information for'*, Mismatched*, '' and /*.
  
  The variables in the echo commands should be quoted to avoid word
  splitting and pathname generation.
 It's makes parser stateful and overly complex, I will think about most
 simple way to do this. Fortunately, at the moment very few, if any, ports
 have files with space in names.
It's seems I was wrong, We have more that 10k files with spaces in ports.
What do think about this solution?

Index: etc/periodic/security/460.chkportsum
@@ -26,8 +26,10 @@
;;
Mismatched|'') ;;
*)
-   if [ -n ${name} ]; then
-   echo ${name}: ${one}
+   if [ -n ${name} ]; then
+   #handle filenames with spaces
+   file=${one} ${two} ${three}
+   echo ${name}: ${file%% fails the original MD5 
checksum}
fi
;;
esac


--
Adios
___
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: r210300 - head/usr.sbin/watchdogd

2010-07-20 Thread Xin LI
Author: delphij
Date: Tue Jul 20 17:42:13 2010
New Revision: 210300
URL: http://svn.freebsd.org/changeset/base/210300

Log:
  Staticify local variables.
  
  While I'm there also add a 'static' keyword for a function to make it
  consistent with prototype.
  
  Reviewed by:  phk
  MFC after:3 months

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

Modified: head/usr.sbin/watchdogd/watchdogd.c
==
--- head/usr.sbin/watchdogd/watchdogd.c Tue Jul 20 17:16:57 2010
(r210299)
+++ head/usr.sbin/watchdogd/watchdogd.c Tue Jul 20 17:42:13 2010
(r210300)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright (c) 2003-2004  Sean M. Kelly smke...@freebsd.org
  * All rights reserved.
  *
@@ -58,17 +58,15 @@ static int  watchdog_onoff(int onoff);
 static int watchdog_patpat(u_int timeout);
 static voidusage(void);
 
-int debugging = 0;
-int end_program = 0;
-const char *pidfile = _PATH_VARRUN watchdogd.pid;
-int reset_mib[3];
-size_t reset_miblen = 3;
-u_int timeout = WD_TO_16SEC;
-u_int passive = 0;
-int is_daemon = 0;
-int fd = -1;
-int nap = 1;
-char *test_cmd = NULL;
+static int debugging = 0;
+static int end_program = 0;
+static const char *pidfile = _PATH_VARRUN watchdogd.pid;
+static u_int timeout = WD_TO_16SEC;
+static u_int passive = 0;
+static int is_daemon = 0;
+static int fd = -1;
+static int nap = 1;
+static char *test_cmd = NULL;
 
 /*
  * Periodically pat the watchdog, preventing it from firing.
@@ -195,7 +193,7 @@ watchdog_loop(void)
  * Reset the watchdog timer. This function must be called periodically
  * to keep the watchdog from firing.
  */
-int
+static int
 watchdog_patpat(u_int 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


svn commit: r210311 - in head/sys: conf contrib/octeon-sdk mips/cavium mips/cavium/dev mips/cavium/octe mips/conf mips/include mips/mips

2010-07-20 Thread Juli Mallett
Author: jmallett
Date: Tue Jul 20 19:25:11 2010
New Revision: 210311
URL: http://svn.freebsd.org/changeset/base/210311

Log:
  Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive
  library:
  o) Increase inline unit / large function growth limits for MIPS to accommodate
 the needs of the Simple Executive, which uses a shocking amount of 
inlining.
  o) Remove TARGET_OCTEON and use CPU_CNMIPS to do things required by cnMIPS and
 the Octeon SoC.
  o) Add OCTEON_VENDOR_LANNER to use Lanner's allocation of vendor-specific
 board numbers, specifically to support the MR320.
  o) Add OCTEON_BOARD_CAPK_0100ND to hard-wire configuration for the 
CAPK-0100nd,
 which improperly uses an evaluation board's board number and breaks board
 detection at runtime.  This board is sold by Portwell as the CAM-0100.
  o) Add support for the RTC available on some Octeon boards.
  o) Add support for the Octeon PCI bus.  Note that rman_[sg]et_virtual for IO
 ports can not work unless building for n64.
  o) Clean up the CompactFlash driver to use Simple Executive macros and
 structures where possible (it would be advisable to use the Simple 
Executive
 API to set the PIO mode, too, but that is not done presently.)  Also use
 structures from FreeBSD's ATA layer rather than structures copied from
 Linux.
  o) Print available Octeon SoC features on boot.
  o) Add support for the Octeon timecounter.
  o) Use the Simple Executive's routines rather than local copies for doing 
reads
 and writes to 64-bit addresses and use its macros for various device
 addresses rather than using local copies.
  o) Rename octeon_board_real to octeon_is_simulation to reduce differences with
 Cavium-provided code originally written for Linux.  Also make it use the
 same simplified test that the Simple Executive and Linux both use rather
 than our complex one.
  o) Add support for the Octeon CIU, which is the main interrupt unit, as a bus
 to use normal interrupt allocation and setup routines.
  o) Use the Simple Executive's bootmem facility to allocate physical memory for
 the kernel, rather than assuming we know which addresses we can steal.
 NB: This may reduce the amount of RAM the kernel reports you as having if
 you are leaving large temporary allocations made by U-Boot allocated
 when starting FreeBSD.
  o) Add a port of the Cavium-provided Ethernet driver for Linux.  This changes
 Ethernet interface naming from rgmxN to octeN.  The new driver has vast
 improvements over the old one, both in performance and functionality, but
 does still have some features which have not been ported entirely and there
 may be unimplemented code that can be hit in everyday use.  I will make
 every effort to correct those as they are reported.
  o) Support loading the kernel on non-contiguous cores.
  o) Add very conservative support for harvesting randomness from the Octeon
 random number device.
  o) Turn SMP on by default.
  o) Clean up the style of the Octeon kernel configurations a little and make
 them compile with -march=octeon.
  o) Add support for the Lanner MR320 and the CAPK-0100nd to the Simple
 Executive.
  o) Modify the Simple Executive to build on FreeBSD and to build without
 executive-config.h or cvmx-config.h.  In the future we may want to
 revert part of these changes and supply executive-config.h and
 cvmx-config.h and access to the options contained in those files via
 kernel configuration files.
  o) Modify the Simple Executive USB routines to support getting and setting
 of the USB PID.

Added:
  head/sys/mips/cavium/ciu.c   (contents, props changed)
  head/sys/mips/cavium/cvmx_config.h   (contents, props changed)
  head/sys/mips/cavium/octe/
  head/sys/mips/cavium/octe/cavium-ethernet.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-common.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-common.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-defines.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-headers.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-mdio.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-mdio.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-mem.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-mem.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-rgmii.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-rx.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-rx.h   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-sgmii.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-spi.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-tx.c   (contents, props changed)
  head/sys/mips/cavium/octe/ethernet-tx.h   (contents, props changed)
  

svn commit: r210312 - in head/sys/mips/cavium: . cryptocteon usb

2010-07-20 Thread Juli Mallett
Author: jmallett
Date: Tue Jul 20 19:32:25 2010
New Revision: 210312
URL: http://svn.freebsd.org/changeset/base/210312

Log:
  o) Add the octusb controller which supports the first port of the Octeon
 on-board USB controller.  It is not currently enabled because there are
 known problems with device communication and until those are fixed I am not
 certain that it won't destabilize the system. [1]
  o) Add the cryptocteon opencrypto device based on the OCF device written by
 David McCullough.  It is not currently enabled because until support for
 saving/restoring coprocessor 2 state on context switch is available, it 
runs
 with interrupts disabled, which tends to pessimize performance over using a
 software crypto facility.  Tests using this driver which are not negatively
 affected by it running with interrupts disabled show it to be substantially
 faster than software for large blocks.
  
  Submitted by: hps [1]

Added:
  head/sys/mips/cavium/cryptocteon/
  head/sys/mips/cavium/cryptocteon/cavium_crypto.c   (contents, props changed)
  head/sys/mips/cavium/cryptocteon/cryptocteon.c   (contents, props changed)
  head/sys/mips/cavium/cryptocteon/cryptocteonvar.h   (contents, props changed)
  head/sys/mips/cavium/usb/
  head/sys/mips/cavium/usb/octusb.c   (contents, props changed)
  head/sys/mips/cavium/usb/octusb.h   (contents, props changed)
  head/sys/mips/cavium/usb/octusb_octeon.c   (contents, props changed)
Modified:
  head/sys/mips/cavium/files.octeon1

Added: head/sys/mips/cavium/cryptocteon/cavium_crypto.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/cavium/cryptocteon/cavium_crypto.cTue Jul 20 19:32:25 
2010(r210312)
@@ -0,0 +1, @@
+/*
+ * vim:sw=4 ts=8
+ */
+/*
+ * Copyright (c) 2009 David McCullough david.mccullo...@securecomputing.com
+ *
+ * Copyright (c) 2003-2007 Cavium Networks (supp...@cavium.com). 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Cavium Networks
+ * 4. Cavium Networks' name may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ * 
+ * This Software, including technical data, may be subject to U.S. export
+ * control laws, including the U.S. Export Administration Act and its
+ * associated regulations, and may be subject to export or import regulations
+ * in other countries. You warrant that You will comply strictly in all
+ * respects with all such regulations and acknowledge that you have the
+ * responsibility to obtain licenses to export, re-export or import the
+ * Software.
+ * 
+ * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED AS IS AND
+ * WITH ALL FAULTS AND CAVIUM MAKES NO PROMISES, REPRESENTATIONS OR WARRANTIES,
+ * EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO THE
+ * SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
+ * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
+ * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
+ * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
+ * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
+ * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
+ * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
+*/
+//
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/module.h
+#include sys/malloc.h
+#include sys/uio.h
+
+#include opencrypto/cryptodev.h
+
+#include contrib/octeon-sdk/cvmx.h
+
+#include mips/cavium/cryptocteon/cryptocteonvar.h
+
+//
+
+#defineIOV_INIT(iov, ptr, idx, len)
\
+   do {\
+   (idx) = 0;  \
+   (ptr) = (iov)[(idx)].iov_base;  \
+   (len) = (iov)[(idx)].iov_len;   \
+   } while (0)
+
+/*
+ * XXX
+ * It