svn commit: r238896 - head/usr.bin/script

2012-07-30 Thread Brian Somers
Author: brian
Date: Mon Jul 30 07:13:06 2012
New Revision: 238896
URL: http://svn.freebsd.org/changeset/base/238896

Log:
  Add d, p and r switches for recording script sessions with timing data
  and playing sessions back with or without time delays.
  
  PR:   114465
  Submitted by: ighighi at gmail dot com
  MFC after:3 weeks

Modified:
  head/usr.bin/script/script.1
  head/usr.bin/script/script.c

Modified: head/usr.bin/script/script.1
==
--- head/usr.bin/script/script.1Mon Jul 30 06:00:31 2012
(r238895)
+++ head/usr.bin/script/script.1Mon Jul 30 07:13:06 2012
(r238896)
@@ -36,7 +36,7 @@
 .Nd make typescript of terminal session
 .Sh SYNOPSIS
 .Nm
-.Op Fl akq
+.Op Fl adkpqr
 .Op Fl t Ar time
 .Op Ar file Op Ar command ...
 .Sh DESCRIPTION
@@ -72,10 +72,20 @@ Append the output to
 or
 .Pa typescript ,
 retaining the prior contents.
+.It Fl d
+When playing back a session with the
+.Fl p
+flag, don't sleep between records when playing back a timestamped session.
 .It Fl k
 Log keys sent to the program as well as output.
+.It Fl p
+Play back a session recorded with the
+.Fl r
+flag in real time.
 .It Fl q
-Run in quiet mode, omit the start and stop status messages.
+Run in quiet mode, omit the start, stop and command status messages.
+.It Fl r
+Record a session with input, output, and timestamping.
 .It Fl t Ar time
 Specify the interval at which the script output file will be flushed
 to disk, in seconds.
@@ -151,6 +161,14 @@ The
 .Nm
 command appeared in
 .Bx 3.0 .
+.Pp
+The
+.Fl d ,
+.Fl p
+and
+.Fl r
+options first appeared in
+.Nx 2.0 .
 .Sh BUGS
 The
 .Nm

Modified: head/usr.bin/script/script.c
==
--- head/usr.bin/script/script.cMon Jul 30 06:00:31 2012
(r238895)
+++ head/usr.bin/script/script.cMon Jul 30 07:13:06 2012
(r238896)
@@ -46,6 +46,9 @@ static const char sccsid[] = "@(#)script
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -59,11 +62,21 @@ static const char sccsid[] = "@(#)script
 #include 
 #include 
 
+#define DEF_BUF 65536
+
+struct stamp {
+   uint64_t scr_len;   /* amount of data */
+   uint64_t scr_sec;   /* time it arrived in seconds... */
+   uint32_t scr_usec;  /* ...and microseconds */
+   uint32_t scr_direction; /* 'i', 'o', etc (also indicates endianness) */
+};
+
 static FILE *fscript;
 static int master, slave;
 static int child;
 static const char *fname;
 static int qflg, ttyflg;
+static int usesleep, rawout;
 
 static struct termios tt;
 
@@ -71,6 +84,9 @@ static void done(int) __dead2;
 static void doshell(char **);
 static void fail(void);
 static void finish(void);
+static void record(FILE *, char *, size_t, int);
+static void consume(FILE *, off_t, char *, int);
+static void playback(FILE *) __dead2;
 static void usage(void);
 
 int
@@ -79,7 +95,7 @@ main(int argc, char *argv[])
int cc;
struct termios rtt, stt;
struct winsize win;
-   int aflg, kflg, ch, n;
+   int aflg, kflg, pflg, ch, n;
struct timeval tv, *tvp;
time_t tvec, start;
char obuf[BUFSIZ];
@@ -87,19 +103,32 @@ main(int argc, char *argv[])
fd_set rfd;
int flushtime = 30;
int readstdin;
+   int k;
+
+   aflg = kflg = pflg = 0;
+   usesleep = 1;
+   rawout = 0;
 
-   aflg = kflg = 0;
-   while ((ch = getopt(argc, argv, "aqkt:")) != -1)
+   while ((ch = getopt(argc, argv, "adkpqrt:")) != -1)
switch(ch) {
case 'a':
aflg = 1;
break;
-   case 'q':
-   qflg = 1;
+   case 'd':
+   usesleep = 0;
break;
case 'k':
kflg = 1;
break;
+   case 'p':
+   pflg = 1;
+   break;
+   case 'q':
+   qflg = 1;
+   break;
+   case 'r':
+   rawout = 1;
+   break;
case 't':
flushtime = atoi(optarg);
if (flushtime < 0)
@@ -119,9 +148,12 @@ main(int argc, char *argv[])
} else
fname = "typescript";
 
-   if ((fscript = fopen(fname, aflg ? "a" : "w")) == NULL)
+   if ((fscript = fopen(fname, pflg ? "r" : aflg ? "a" : "w")) == NULL)
err(1, "%s", fname);
 
+   if (pflg)
+   playback(fscript);
+
if ((ttyflg = isatty(STDIN_FILENO)) != 0) {
if (tcgetattr(STDIN_FILENO, &tt) == -1)
err(1, "tcgetattr");
@@ -134,10 +166,23 @@ main(int argc, char *argv[])
err(1, "openpty"

svn commit: r238897 - head/usr.bin/script

2012-07-30 Thread Brian Somers
Author: brian
Date: Mon Jul 30 08:06:00 2012
New Revision: 238897
URL: http://svn.freebsd.org/changeset/base/238897

Log:
  Mention when -d, -p and -r first hit FreeBSD.
  
  Bump the document date to when the change was made (rather than when the PR
  was submitted).
  
  Suggested by: pluknet

Modified:
  head/usr.bin/script/script.1

Modified: head/usr.bin/script/script.1
==
--- head/usr.bin/script/script.1Mon Jul 30 07:13:06 2012
(r238896)
+++ head/usr.bin/script/script.1Mon Jul 30 08:06:00 2012
(r238897)
@@ -28,7 +28,7 @@
 .\"@(#)script.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd September 28, 2011
+.Dd July 30, 2012
 .Dt SCRIPT 1
 .Os
 .Sh NAME
@@ -168,7 +168,9 @@ The
 and
 .Fl r
 options first appeared in
-.Nx 2.0 .
+.Nx 2.0
+and were ported to
+.Fx 10 .
 .Sh BUGS
 The
 .Nm
___
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: r238898 - head/sys/dev/sdhci

2012-07-30 Thread Gleb Smirnoff
Author: glebius
Date: Mon Jul 30 08:56:56 2012
New Revision: 238898
URL: http://svn.freebsd.org/changeset/base/238898

Log:
  Return back double spacing.

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Mon Jul 30 08:06:00 2012(r238897)
+++ head/sys/dev/sdhci/sdhci.c  Mon Jul 30 08:56:56 2012(r238898)
@@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev)
 
/*
 * Some SD/MMC cards don't work with the default base
-* clock frequency of 200MHz. Lower it to 50MHz.
+* clock frequency of 200MHz.  Lower it to 50MHz.
 */
pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1);
pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1);
___
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: r238899 - head/sbin/geom/class/sched

2012-07-30 Thread Joel Dahl
Author: joel (doc committer)
Date: Mon Jul 30 10:14:37 2012
New Revision: 238899
URL: http://svn.freebsd.org/changeset/base/238899

Log:
  Remove trailing whitespace.

Modified:
  head/sbin/geom/class/sched/gsched.8

Modified: head/sbin/geom/class/sched/gsched.8
==
--- head/sbin/geom/class/sched/gsched.8 Mon Jul 30 08:56:56 2012
(r238898)
+++ head/sbin/geom/class/sched/gsched.8 Mon Jul 30 10:14:37 2012
(r238899)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 26, 2012 
+.Dd July 26, 2012
 .Dt GSCHED 8
 .Os
 .Sh NAME
___
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: r238900 - head/sbin/ipfw

2012-07-30 Thread Luigi Rizzo
Author: luigi
Date: Mon Jul 30 10:55:23 2012
New Revision: 238900
URL: http://svn.freebsd.org/changeset/base/238900

Log:
  Fix some compile errors at high WARNS, including one
  for an uninitialized variable.
  
  unused parameters and variables are annotated with
(void)foo;  /* UNUSED */
  instead of __unused, because this code needs to build
  also on linux and windows.

Modified:
  head/sbin/ipfw/dummynet.c
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/nat.c

Modified: head/sbin/ipfw/dummynet.c
==
--- head/sbin/ipfw/dummynet.c   Mon Jul 30 10:14:37 2012(r238899)
+++ head/sbin/ipfw/dummynet.c   Mon Jul 30 10:55:23 2012(r238900)
@@ -759,7 +759,8 @@ load_extra_delays(const char *filename, 
 void
 ipfw_config_pipe(int ac, char **av)
 {
-   int i, j;
+   int i;
+   u_int j;
char *end;
struct dn_id *buf, *base;
struct dn_sch *sch = NULL;
@@ -1282,8 +1283,8 @@ parse_range(int ac, char *av[], uint32_t
av--;
}
if (v[1] < v[0] ||
-   v[1] < 0 || v[1] >= DN_MAX_ID-1 ||
-   v[0] < 0 || v[1] >= DN_MAX_ID-1) {
+   v[1] >= DN_MAX_ID-1 ||
+   v[1] >= DN_MAX_ID-1) {
continue; /* invalid entry */
}
n++;
@@ -1310,11 +1311,12 @@ void
 dummynet_list(int ac, char *av[], int show_counters)
 {
struct dn_id *oid, *x = NULL;
-   int ret, i, l;
+   int ret, i;
int n;  /* # of ranges */
-   int buflen;
-   int max_size;   /* largest obj passed up */
+   u_int buflen, l;
+   u_int max_size; /* largest obj passed up */
 
+   (void)show_counters;// XXX unused, but we should use it.
ac--;
av++;   /* skip 'list' | 'show' word */
 

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Mon Jul 30 10:14:37 2012(r238899)
+++ head/sbin/ipfw/ipfw2.c  Mon Jul 30 10:55:23 2012(r238900)
@@ -412,7 +412,7 @@ do_cmd(int optname, void *optval, uintpt
  * and calls setsockopt().
  * Function returns 0 on success or -1 otherwise.
  */
-int
+static int
 do_setcmd3(int optname, void *optval, socklen_t optlen)
 {
socklen_t len;
@@ -3930,6 +3930,7 @@ ipfw_table_handler(int ac, char *av[])
uint32_t a, type, mask, addrlen;
uint32_t tables_max;
 
+   mask = 0;   // XXX uninitialized ?
len = sizeof(tables_max);
if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len,
NULL, 0) == -1)
@@ -4135,7 +4136,7 @@ table_list(uint16_t num, int need_header
if (sz < xent->len)
break;
sz -= xent->len;
-   xent = (void *)xent + xent->len;
+   xent = (ipfw_table_xentry *)((char *)xent + xent->len);
}
 
free(tbl);

Modified: head/sbin/ipfw/nat.c
==
--- head/sbin/ipfw/nat.cMon Jul 30 10:14:37 2012(r238899)
+++ head/sbin/ipfw/nat.cMon Jul 30 10:55:23 2012(r238900)
@@ -318,6 +318,7 @@ estimate_redir_addr(int *ac, char ***av)
char *sep = **av;
u_int c = 0;
 
+   (void)ac;   /* UNUSED */
while ((sep = strchr(sep, ',')) != NULL) {
c++;
sep++;
@@ -379,6 +380,7 @@ estimate_redir_port(int *ac, char ***av)
char *sep = **av;
u_int c = 0;
 
+   (void)ac;   /* UNUSED */
while ((sep = strchr(sep, ',')) != NULL) {
c++;
sep++;
___
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: r238903 - head/sbin/ipfw

2012-07-30 Thread Luigi Rizzo
Author: luigi
Date: Mon Jul 30 11:02:22 2012
New Revision: 238903
URL: http://svn.freebsd.org/changeset/base/238903

Log:
  remove the last __unused instance in sbin/ipfw.
  This particular function (show_prerequisites() ) we should actually
  remove the argument from the callers as well, but i'll do it at a
  later time.

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Mon Jul 30 11:00:55 2012(r238902)
+++ head/sbin/ipfw/ipfw2.c  Mon Jul 30 11:02:22 2012(r238903)
@@ -976,8 +976,9 @@ print_icmptypes(ipfw_insn_u32 *cmd)
 #defineHAVE_OPTIONS0x8000
 
 static void
-show_prerequisites(int *flags, int want, int cmd __unused)
+show_prerequisites(int *flags, int want, int cmd)
 {
+   (void)cmd;  /* UNUSED */
if (co.comment_only)
return;
if ( (*flags & HAVE_IP) == HAVE_IP)
___
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: r238909 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive lib/libarchive/test

2012-07-30 Thread Martin Matuska
Author: mm
Date: Mon Jul 30 14:47:35 2012
New Revision: 238909
URL: http://svn.freebsd.org/changeset/base/238909

Log:
  Backport NFSv4 ACL fix from libarchive master branch.
  
  Source:
  https://github.com/libarchive/libarchive/commit/f67370d5
  
  Obtained from:libarchive (master branch)

Added:
  head/contrib/libarchive/libarchive/archive_write_disk_acl.c
  head/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c
  head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c
Modified:
  head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
  head/contrib/libarchive/libarchive/archive_write_disk_posix.c
  head/contrib/libarchive/libarchive/archive_write_disk_private.h
  head/contrib/libarchive/tar/test/test_basic.c
  head/lib/libarchive/Makefile
  head/lib/libarchive/config_freebsd.h
  head/lib/libarchive/test/Makefile

Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
==
--- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Mon Jul 30 14:34:30 2012(r238908)
+++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Mon Jul 30 14:47:35 2012(r238909)
@@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$");
 #defineACL_GET_PERM acl_get_perm_np
 #endif
 
-static int setup_acls_posix1e(struct archive_read_disk *,
+static int setup_acls(struct archive_read_disk *,
 struct archive_entry *, int *fd);
 static int setup_mac_metadata(struct archive_read_disk *,
 struct archive_entry *, int *fd);
@@ -168,15 +168,16 @@ archive_read_disk_entry_from_file(struct
st = &s;
}
archive_entry_copy_stat(entry, st);
-   /* Lookup uname/gname */
-   name = archive_read_disk_uname(_a, archive_entry_uid(entry));
-   if (name != NULL)
-   archive_entry_copy_uname(entry, name);
-   name = archive_read_disk_gname(_a, archive_entry_gid(entry));
-   if (name != NULL)
-   archive_entry_copy_gname(entry, name);
}
 
+   /* Lookup uname/gname */
+   name = archive_read_disk_uname(_a, archive_entry_uid(entry));
+   if (name != NULL)
+   archive_entry_copy_uname(entry, name);
+   name = archive_read_disk_gname(_a, archive_entry_gid(entry));
+   if (name != NULL)
+   archive_entry_copy_gname(entry, name);
+
 #ifdef HAVE_STRUCT_STAT_ST_FLAGS
/* On FreeBSD, we get flags for free with the stat. */
/* TODO: Does this belong in copy_stat()? */
@@ -244,7 +245,7 @@ archive_read_disk_entry_from_file(struct
}
 #endif /* HAVE_READLINK || HAVE_READLINKAT */
 
-   r = setup_acls_posix1e(a, entry, &fd);
+   r = setup_acls(a, entry, &fd);
r1 = setup_xattrs(a, entry, &fd);
if (r1 < r)
r = r1;
@@ -388,15 +389,16 @@ setup_mac_metadata(struct archive_read_d
 
 
 #ifdef HAVE_POSIX_ACL
-static void setup_acl_posix1e(struct archive_read_disk *a,
+static int translate_acl(struct archive_read_disk *a,
 struct archive_entry *entry, acl_t acl, int archive_entry_acl_type);
 
 static int
-setup_acls_posix1e(struct archive_read_disk *a,
+setup_acls(struct archive_read_disk *a,
 struct archive_entry *entry, int *fd)
 {
const char  *accpath;
acl_tacl;
+   int r;
 
accpath = archive_entry_sourcepath(entry);
if (accpath == NULL)
@@ -404,15 +406,33 @@ setup_acls_posix1e(struct archive_read_d
 
archive_entry_acl_clear(entry);
 
-   if (*fd < 0 && a->tree != NULL &&
-   (a->follow_symlinks || archive_entry_filetype(entry) != AE_IFLNK)){
-   *fd = a->open_on_current_dir(a->tree, accpath,
-   O_RDONLY | O_NONBLOCK);
-   if (*fd < 0) {
-   archive_set_error(&a->archive, errno,
-   "Couldn't access %s", accpath);
-   return (ARCHIVE_FAILED);
-   }
+   /* Try NFS4 ACL first. */
+   if (*fd >= 0)
+   acl = acl_get_fd(*fd);
+#if HAVE_ACL_GET_LINK_NP
+   else if (!a->follow_symlinks)
+   acl = acl_get_link_np(accpath, ACL_TYPE_NFS4);
+#else
+   else if ((!a->follow_symlinks)
+   && (archive_entry_filetype(entry) == AE_IFLNK))
+   /* We can't get the ACL of a symlink, so we assume it can't
+  have one. */
+   acl = NULL;
+#endif
+   else
+   acl = acl_get_file(accpath, ACL_TYPE_NFS4);
+#if HAVE_ACL_IS_TRIVIAL_NP
+   /* Ignore "trivial" ACLs that just mirror the file mode. */
+   acl_is_trivial_np(acl, &r);
+   if (r) {
+   acl_free(acl);
+   acl = NULL;
+   }
+#endif
+   if (acl != NULL) {
+   translate_acl(a, entry, acl, ARCHIVE_ENTRY

Re: svn commit: r238597 - head/sys/amd64/amd64

2012-07-30 Thread John Baldwin
On Wednesday, July 18, 2012 11:36:04 am Konstantin Belousov wrote:
> Author: kib
> Date: Wed Jul 18 15:36:03 2012
> New Revision: 238597
> URL: http://svn.freebsd.org/changeset/base/238597
> 
> Log:
>   Add stmxcsr.
>   
>   Submitted by:   Ed Alley 
>   PR:   amd64/169927
>   MFC after:  3 weeks
> 
> Modified:
>   head/sys/amd64/amd64/fpu.c
> 
> Modified: head/sys/amd64/amd64/fpu.c
> 
==
> --- head/sys/amd64/amd64/fpu.cWed Jul 18 12:41:09 2012
> (r238596)
> +++ head/sys/amd64/amd64/fpu.cWed Jul 18 15:36:03 2012
> (r238597)
> @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$");
>  #define  fxrstor(addr)   __asm __volatile("fxrstor %0" : : "m" 
(*(addr)))
>  #define  fxsave(addr)__asm __volatile("fxsave %0" : "=m" 
> (*(addr)))
>  #define  ldmxcsr(csr)__asm __volatile("ldmxcsr %0" : : "m" 
> (csr))
> +#define  stmxcsr(addr)   __asm __volatile("stmxcsr %0" : : "m" 
(*(addr)))
>  
>  static __inline void
>  xrstor(char *addr, uint64_t mask)
> @@ -105,6 +106,7 @@ void  fnstsw(caddr_t addr);
>  void fxsave(caddr_t addr);
>  void fxrstor(caddr_t addr);
>  void ldmxcsr(u_int csr);
> +void stmxcsr(u_int csr);
>  void xrstor(char *addr, uint64_t mask);
>  void xsave(char *addr, uint64_t mask);

I think this should use 'u_int *addr' rather than 'u_int csr'.

-- 
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: r238563 - head/gnu/usr.bin/groff/tmac

2012-07-30 Thread John Baldwin
On Wednesday, July 18, 2012 1:57:43 am David E. O'Brien wrote:
> Author: obrien
> Date: Wed Jul 18 05:57:42 2012
> New Revision: 238563
> URL: http://svn.freebsd.org/changeset/base/238563
> 
> Log:
>   a ";" tells make we want the shell to be used
>   
>   Submitted by:   Simon Gerraty 
> 
> Modified:
>   head/gnu/usr.bin/groff/tmac/Makefile
> 
> Modified: head/gnu/usr.bin/groff/tmac/Makefile
> ==
> --- head/gnu/usr.bin/groff/tmac/Makefile  Wed Jul 18 05:50:40 2012
> (r238562)
> +++ head/gnu/usr.bin/groff/tmac/Makefile  Wed Jul 18 05:57:42 2012
> (r238563)
> @@ -68,7 +68,7 @@ beforeinstall:
>   cd ${.CURDIR}; \
>   ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
>   koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}
> - cd ${.OBJDIR}
> + cd ${.OBJDIR};

Isn't this a nop now?  That is, it changes the working directory in a temporary
shell that immediately exits?

-- 
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: r238912 - head/sys/dev/netmap

2012-07-30 Thread Luigi Rizzo
Author: luigi
Date: Mon Jul 30 18:21:48 2012
New Revision: 238912
URL: http://svn.freebsd.org/changeset/base/238912

Log:
  - move the inclusion of netmap headers to the common part of the code;
  - more portable annotations for unused arguments;

Modified:
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_mem2.c

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cMon Jul 30 15:37:47 2012
(r238911)
+++ head/sys/dev/netmap/netmap.cMon Jul 30 18:21:48 2012
(r238912)
@@ -90,13 +90,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include/* BIOCIMMEDIATE */
 #include 
-#include 
-#include 
 #include/* bus_dmamap_* */
 
 MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map");
 #endif /* __FreeBSD__ */
 
+#include 
+#include 
+
 /*
  * lock and unlock for the netmap memory allocator
  */
@@ -764,8 +765,8 @@ netmap_set_ringid(struct netmap_priv_d *
  * Return 0 on success, errno otherwise.
  */
 static int
-netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data,
-   __unused int fflag, struct thread *td)
+netmap_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
+   int fflag, struct thread *td)
 {
struct netmap_priv_d *priv = NULL;
struct ifnet *ifp;
@@ -775,6 +776,8 @@ netmap_ioctl(__unused struct cdev *dev, 
u_int i, lim;
struct netmap_if *nifp;
 
+   (void)dev;  /* UNUSED */
+   (void)fflag;/* UNUSED */
 #ifdef linux
 #define devfs_get_cdevpriv(pp) \
({ *(struct netmap_priv_d **)pp = ((struct file *)td)->private_data;
\
@@ -1551,7 +1554,7 @@ linux_netmap_poll(struct file * file, st
 }
 
 static int
-netmap_mmap(__unused struct file *f, struct vm_area_struct *vma)
+netmap_mmap(struct file *f, struct vm_area_struct *vma)
 {
int lut_skip, i, j;
int user_skip = 0;
@@ -1565,6 +1568,7 @@ netmap_mmap(__unused struct file *f, str
 * vma->vm_end: end of the mapping user address space
 */
 
+   (void)f;/* UNUSED */
// XXX security checks
 
for (i = 0; i < 3; i++) {  /* loop through obj_pools */
@@ -1599,7 +1603,7 @@ netmap_start_linux(struct sk_buff *skb, 
 }
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)// XXX was 38
 #define LIN_IOCTL_NAME .ioctl
 int
 linux_netmap_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long 
data /* arg */)
@@ -1623,8 +1627,9 @@ linux_netmap_ioctl(struct file *file, u_
 
 
 static int
-netmap_release(__unused struct inode *inode, struct file *file)
+netmap_release(struct inode *inode, struct file *file)
 {
+   (void)inode;/* UNUSED */
if (file->private_data)
netmap_dtor(file->private_data);
return (0);

Modified: head/sys/dev/netmap/netmap_mem2.c
==
--- head/sys/dev/netmap/netmap_mem2.c   Mon Jul 30 15:37:47 2012
(r238911)
+++ head/sys/dev/netmap/netmap_mem2.c   Mon Jul 30 18:21:48 2012
(r238912)
@@ -25,7 +25,7 @@
 
 /*
  * $FreeBSD$
- * $Id: netmap_mem2.c 10830 2012-03-22 18:06:01Z luigi $
+ * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $
  *
  * New memory allocator for netmap
  */
@@ -300,12 +300,13 @@ netmap_obj_free_va(struct netmap_obj_poo
 
 
 static void
-netmap_new_bufs(struct netmap_if *nifp __unused,
+netmap_new_bufs(struct netmap_if *nifp,
 struct netmap_slot *slot, u_int n)
 {
struct netmap_obj_pool *p = nm_mem->nm_buf_pool;
uint32_t i = 0; /* slot counter */
 
+   (void)nifp; /* UNUSED */
for (i = 0; i < n; i++) {
void *vaddr = netmap_buf_malloc();
if (vaddr == NULL) {
___
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: r238914 - in head/sys: amd64/amd64 i386/isa

2012-07-30 Thread Konstantin Belousov
Author: kib
Date: Mon Jul 30 19:26:02 2012
New Revision: 238914
URL: http://svn.freebsd.org/changeset/base/238914

Log:
  Change (unused) prototype for stmxcsr() to match reality.
  
  Noted by: jhb
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/isa/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Mon Jul 30 19:05:41 2012(r238913)
+++ head/sys/amd64/amd64/fpu.c  Mon Jul 30 19:26:02 2012(r238914)
@@ -106,7 +106,7 @@ voidfnstsw(caddr_t addr);
 void   fxsave(caddr_t addr);
 void   fxrstor(caddr_t addr);
 void   ldmxcsr(u_int csr);
-void   stmxcsr(u_int csr);
+void   stmxcsr(u_int *csr);
 void   xrstor(char *addr, uint64_t mask);
 void   xsave(char *addr, uint64_t mask);
 

Modified: head/sys/i386/isa/npx.c
==
--- head/sys/i386/isa/npx.c Mon Jul 30 19:05:41 2012(r238913)
+++ head/sys/i386/isa/npx.c Mon Jul 30 19:26:02 2012(r238914)
@@ -114,7 +114,7 @@ voidfrstor(caddr_t addr);
 #ifdef CPU_ENABLE_SSE
 void   fxsave(caddr_t addr);
 void   fxrstor(caddr_t addr);
-void   stmxcsr(u_int csr);
+void   stmxcsr(u_int *csr);
 #endif
 
 #endif /* __GNUCLIKE_ASM && !lint */
___
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: r238765 - head/sys/dev/e1000

2012-07-30 Thread John Baldwin
On Wednesday, July 25, 2012 7:28:15 am Luigi Rizzo wrote:
> Author: luigi
> Date: Wed Jul 25 11:28:15 2012
> New Revision: 238765
> URL: http://svn.freebsd.org/changeset/base/238765
> 
> Log:
>   Use legacy interrupts as a default. This gives up to 10% speedup
>   when used in qemu (and this driver is for non-PCIe cards,
>   so probably its largest use is in virtualized environments).
>   
>   Approved by:Jack Vogel
>   MFC after:  3 days

Why not make this a tunable or some such?  You could even have it only use the 
legacy handler under qemu easily enough.  There's no reason this has to be a 
compile-time option.  This is almost certainly slower on real hardware where 
this is important to work around dubious Intel Host-PCI bridges that result in 
aliased USB interrupts for every em(4) interrupt.

-- 
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: r238915 - head/sys/vm

2012-07-30 Thread Alan Cox
Author: alc
Date: Mon Jul 30 20:38:37 2012
New Revision: 238915
URL: http://svn.freebsd.org/changeset/base/238915

Log:
  Eliminate an unneeded declaration.  (I should have removed this as part
  of r227568.)

Modified:
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Mon Jul 30 19:26:02 2012(r238914)
+++ head/sys/vm/vm_page.h   Mon Jul 30 20:38:37 2012(r238915)
@@ -310,7 +310,6 @@ extern struct vpglocks pa_lock[];
  *
  */
 
-struct vnode;
 extern int vm_page_zero_count;
 
 extern vm_page_t vm_page_array;/* First resident page in table 
*/
___
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: r238917 - head/sys/i386/linux

2012-07-30 Thread John Baldwin
Author: jhb
Date: Mon Jul 30 20:44:45 2012
New Revision: 238917
URL: http://svn.freebsd.org/changeset/base/238917

Log:
  The linux_lstat() system call accepts a pointer to a 'struct l_stat', not a
  'struct ostat'.

Modified:
  head/sys/i386/linux/syscalls.master

Modified: head/sys/i386/linux/syscalls.master
==
--- head/sys/i386/linux/syscalls.master Mon Jul 30 20:40:14 2012
(r238916)
+++ head/sys/i386/linux/syscalls.master Mon Jul 30 20:44:45 2012
(r238917)
@@ -158,7 +158,7 @@
struct l_old_select_argv *ptr); }
 83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); }
 ; 84: oldlstat
-84 AUE_LSTAT   STD { int linux_lstat(char *path, struct ostat 
*up); }
+84 AUE_LSTAT   STD { int linux_lstat(char *path, struct l_stat 
*up); }
 85 AUE_READLINKSTD { int linux_readlink(char *name, char *buf, \
l_int count); }
 86 AUE_USELIB  STD { int linux_uselib(char *library); }
___
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: r238918 - head/sys/i386/linux

2012-07-30 Thread John Baldwin
Author: jhb
Date: Mon Jul 30 20:45:17 2012
New Revision: 238918
URL: http://svn.freebsd.org/changeset/base/238918

Log:
  Regen.

Modified:
  head/sys/i386/linux/linux_proto.h
  head/sys/i386/linux/linux_syscall.h
  head/sys/i386/linux/linux_syscalls.c
  head/sys/i386/linux/linux_sysent.c
  head/sys/i386/linux/linux_systrace_args.c

Modified: head/sys/i386/linux/linux_proto.h
==
--- head/sys/i386/linux/linux_proto.h   Mon Jul 30 20:44:45 2012
(r238917)
+++ head/sys/i386/linux/linux_proto.h   Mon Jul 30 20:45:17 2012
(r238918)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 234359 2012-04-16 
23:16:18Z jkim 
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 238917 2012-07-30 
20:44:45Z jhb 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -261,7 +261,7 @@ struct linux_symlink_args {
 };
 struct linux_lstat_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-   char up_l_[PADL_(struct ostat *)]; struct ostat * up; char 
up_r_[PADR_(struct ostat *)];
+   char up_l_[PADL_(struct l_stat *)]; struct l_stat * up; char 
up_r_[PADR_(struct l_stat *)];
 };
 struct linux_readlink_args {
char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)];

Modified: head/sys/i386/linux/linux_syscall.h
==
--- head/sys/i386/linux/linux_syscall.h Mon Jul 30 20:44:45 2012
(r238917)
+++ head/sys/i386/linux/linux_syscall.h Mon Jul 30 20:45:17 2012
(r238918)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 234359 2012-04-16 
23:16:18Z jkim 
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 238917 2012-07-30 
20:44:45Z jhb 
  */
 
 #defineLINUX_SYS_exit  1

Modified: head/sys/i386/linux/linux_syscalls.c
==
--- head/sys/i386/linux/linux_syscalls.cMon Jul 30 20:44:45 2012
(r238917)
+++ head/sys/i386/linux/linux_syscalls.cMon Jul 30 20:45:17 2012
(r238918)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 234359 2012-04-16 
23:16:18Z jkim 
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 238917 2012-07-30 
20:44:45Z jhb 
  */
 
 const char *linux_syscallnames[] = {

Modified: head/sys/i386/linux/linux_sysent.c
==
--- head/sys/i386/linux/linux_sysent.c  Mon Jul 30 20:44:45 2012
(r238917)
+++ head/sys/i386/linux/linux_sysent.c  Mon Jul 30 20:45:17 2012
(r238918)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 234359 2012-04-16 
23:16:18Z jkim 
+ * created from FreeBSD: head/sys/i386/linux/syscalls.master 238917 2012-07-30 
20:44:45Z jhb 
  */
 
 #include 

Modified: head/sys/i386/linux/linux_systrace_args.c
==
--- head/sys/i386/linux/linux_systrace_args.c   Mon Jul 30 20:44:45 2012
(r238917)
+++ head/sys/i386/linux/linux_systrace_args.c   Mon Jul 30 20:45:17 2012
(r238918)
@@ -570,7 +570,7 @@ systrace_args(int sysnum, void *params, 
case 84: {
struct linux_lstat_args *p = params;
uarg[0] = (intptr_t) p->path; /* char * */
-   uarg[1] = (intptr_t) p->up; /* struct ostat * */
+   uarg[1] = (intptr_t) p->up; /* struct l_stat * */
*n_args = 2;
break;
}
@@ -3192,7 +3192,7 @@ systrace_entry_setargdesc(int sysnum, in
p = "char *";
break;
case 1:
-   p = "struct ostat *";
+   p = "struct l_stat *";
break;
default:
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: r238919 - head/lib/libc/locale

2012-07-30 Thread Isabell Long
Author: issyl0 (doc committer)
Date: Mon Jul 30 20:56:19 2012
New Revision: 238919
URL: http://svn.freebsd.org/changeset/base/238919

Log:
  Add more locale-specific functions to the relevant man pages and Makefile:
- lib/libc/locale/islower.3
- lib/libc/locale/ispunct.3
- lib/libc/locale/nl_langinfo.3
- lib/libc/locale/isgraph.3
- lib/libc/locale/isspace.3
  
  Reviewed by:  bz
  Approved by:  theraven
  MFC after:5 days

Modified:
  head/lib/libc/locale/Makefile.inc
  head/lib/libc/locale/isgraph.3
  head/lib/libc/locale/islower.3
  head/lib/libc/locale/ispunct.3
  head/lib/libc/locale/isspace.3
  head/lib/libc/locale/nl_langinfo.3

Modified: head/lib/libc/locale/Makefile.inc
==
--- head/lib/libc/locale/Makefile.inc   Mon Jul 30 20:45:17 2012
(r238918)
+++ head/lib/libc/locale/Makefile.inc   Mon Jul 30 20:56:19 2012
(r238919)
@@ -47,6 +47,11 @@ MAN+=big5.5 euc.5 gb18030.5 gb2312.5 gb
 
 MLINKS+=btowc.3 wctob.3
 MLINKS+=isdigit.3 isnumber.3
+MLINKS+=isgraph.3 isgraph_l.3
+MLINKS+=islower.3 islower_l.3
+MLINKS+=ispunct.3 ispunct_l.3
+MLINKS+=isspace.3 isspace_l.3
+MLINKS+=nl_langinfo.3 nl_langinfo_l.3
 MLINKS+=iswalnum.3 iswalpha.3 iswalnum.3 iswascii.3 iswalnum.3 iswblank.3 \
iswalnum.3 iswcntrl.3 iswalnum.3 iswdigit.3 iswalnum.3 iswgraph.3 \
iswalnum.3 iswhexnumber.3 \

Modified: head/lib/libc/locale/isgraph.3
==
--- head/lib/libc/locale/isgraph.3  Mon Jul 30 20:45:17 2012
(r238918)
+++ head/lib/libc/locale/isgraph.3  Mon Jul 30 20:56:19 2012
(r238919)
@@ -32,7 +32,7 @@
 .\" @(#)isgraph.3  8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd July 17, 2005
+.Dd July 30, 2012
 .Dt ISGRAPH 3
 .Os
 .Sh NAME
@@ -44,6 +44,8 @@
 .In ctype.h
 .Ft int
 .Fn isgraph "int c"
+.Ft int
+.Fn isgraph_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn isgraph
@@ -79,11 +81,19 @@ In the ASCII character set, this include
 .It "\&166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" Ta "172\ 
``z''"
 .It "\&173\ ``{''" Ta "174\ ``|''" Ta "175\ ``}''" Ta "176\ ``~''" Ta \&
 .El
+.Pp
+The
+.Fn isgraph_l
+function takes an explicit locale argument, whereas the
+.Fn isgraph
+function uses the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn isgraph
-function returns zero if the character tests false and
-returns non-zero if the character tests true.
+and
+.Fn isgraph_l
+functions return zero if the character tests false and
+return non-zero if the character tests true.
 .Sh COMPATIBILITY
 The
 .Bx 4.4
@@ -103,3 +113,7 @@ The
 .Fn isgraph
 function conforms to
 .St -isoC .
+The
+.Fn isgraph_l
+function conforms to
+.St -p1003.1-2008 .

Modified: head/lib/libc/locale/islower.3
==
--- head/lib/libc/locale/islower.3  Mon Jul 30 20:45:17 2012
(r238918)
+++ head/lib/libc/locale/islower.3  Mon Jul 30 20:56:19 2012
(r238919)
@@ -32,7 +32,7 @@
 .\" @(#)islower.3  8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd July 17, 2005
+.Dd July 30, 2012
 .Dt ISLOWER 3
 .Os
 .Sh NAME
@@ -44,6 +44,8 @@
 .In ctype.h
 .Ft int
 .Fn islower "int c"
+.Ft int
+.Fn islower_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn islower
@@ -63,11 +65,18 @@ In the ASCII character set, this include
 .It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ 
``y''"
 .It "\&172\ ``z''" Ta \& Ta \& Ta \& Ta \&
 .El
+The
+.Fn islower_l
+function takes an explicit locale argument, whereas the
+.Fn islower
+function uses the current global or per-thread locale. 
 .Sh RETURN VALUES
 The
 .Fn islower
-function returns zero if the character tests false and
-returns non-zero if the character tests true.
+and
+.Fn islower_l
+functions return zero if the character tests false and
+return non-zero if the character tests true.
 .Sh COMPATIBILITY
 The
 .Bx 4.4
@@ -88,3 +97,7 @@ The
 .Fn islower
 function conforms to
 .St -isoC .
+The
+.Fn islower_l
+function conforms to
+.St -p1003.1-2008 .

Modified: head/lib/libc/locale/ispunct.3
==
--- head/lib/libc/locale/ispunct.3  Mon Jul 30 20:45:17 2012
(r238918)
+++ head/lib/libc/locale/ispunct.3  Mon Jul 30 20:56:19 2012
(r238919)
@@ -32,7 +32,7 @@
 .\"@(#)ispunct.3   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd July 17, 2005
+.Dd July 30, 2012
 .Dt ISPUNCT 3
 .Os
 .Sh NAME
@@ -44,6 +44,8 @@
 .In ctype.h
 .Ft int
 .Fn ispunct "int c"
+.Ft int
+.Fn ispunct_l "int c" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn ispunct
@@ -69,11 +71,19 @@ In the ASCII character set, this include
 .It "\&136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" Ta "173\ ``{''" Ta "174\ 
``|''"
 .It "\&175\ ``}''" Ta "176\ ``~''" Ta \& Ta \& Ta \&
 .El
+.Pp
+The
+.Fn ispunct_l
+function tak

svn commit: r238920 - head/lib/libc/locale

2012-07-30 Thread Joel Dahl
Author: joel (doc committer)
Date: Mon Jul 30 21:02:44 2012
New Revision: 238920
URL: http://svn.freebsd.org/changeset/base/238920

Log:
  Remove trailing whitespace.

Modified:
  head/lib/libc/locale/islower.3

Modified: head/lib/libc/locale/islower.3
==
--- head/lib/libc/locale/islower.3  Mon Jul 30 20:56:19 2012
(r238919)
+++ head/lib/libc/locale/islower.3  Mon Jul 30 21:02:44 2012
(r238920)
@@ -69,7 +69,7 @@ The
 .Fn islower_l
 function takes an explicit locale argument, whereas the
 .Fn islower
-function uses the current global or per-thread locale. 
+function uses the current global or per-thread locale.
 .Sh RETURN VALUES
 The
 .Fn islower
___
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: r238921 - head/sys/arm/at91

2012-07-30 Thread Warner Losh
Author: imp
Date: Mon Jul 30 21:19:19 2012
New Revision: 238921
URL: http://svn.freebsd.org/changeset/base/238921

Log:
  List the members of the AT91SAM9G45 family.

Modified:
  head/sys/arm/at91/std.at91sam9g45

Modified: head/sys/arm/at91/std.at91sam9g45
==
--- head/sys/arm/at91/std.at91sam9g45   Mon Jul 30 21:02:44 2012
(r238920)
+++ head/sys/arm/at91/std.at91sam9g45   Mon Jul 30 21:19:19 2012
(r238921)
@@ -1,6 +1,9 @@
 # $FreeBSD$
 #
-# PHYSADDR is different on at91sam9g45 than the other at91sam SoCs
+# Unlike other Atmel SoCs, which have their SDRAM at CS1, the
+# at91sam9g45 family has it on CS6, so PHYSADDR must be adjusted
+# accordingly.  The at91sam9g45, at91sam9g46, at91sam9m10 and at91sam9m11
+# SoCs are members of this family.
 
 files  "../at91/files.at91"
 cpuCPU_ARM9
___
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: r238922 - head/sys/arm/at91

2012-07-30 Thread Warner Losh
Author: imp
Date: Mon Jul 30 21:30:43 2012
New Revision: 238922
URL: http://svn.freebsd.org/changeset/base/238922

Log:
  These files will support the whole at91sam9x5 family when done,
  so rename them now before they get copied further afield...

Added:
  head/sys/arm/at91/at91sam9x5.c
 - copied, changed from r238879, head/sys/arm/at91/at91sam9x25.c
  head/sys/arm/at91/at91sam9x5reg.h
 - copied, changed from r238879, head/sys/arm/at91/at91sam9x25reg.h
Deleted:
  head/sys/arm/at91/at91sam9x25.c
  head/sys/arm/at91/at91sam9x25reg.h
Modified:
  head/sys/arm/at91/files.at91
  head/sys/arm/at91/std.atmel
  head/sys/arm/at91/std.sam9x25ek

Copied and modified: head/sys/arm/at91/at91sam9x5.c (from r238879, 
head/sys/arm/at91/at91sam9x25.c)
==
--- head/sys/arm/at91/at91sam9x25.c Sun Jul 29 01:01:35 2012
(r238879, copy source)
+++ head/sys/arm/at91/at91sam9x5.c  Mon Jul 30 21:30:43 2012
(r238922)
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Copied and modified: head/sys/arm/at91/at91sam9x5reg.h (from r238879, 
head/sys/arm/at91/at91sam9x25reg.h)
==
--- head/sys/arm/at91/at91sam9x25reg.h  Sun Jul 29 01:01:35 2012
(r238879, copy source)
+++ head/sys/arm/at91/at91sam9x5reg.h   Mon Jul 30 21:30:43 2012
(r238922)
@@ -27,8 +27,8 @@
 
 /* $FreeBSD$ */
 
-#ifndef AT91SAM9X25REG_H_
-#define AT91SAM9X25REG_H_
+#ifndef AT91SAM9X5REG_H_
+#define AT91SAM9X5REG_H_
 
 #ifndef AT91SAM9X25_MASTER_CLOCK
 #define AT91SAM9X25_MASTER_CLOCK ((18432000 * 43)/6)
@@ -312,5 +312,4 @@
 #define AT91SAM9X25_SDRAMC_ISR 0x20
 #define AT91SAM9X25_SDRAMC_MDR 0x24
 
-#endif /* AT91SAM9X25REG_H_*/
-
+#endif /* AT91SAM9X5REG_H_*/

Modified: head/sys/arm/at91/files.at91
==
--- head/sys/arm/at91/files.at91Mon Jul 30 21:19:19 2012
(r238921)
+++ head/sys/arm/at91/files.at91Mon Jul 30 21:30:43 2012
(r238922)
@@ -33,7 +33,7 @@ arm/at91/at91rm9200_devices.c optionala
 arm/at91/at91sam9260.c optionalat91sam9260
 arm/at91/at91sam9g20.c optionalat91sam9g20
 arm/at91/at91sam9g45.c optionalat91sam9g45
-arm/at91/at91sam9x25.c optionalat91sam9x25
+arm/at91/at91sam9x5.c  optionalat91sam9x5
 #
 # All the boards we support
 #

Modified: head/sys/arm/at91/std.atmel
==
--- head/sys/arm/at91/std.atmel Mon Jul 30 21:19:19 2012(r238921)
+++ head/sys/arm/at91/std.atmel Mon Jul 30 21:30:43 2012(r238922)
@@ -10,7 +10,7 @@ deviceat91rm9200
 device at91sam9260
 device at91sam9g20
 device at91sam9g45
-device at91sam9x25
+device at91sam9x5
 
 # bring in the sam specific timers and such
 device at91sam9

Modified: head/sys/arm/at91/std.sam9x25ek
==
--- head/sys/arm/at91/std.sam9x25ek Mon Jul 30 21:19:19 2012
(r238921)
+++ head/sys/arm/at91/std.sam9x25ek Mon Jul 30 21:30:43 2012
(r238922)
@@ -8,4 +8,4 @@ options KERNPHYSADDR=0x2000 
 optionsKERNVIRTADDR=0xc000
 
 device at91_board_sam9x25ek
-device at91sam9x25
+device at91sam9x5
___
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: r238923 - in head/lib/msun: ld128 ld80 src

2012-07-30 Thread Steve Kargl
Author: kargl
Date: Mon Jul 30 21:55:49 2012
New Revision: 238923
URL: http://svn.freebsd.org/changeset/base/238923

Log:
  Whitespace.
  
  Submitted by: bde
  Approved by:  das (pre-approved)

Modified:
  head/lib/msun/ld128/s_expl.c
  head/lib/msun/ld80/s_expl.c
  head/lib/msun/src/s_cbrtl.c

Modified: head/lib/msun/ld128/s_expl.c
==
--- head/lib/msun/ld128/s_expl.cMon Jul 30 21:30:43 2012
(r238922)
+++ head/lib/msun/ld128/s_expl.cMon Jul 30 21:55:49 2012
(r238923)
@@ -58,7 +58,7 @@ P9 = 2.755731922401038678178761995444688
 P10 = 2.75573236172670046201884000197885520e-7L,
 P11 = 2.50517544183909126492878226167697856e-8L;
 
-#defineINTERVALS   128
+#defineINTERVALS   128
 
 static const struct {
long double hi;
@@ -205,7 +205,7 @@ expl(long double x)
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
-   ix = hx &  0x7fff;
+   ix = hx & 0x7fff;
if (ix >= BIAS + 13) {  /* |x| >= 8192 or x is NaN */
if (ix == BIAS + LDBL_MAX_EXP) {
if (u.xbits.manh != 0

Modified: head/lib/msun/ld80/s_expl.c
==
--- head/lib/msun/ld80/s_expl.c Mon Jul 30 21:30:43 2012(r238922)
+++ head/lib/msun/ld80/s_expl.c Mon Jul 30 21:55:49 2012(r238923)
@@ -88,7 +88,7 @@ P6 =  1.391738560272e-3;  /*  0x16c1
  * the first 47 (?!) bits of the significand is stored in hi and the next 53
  * bits are in lo.
  */
-#defineINTERVALS   128
+#defineINTERVALS   128
 
 static const struct {
double  hi;

Modified: head/lib/msun/src/s_cbrtl.c
==
--- head/lib/msun/src/s_cbrtl.c Mon Jul 30 21:30:43 2012(r238922)
+++ head/lib/msun/src/s_cbrtl.c Mon Jul 30 21:55:49 2012(r238923)
@@ -52,7 +52,6 @@ cbrtl(long double x)
return (x + x);
 
ENTERI();
-
if (k == 0) {
/* If x = +-0, then cbrt(x) = +-0. */
if ((u.bits.manh | u.bits.manl) == 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: r238924 - head/lib/msun/src

2012-07-30 Thread Steve Kargl
Author: kargl
Date: Mon Jul 30 21:58:28 2012
New Revision: 238924
URL: http://svn.freebsd.org/changeset/base/238924

Log:
  ieeefp.h is only needed on i386 class hardware.
  
  Submitted by: bde
  Approved by:  das (pre-approved)

Modified:
  head/lib/msun/src/s_cbrtl.c

Modified: head/lib/msun/src/s_cbrtl.c
==
--- head/lib/msun/src/s_cbrtl.c Mon Jul 30 21:55:49 2012(r238923)
+++ head/lib/msun/src/s_cbrtl.c Mon Jul 30 21:58:28 2012(r238924)
@@ -18,7 +18,9 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#ifdef __i386__
 #include 
+#endif
 
 #include "fpmath.h"
 #include "math.h"
___
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: r237742 - in head/sys/arm: at91 conf

2012-07-30 Thread Daan Vreeken
Hi Warner,


On Friday 29 June 2012 06:18:52 Warner Losh wrote:
> Author: imp
> Date: Fri Jun 29 04:18:52 2012
> New Revision: 237742
> URL: http://svn.freebsd.org/changeset/base/237742
>
> Log:
>   Initital support for AT91SAM9X25 SoC and the SAM9X25-EK evaluation
>   board.  Much work remains.
...
> Added: head/sys/arm/at91/at91sam9x25.c
> ===
>=== --- /dev/null  00:00:00 1970   (empty, because file is newly added)
> +++ head/sys/arm/at91/at91sam9x25.c   Fri Jun 29 04:18:52 2012
> (r237742)
> @@ -0,0 +1,343 @@
...
> +static uint32_t
> +at91_pll_outa(int freq)
> +{
> +
> + switch (freq / 1000) {

You seem to be dividing freq into multiples of 10MHz instead of 1MHz here. I 
think dividing by 1e6 was the intention.

> + case 747 ... 801: return ((1 << 29) | (0 << 14));
> + case 697 ... 746: return ((1 << 29) | (1 << 14));
> + case 647 ... 696: return ((1 << 29) | (2 << 14));
> + case 597 ... 646: return ((1 << 29) | (3 << 14));
> + case 547 ... 596: return ((1 << 29) | (1 << 14));
> + case 497 ... 546: return ((1 << 29) | (2 << 14));
> + case 447 ... 496: return ((1 << 29) | (3 << 14));

> + case 397 ... 446: return ((1 << 29) | (4 << 14));

The (4 << 14) looks a bit strange here, as OUTA only occupies bit 14 and 15 of 
CKGR_PLLAR. (See Atmel doc11054, page 201 and 1103.)

Maybe this entire routine could be written as something like:
uint8_t outa;

freq /= 100;
// optional:
//freq += 3;
// see doc11054, page 1103
outa = 3 - ((freq / 50) & 3);

return ((1 << 29) | (outa << 14));

Just glancing at the code, setting ICPLLA in PMC_PLLICPR for frequencies <= 
600MHz seems to be missing at this moment (or I'm just not seeing it).
(see page 212 and 1103)


Regards,
-- 
Daan Vreeken
Vitsch Electronics
http://Vitsch.nl/
http://VitschVPN.nl/
tel: +31-(0)40-7113051
KvK nr: 17174380
___
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: r238925 - in head/sys: conf kern

2012-07-30 Thread Davide Italiano
Author: davide
Date: Mon Jul 30 22:46:42 2012
New Revision: 238925
URL: http://svn.freebsd.org/changeset/base/238925

Log:
  Until now KTR_ENTRIES, which defines the size of circular buffer used in
  ktr(4), was constrained to be a power of two. Remove this constraint and
  update sys/conf/NOTES accordingly.
  
  Reviewed by:  jhb
  Approved by:  gnn (mentor)
  Sponsored by: Google Summer of Code 2012

Modified:
  head/sys/conf/NOTES
  head/sys/kern/kern_ktr.c

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Mon Jul 30 21:58:28 2012(r238924)
+++ head/sys/conf/NOTES Mon Jul 30 22:46:42 2012(r238925)
@@ -435,7 +435,7 @@ options KTRACE_REQUEST_POOL=101
 #
 # KTR is a kernel tracing facility imported from BSD/OS.  It is
 # enabled with the KTR option.  KTR_ENTRIES defines the number of
-# entries in the circular trace buffer; it must be a power of two.
+# entries in the circular trace buffer; it may be an arbitrary number.
 # KTR_COMPILE defines the mask of events to compile into the kernel as
 # defined by the KTR_* constants in .  KTR_MASK defines the
 # initial value of the ktr_mask variable which determines at runtime

Modified: head/sys/kern/kern_ktr.c
==
--- head/sys/kern/kern_ktr.cMon Jul 30 21:58:28 2012(r238924)
+++ head/sys/kern/kern_ktr.cMon Jul 30 22:46:42 2012(r238925)
@@ -283,7 +283,7 @@ ktr_tracepoint(u_int mask, const char *f
{
do {
saveindex = ktr_idx;
-   newindex = (saveindex + 1) & (KTR_ENTRIES - 1);
+   newindex = (saveindex + 1) % KTR_ENTRIES;
} while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) 
== 0);
entry = &ktr_buf[saveindex];
}
@@ -338,7 +338,7 @@ static  int db_mach_vtrace(void);
 DB_SHOW_COMMAND(ktr, db_ktr_all)
 {

-   tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1);
+   tstate.cur = (ktr_idx - 1) % KTR_ENTRIES;
tstate.first = -1;
db_ktr_verbose = 0;
db_ktr_verbose |= (strchr(modif, 'v') != NULL) ? 2 : 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: r238925 - in head/sys: conf kern

2012-07-30 Thread Davide Italiano
On Tue, Jul 31, 2012 at 12:46 AM, Davide Italiano  wrote:
> Author: davide
> Date: Mon Jul 30 22:46:42 2012
> New Revision: 238925
> URL: http://svn.freebsd.org/changeset/base/238925
>
> Log:
>   Until now KTR_ENTRIES, which defines the size of circular buffer used in
>   ktr(4), was constrained to be a power of two. Remove this constraint and
>   update sys/conf/NOTES accordingly.
>
>   Reviewed by:  jhb
>   Approved by:  gnn (mentor)
>   Sponsored by: Google Summer of Code 2012
>
> Modified:
>   head/sys/conf/NOTES
>   head/sys/kern/kern_ktr.c
>
> Modified: head/sys/conf/NOTES
> ==
> --- head/sys/conf/NOTES Mon Jul 30 21:58:28 2012(r238924)
> +++ head/sys/conf/NOTES Mon Jul 30 22:46:42 2012(r238925)
> @@ -435,7 +435,7 @@ options KTRACE_REQUEST_POOL=101
>  #
>  # KTR is a kernel tracing facility imported from BSD/OS.  It is
>  # enabled with the KTR option.  KTR_ENTRIES defines the number of
> -# entries in the circular trace buffer; it must be a power of two.
> +# entries in the circular trace buffer; it may be an arbitrary number.
>  # KTR_COMPILE defines the mask of events to compile into the kernel as
>  # defined by the KTR_* constants in .  KTR_MASK defines the
>  # initial value of the ktr_mask variable which determines at runtime
>
> Modified: head/sys/kern/kern_ktr.c
> ==
> --- head/sys/kern/kern_ktr.cMon Jul 30 21:58:28 2012(r238924)
> +++ head/sys/kern/kern_ktr.cMon Jul 30 22:46:42 2012(r238925)
> @@ -283,7 +283,7 @@ ktr_tracepoint(u_int mask, const char *f
> {
> do {
> saveindex = ktr_idx;
> -   newindex = (saveindex + 1) & (KTR_ENTRIES - 1);
> +   newindex = (saveindex + 1) % KTR_ENTRIES;
> } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) 
> == 0);
> entry = &ktr_buf[saveindex];
> }
> @@ -338,7 +338,7 @@ static  int db_mach_vtrace(void);
>  DB_SHOW_COMMAND(ktr, db_ktr_all)
>  {
>
> -   tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1);
> +   tstate.cur = (ktr_idx - 1) % KTR_ENTRIES;
> tstate.first = -1;
> db_ktr_verbose = 0;
> db_ktr_verbose |= (strchr(modif, 'v') != NULL) ? 2 : 0;

I forget this:
MFC after:  3 days.
___
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: r238765 - head/sys/dev/e1000

2012-07-30 Thread Jack Vogel
I have some changes that are needed anyway, I will change this to a
tuneable.

Jack


On Mon, Jul 30, 2012 at 11:45 AM, John Baldwin  wrote:

> On Wednesday, July 25, 2012 7:28:15 am Luigi Rizzo wrote:
> > Author: luigi
> > Date: Wed Jul 25 11:28:15 2012
> > New Revision: 238765
> > URL: http://svn.freebsd.org/changeset/base/238765
> >
> > Log:
> >   Use legacy interrupts as a default. This gives up to 10% speedup
> >   when used in qemu (and this driver is for non-PCIe cards,
> >   so probably its largest use is in virtualized environments).
> >
> >   Approved by:Jack Vogel
> >   MFC after:  3 days
>
> Why not make this a tunable or some such?  You could even have it only use
> the
> legacy handler under qemu easily enough.  There's no reason this has to be
> a
> compile-time option.  This is almost certainly slower on real hardware
> where
> this is important to work around dubious Intel Host-PCI bridges that
> result in
> aliased USB interrupts for every em(4) interrupt.
>
> --
> 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: r237742 - in head/sys/arm: at91 conf

2012-07-30 Thread Warner Losh
Thanks for the review.  I'm pretty sure that code is wrong.  I'll go over your 
comments with a printed datasheet.  They are likely correct.  This code suffers 
a bitt too much from being cut and pasted too many times.

Warner


On Jul 30, 2012, at 4:28 PM, Daan Vreeken wrote:

> Hi Warner,
> 
> 
> On Friday 29 June 2012 06:18:52 Warner Losh wrote:
>> Author: imp
>> Date: Fri Jun 29 04:18:52 2012
>> New Revision: 237742
>> URL: http://svn.freebsd.org/changeset/base/237742
>> 
>> Log:
>>  Initital support for AT91SAM9X25 SoC and the SAM9X25-EK evaluation
>>  board.  Much work remains.
> ...
>> Added: head/sys/arm/at91/at91sam9x25.c
>> ===
>> === --- /dev/null00:00:00 1970   (empty, because file is newly added)
>> +++ head/sys/arm/at91/at91sam9x25.c  Fri Jun 29 04:18:52 2012
>> (r237742)
>> @@ -0,0 +1,343 @@
> ...
>> +static uint32_t
>> +at91_pll_outa(int freq)
>> +{
>> +
>> +switch (freq / 1000) {
> 
> You seem to be dividing freq into multiples of 10MHz instead of 1MHz here. I 
> think dividing by 1e6 was the intention.
> 
>> +case 747 ... 801: return ((1 << 29) | (0 << 14));
>> +case 697 ... 746: return ((1 << 29) | (1 << 14));
>> +case 647 ... 696: return ((1 << 29) | (2 << 14));
>> +case 597 ... 646: return ((1 << 29) | (3 << 14));
>> +case 547 ... 596: return ((1 << 29) | (1 << 14));
>> +case 497 ... 546: return ((1 << 29) | (2 << 14));
>> +case 447 ... 496: return ((1 << 29) | (3 << 14));
> 
>> +case 397 ... 446: return ((1 << 29) | (4 << 14));
> 
> The (4 << 14) looks a bit strange here, as OUTA only occupies bit 14 and 15 
> of 
> CKGR_PLLAR. (See Atmel doc11054, page 201 and 1103.)
> 
> Maybe this entire routine could be written as something like:
>   uint8_t outa;
> 
>   freq /= 100;
>   // optional:
>   //freq += 3;
>   // see doc11054, page 1103
>   outa = 3 - ((freq / 50) & 3);
> 
>   return ((1 << 29) | (outa << 14));
> 
> Just glancing at the code, setting ICPLLA in PMC_PLLICPR for frequencies <= 
> 600MHz seems to be missing at this moment (or I'm just not seeing it).
> (see page 212 and 1103)
> 
> 
> Regards,
> -- 
> Daan Vreeken
> Vitsch Electronics
> http://Vitsch.nl/
> http://VitschVPN.nl/
> tel: +31-(0)40-7113051
> KvK nr: 17174380

___
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: r238926 - in head: . cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/lib/libzfs rescue/rescue sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/...

2012-07-30 Thread Martin Matuska
Author: mm
Date: Mon Jul 30 23:14:24 2012
New Revision: 238926
URL: http://svn.freebsd.org/changeset/base/238926

Log:
  Partial MFV (illumos-gate 13753:2aba784c276b)
  2762 zpool command should have better support for feature flags
  
  References:
  https://www.illumos.org/issues/2762
  
  MFC after:2 weeks

Modified:
  head/Makefile.inc1
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c
  head/cddl/lib/libzfs/Makefile
  head/rescue/rescue/Makefile
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Jul 30 22:46:42 2012(r238925)
+++ head/Makefile.inc1  Mon Jul 30 23:14:24 2012(r238926)
@@ -1260,7 +1260,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1
lib/ncurses/ncurses lib/ncurses/ncursesw \
lib/libopie lib/libpam ${_lib_libthr} \
lib/libradius lib/libsbuf lib/libtacplus \
-   ${_cddl_lib_libumem} \
+   ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
${_secure_lib_libcrypto} ${_secure_lib_libssh} \
${_secure_lib_libssl}
@@ -1284,6 +1284,7 @@ lib/libopie__L lib/libtacplus__L: lib/li
 
 .if ${MK_CDDL} != "no"
 _cddl_lib_libumem= cddl/lib/libumem
+_cddl_lib_libnvpair= cddl/lib/libnvpair
 _cddl_lib= cddl/lib
 .endif
 

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Jul 30 22:46:42 
2012(r238925)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Jul 30 23:14:24 
2012(r238926)
@@ -1636,21 +1636,22 @@ for unixtime
 .Op Fl v
 .Xc
 .Pp
-Displays all pools formatted using a different
+Displays pools which do not have all supported features enabled and pools
+formatted using a legacy
 .Tn ZFS
-pool on-disk version. Older versions can continue to be used, but some
-features may not be available. These pools can be upgraded using
-.Qq Nm Cm upgrade Fl a .
-Pools that are formatted with a more recent version are also displayed,
-although these pools will be inaccessible on the system.
+version number.
+These pools can continue to be used, but some features may not be available.
+Use
+.Nm Cm upgrade Fl a
+to enable all features on all pools.
 .Bl -tag -width indent
 .It Fl v
-Displays
+Displays legacy
 .Tn ZFS
-pool versions supported by the current software. The current
-.Tn ZFS
-pool version and all previous supported versions are displayed, along
-with an explanation of the features provided with each version.
+versions supported by the current software.
+See
+.Xr zpool-features.5
+for a description of feature flags features supported by the current software.
 .El
 .It Xo
 .Nm
@@ -1659,18 +1660,22 @@ with an explanation of the features prov
 .Fl a | Ar pool ...
 .Xc
 .Pp
-Upgrades the given pool to the latest on-disk pool version. Once this is done,
-the pool will no longer be accessible on systems running older versions of the
-software.
+Enables all supported features on the given pool.
+Once this is done, the pool will no longer be accessible on systems that do
+not support feature flags.
+See
+.Xr zpool-features.5
+for details on compatability with system sthat support feature flags, but do
+not support all features enabled on the pool.
 .Bl -tag -width indent
 .It Fl a
-Upgrades all pools.
+Enables all supported features on all pools.
 .It Fl V Ar version
-Upgrade to the specified version. If the
+Upgrade to the specified legacy version. If the
 .Fl V
-flag is not specified, the pool is upgraded to the most recent version. This
-option can only be used to increase the version number, and only up to the most
-recent version supported by this software.
+flag is specified, no features will be enabled on the pool.
+This option can only be used to increase version number up to the last
+supported legacy version number.
 .El
 .El
 .Sh EXAMPLES

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cMon Jul 30 
22:46:42 2012(r238925)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cMon Jul 30 
2

svn commit: r238928 - in head/sys: fs/fifofs kern sys

2012-07-30 Thread David Xu
Author: davidxu
Date: Tue Jul 31 02:00:37 2012
New Revision: 238928
URL: http://svn.freebsd.org/changeset/base/238928

Log:
  When a thread is blocked in direct write state, it only sets PIPE_DIRECTW
  flag but not PIPE_WANTW, but FIFO pipe code does not understand this internal
  state, when a FIFO peer reader closes the pipe, it wants to notify the writer,
  it checks PIPE_WANTW, if not set, it skips calling wakeup(), so blocked writer
  never noticed the case, but in general, the writer should return from the
  syscall with EPIPE error code and may get SIGPIPE signal. Setting the
  PIPE_WANTW fixed problem, or you can turn off direct write, it should fix the
  problem too. This bug is found by PR/170203.
  
  Another bug in FIFO pipe code is when peer closes the pipe, another end which
  is being blocked in select() or poll() is not notified, it missed to call
  pipeselwakeup().
  
  Third problem is found in poll regression test, the existing code can not
  pass 6b,6c,6d tests, but FreeBSD-4 works. This commit does not fix the
  problem, I still need to study more to find the cause.
  
  PR: 170203
  Tested by: Garrett Copper < yanegomi at gmail dot com >

Modified:
  head/sys/fs/fifofs/fifo_vnops.c
  head/sys/kern/sys_pipe.c
  head/sys/sys/pipe.h

Modified: head/sys/fs/fifofs/fifo_vnops.c
==
--- head/sys/fs/fifofs/fifo_vnops.c Tue Jul 31 00:46:19 2012
(r238927)
+++ head/sys/fs/fifofs/fifo_vnops.c Tue Jul 31 02:00:37 2012
(r238928)
@@ -283,8 +283,11 @@ fifo_close(ap)
if (fip->fi_readers == 0) {
PIPE_LOCK(cpipe);
cpipe->pipe_state |= PIPE_EOF;
-   if (cpipe->pipe_state & PIPE_WANTW)
+   if ((cpipe->pipe_state & PIPE_WANTW)) {
+   cpipe->pipe_state &= ~PIPE_WANTW;
wakeup(cpipe);
+   }
+   pipeselwakeup(cpipe);
PIPE_UNLOCK(cpipe);
}
}
@@ -293,10 +296,13 @@ fifo_close(ap)
if (fip->fi_writers == 0) {
PIPE_LOCK(cpipe);
cpipe->pipe_state |= PIPE_EOF;
-   if (cpipe->pipe_state & PIPE_WANTR)
+   if ((cpipe->pipe_state & PIPE_WANTR)) {
+   cpipe->pipe_state &= ~PIPE_WANTR;
wakeup(cpipe);
+   }
fip->fi_wgen++;
FIFO_UPDWGEN(fip, cpipe);
+   pipeselwakeup(cpipe);
PIPE_UNLOCK(cpipe);
}
}

Modified: head/sys/kern/sys_pipe.c
==
--- head/sys/kern/sys_pipe.cTue Jul 31 00:46:19 2012(r238927)
+++ head/sys/kern/sys_pipe.cTue Jul 31 02:00:37 2012(r238928)
@@ -227,7 +227,6 @@ static int pipe_create(struct pipe *pipe
 static int pipe_paircreate(struct thread *td, struct pipepair **p_pp);
 static __inline int pipelock(struct pipe *cpipe, int catch);
 static __inline void pipeunlock(struct pipe *cpipe);
-static __inline void pipeselwakeup(struct pipe *cpipe);
 #ifndef PIPE_NODIRECT
 static int pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio);
 static void pipe_destroy_write_buffer(struct pipe *wpipe);
@@ -607,7 +606,7 @@ pipeunlock(cpipe)
}
 }
 
-static __inline void
+void
 pipeselwakeup(cpipe)
struct pipe *cpipe;
 {
@@ -738,7 +737,7 @@ pipe_read(fp, uio, active_cred, flags, t
rpipe->pipe_map.pos += size;
rpipe->pipe_map.cnt -= size;
if (rpipe->pipe_map.cnt == 0) {
-   rpipe->pipe_state &= ~PIPE_DIRECTW;
+   rpipe->pipe_state &= ~(PIPE_DIRECTW|PIPE_WANTW);
wakeup(rpipe);
}
 #endif
@@ -1001,6 +1000,7 @@ retry:
wakeup(wpipe);
}
pipeselwakeup(wpipe);
+   wpipe->pipe_state |= PIPE_WANTW;
pipeunlock(wpipe);
error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH,
"pipdwt", 0);

Modified: head/sys/sys/pipe.h
==
--- head/sys/sys/pipe.h Tue Jul 31 00:46:19 2012(r238927)
+++ head/sys/sys/pipe.h Tue Jul 31 02:00:37 2012(r238928)
@@ -143,5 +143,5 @@ struct pipepair {
 
 void   pipe_dtor(struct pipe *dpipe);
 intpipe_named_ctor(struct pipe **ppipe, struct thread *td);
-
+void   pipeselwakeup(struct pipe *cpipe);
 #endif /* !_SYS_PIPE_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To un

svn commit: r238929 - head/sys/dev/ath

2012-07-30 Thread Adrian Chadd
Author: adrian
Date: Tue Jul 31 02:18:10 2012
New Revision: 238929
URL: http://svn.freebsd.org/changeset/base/238929

Log:
  Placeholder ioctl for an upcoming rate control statistics API change.

Modified:
  head/sys/dev/ath/if_athioctl.h

Modified: head/sys/dev/ath/if_athioctl.h
==
--- head/sys/dev/ath/if_athioctl.h  Tue Jul 31 02:00:37 2012
(r238928)
+++ head/sys/dev/ath/if_athioctl.h  Tue Jul 31 02:18:10 2012
(r238929)
@@ -231,6 +231,7 @@ struct ath_rateioctl {
caddr_t buf;
 };
 #defineSIOCGATHNODERATESTATS   _IOWR('i', 149, struct ath_rateioctl)
+#defineSIOCGATHRATESTATS   _IOWR('i', 150, struct ath_rateioctl)
 
 /*
  * Radio capture format.
___
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: r238930 - head/sys/dev/ath

2012-07-30 Thread Adrian Chadd
Author: adrian
Date: Tue Jul 31 02:28:32 2012
New Revision: 238930
URL: http://svn.freebsd.org/changeset/base/238930

Log:
  Break out the hardware handoff and TX DMA restart code into methods.
  
  These (and a few others) will differ based on the underlying DMA
  implementation.
  
  For the EDMA NICs, simply stub them out in a fashion which will let
  me focus on implementing the necessary descriptor API changes.

Modified:
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx.h
  head/sys/dev/ath/if_ath_tx_edma.c

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cTue Jul 31 02:18:10 2012
(r238929)
+++ head/sys/dev/ath/if_ath_tx.cTue Jul 31 02:28:32 2012
(r238930)
@@ -639,8 +639,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, 
  *
  * This must be called whether the queue is empty or not.
  */
-void
-ath_txq_restart_dma(struct ath_softc *sc, struct ath_txq *txq)
+static void
+ath_legacy_tx_dma_restart(struct ath_softc *sc, struct ath_txq *txq)
 {
struct ath_hal *ah = sc->sc_ah;
struct ath_buf *bf, *bf_last;
@@ -668,7 +668,8 @@ ath_txq_restart_dma(struct ath_softc *sc
  * The relevant hardware txq should be locked.
  */
 static void
-ath_tx_handoff(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf)
+ath_legacy_xmit_handoff(struct ath_softc *sc, struct ath_txq *txq,
+struct ath_buf *bf)
 {
ATH_TXQ_LOCK_ASSERT(txq);
 
@@ -4493,4 +4494,7 @@ ath_xmit_setup_legacy(struct ath_softc *
 
sc->sc_tx.xmit_setup = ath_legacy_dma_txsetup;
sc->sc_tx.xmit_teardown = ath_legacy_dma_txteardown;
+
+   sc->sc_tx.xmit_dma_restart = ath_legacy_tx_dma_restart;
+   sc->sc_tx.xmit_handoff = ath_legacy_xmit_handoff;
 }

Modified: head/sys/dev/ath/if_ath_tx.h
==
--- head/sys/dev/ath/if_ath_tx.hTue Jul 31 02:18:10 2012
(r238929)
+++ head/sys/dev/ath/if_ath_tx.hTue Jul 31 02:28:32 2012
(r238930)
@@ -79,7 +79,6 @@
 #defineBAW_WITHIN(_start, _bawsz, _seqno)  \
_seqno) - (_start)) & 4095) < (_bawsz))
 
-extern void ath_txq_restart_dma(struct ath_softc *sc, struct ath_txq *txq);
 extern void ath_freetx(struct mbuf *m);
 extern void ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an);
 extern void ath_tx_txq_drain(struct ath_softc *sc, struct ath_txq *txq);
@@ -131,6 +130,10 @@ extern void ath_addba_response_timeout(s
(_sc)->sc_tx.xmit_setup(_sc)
 #defineath_txdma_teardown(_sc) \
(_sc)->sc_tx.xmit_teardown(_sc)
+#defineath_txq_restart_dma(_sc, _txq)  \
+   (_sc)->sc_tx.xmit_dma_restart((_sc), (_txq))
+#defineath_tx_handoff(_sc, _txq, _bf)  \
+   (_sc)->sc_tx.xmit_handoff((_sc), (_txq), (_bf))
 extern void ath_xmit_setup_legacy(struct ath_softc *sc);
 
 #endif

Modified: head/sys/dev/ath/if_ath_tx_edma.c
==
--- head/sys/dev/ath/if_ath_tx_edma.c   Tue Jul 31 02:18:10 2012
(r238929)
+++ head/sys/dev/ath/if_ath_tx_edma.c   Tue Jul 31 02:28:32 2012
(r238930)
@@ -130,6 +130,62 @@ __FBSDID("$FreeBSD$");
 
 MALLOC_DECLARE(M_ATHDEV);
 
+/*
+ * Re-initialise the DMA FIFO with the current contents of
+ * said FIFO.
+ *
+ * This should only be called as part of the chip reset path, as it
+ * assumes the FIFO is currently empty.
+ *
+ * TODO: verify that a cold/warm reset does clear the TX FIFO, so
+ * writing in a partially-filled FIFO will not cause double-entries
+ * to appear.
+ */
+static void
+ath_edma_dma_restart(struct ath_softc *sc, struct ath_txq *txq)
+{
+
+   device_printf(sc->sc_dev, "%s: called: txq=%p, qnum=%d\n",
+   __func__,
+   txq,
+   txq->axq_qnum);
+}
+
+/*
+ * Handoff this frame to the hardware.
+ *
+ * For the multicast queue, this will treat it as a software queue
+ * and append it to the list, after updating the MORE_DATA flag
+ * in the previous frame.  The cabq processing code will ensure
+ * that the queue contents gets transferred over.
+ *
+ * For the hardware queues, this will queue a frame to the queue
+ * like before, then populate the FIFO from that.  Since the
+ * EDMA hardware has 8 FIFO slots per TXQ, this ensures that
+ * frames such as management frames don't get prematurely dropped.
+ *
+ * This does imply that a similar flush-hwq-to-fifoq method will
+ * need to be called from the processq function, before the
+ * per-node software scheduler is called.
+ */
+static void
+ath_edma_xmit_handoff(struct ath_softc *sc, struct ath_txq *txq,
+struct ath_buf *bf)
+{
+
+   device_printf(sc->sc_dev, "%s: called; bf=%p, txq=%p, qnum=%d\n",
+   __func__,
+   bf,
+   txq,
+   txq->axq_qnum);
+
+   /*
+* XXX For now this is a placeh

svn commit: r238931 - head/sys/dev/ath

2012-07-30 Thread Adrian Chadd
Author: adrian
Date: Tue Jul 31 03:09:48 2012
New Revision: 238931
URL: http://svn.freebsd.org/changeset/base/238931

Log:
  Migrate some more TX side setup routines to be methods.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx.h
  head/sys/dev/ath/if_ath_tx_edma.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Jul 31 02:28:32 2012(r238930)
+++ head/sys/dev/ath/if_ath.c   Tue Jul 31 03:09:48 2012(r238931)
@@ -254,6 +254,28 @@ SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CT
 
 MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers");
 
+void
+ath_legacy_attach_comp_func(struct ath_softc *sc)
+{
+
+   /*
+* Special case certain configurations.  Note the
+* CAB queue is handled by these specially so don't
+* include them when checking the txq setup mask.
+*/
+   switch (sc->sc_txqsetup &~ (1axq_qnum)) {
+   case 0x01:
+   TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc_q0, sc);
+   break;
+   case 0x0f:
+   TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc_q0123, sc);
+   break;
+   default:
+   TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc, sc);
+   break;
+   }
+}
+
 #defineHAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20)
 #defineHAL_MODE_HT40 \
(HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \
@@ -460,21 +482,12 @@ ath_attach(u_int16_t devid, struct ath_s
}
 
/*
-* Special case certain configurations.  Note the
-* CAB queue is handled by these specially so don't
-* include them when checking the txq setup mask.
+* Attach the TX completion function.
+*
+* The non-EDMA chips may have some special case optimisations;
+* this method gives everyone a chance to attach cleanly.
 */
-   switch (sc->sc_txqsetup &~ (1axq_qnum)) {
-   case 0x01:
-   TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc_q0, sc);
-   break;
-   case 0x0f:
-   TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc_q0123, sc);
-   break;
-   default:
-   TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc, sc);
-   break;
-   }
+   sc->sc_tx.xmit_attach_comp_func(sc);
 
/*
 * Setup rate control.  Some rate control modules
@@ -3563,8 +3576,8 @@ ath_tx_update_busy(struct ath_softc *sc)
  * Kick the packet scheduler if needed. This can occur from this
  * particular task.
  */
-static int
-ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched)
+int
+ath_legacy_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched)
 {
struct ath_hal *ah = sc->sc_ah;
struct ath_buf *bf;
@@ -3964,7 +3977,7 @@ ath_tx_freebuf(struct ath_softc *sc, str
 }
 
 void
-ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
+ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
 {
 #ifdef ATH_DEBUG
struct ath_hal *ah = sc->sc_ah;

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Tue Jul 31 02:28:32 2012
(r238930)
+++ head/sys/dev/ath/if_ath_misc.h  Tue Jul 31 03:09:48 2012
(r238931)
@@ -66,7 +66,6 @@ extern void ath_returnbuf_head(struct at
 extern void ath_returnbuf_tail(struct ath_softc *sc, struct ath_buf *bf);
 
 extern int ath_reset(struct ifnet *, ATH_RESET_TYPE);
-extern void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq);
 extern void ath_tx_default_comp(struct ath_softc *sc, struct ath_buf *bf,
int fail);
 extern void ath_tx_update_ratectrl(struct ath_softc *sc,
@@ -96,6 +95,11 @@ extern   int ath_descdma_setup_rx_edma(str
 extern void ath_descdma_cleanup(struct ath_softc *sc,
struct ath_descdma *dd, ath_bufhead *head);
 
+extern void ath_legacy_attach_comp_func(struct ath_softc *sc);
+extern void ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq);
+extern int ath_legacy_tx_processq(struct ath_softc *sc, struct ath_txq *txq,
+   int dosched);
+
 /*
  * This is only here so that the RX proc function can call it.
  * It's very likely that the "start TX after RX" call should be

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cTue Jul 31 02:28:32 2012
(r238930)
+++ head/sys/dev/ath/if_ath_tx.cTue Jul 31 03:09:48 2012
(r238931)
@@ -4494,7 +4494,10 @@ ath_xmit_setup_legacy(struct ath_softc *
 
sc->sc_tx.xmit_setup = ath_legacy_dma_txsetup;
sc->sc_tx.xmit_teardown = ath_legacy_dma_txteardown;
+   sc->sc_tx.xmit_attach_

Re: svn commit: r238912 - head/sys/dev/netmap

2012-07-30 Thread Doug Barton
It seems this broke the build?


On 07/30/2012 11:21, Luigi Rizzo wrote:
> Author: luigi
> Date: Mon Jul 30 18:21:48 2012
> New Revision: 238912
> URL: http://svn.freebsd.org/changeset/base/238912
> 
> Log:
>   - move the inclusion of netmap headers to the common part of the code;
>   - more portable annotations for unused arguments;
> 
> Modified:
>   head/sys/dev/netmap/netmap.c
>   head/sys/dev/netmap/netmap_mem2.c
> 
> Modified: head/sys/dev/netmap/netmap.c
> ==
> --- head/sys/dev/netmap/netmap.c  Mon Jul 30 15:37:47 2012
> (r238911)
> +++ head/sys/dev/netmap/netmap.c  Mon Jul 30 18:21:48 2012
> (r238912)
> @@ -90,13 +90,14 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include  /* BIOCIMMEDIATE */
>  #include 
> -#include 
> -#include 
>  #include  /* bus_dmamap_* */
>  
>  MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map");
>  #endif /* __FreeBSD__ */
>  
> +#include 
> +#include 
> +
>  /*
>   * lock and unlock for the netmap memory allocator
>   */
> @@ -764,8 +765,8 @@ netmap_set_ringid(struct netmap_priv_d *
>   * Return 0 on success, errno otherwise.
>   */
>  static int
> -netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data,
> - __unused int fflag, struct thread *td)
> +netmap_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
> + int fflag, struct thread *td)
>  {
>   struct netmap_priv_d *priv = NULL;
>   struct ifnet *ifp;
> @@ -775,6 +776,8 @@ netmap_ioctl(__unused struct cdev *dev, 
>   u_int i, lim;
>   struct netmap_if *nifp;
>  
> + (void)dev;  /* UNUSED */
> + (void)fflag;/* UNUSED */
>  #ifdef linux
>  #define devfs_get_cdevpriv(pp)   \
>   ({ *(struct netmap_priv_d **)pp = ((struct file *)td)->private_data;
> \
> @@ -1551,7 +1554,7 @@ linux_netmap_poll(struct file * file, st
>  }
>  
>  static int
> -netmap_mmap(__unused struct file *f, struct vm_area_struct *vma)
> +netmap_mmap(struct file *f, struct vm_area_struct *vma)
>  {
>   int lut_skip, i, j;
>   int user_skip = 0;
> @@ -1565,6 +1568,7 @@ netmap_mmap(__unused struct file *f, str
>* vma->vm_end: end of the mapping user address space
>*/
>  
> + (void)f;/* UNUSED */
>   // XXX security checks
>  
>   for (i = 0; i < 3; i++) {  /* loop through obj_pools */
> @@ -1599,7 +1603,7 @@ netmap_start_linux(struct sk_buff *skb, 
>  }
>  
>  
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)  // XXX was 38
>  #define LIN_IOCTL_NAME   .ioctl
>  int
>  linux_netmap_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long 
> data /* arg */)
> @@ -1623,8 +1627,9 @@ linux_netmap_ioctl(struct file *file, u_
>  
>  
>  static int
> -netmap_release(__unused struct inode *inode, struct file *file)
> +netmap_release(struct inode *inode, struct file *file)
>  {
> + (void)inode;/* UNUSED */
>   if (file->private_data)
>   netmap_dtor(file->private_data);
>   return (0);
> 
> Modified: head/sys/dev/netmap/netmap_mem2.c
> ==
> --- head/sys/dev/netmap/netmap_mem2.c Mon Jul 30 15:37:47 2012
> (r238911)
> +++ head/sys/dev/netmap/netmap_mem2.c Mon Jul 30 18:21:48 2012
> (r238912)
> @@ -25,7 +25,7 @@
>  
>  /*
>   * $FreeBSD$
> - * $Id: netmap_mem2.c 10830 2012-03-22 18:06:01Z luigi $
> + * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $
>   *
>   * New memory allocator for netmap
>   */
> @@ -300,12 +300,13 @@ netmap_obj_free_va(struct netmap_obj_poo
>  
>  
>  static void
> -netmap_new_bufs(struct netmap_if *nifp __unused,
> +netmap_new_bufs(struct netmap_if *nifp,
>  struct netmap_slot *slot, u_int n)
>  {
>   struct netmap_obj_pool *p = nm_mem->nm_buf_pool;
>   uint32_t i = 0; /* slot counter */
>  
> + (void)nifp; /* UNUSED */
>   for (i = 0; i < n; i++) {
>   void *vaddr = netmap_buf_malloc();
>   if (vaddr == NULL) {
> 


-- 

I am only one, but I am one.  I cannot do everything, but I can do
something.  And I will not let what I cannot do interfere with what
I can do.
-- Edward Everett Hale, (1822 - 1909)
___
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: r238912 - head/sys/dev/netmap

2012-07-30 Thread Garrett Cooper
On Mon, Jul 30, 2012 at 8:47 PM, Doug Barton  wrote:
> It seems this broke the build?
>
>
> On 07/30/2012 11:21, Luigi Rizzo wrote:
>> Author: luigi
>> Date: Mon Jul 30 18:21:48 2012
>> New Revision: 238912
>> URL: http://svn.freebsd.org/changeset/base/238912
>>
>> Log:
>>   - move the inclusion of netmap headers to the common part of the code;

This part did in particular. I CCed Luigi about the issue this morning.
Thanks!
-Garrett
___
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: r238912 - head/sys/dev/netmap

2012-07-30 Thread Luigi Rizzo
On Mon, Jul 30, 2012 at 08:53:29PM -0700, Garrett Cooper wrote:
> On Mon, Jul 30, 2012 at 8:47 PM, Doug Barton  wrote:
> > It seems this broke the build?
> >
> >
> > On 07/30/2012 11:21, Luigi Rizzo wrote:
> >> Author: luigi
> >> Date: Mon Jul 30 18:21:48 2012
> >> New Revision: 238912
> >> URL: http://svn.freebsd.org/changeset/base/238912
> >>
> >> Log:
> >>   - move the inclusion of netmap headers to the common part of the code;
> 
> This part did in particular. I CCed Luigi about the issue this morning.

yes, thanks, i am working on this.
i think a quick fix is to move the MALLOC_DECLARE after the netmap_kern.h header
inclusion. I am working on a fix.
(6am here, give me a couple of hours to wake up :)

cheers
luigi
___
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: r238932 - head/sys/arm/conf

2012-07-30 Thread Warner Losh
Author: imp
Date: Tue Jul 31 04:09:27 2012
New Revision: 238932
URL: http://svn.freebsd.org/changeset/base/238932

Log:
  macb doesn't work, switch to ate.

Modified:
  head/sys/arm/conf/SAM9X25EK

Modified: head/sys/arm/conf/SAM9X25EK
==
--- head/sys/arm/conf/SAM9X25EK Tue Jul 31 03:09:48 2012(r238931)
+++ head/sys/arm/conf/SAM9X25EK Tue Jul 31 04:09:27 2012(r238932)
@@ -86,8 +86,7 @@ devicemd
 device uart# Serial Ports
 
 # Ethernet
-#deviceate # Ethernet Driver   
-device macb# Alternate Ethernet driver
+device ate # Ethernet Driver   
 device mii
 option AT91_ATE_USE_RMII
 
___
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: r238933 - head/sys/dev/puc

2012-07-30 Thread Max Khon
Author: fjoe
Date: Tue Jul 31 05:23:23 2012
New Revision: 238933
URL: http://svn.freebsd.org/changeset/base/238933

Log:
  - Change back "d_ofs" to int8_t to not pessimize padding and size of "struct 
puc_cfg".
  - Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f
  
  Prodded by:   marcel@, gavin@
  MFC after:3 days

Modified:
  head/sys/dev/puc/puc_cfg.h
  head/sys/dev/puc/pucdata.c

Modified: head/sys/dev/puc/puc_cfg.h
==
--- head/sys/dev/puc/puc_cfg.h  Tue Jul 31 04:09:27 2012(r238932)
+++ head/sys/dev/puc/puc_cfg.h  Tue Jul 31 05:23:23 2012(r238933)
@@ -79,7 +79,7 @@ struct puc_cfg {
int8_t  ports;
int8_t  rid;/* Rid of first port */
int8_t  d_rid;  /* Delta rid of next ports */
-   int16_t d_ofs;  /* Delta offset of next ports */
+   int8_t  d_ofs;  /* Delta offset of next ports */
puc_config_f*config_function;
 };
 

Modified: head/sys/dev/puc/pucdata.c
==
--- head/sys/dev/puc/pucdata.c  Tue Jul 31 04:09:27 2012(r238932)
+++ head/sys/dev/puc/pucdata.c  Tue Jul 31 05:23:23 2012(r238933)
@@ -510,13 +510,15 @@ const struct puc_cfg puc_pci_devices[] =
{   0x1393, 0x1024, 0x, 0,
"Moxa Technologies, Smartio CP-102E/PCIe",
DEFAULT_RCLK * 8,
-   PUC_PORT_2S, 0x14, 0, 0x200
+   PUC_PORT_2S, 0x14, 0, -1,
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1025, 0x, 0,
"Moxa Technologies, Smartio CP-102EL/PCIe",
DEFAULT_RCLK * 8,
-   PUC_PORT_2S, 0x14, 0, 0x200,
+   PUC_PORT_2S, 0x14, 0, -1,
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1040, 0x, 0,
@@ -572,7 +574,8 @@ const struct puc_cfg puc_pci_devices[] =
{   0x1393, 0x1182, 0x, 0,
"Moxa Technologies, Smartio CP-118EL-A/PCIe",
DEFAULT_RCLK * 8,
-   PUC_PORT_8S, 0x14, 0, 0x200,
+   PUC_PORT_8S, 0x14, 0, -1,
+   .config_function = puc_config_moxa
},
 
{   0x1393, 0x1680, 0x, 0,
@@ -596,7 +599,8 @@ const struct puc_cfg puc_pci_devices[] =
{   0x1393, 0x1683, 0x, 0,
"Moxa Technologies, Smartio CP-168EL-A/PCIe",
DEFAULT_RCLK * 8,
-   PUC_PORT_8S, 0x14, 0, 0x200,
+   PUC_PORT_8S, 0x14, 0, -1,
+   .config_function = puc_config_moxa
},
 
{   0x13a8, 0x0152, 0x, 0,
@@ -1159,7 +1163,12 @@ puc_config_moxa(struct puc_softc *sc, en
 intptr_t *res)
 {
if (cmd == PUC_CFG_GET_OFS) {
-   *res = ((port == 3) ? 7 : port) * 0x200;
+   const struct puc_cfg *cfg = sc->sc_cfg;
+
+   if (port == 3 && (cfg->device == 0x1045 || cfg->device == 
0x1144))
+   port = 7;
+   *res = port * 0x200;
+
return 0;
}
return (ENXIO);
___
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: r238934 - head/sys/netinet6

2012-07-30 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Jul 31 05:34:54 2012
New Revision: 238934
URL: http://svn.freebsd.org/changeset/base/238934

Log:
  Improve the should-never-hit printf to ease debugging in case we'd ever hit
  it again when doing the delayed IPv6 checksum calculations.
  
  MFC after:3 days

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Tue Jul 31 05:23:23 2012
(r238933)
+++ head/sys/netinet6/ip6_output.c  Tue Jul 31 05:34:54 2012
(r238934)
@@ -195,8 +195,9 @@ in6_delayed_cksum(struct mbuf *m, uint32
offset += m->m_pkthdr.csum_data;/* checksum offset */
 
if (offset + sizeof(u_short) > m->m_len) {
-   printf("%s: delayed m_pullup, m->len: %d off: %d\n",
-   __func__, m->m_len, offset);
+   printf("%s: delayed m_pullup, m->len: %d plen %u off %u "
+   "csum_flags=0x%04x\n", __func__, m->m_len, plen, offset,
+   m->m_pkthdr.csum_flags);
/*
 * XXX this should not happen, but if it does, the correct
 * behavior may be to insert the checksum in the appropriate
___
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: r238935 - head/sys/netinet6

2012-07-30 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Jul 31 05:44:03 2012
New Revision: 238935
URL: http://svn.freebsd.org/changeset/base/238935

Log:
  Properly apply #ifdef INET and leave a comment that we are (will) apply
  delayed IPv6 checksum processing in ip6_output.c when doing IPsec.
  
  PR:   kern/170116
  MFC after:3 days

Modified:
  head/sys/netinet6/ip6_ipsec.c

Modified: head/sys/netinet6/ip6_ipsec.c
==
--- head/sys/netinet6/ip6_ipsec.c   Tue Jul 31 05:34:54 2012
(r238934)
+++ head/sys/netinet6/ip6_ipsec.c   Tue Jul 31 05:44:03 2012
(r238935)
@@ -291,16 +291,16 @@ ip6_ipsec_output(struct mbuf **m, struct
/*
 * Do delayed checksums now because we send before
 * this is done in the normal processing path.
-* XXX-BZ CSUM_DELAY_DATA_IPV6?
+* For IPv6 we do delayed checksums in ip6_output.c.
 */
+#ifdef INET
if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
ipseclog((LOG_DEBUG,
"%s: we do not support IPv4 over IPv6", __func__));
-#ifdef INET
in_delayed_cksum(*m);
-#endif
(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
+#endif
 
/*
 * Preserve KAME behaviour: ENOENT can be returned
___
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: r238936 - in head/sys: fs/fifofs kern sys

2012-07-30 Thread David Xu
Author: davidxu
Date: Tue Jul 31 05:48:35 2012
New Revision: 238936
URL: http://svn.freebsd.org/changeset/base/238936

Log:
  I am comparing current pipe code with the one in 8.3-STABLE r236165,
  I found 8.3 is a history BSD version using socket to implement FIFO
  pipe, it uses per-file seqcount to compare with writer generation
  stored in per-pipe object. The concept is after all writers are gone,
  the pipe enters next generation, all old readers have not closed the
  pipe should get the indication that the pipe is disconnected, result
  is they should get EPIPE, SIGPIPE or get POLLHUP in poll().
  But newcomer should not know that previous writters were gone, it
  should treat it as a fresh session.
  I am trying to bring back FIFO pipe to history behavior. It is still
  unclear that if single EOF flag can represent SBS_CANTSENDMORE and
  SBS_CANTRCVMORE which socket-based version is using, but I have run
  the poll regression test in tool directory, output is same as the one
  on 8.3-STABLE now.
  I think the output "not ok 18 FIFO state 6b: poll result 0 expected 1.
  expected POLLHUP; got 0" might be bogus, because newcomer should not
  know that old writers were gone. I got the same behavior on Linux.
  Our implementation always return POLLIN for disconnected pipe even it
  should return POLLHUP, but I think it is not wise to remove POLLIN for
  compatible reason, this is our history behavior.
  
  Regression test: /usr/src/tools/regression/poll

Modified:
  head/sys/fs/fifofs/fifo_vnops.c
  head/sys/kern/sys_pipe.c
  head/sys/sys/pipe.h

Modified: head/sys/fs/fifofs/fifo_vnops.c
==
--- head/sys/fs/fifofs/fifo_vnops.c Tue Jul 31 05:44:03 2012
(r238935)
+++ head/sys/fs/fifofs/fifo_vnops.c Tue Jul 31 05:48:35 2012
(r238936)
@@ -59,23 +59,13 @@
  * Notes about locking:
  *   - fi_pipe is invariant since init time.
  *   - fi_readers and fi_writers are protected by the vnode lock.
- *   - fi_wgen and fi_seqcount are protected by the pipe mutex.
  */
 struct fifoinfo {
struct pipe *fi_pipe;
longfi_readers;
longfi_writers;
-   int fi_wgen;
-   int fi_seqcount;
 };
 
-#define FIFO_UPDWGEN(fip, pip) do { \
-   if ((fip)->fi_wgen == (fip)->fi_seqcount)   \
-   (pip)->pipe_state |= PIPE_SAMEWGEN; \
-   else\
-   (pip)->pipe_state &= ~PIPE_SAMEWGEN;\
-} while (0)
-
 static vop_print_t fifo_print;
 static vop_open_t  fifo_open;
 static vop_close_t fifo_close;
@@ -161,7 +151,7 @@ fifo_open(ap)
return (error);
fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK);
fip->fi_pipe = fpipe;
-   fip->fi_wgen = fip->fi_readers = fip->fi_writers = 0;
+   fpipe->pipe_wgen = fip->fi_readers = fip->fi_writers = 0;
KASSERT(vp->v_fifoinfo == NULL, ("fifo_open: v_fifoinfo race"));
vp->v_fifoinfo = fip;
}
@@ -181,8 +171,7 @@ fifo_open(ap)
if (fip->fi_writers > 0)
wakeup(&fip->fi_writers);
}
-   fip->fi_seqcount = fip->fi_wgen - fip->fi_writers;
-   FIFO_UPDWGEN(fip, fpipe);
+   fp->f_seqcount = fpipe->pipe_wgen - fip->fi_writers;
}
if (ap->a_mode & FWRITE) {
if ((ap->a_mode & O_NONBLOCK) && fip->fi_readers == 0) {
@@ -235,8 +224,7 @@ fifo_open(ap)
fpipe->pipe_state |= PIPE_EOF;
if (fpipe->pipe_state & PIPE_WANTR)
wakeup(fpipe);
-   fip->fi_wgen++;
-   FIFO_UPDWGEN(fip, fpipe);
+   fpipe->pipe_wgen++;
PIPE_UNLOCK(fpipe);
fifo_cleanup(vp);
}
@@ -300,8 +288,7 @@ fifo_close(ap)
cpipe->pipe_state &= ~PIPE_WANTR;
wakeup(cpipe);
}
-   fip->fi_wgen++;
-   FIFO_UPDWGEN(fip, cpipe);
+   cpipe->pipe_wgen++;
pipeselwakeup(cpipe);
PIPE_UNLOCK(cpipe);
}

Modified: head/sys/kern/sys_pipe.c
==
--- head/sys/kern/sys_pipe.cTue Jul 31 05:44:03 2012(r238935)
+++ head/sys/kern/sys_pipe.cTue Jul 31 05:48:35 2012(r238936)
@@ -1442,7 +1442,7 @@ pipe_poll(fp, events, active_cred, td)
levents = events &
(POLLIN | POLLINIGNEOF | PO

svn commit: r238937 - head/sys/dev/netmap

2012-07-30 Thread Luigi Rizzo
Author: luigi
Date: Tue Jul 31 05:51:48 2012
New Revision: 238937
URL: http://svn.freebsd.org/changeset/base/238937

Log:
  remove a redundant MALLOC_DECLARE

Modified:
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Tue Jul 31 05:48:35 2012
(r238936)
+++ head/sys/dev/netmap/netmap_kern.h   Tue Jul 31 05:51:48 2012
(r238937)
@@ -80,10 +80,6 @@
 #error unsupported platform
 #endif
 
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_NETMAP);
-#endif
-
 #define ND(format, ...)
 #define D(format, ...) \
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"