svn commit: r261117 - head/sys/netpfil/ipfw

2014-01-24 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Jan 24 09:13:30 2014
New Revision: 261117
URL: http://svnweb.freebsd.org/changeset/base/261117

Log:
  Reorder struct ip_fw_chain:
  * move rarely-used fields down
  * move uh_lock to different cacheline
  * remove some usused fields
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/ipfw/ip_fw_private.h
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==
--- head/sys/netpfil/ipfw/ip_fw2.c  Fri Jan 24 08:27:19 2014
(r261116)
+++ head/sys/netpfil/ipfw/ip_fw2.c  Fri Jan 24 09:13:30 2014
(r261117)
@@ -2666,7 +2666,7 @@ vnet_ipfw_init(const void *unused)
rule->set = RESVD_SET;
rule->cmd[0].len = 1;
rule->cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY;
-   chain->rules = chain->default_rule = chain->map[0] = rule;
+   chain->default_rule = chain->map[0] = rule;
chain->id = rule->id = 1;
 
IPFW_LOCK_INIT(chain);

Modified: head/sys/netpfil/ipfw/ip_fw_private.h
==
--- head/sys/netpfil/ipfw/ip_fw_private.h   Fri Jan 24 08:27:19 2014
(r261116)
+++ head/sys/netpfil/ipfw/ip_fw_private.h   Fri Jan 24 09:13:30 2014
(r261117)
@@ -213,25 +213,27 @@ VNET_DECLARE(unsigned int, fw_tables_max
 #define V_fw_tables_maxVNET(fw_tables_max)
 
 struct ip_fw_chain {
-   struct ip_fw*rules; /* list of rules */
-   struct ip_fw*reap;  /* list of rules to reap */
-   struct ip_fw*default_rule;
-   int n_rules;/* number of static rules */
-   int static_len; /* total len of static rules */
struct ip_fw**map;  /* array of rule ptrs to ease lookup */
+   uint32_tid; /* ruleset id */
+   int n_rules;/* number of static rules */
LIST_HEAD(nat_list, cfg_nat) nat;   /* list of nat entries */
struct radix_node_head **tables;/* IPv4 tables */
struct radix_node_head **xtables;   /* extended tables */
uint8_t *tabletype; /* Array of table types */
 #if defined( __linux__ ) || defined( _WIN32 )
spinlock_t rwmtx;
-   spinlock_t uh_lock;
 #else
struct rwlock   rwmtx;
+#endif
+   int static_len; /* total len of static rules */
+   uint32_tgencnt; /* NAT generation count */
+   struct ip_fw*reap;  /* list of rules to reap */
+   struct ip_fw*default_rule;
+#if defined( __linux__ ) || defined( _WIN32 )
+   spinlock_t uh_lock;
+#else
struct rwlock   uh_lock;/* lock for upper half */
 #endif
-   uint32_tid; /* ruleset id */
-   uint32_tgencnt; /* generation count */
 };
 
 struct sockopt;/* used by tcp_var.h */

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c   Fri Jan 24 08:27:19 2014
(r261116)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c   Fri Jan 24 09:13:30 2014
(r261117)
@@ -159,7 +159,7 @@ ipfw_add_rule(struct ip_fw_chain *chain,
int i, l, insert_before;
struct ip_fw **map; /* the new array of pointers */
 
-   if (chain->rules == NULL || input_rule->rulenum > IPFW_DEFAULT_RULE-1)
+   if (chain->map == NULL || input_rule->rulenum > IPFW_DEFAULT_RULE - 1)
return (EINVAL);
 
l = RULESIZE(input_rule);
___
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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Kevin Lo
Author: kevlo
Date: Fri Jan 24 09:17:29 2014
New Revision: 261118
URL: http://svnweb.freebsd.org/changeset/base/261118

Log:
  Get rid of memmove().  It's not portable.
  
  Tested on RT3071, RT3573, RT3570, RT3572, and RT5572.
  
  Reviewed by:  hselasky

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

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Fri Jan 24 09:13:30 2014
(r261117)
+++ head/sys/dev/usb/wlan/if_run.c  Fri Jan 24 09:17:29 2014
(r261118)
@@ -359,8 +359,6 @@ static int  run_write(struct run_softc *,
 static int run_write_region_1(struct run_softc *, uint16_t,
const uint8_t *, int);
 static int run_set_region_4(struct run_softc *, uint16_t, uint32_t, int);
-static int run_rf3593_efuse_read_1(struct run_softc *, uint16_t,
-   uint16_t *);
 static int run_efuse_read(struct run_softc *, uint16_t, uint16_t *, int);
 static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *);
 static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t *);
@@ -1344,12 +1342,6 @@ run_set_region_4(struct run_softc *sc, u
 }
 
 static int
-run_rf3593_efuse_read_1(struct run_softc *sc, uint16_t addr, uint16_t *val)
-{
-   return (run_efuse_read(sc, addr * 2, val, 1));
-}
-
-static int
 run_efuse_read(struct run_softc *sc, uint16_t addr, uint16_t *val, int count)
 {
uint32_t tmp;
@@ -1390,12 +1382,9 @@ run_efuse_read(struct run_softc *sc, uin
if ((error = run_read(sc, reg, &tmp)) != 0)
return (error);
 
-   if (count == 2)
-   *val = (addr & 2) ? tmp >> 16 : tmp & 0x;
-   else {
-   tmp >>= (8 *(addr & 0x3));
-   memmove(val, &tmp, sizeof(*val));
-   }
+   tmp >>= (8 * (addr & 0x3));
+   *val = (addr & 1) ? tmp >> 16 : tmp & 0x;
+
return (0);
 }
 
@@ -1753,10 +1742,8 @@ run_read_eeprom(struct run_softc *sc)
if (sc->mac_ver >= 0x3070) {
run_read(sc, RT3070_EFUSE_CTRL, &tmp);
DPRINTF("EFUSE_CTRL=0x%08x\n", tmp);
-   if ((tmp & RT3070_SEL_EFUSE) && sc->mac_ver != 0x3593)
+   if ((tmp & RT3070_SEL_EFUSE) || sc->mac_ver == 0x3593)
sc->sc_srom_read = run_efuse_read_2;
-   else
-   sc->sc_srom_read = run_rf3593_efuse_read_1;
}
 
/* read ROM version */
___
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: r261120 - head/sys/fs/ext2fs

2014-01-24 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jan 24 13:51:38 2014
New Revision: 261120
URL: http://svnweb.freebsd.org/changeset/base/261120

Log:
  ext2fs: fix a bug in dirindex and re-enable.
  
  The IN_* flags should be set in i_flag instead of corrupting
  i_flags [1].
  
  Re-enable HTree dirindex as the last series of bug fixes
  seems to have fixed the issues.
  
  Reported by:  bde [1]
  Tested by:kevlo
  MFC after:1 week

Modified:
  head/sys/fs/ext2fs/ext2_htree.c
  head/sys/fs/ext2fs/ext2_lookup.c

Modified: head/sys/fs/ext2fs/ext2_htree.c
==
--- head/sys/fs/ext2fs/ext2_htree.c Fri Jan 24 13:36:41 2014
(r261119)
+++ head/sys/fs/ext2fs/ext2_htree.c Fri Jan 24 13:51:38 2014
(r261120)
@@ -89,12 +89,10 @@ static int  ext2_htree_writebuf(struct ex
 int
 ext2_htree_has_idx(struct inode *ip)
 {
-#ifdef EXT2FS_HTREE
if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) &&
ip->i_flags & E4_INDEX)
return (1);
else
-#endif
return (0);
 }
 

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==
--- head/sys/fs/ext2fs/ext2_lookup.cFri Jan 24 13:36:41 2014
(r261119)
+++ head/sys/fs/ext2fs/ext2_lookup.cFri Jan 24 13:51:38 2014
(r261120)
@@ -884,13 +884,11 @@ ext2_direnter(struct inode *ip, struct v
bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1);
newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen);
 
-#ifdef EXT2FS_HTREE
if (ext2_htree_has_idx(dp)) {
error = ext2_htree_add_entry(dvp, &newdir, cnp);
if (error) {
-   /* XXX: These are set in the wrong place. */
dp->i_flags &= ~E4_INDEX;
-   dp->i_flags |= IN_CHANGE | IN_UPDATE;
+   dp->i_flag |= IN_CHANGE | IN_UPDATE;
}
return (error);
}
@@ -906,7 +904,6 @@ ext2_direnter(struct inode *ip, struct v
return ext2_htree_create_index(dvp, cnp, &newdir);
}
}
-#endif /* EXT2FS_HTREE */
 
if (dp->i_count == 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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Adrian Chadd
Memmove() isn't portable? To what?

Adrian
On Jan 24, 2014 4:17 AM, "Kevin Lo"  wrote:

> Author: kevlo
> Date: Fri Jan 24 09:17:29 2014
> New Revision: 261118
> URL: http://svnweb.freebsd.org/changeset/base/261118
>
> Log:
>   Get rid of memmove().  It's not portable.
>
>   Tested on RT3071, RT3573, RT3570, RT3572, and RT5572.
>
>   Reviewed by:  hselasky
>
> Modified:
>   head/sys/dev/usb/wlan/if_run.c
>
> Modified: head/sys/dev/usb/wlan/if_run.c
>
> ==
> --- head/sys/dev/usb/wlan/if_run.c  Fri Jan 24 09:13:30 2014
>  (r261117)
> +++ head/sys/dev/usb/wlan/if_run.c  Fri Jan 24 09:17:29 2014
>  (r261118)
> @@ -359,8 +359,6 @@ static int  run_write(struct run_softc *,
>  static int run_write_region_1(struct run_softc *, uint16_t,
> const uint8_t *, int);
>  static int run_set_region_4(struct run_softc *, uint16_t, uint32_t,
> int);
> -static int run_rf3593_efuse_read_1(struct run_softc *, uint16_t,
> -   uint16_t *);
>  static int run_efuse_read(struct run_softc *, uint16_t, uint16_t *,
> int);
>  static int run_efuse_read_2(struct run_softc *, uint16_t, uint16_t *);
>  static int run_eeprom_read_2(struct run_softc *, uint16_t, uint16_t
> *);
> @@ -1344,12 +1342,6 @@ run_set_region_4(struct run_softc *sc, u
>  }
>
>  static int
> -run_rf3593_efuse_read_1(struct run_softc *sc, uint16_t addr, uint16_t
> *val)
> -{
> -   return (run_efuse_read(sc, addr * 2, val, 1));
> -}
> -
> -static int
>  run_efuse_read(struct run_softc *sc, uint16_t addr, uint16_t *val, int
> count)
>  {
> uint32_t tmp;
> @@ -1390,12 +1382,9 @@ run_efuse_read(struct run_softc *sc, uin
> if ((error = run_read(sc, reg, &tmp)) != 0)
> return (error);
>
> -   if (count == 2)
> -   *val = (addr & 2) ? tmp >> 16 : tmp & 0x;
> -   else {
> -   tmp >>= (8 *(addr & 0x3));
> -   memmove(val, &tmp, sizeof(*val));
> -   }
> +   tmp >>= (8 * (addr & 0x3));
> +   *val = (addr & 1) ? tmp >> 16 : tmp & 0x;
> +
> return (0);
>  }
>
> @@ -1753,10 +1742,8 @@ run_read_eeprom(struct run_softc *sc)
> if (sc->mac_ver >= 0x3070) {
> run_read(sc, RT3070_EFUSE_CTRL, &tmp);
> DPRINTF("EFUSE_CTRL=0x%08x\n", tmp);
> -   if ((tmp & RT3070_SEL_EFUSE) && sc->mac_ver != 0x3593)
> +   if ((tmp & RT3070_SEL_EFUSE) || sc->mac_ver == 0x3593)
> sc->sc_srom_read = run_efuse_read_2;
> -   else
> -   sc->sc_srom_read = run_rf3593_efuse_read_1;
> }
>
> /* read ROM version */
>
___
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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Hans Petter Selasky

On 01/24/14 15:31, Adrian Chadd wrote:

Memmove() isn't portable? To what?



Hi,

memmove() doesn't know about the byte order when you copy inside an 
integer. s/memmove/code/ is not portable.


--HPS

___
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: r261121 - head/bin/sh/tests/parser

2014-01-24 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 24 15:03:56 2014
New Revision: 261121
URL: http://svnweb.freebsd.org/changeset/base/261121

Log:
  sh: Add test for nested alias.

Added:
  head/bin/sh/tests/parser/alias11.0   (contents, props changed)
Modified:
  head/bin/sh/tests/parser/Makefile

Modified: head/bin/sh/tests/parser/Makefile
==
--- head/bin/sh/tests/parser/Makefile   Fri Jan 24 13:51:38 2014
(r261120)
+++ head/bin/sh/tests/parser/Makefile   Fri Jan 24 15:03:56 2014
(r261121)
@@ -15,6 +15,7 @@ FILES+=   alias7.0
 FILES+=alias8.0
 FILES+=alias9.0
 FILES+=alias10.0
+FILES+=alias11.0
 FILES+=and-pipe-not.0
 FILES+=case1.0
 FILES+=case2.0

Added: head/bin/sh/tests/parser/alias11.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/parser/alias11.0  Fri Jan 24 15:03:56 2014
(r261121)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+alias alias0=alias1
+alias alias1=exit
+alias0 0
+exit 3
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261123 - head/sys/dev/usb

2014-01-24 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 24 15:05:28 2014
New Revision: 261123
URL: http://svnweb.freebsd.org/changeset/base/261123

Log:
  Hide now harmless warning from dmesg.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/usb_dev.c

Modified: head/sys/dev/usb/usb_dev.c
==
--- head/sys/dev/usb/usb_dev.c  Fri Jan 24 15:04:02 2014(r261122)
+++ head/sys/dev/usb/usb_dev.c  Fri Jan 24 15:05:28 2014(r261123)
@@ -930,7 +930,7 @@ usb_close(void *arg)
err = usb_ref_device(cpd, &refs,
2 /* uref and allow detached state */);
if (err) {
-   DPRINTFN(0, "Cannot grab USB reference when "
+   DPRINTFN(2, "Cannot grab USB reference when "
"closing USB file handle\n");
goto done;
}
___
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: r261122 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2014-01-24 Thread Andriy Gapon
Author: avg
Date: Fri Jan 24 15:04:02 2014
New Revision: 261122
URL: http://svnweb.freebsd.org/changeset/base/261122

Log:
  dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc
  
  The limitation was introduced in r178556 without any note or comment.
  It seems pretty artificial and now it leads to problems like the following:
$ dtrace -x bufsize=17m -n ...
dtrace: processing aborted: Memory allocation failure
  OpenSolaris and illumos never had this limitation.
  
  Sponsored by: HybridCluster

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cFri Jan 
24 15:03:56 2014(r261121)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cFri Jan 
24 15:04:02 2014(r261122)
@@ -734,11 +734,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size
 {
void *data;
 
-   if (size > 16 * 1024 * 1024) {
-   (void) dt_set_errno(dtp, EDT_NOMEM);
-   return (NULL);
-   }
-
if ((data = malloc(size)) == NULL)
(void) dt_set_errno(dtp, EDT_NOMEM);
else
@@ -752,11 +747,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size)
 {
void *data;
 
-   if (size > 16 * 1024 * 1024) {
-   (void) dt_set_errno(dtp, EDT_NOMEM);
-   return (NULL);
-   }
-
if ((data = malloc(size)) == NULL)
(void) dt_set_errno(dtp, EDT_NOMEM);
 
___
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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Adrian Chadd
... How's that matter?

Adrian
On Jan 24, 2014 9:33 AM, "Hans Petter Selasky"  wrote:

> On 01/24/14 15:31, Adrian Chadd wrote:
>
>> Memmove() isn't portable? To what?
>>
>>
> Hi,
>
> memmove() doesn't know about the byte order when you copy inside an
> integer. s/memmove/code/ is not portable.
>
> --HPS
>
>
___
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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Adrian Chadd
On 24 January 2014 07:16, Hans Petter Selasky  wrote:
> On 01/24/14 16:11, Adrian Chadd wrote:
>>
>> ... How's that matter?
>>
>> Adrian
>
>
> Ok, read slowly:
>
> uint32_t x = 255U;
> uint8_t y;
>
> On Big endian:
>
> memcpy(&y, &x, 1);
>
> y == 0;
>
> On Little endian:
>
> memcpy(&y, &x, 1);
>
> y == 255;
>
> If I'm not mistaken. The code is wrong because result depends on endianness
> :-)

Right. But that has nothing to do with the memory copy operation. That
has to do with how its stored.

So again - how's memmove() not portable here? :)


-a
___
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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Hans Petter Selasky

On 01/24/14 16:11, Adrian Chadd wrote:

... How's that matter?

Adrian


Ok, read slowly:

uint32_t x = 255U;
uint8_t y;

On Big endian:

memcpy(&y, &x, 1);

y == 0;

On Little endian:

memcpy(&y, &x, 1);

y == 255;

If I'm not mistaken. The code is wrong because result depends on 
endianness :-)


--HPS


___
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: r261124 - head/sys/dev/usb/wlan

2014-01-24 Thread Kevin Lo
Author: kevlo
Date: Fri Jan 24 15:34:22 2014
New Revision: 261124
URL: http://svnweb.freebsd.org/changeset/base/261124

Log:
  Fix comment.

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

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Fri Jan 24 15:05:28 2014
(r261123)
+++ head/sys/dev/usb/wlan/if_run.c  Fri Jan 24 15:34:22 2014
(r261124)
@@ -1388,7 +1388,7 @@ run_efuse_read(struct run_softc *sc, uin
return (0);
 }
 
-/* Read 16-bit from eFUSE ROM (RT3070 only.) */
+/* Read 16-bit from eFUSE ROM for RT3xxx. */
 static int
 run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val)
 {
___
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: r261125 - in head/bin/sh: . tests/builtins

2014-01-24 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 24 16:40:51 2014
New Revision: 261125
URL: http://svnweb.freebsd.org/changeset/base/261125

Log:
  sh: Solve the alias recursion problem in a less hackish way.
  
  Add the space to avoid alias recursion when the alias is expanded, not when
  it is added.
  
  As a result, displaying an alias via command -v, command -V or type no
  longer erroneously appends a space. Adjust the tests so they now require
  this bug to be absent.

Modified:
  head/bin/sh/alias.c
  head/bin/sh/input.c
  head/bin/sh/tests/builtins/command3.0.stdout
  head/bin/sh/tests/builtins/command5.0.stdout
  head/bin/sh/tests/builtins/command6.0.stdout

Modified: head/bin/sh/alias.c
==
--- head/bin/sh/alias.c Fri Jan 24 15:34:22 2014(r261124)
+++ head/bin/sh/alias.c Fri Jan 24 16:40:51 2014(r261125)
@@ -68,18 +68,7 @@ setalias(const char *name, const char *v
if (equal(name, ap->name)) {
INTOFF;
ckfree(ap->val);
-   /* See HACK below. */
-#ifdef notyet
ap->val = savestr(val);
-#else
-   {
-   size_t len = strlen(val);
-   ap->val = ckmalloc(len + 2);
-   memcpy(ap->val, val, len);
-   ap->val[len] = ' ';
-   ap->val[len+1] = '\0';
-   }
-#endif
INTON;
return;
}
@@ -88,34 +77,7 @@ setalias(const char *name, const char *v
INTOFF;
ap = ckmalloc(sizeof (struct alias));
ap->name = savestr(name);
-   /*
-* XXX - HACK: in order that the parser will not finish reading the
-* alias value off the input before processing the next alias, we
-* dummy up an extra space at the end of the alias.  This is a crock
-* and should be re-thought.  The idea (if you feel inclined to help)
-* is to avoid alias recursions.  The mechanism used is: when
-* expanding an alias, the value of the alias is pushed back on the
-* input as a string and a pointer to the alias is stored with the
-* string.  The alias is marked as being in use.  When the input
-* routine finishes reading the string, it marks the alias not
-* in use.  The problem is synchronization with the parser.  Since
-* it reads ahead, the alias is marked not in use before the
-* resulting token(s) is next checked for further alias sub.  The
-* H A C K is that we add a little fluff after the alias value
-* so that the string will not be exhausted.  This is a good
-* idea --- ***NOT***
-*/
-#ifdef notyet
ap->val = savestr(val);
-#else /* hack */
-   {
-   size_t len = strlen(val);
-   ap->val = ckmalloc(len + 2);
-   memcpy(ap->val, val, len);
-   ap->val[len] = ' '; /* fluff */
-   ap->val[len+1] = '\0';
-   }
-#endif
ap->flag = 0;
ap->next = *app;
*app = ap;
@@ -207,14 +169,8 @@ comparealiases(const void *p1, const voi
 static void
 printalias(const struct alias *a)
 {
-   char *p;
-
out1fmt("%s=", a->name);
-   /* Don't print the space added above. */
-   p = a->val + strlen(a->val) - 1;
-   *p = '\0';
out1qstr(a->val);
-   *p = ' ';
out1c('\n');
 }
 

Modified: head/bin/sh/input.c
==
--- head/bin/sh/input.c Fri Jan 24 15:34:22 2014(r261124)
+++ head/bin/sh/input.c Fri Jan 24 16:40:51 2014(r261125)
@@ -226,7 +226,14 @@ preadbuffer(void)
int more;
char savec;
 
-   if (parsefile->strpush) {
+   while (parsefile->strpush) {
+   /*
+* Add a space to the end of an alias to ensure that the
+* alias remains in use while parsing its last word.
+* This avoids alias recursions.
+*/
+   if (parsenleft == -1 && parsefile->strpush->ap != NULL)
+   return ' ';
popstring();
if (--parsenleft >= 0)
return (*parsenextc++);

Modified: head/bin/sh/tests/builtins/command3.0.stdout
==
--- head/bin/sh/tests/builtins/command3.0.stdoutFri Jan 24 15:34:22 
2014(r261124)
+++ head/bin/sh/tests/builtins/command3.0.stdoutFri Jan 24 16:40:51 
2014(r261125)
@@ -4,4 +4,4 @@ true
 fun
 break
 if
-alias foo='bar '
+alias foo=bar

Modified: head/bin/sh/tests/builtins/command5.0.stdout
==
--- head/bin/sh/tests/builtins/command5.0.stdoutFri Jan 24 15:34:22 
2014(r261124)
+++ head/bin

svn commit: r261128 - head/sys/arm/conf

2014-01-24 Thread Warner Losh
Author: imp
Date: Fri Jan 24 16:57:42 2014
New Revision: 261128
URL: http://svnweb.freebsd.org/changeset/base/261128

Log:
  Fix comment to match option

Modified:
  head/sys/arm/conf/BWCT
  head/sys/arm/conf/QILA9G20
  head/sys/arm/conf/SN9G45

Modified: head/sys/arm/conf/BWCT
==
--- head/sys/arm/conf/BWCT  Fri Jan 24 16:56:27 2014(r261127)
+++ head/sys/arm/conf/BWCT  Fri Jan 24 16:57:42 2014(r261128)
@@ -41,7 +41,7 @@ options   SOFTUPDATES #Enable FFS soft u
 #options   UFS_ACL #Support for access control lists
 #options   UFS_DIRHASH #Improve performance on big directories
 #options   MD_ROOT #MD is a potential root device
-#options   MD_ROOT_SIZE=4096   # 3MB ram disk
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
 #options   ROOTDEVNAME=\"ufs:md0\"
 #options   ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\"
 optionsNFSCL   #New Network Filesystem Client

Modified: head/sys/arm/conf/QILA9G20
==
--- head/sys/arm/conf/QILA9G20  Fri Jan 24 16:56:27 2014(r261127)
+++ head/sys/arm/conf/QILA9G20  Fri Jan 24 16:57:42 2014(r261128)
@@ -38,7 +38,7 @@ options   FFS #Berkeley Fast 
Filesystem
 #options   UFS_ACL #Support for access control lists
 #options   UFS_DIRHASH #Improve performance on big directories
 #options   MD_ROOT #MD is a potential root device
-#options   MD_ROOT_SIZE=4096   # 3MB ram disk
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
 optionsNFSCL   #New Network Filesystem Client
 #options   NFSD#New Network Filesystem Server
 #options   NFSLOCKD#Network Lock Manager

Modified: head/sys/arm/conf/SN9G45
==
--- head/sys/arm/conf/SN9G45Fri Jan 24 16:56:27 2014(r261127)
+++ head/sys/arm/conf/SN9G45Fri Jan 24 16:57:42 2014(r261128)
@@ -37,7 +37,7 @@ options   FFS #Berkeley Fast 
Filesystem
 #options   UFS_ACL #Support for access control lists
 #options   UFS_DIRHASH #Improve performance on big directories
 #options   MD_ROOT #MD is a potential root device
-#options   MD_ROOT_SIZE=4096   # 3MB ram disk
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
 optionsNFSCL   #New Network Filesystem Client
 #options   NFSD#New Network Filesystem Server
 #options   NFSLOCKD#Network Lock Manager
___
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: r261130 - head/sys/arm/conf

2014-01-24 Thread Warner Losh
Author: imp
Date: Fri Jan 24 16:58:50 2014
New Revision: 261130
URL: http://svnweb.freebsd.org/changeset/base/261130

Log:
  Fix comment to match option

Modified:
  head/sys/arm/conf/SAM9X25EK

Modified: head/sys/arm/conf/SAM9X25EK
==
--- head/sys/arm/conf/SAM9X25EK Fri Jan 24 16:58:21 2014(r261129)
+++ head/sys/arm/conf/SAM9X25EK Fri Jan 24 16:58:50 2014(r261130)
@@ -38,7 +38,7 @@ options   FFS #Berkeley Fast 
Filesystem
 #options   UFS_ACL #Support for access control lists
 #options   UFS_DIRHASH #Improve performance on big directories
 #options   MD_ROOT #MD is a potential root device
-#options   MD_ROOT_SIZE=4096   # 3MB ram disk
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
 optionsNFSCL   #New Network Filesystem Client
 #options   NFSD#New Network Filesystem Server
 #options   NFSLOCKD#Network Lock Manager
___
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: r261131 - head/sys/arm/conf

2014-01-24 Thread Warner Losh
Author: imp
Date: Fri Jan 24 17:00:27 2014
New Revision: 261131
URL: http://svnweb.freebsd.org/changeset/base/261131

Log:
  Remove obsolete option

Modified:
  head/sys/arm/conf/QILA9G20
  head/sys/arm/conf/SAM9G20EK
  head/sys/arm/conf/SAM9X25EK
  head/sys/arm/conf/SN9G45

Modified: head/sys/arm/conf/QILA9G20
==
--- head/sys/arm/conf/QILA9G20  Fri Jan 24 16:58:50 2014(r261130)
+++ head/sys/arm/conf/QILA9G20  Fri Jan 24 17:00:27 2014(r261131)
@@ -63,7 +63,6 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
 optionsMUTEX_NOINLINE
 optionsRWLOCK_NOINLINE
 optionsNO_FFS_SNAPSHOT

Modified: head/sys/arm/conf/SAM9G20EK
==
--- head/sys/arm/conf/SAM9G20EK Fri Jan 24 16:58:50 2014(r261130)
+++ head/sys/arm/conf/SAM9G20EK Fri Jan 24 17:00:27 2014(r261131)
@@ -63,7 +63,6 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
 optionsMUTEX_NOINLINE
 optionsRWLOCK_NOINLINE
 optionsNO_FFS_SNAPSHOT

Modified: head/sys/arm/conf/SAM9X25EK
==
--- head/sys/arm/conf/SAM9X25EK Fri Jan 24 16:58:50 2014(r261130)
+++ head/sys/arm/conf/SAM9X25EK Fri Jan 24 17:00:27 2014(r261131)
@@ -63,7 +63,6 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
 optionsMUTEX_NOINLINE
 optionsRWLOCK_NOINLINE
 optionsNO_FFS_SNAPSHOT

Modified: head/sys/arm/conf/SN9G45
==
--- head/sys/arm/conf/SN9G45Fri Jan 24 16:58:50 2014(r261130)
+++ head/sys/arm/conf/SN9G45Fri Jan 24 17:00:27 2014(r261131)
@@ -62,7 +62,6 @@ options   SYSVSHM #SYSV-style shared me
 optionsSYSVMSG #SYSV-style message queues
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-#options   SYSCTL_OMIT_DESCR
 optionsMUTEX_NOINLINE
 optionsRWLOCK_NOINLINE
 optionsNO_FFS_SNAPSHOT
___
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: r261126 - head/sys/arm/at91

2014-01-24 Thread Warner Losh
Author: imp
Date: Fri Jan 24 16:50:15 2014
New Revision: 261126
URL: http://svnweb.freebsd.org/changeset/base/261126

Log:
  Remove redundant declaration for uart devclass.
  Commint some unrelated, but harmless, FDT ifdefs.

Modified:
  head/sys/arm/at91/uart_bus_at91usart.c
  head/sys/arm/at91/uart_cpu_at91usart.c

Modified: head/sys/arm/at91/uart_bus_at91usart.c
==
--- head/sys/arm/at91/uart_bus_at91usart.c  Fri Jan 24 16:40:51 2014
(r261125)
+++ head/sys/arm/at91/uart_bus_at91usart.c  Fri Jan 24 16:50:15 2014
(r261126)
@@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$");
 
 static int usart_at91_probe(device_t dev);
 
-extern struct uart_class at91_usart_class;
-
 static device_method_t usart_at91_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, usart_at91_probe),

Modified: head/sys/arm/at91/uart_cpu_at91usart.c
==
--- head/sys/arm/at91/uart_cpu_at91usart.c  Fri Jan 24 16:40:51 2014
(r261125)
+++ head/sys/arm/at91/uart_cpu_at91usart.c  Fri Jan 24 16:50:15 2014
(r261126)
@@ -26,8 +26,10 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_platform.h"
 #include "opt_uart.h"
 
+#ifndef FDT
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -48,7 +50,6 @@ __FBSDID("$FreeBSD$");
 bus_space_tag_t uart_bus_space_io;
 bus_space_tag_t uart_bus_space_mem;
 
-extern struct uart_class at91_usart_class;
 extern struct bus_space at91_bs_tag;
 
 int
@@ -86,3 +87,4 @@ uart_cpu_getdev(int devtype, struct uart
uart_getenv(devtype, di, class);
return (0);
 }
+#endif
___
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: r261129 - head/sys/arm/conf

2014-01-24 Thread Warner Losh
Author: imp
Date: Fri Jan 24 16:58:21 2014
New Revision: 261129
URL: http://svnweb.freebsd.org/changeset/base/261129

Log:
  Fix comment to match option

Modified:
  head/sys/arm/conf/HL200

Modified: head/sys/arm/conf/HL200
==
--- head/sys/arm/conf/HL200 Fri Jan 24 16:57:42 2014(r261128)
+++ head/sys/arm/conf/HL200 Fri Jan 24 16:58:21 2014(r261129)
@@ -37,7 +37,7 @@ options   FFS #Berkeley Fast 
Filesystem
 #options   UFS_ACL #Support for access control lists
 #options   UFS_DIRHASH #Improve performance on big directories
 #options   MD_ROOT #MD is a potential root device
-#options   MD_ROOT_SIZE=4096   # 3MB ram disk
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
 #options   ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\"
 optionsNFSCL   #New Network Filesystem Client
 #options   NFSD#New Network Filesystem Server
___
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: r261127 - head/sys/arm/conf

2014-01-24 Thread Warner Losh
Author: imp
Date: Fri Jan 24 16:56:27 2014
New Revision: 261127
URL: http://svnweb.freebsd.org/changeset/base/261127

Log:
  Add NAND support
  Fix comment
  This board has 4 wire support

Modified:
  head/sys/arm/conf/SAM9G20EK

Modified: head/sys/arm/conf/SAM9G20EK
==
--- head/sys/arm/conf/SAM9G20EK Fri Jan 24 16:50:15 2014(r261126)
+++ head/sys/arm/conf/SAM9G20EK Fri Jan 24 16:56:27 2014(r261127)
@@ -37,7 +37,8 @@ options   FFS #Berkeley Fast 
Filesystem
 #options   UFS_ACL #Support for access control lists
 #options   UFS_DIRHASH #Improve performance on big directories
 #options   MD_ROOT #MD is a potential root device
-#options   MD_ROOT_SIZE=4096   # 3MB ram disk
+#options   MD_ROOT_SIZE=4096   # 4MB ram disk
+optionsNANDFS  #NAND file system
 optionsNFSCL   #New Network Filesystem Client
 #options   NFSD#New Network Filesystem Server
 #options   NFSLOCKD#Network Lock Manager
@@ -91,6 +92,9 @@ optionAT91_ATE_USE_RMII
 device at91_twi# TWI: Two Wire Interface (EEPROM)
 device at91_wdt# WDT: Watchdog timer
 
+# NAND Flash - Reference design has Samsung 256MB but others possible
+device nand# NAND interface on CS3
+
 # NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware
 #  confilict on this card. Use one or the other.
 #   see board_sam9g20ek.c
@@ -105,7 +109,7 @@ device  at91_mci
 device mmc
 device mmcsd
 option AT91_MCI_SLOT_B
-#optionAT91_MCI_HAS_4WIRE
+option AT91_MCI_HAS_4WIRE
 
 # iic
 device iic
@@ -128,14 +132,14 @@ deviceuhid# "Human Interface 
Devices
 #deviceudbp# USB Double Bulk Pipe devices
 
 # USB Ethernet, requires miibus
-device miibus
+#devicemiibus
 #deviceaue # ADMtek USB Ethernet
 #deviceaxe # ASIX Electronics USB Ethernet
 #devicecdce# Generic USB over Ethernet
 #devicecue # CATC USB Ethernet
 #devicekue # Kawasaki LSI USB Ethernet
 #devicerue # RealTek RTL8150 USB Ethernet
-device udav# Davicom DM9601E USB
+#deviceudav# Davicom DM9601E USB
 
 # USB Wireless
 #devicerum # Ralink Technology RT2501USB wireless 
NICs
@@ -149,4 +153,3 @@ device  udav# Davicom DM9601E USB
 #devicewlan_ccmp   # 802.11 CCMP support
 #devicewlan_tkip   # 802.11 TKIP support
 #devicewlan_amrr   # AMRR transmit rate control algorithm
-
___
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: r261132 - head

2014-01-24 Thread Alan Somers
Author: asomers
Date: Fri Jan 24 18:01:46 2014
New Revision: 261132
URL: http://svnweb.freebsd.org/changeset/base/261132

Log:
  Fix the build so -DNO_TESTS is passed in various phases that don't
  require tests in order to build or install.  Crucially, don't try to
  install tests during the lib32 install phase.  This commit supersedes
  r261081, which fixed the lib32 install phase problem, but didn't fix
  other phases.
  
  Submitted by: Garrett Cooper
  Reviewed by:  sjg
  MFC after:13 days

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Jan 24 17:00:27 2014(r261131)
+++ head/Makefile.inc1  Fri Jan 24 18:01:46 2014(r261132)
@@ -246,7 +246,7 @@ BMAKE=  MAKEOBJDIRPREFIX=${WORLDTMP} \
SSP_CFLAGS= \
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
-DNO_PIC -DNO_PROFILE -DNO_SHARED \
-   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
+   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
 
 # build-tools stage
 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
@@ -256,12 +256,12 @@ TMAKE=MAKEOBJDIRPREFIX=${OBJTREE} \
BOOTSTRAPPING=${OSRELDATE} \
SSP_CFLAGS= \
-DNO_LINT \
-   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
+   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
 
 # cross-tools stage
 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-   -DWITHOUT_GDB
+   -DWITHOUT_GDB -DNO_TESTS
 
 # kernel-tools stage
 KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
@@ -414,10 +414,11 @@ LIB32WMAKEFLAGS+= \
-DLIBRARIES_ONLY \
-DNO_CPU_CFLAGS \
-DNO_CTF \
-   -DNO_LINT
+   -DNO_LINT \
+   -DNO_TESTS
 
 LIB32WMAKE=${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
-   -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML -DNO_TESTS
+   -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML
 LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \
${IMAKE_INSTALL}
 .endif
@@ -569,7 +570,7 @@ _libraries:
@echo "--"
${_+_}cd ${.CURDIR}; \
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-   -DWITHOUT_MAN -DNO_PROFILE libraries
+   -DWITHOUT_MAN -DNO_PROFILE -DNO_TESTS libraries
 _depend:
@echo
@echo "--"
@@ -1501,7 +1502,12 @@ _prebuild_libs=  ${_kerberos5_lib_libasn1
${_secure_lib_libcrypto} ${_lib_libldns} \
${_secure_lib_libssh} ${_secure_lib_libssl}
 
-.if ${MK_TESTS} != "no"
+.if defined(WITH_ATF) || ${MK_TESTS} != "no"
+.if !defined(WITH_ATF)
+# Ensure that the ATF libraries will be built during make libraries, even
+# though they will have -DNO_TESTS
+MAKE+= -DWITH_ATF
+.endif
 _lib_atf=  lib/atf
 .endif
 
@@ -1877,7 +1883,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE}
 
 NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE \
-   -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS \
+   -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_TESTS -DNO_WARNS \
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
CPUTYPE=${XDEV_CPUTYPE}
 
___
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: r261133 - in head/tests: . sys

2014-01-24 Thread Alan Somers
Author: asomers
Date: Fri Jan 24 18:04:16 2014
New Revision: 261133
URL: http://svnweb.freebsd.org/changeset/base/261133

Log:
  Fix the Makefiles so that the tests I submitted in r261081 will actually
  get built.
  
  Sponsored by: Spectra Logic
  MFC after:13 days
  X-MFC-With:   r261081

Modified:
  head/tests/Makefile
  head/tests/sys/Makefile

Modified: head/tests/Makefile
==
--- head/tests/Makefile Fri Jan 24 18:01:46 2014(r261132)
+++ head/tests/Makefile Fri Jan 24 18:04:16 2014(r261133)
@@ -2,7 +2,7 @@
 
 .include 
 
-SUBDIR= # still empty
+SUBDIR= sys
 
 TESTSDIR= ${TESTSBASE}
 KYUAFILE= yes

Modified: head/tests/sys/Makefile
==
--- head/tests/sys/Makefile Fri Jan 24 18:01:46 2014(r261132)
+++ head/tests/sys/Makefile Fri Jan 24 18:04:16 2014(r261133)
@@ -2,6 +2,7 @@
 
 .include 
 
+SUBDIR= kern
 TESTSDIR= ${TESTSBASE}/sys
 
 KYUAFILE= yes
___
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: r261134 - in head/sys/dev/usb: . quirk

2014-01-24 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 24 18:52:04 2014
New Revision: 261134
URL: http://svnweb.freebsd.org/changeset/base/261134

Log:
  Add more USB quirks.
  
  Submitted by: Gerrit Kuehn 
  MFC after:1 week

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Fri Jan 24 18:04:16 2014
(r261133)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Fri Jan 24 18:52:04 2014
(r261134)
@@ -164,6 +164,7 @@ static struct usb_quirk_entry usb_quirks
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY),
USB_QUIRK(ASAHIOPTICAL, OPTIO330, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY),
+   USB_QUIRK(ATP, EUSB, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(BELKIN, USB2SCSI, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI),
USB_QUIRK(CASIO, QV_DIGICAM, 0x, 0x, UQ_MSC_FORCE_WIRE_CBI,

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Jan 24 18:04:16 2014(r261133)
+++ head/sys/dev/usb/usbdevsFri Jan 24 18:52:04 2014(r261134)
@@ -643,6 +643,7 @@ vendor ABOCOM2  0x1482  AboCom Systems
 vendor SILICOM 0x1485  Silicom
 vendor RALINK  0x148f  Ralink Technology
 vendor IMAGINATION 0x149a  Imagination Technologies
+vendor ATP 0x14af  ATP Electronics
 vendor CONCEPTRONIC2   0x14b2  Conceptronic
 vendor SUPERTOP0x14cd  Super Top
 vendor PLANEX3 0x14ea  Planex Communications
@@ -1162,6 +1163,9 @@ product ATEN UC232A   0x2008  Serial
 product ATEN UC210T0x2009  UC-210T Ethernet
 product ATEN DSB650C   0x4000  DSB-650C
 
+/* ATP Electronics products */
+product ATP EUSB   0xaf01  ATP IG eUSB SSD
+
 /* Atheros Communications products */
 product ATHEROS AR5523 0x0001  AR5523
 product ATHEROS AR5523_NF  0x0002  AR5523 (no firmware)
___
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: r261135 - head/sys/vm

2014-01-24 Thread Alan Cox
Author: alc
Date: Fri Jan 24 19:08:42 2014
New Revision: 261135
URL: http://svnweb.freebsd.org/changeset/base/261135

Log:
  In an effort to diagnose possible corruption of struct vm_page on some
  sparc64 machines make the page queue assert in vm_page_dequeue() more
  precise.  While I'm here switch the page lock assert to the newer style.

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Fri Jan 24 18:52:04 2014(r261134)
+++ head/sys/vm/vm_page.c   Fri Jan 24 19:08:42 2014(r261135)
@@ -2028,8 +2028,8 @@ vm_page_dequeue(vm_page_t m)
 {
struct vm_pagequeue *pq;
 
-   vm_page_lock_assert(m, MA_OWNED);
-   KASSERT(m->queue != PQ_NONE,
+   vm_page_assert_locked(m);
+   KASSERT(m->queue == PQ_ACTIVE || m->queue == PQ_INACTIVE,
("vm_page_dequeue: page %p is not queued", m));
pq = vm_page_pagequeue(m);
vm_pagequeue_lock(pq);
___
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: r261136 - head/sys/fs/ext2fs

2014-01-24 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jan 24 20:26:00 2014
New Revision: 261136
URL: http://svnweb.freebsd.org/changeset/base/261136

Log:
  ext2fs: Re-enable reallocblk.
  
  The major corruption issues affecting this code have been fixed
  a while ago.
  
  MFC after:1 week

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Fri Jan 24 19:08:42 2014
(r261135)
+++ head/sys/fs/ext2fs/ext2_alloc.c Fri Jan 24 20:26:00 2014
(r261136)
@@ -147,11 +147,11 @@ nospace:
 
 static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW, 0, "EXT2FS filesystem");
 
-static int doasyncfree = 0;
+static int doasyncfree = 1;
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0,
 "Use asychronous writes to update block pointers when freeing blocks");
 
-static int doreallocblks = 0;
+static int doreallocblks = 1;
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 
0, "");
 
 int
___
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: r261137 - head/sys/arm/include

2014-01-24 Thread Andrew Turner
Author: andrew
Date: Fri Jan 24 20:51:56 2014
New Revision: 261137
URL: http://svnweb.freebsd.org/changeset/base/261137

Log:
  Correct the alignment of sp through functions that use UNWINDSVCFRAME. We
  were incorrectly adding the trap frame padding to the stack pointer after
  reading it's value and unaligning it.

Modified:
  head/sys/arm/include/asmacros.h

Modified: head/sys/arm/include/asmacros.h
==
--- head/sys/arm/include/asmacros.h Fri Jan 24 20:26:00 2014
(r261136)
+++ head/sys/arm/include/asmacros.h Fri Jan 24 20:51:56 2014
(r261137)
@@ -216,8 +216,13 @@
ldmia   sp, {sp, lr, pc}^   /* Restore lr and exit */
 #endif
 #if defined(__ARM_EABI__)
+/*
+ * Unwind hints so we can unwind past functions that use
+ * PULLFRAMEFROMSVCANDEXIT. They are run in reverse order.
+ * As the last thing we do is restore the stack pointer
+ * we can ignore the padding at the end of struct trapframe.
+ */
 #defineUNWINDSVCFRAME  
   \
-   .pad #(4);  /* Skip stack alignment */ \
.save {r13-r15};/* Restore sp, lr, pc */   \
.pad #(2*4);/* Skip user sp and lr */  \
.save {r0-r12}; /* Restore r0-r12 */   \
___
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: r261138 - head/sys/kern

2014-01-24 Thread Robert Millan
Author: rmh
Date: Fri Jan 24 21:05:07 2014
New Revision: 261138
URL: http://svnweb.freebsd.org/changeset/base/261138

Log:
  Accept O_CLOEXEC in shm_open().
  
  Reviewed by:  jilles, jhb
  MFC after:1 week

Modified:
  head/sys/kern/uipc_shm.c

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cFri Jan 24 20:51:56 2014(r261137)
+++ head/sys/kern/uipc_shm.cFri Jan 24 21:05:07 2014(r261138)
@@ -704,7 +704,7 @@ sys_shm_open(struct thread *td, struct s
(uap->flags & O_ACCMODE) != O_RDWR)
return (EINVAL);
 
-   if ((uap->flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC)) != 0)
+   if ((uap->flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC | 
O_CLOEXEC)) != 0)
return (EINVAL);
 
fdp = td->td_proc->p_fd;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r261031 - in head: . etc usr.sbin/etcupdate usr.sbin/mergemaster

2014-01-24 Thread John Baldwin
On Thursday, January 23, 2014 5:48:34 pm Peter Wemm wrote:
> On 1/23/14, 2:12 PM, John Baldwin wrote:
> > On Thursday, January 23, 2014 4:22:56 pm Bryan Drewery wrote:
> >> On Thu, Jan 23, 2014 at 03:03:42PM -0500, John Baldwin wrote:
> >>> On Thursday, January 23, 2014 2:48:41 pm Bryan Drewery wrote:
>  On Thu, Jan 23, 2014 at 02:39:14PM -0500, John Baldwin wrote:
> > On Thursday, January 23, 2014 10:42:36 am David Chisnall wrote:
> >> On 22 Jan 2014, at 22:36, Glen Barber  wrote:
> >>
> >>> It needs to use the build host version, because using (for example)
> >>> powerpc resulting binary won't work on and amd64 system.
> >>
> >> If it's used as part of the build, then it should be part of the 
> >> toolchain 
> > target and we should be using the version built there.
> >
> > 'make distribute' is not a normal part of the build (it's not part of
> > buildworld or installworld).  Both mergemaster and etcupdate only run it
> > after an installworld has been performed, in which case an up-to-date
> > services_mkdb should already be installed.
> >
> > Bryan, what are you running 'make distribute' for?  Is this to populate
> > a new jail from a world build?
> 
>  Yes, poudriere uses this to create jails. It runs:
> 
>  export TARGET_ARCH=...
>  make buildworld
>  make installworld DESTDIR=...
>  make distrib-dirs DESTDIR=... DB_FROM_SRC=1
>  make distribution DESTDIR=...
> 
> 
>  No mergemaster or etc-update is ran, we just install all of the
>  defaults.
> >>>
> >>> Yes, but you are attemping to install a newer jail than the host, and 
> >>> strictly
> >>> speaking that isn't supported.  (Rather, we only guarantee that a jail 
> >>> will work
> >>> so long as its world is older or equal in age to the host.)
> >>
> >> I am aware of *running* newer jails not being suppored, but *building*
> >> seems to be an absolute must to be supported. How else would you
> >> upgrade?
> > 
> > A normal upgrade does 'installworld' followed by some sort of /etc updating
> > tool.  It doesn't do 'make distribute'.  Also, this is related to why one
> > is not guaranteed to be able to do an 'installworld' unless you've booted 
> > into
> > the new kernel first (though it often works, and 'make distribute' also 
> > often
> > works, but often != always).
> > 
> > The thing is, there is no notion of cross-tools, etc. for things like
> > installworld and distribution.  We have always expected the host to have
> > ITOOLS that work.
> > 
> > Note that this exact situation has happened before back when cap_mkdb and
> > pwd_mkdb grew endianness flags for release cross-builds.  The pwd_mkdb
> > flag and the change to enable it in etc/Makefile were both made on the same
> > day.  (The cap_mkdb change was made earlier, but that appears to be more
> > a result of the testing cycle for cross-building releases than an
> > intentional delay.)
> 
> FWIW, we do this at work and ran into the same problem.  We do the same
> things that poudriere does, almost exactly.
> 
> We added:  "CAP_MKDB_ENDIAN= PWD_MKDB_ENDIAN=" to the "make DESTDIR=/stage
> distribution" phase.  This currently works all the way back to stable/4.
> 
> Is there a middle ground where we could only specify -l / -b in a cross
> build perhaps?

I would be fine with that, definitely.  Not sure what the proper test
for that is though.

-- 
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: r261140 - head/lib/libc/gen

2014-01-24 Thread Bryan Drewery
Author: bdrewery
Date: Fri Jan 24 22:37:35 2014
New Revision: 261140
URL: http://svnweb.freebsd.org/changeset/base/261140

Log:
  Add MLINK for fdclosedir.3 to directory.3 and sort fdopendir(3) entry.
  
  Reported by:  bde
  Approved by:  bapt (mentor)

Modified:
  head/lib/libc/gen/Makefile.inc

Modified: head/lib/libc/gen/Makefile.inc
==
--- head/lib/libc/gen/Makefile.inc  Fri Jan 24 22:12:59 2014
(r261139)
+++ head/lib/libc/gen/Makefile.inc  Fri Jan 24 22:37:35 2014
(r261140)
@@ -304,8 +304,9 @@ MLINKS+=devname.3 fdevname.3
 MLINKS+=devname.3 fdevname_r.3
 MLINKS+=directory.3 closedir.3 \
directory.3 dirfd.3 \
-   directory.3 opendir.3 \
+   directory.3 fdclosedir.3 \
directory.3 fdopendir.3 \
+   directory.3 opendir.3 \
directory.3 readdir.3 \
directory.3 readdir_r.3 \
directory.3 rewinddir.3 \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261141 - head/bin/sh/tests/parser

2014-01-24 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 24 23:00:35 2014
New Revision: 261141
URL: http://svnweb.freebsd.org/changeset/base/261141

Log:
  sh: Do not depend on parse/execute split in new alias test.

Modified:
  head/bin/sh/tests/parser/alias11.0

Modified: head/bin/sh/tests/parser/alias11.0
==
--- head/bin/sh/tests/parser/alias11.0  Fri Jan 24 22:37:35 2014
(r261140)
+++ head/bin/sh/tests/parser/alias11.0  Fri Jan 24 23:00:35 2014
(r261141)
@@ -2,5 +2,5 @@
 
 alias alias0=alias1
 alias alias1=exit
-alias0 0
+eval 'alias0 0'
 exit 3
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r261142 - head/etc

2014-01-24 Thread Glen Barber
Author: gjb
Date: Sat Jan 25 00:03:33 2014
New Revision: 261142
URL: http://svnweb.freebsd.org/changeset/base/261142

Log:
  Temporarily turn off the services.db generation during distributeworld.
  I'll work on an update to test for endianness-compatibility.
  
  Submitted by: many
  Sponsored by: The FreeBSD Foundation

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Fri Jan 24 23:00:35 2014(r261141)
+++ head/etc/Makefile   Sat Jan 25 00:03:33 2014(r261142)
@@ -198,8 +198,6 @@ distribution:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${BIN1} ${DESTDIR}/etc; \
cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
-   services_mkdb ${CAP_MKDB_ENDIAN} -q -o 
${DESTDIR}/var/db/services.db \
-   ${DESTDIR}/etc/services; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
${BIN2} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
___
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: r261146 - head/usr.sbin/cron/cron

2014-01-24 Thread Andrey A. Chernov
Author: ache
Date: Sat Jan 25 02:16:09 2014
New Revision: 261146
URL: http://svnweb.freebsd.org/changeset/base/261146

Log:
  Bad timespec_subtract() calculations produce negative tv_nsec on i386
  which cause EINVAL returned from nanosleep() which cause loop in
  cron_sleep() and making all cron jobs to start about 30 seconds earlier
  (which cause f.e. logfiles rotation by newsyslog delayed by 1 hour).
  
  Use simple and proved calculations from kernel's timespecsub() instead.
  
  MFC after:  3 days

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

Modified: head/usr.sbin/cron/cron/cron.c
==
--- head/usr.sbin/cron/cron/cron.c  Sat Jan 25 01:58:15 2014
(r261145)
+++ head/usr.sbin/cron/cron/cron.c  Sat Jan 25 02:16:09 2014
(r261146)
@@ -376,30 +376,17 @@ cron_sync(int secres) {
}
 }
 
-static int
+static void
 timespec_subtract(struct timespec *result, struct timespec *x,
 struct timespec *y)
 {
-   time_t nsec;
-
-   /* Perform the carry for the later subtraction by updating y. */
-   if (x->tv_nsec < y->tv_nsec) {
-   nsec = (y->tv_nsec - x->tv_nsec) / 1000 + 1;
-   y->tv_nsec -= 10 * nsec;
-   y->tv_sec += nsec;
-   }
-   if (x->tv_nsec - y->tv_nsec > 10) {
-   nsec = (x->tv_nsec - y->tv_nsec) / 10;
-   y->tv_nsec += 10 * nsec;
-   y->tv_sec -= nsec;
-   }
- 
-   /* tv_nsec is certainly positive. */
-   result->tv_sec = x->tv_sec - y->tv_sec;
-   result->tv_nsec = x->tv_nsec - y->tv_nsec;
- 
-   /* Return True if result is negative. */
-   return (x->tv_sec < y->tv_sec);
+   *result = *x;
+   result->tv_sec -= y->tv_sec;
+   result->tv_nsec -= y->tv_nsec;
+   if (result->tv_nsec < 0) {
+   result->tv_sec--;
+   result->tv_nsec += 10;
+   }
 }
 
 static void
___
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: r261118 - head/sys/dev/usb/wlan

2014-01-24 Thread Adrian Chadd
oooh. Sorry, I shouldn't read code whilst medicated.

I see now. Yes, memmove() is fine, you're just removing an invalid use
of it. Sorry!


-a
___
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: r261147 - head/sys/dev/virtio/scsi

2014-01-24 Thread Bryan Venteicher
Author: bryanv
Date: Sat Jan 25 06:54:04 2014
New Revision: 261147
URL: http://svnweb.freebsd.org/changeset/base/261147

Log:
  Remove spaces before tabs in the function prototype list

Modified:
  head/sys/dev/virtio/scsi/virtio_scsi.c

Modified: head/sys/dev/virtio/scsi/virtio_scsi.c
==
--- head/sys/dev/virtio/scsi/virtio_scsi.c  Sat Jan 25 02:16:09 2014
(r261146)
+++ head/sys/dev/virtio/scsi/virtio_scsi.c  Sat Jan 25 06:54:04 2014
(r261147)
@@ -81,7 +81,7 @@ static void   vtscsi_write_device_config(s
 static int vtscsi_reinit(struct vtscsi_softc *);
 
 static int vtscsi_alloc_cam(struct vtscsi_softc *);
-static int vtscsi_register_cam(struct vtscsi_softc *);
+static int vtscsi_register_cam(struct vtscsi_softc *);
 static voidvtscsi_free_cam(struct vtscsi_softc *);
 static voidvtscsi_cam_async(void *, uint32_t, struct cam_path *, void *);
 static int vtscsi_register_async(struct vtscsi_softc *);
@@ -91,7 +91,7 @@ static void   vtscsi_cam_poll(struct cam_s
 
 static voidvtscsi_cam_scsi_io(struct vtscsi_softc *, struct cam_sim *,
union ccb *);
-static voidvtscsi_cam_get_tran_settings(struct vtscsi_softc *,
+static voidvtscsi_cam_get_tran_settings(struct vtscsi_softc *,
union ccb *);
 static voidvtscsi_cam_reset_bus(struct vtscsi_softc *, union ccb *);
 static voidvtscsi_cam_reset_dev(struct vtscsi_softc *, union ccb *);
@@ -99,69 +99,69 @@ static void vtscsi_cam_abort(struct vtsc
 static voidvtscsi_cam_path_inquiry(struct vtscsi_softc *,
struct cam_sim *, union ccb *);
 
-static int vtscsi_sg_append_scsi_buf(struct vtscsi_softc *,
+static int vtscsi_sg_append_scsi_buf(struct vtscsi_softc *,
struct sglist *, struct ccb_scsiio *);
-static int vtscsi_fill_scsi_cmd_sglist(struct vtscsi_softc *,
+static int vtscsi_fill_scsi_cmd_sglist(struct vtscsi_softc *,
struct vtscsi_request *, int *, int *);
-static int vtscsi_execute_scsi_cmd(struct vtscsi_softc *,
+static int vtscsi_execute_scsi_cmd(struct vtscsi_softc *,
struct vtscsi_request *);
-static int vtscsi_start_scsi_cmd(struct vtscsi_softc *, union ccb *);
+static int vtscsi_start_scsi_cmd(struct vtscsi_softc *, union ccb *);
 static voidvtscsi_complete_abort_timedout_scsi_cmd(struct vtscsi_softc *,
struct vtscsi_request *);
-static int vtscsi_abort_timedout_scsi_cmd(struct vtscsi_softc *,
+static int vtscsi_abort_timedout_scsi_cmd(struct vtscsi_softc *,
struct vtscsi_request *);
 static voidvtscsi_timedout_scsi_cmd(void *);
 static cam_status vtscsi_scsi_cmd_cam_status(struct virtio_scsi_cmd_resp *);
 static cam_status vtscsi_complete_scsi_cmd_response(struct vtscsi_softc *,
struct ccb_scsiio *, struct virtio_scsi_cmd_resp *);
-static voidvtscsi_complete_scsi_cmd(struct vtscsi_softc *,
+static voidvtscsi_complete_scsi_cmd(struct vtscsi_softc *,
struct vtscsi_request *);
 
 static voidvtscsi_poll_ctrl_req(struct vtscsi_softc *,
struct vtscsi_request *);
-static int vtscsi_execute_ctrl_req(struct vtscsi_softc *,
+static int vtscsi_execute_ctrl_req(struct vtscsi_softc *,
struct vtscsi_request *, struct sglist *, int, int, int);
-static voidvtscsi_complete_abort_task_cmd(struct vtscsi_softc *c,
+static voidvtscsi_complete_abort_task_cmd(struct vtscsi_softc *c,
struct vtscsi_request *);
-static int vtscsi_execute_abort_task_cmd(struct vtscsi_softc *,
+static int vtscsi_execute_abort_task_cmd(struct vtscsi_softc *,
struct vtscsi_request *);
-static int vtscsi_execute_reset_dev_cmd(struct vtscsi_softc *,
+static int vtscsi_execute_reset_dev_cmd(struct vtscsi_softc *,
struct vtscsi_request *);
 
-static voidvtscsi_get_request_lun(uint8_t [], target_id_t *, lun_id_t *);
+static voidvtscsi_get_request_lun(uint8_t [], target_id_t *, lun_id_t *);
 static voidvtscsi_set_request_lun(struct ccb_hdr *, uint8_t []);
 static voidvtscsi_init_scsi_cmd_req(struct ccb_scsiio *,
struct virtio_scsi_cmd_req *);
 static voidvtscsi_init_ctrl_tmf_req(struct ccb_hdr *, uint32_t,
uintptr_t, struct virtio_scsi_ctrl_tmf_req *);
 
-static voidvtscsi_freeze_simq(struct vtscsi_softc *, int);
+static voidvtscsi_freeze_simq(struct vtscsi_softc *, int);
 static int vtscsi_thaw_simq(struct vtscsi_softc *, int);
 
-static voidvtscsi_announce(struct vtscsi_softc *, uint32_t, target_id_t,
+static voidvtscsi_announce(struct vtscsi_softc *, uint32_t, target_id_t,
lun_id_t);
-static voidvtscsi_execute_rescan(struct vtscsi_softc *, target_id_t,
+static voidvtscsi_e

svn commit: r261148 - head/sys/amd64/amd64

2014-01-24 Thread Peter Grehan
Author: grehan
Date: Sat Jan 25 06:58:41 2014
New Revision: 261148
URL: http://svnweb.freebsd.org/changeset/base/261148

Log:
  Change RWX to XWR in comments to match intent and bit patterns
  in discussion of valid EPT pte protections.
  
  Discussed with:   neel
  MFC after:3 days

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Sat Jan 25 06:54:04 2014(r261147)
+++ head/sys/amd64/amd64/pmap.c Sat Jan 25 06:58:41 2014(r261148)
@@ -5575,7 +5575,7 @@ safe_to_clear_referenced(pmap_t pmap, pt
KASSERT(pmap->pm_type == PT_EPT, ("invalid pm_type %d", pmap->pm_type));
 
/*
-* RWX = 010 or 110 will cause an unconditional EPT misconfiguration
+* XWR = 010 or 110 will cause an unconditional EPT misconfiguration
 * so we don't let the referenced (aka EPT_PG_READ) bit to be cleared
 * if the EPT_PG_WRITE bit is set.
 */
@@ -5583,7 +5583,7 @@ safe_to_clear_referenced(pmap_t pmap, pt
return (FALSE);
 
/*
-* RWX = 100 is allowed only if the PMAP_SUPPORTS_EXEC_ONLY is set.
+* XWR = 100 is allowed only if the PMAP_SUPPORTS_EXEC_ONLY is set.
 */
if ((pte & EPT_PG_EXECUTE) == 0 ||
((pmap->pm_flags & PMAP_SUPPORTS_EXEC_ONLY) != 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: r261149 - head/sys/dev/virtio/scsi

2014-01-24 Thread Bryan Venteicher
Author: bryanv
Date: Sat Jan 25 07:01:51 2014
New Revision: 261149
URL: http://svnweb.freebsd.org/changeset/base/261149

Log:
  Read each field of the configuration individually
  
  In the forthcoming VirtIO spec, the device configuration is
  always in little endian instead of guest edian. This is a
  noop change for now.

Modified:
  head/sys/dev/virtio/scsi/virtio_scsi.c

Modified: head/sys/dev/virtio/scsi/virtio_scsi.c
==
--- head/sys/dev/virtio/scsi/virtio_scsi.c  Sat Jan 25 06:58:41 2014
(r261148)
+++ head/sys/dev/virtio/scsi/virtio_scsi.c  Sat Jan 25 07:01:51 2014
(r261149)
@@ -75,6 +75,8 @@ static intvtscsi_suspend(device_t);
 static int vtscsi_resume(device_t);
 
 static voidvtscsi_negotiate_features(struct vtscsi_softc *);
+static voidvtscsi_read_config(struct vtscsi_softc *,
+   struct virtio_scsi_config *);
 static int vtscsi_maximum_segments(struct vtscsi_softc *, int);
 static int vtscsi_alloc_virtqueues(struct vtscsi_softc *);
 static voidvtscsi_write_device_config(struct vtscsi_softc *);
@@ -287,8 +289,7 @@ vtscsi_attach(device_t dev)
if (virtio_with_feature(dev, VIRTIO_SCSI_F_HOTPLUG))
sc->vtscsi_flags |= VTSCSI_FLAG_HOTPLUG;
 
-   virtio_read_device_config(dev, 0, &scsicfg,
-   sizeof(struct virtio_scsi_config));
+   vtscsi_read_config(sc, &scsicfg);
 
sc->vtscsi_max_channel = scsicfg.max_channel;
sc->vtscsi_max_target = scsicfg.max_target;
@@ -408,6 +409,35 @@ vtscsi_negotiate_features(struct vtscsi_
sc->vtscsi_features = features;
 }
 
+#define VTSCSI_GET_CONFIG(_dev, _field, _cfg)  \
+   virtio_read_device_config(_dev, \
+   offsetof(struct virtio_scsi_config, _field),\
+   &(_cfg)->_field, sizeof((_cfg)->_field))\
+
+static void
+vtscsi_read_config(struct vtscsi_softc *sc,
+struct virtio_scsi_config *scsicfg)
+{
+   device_t dev;
+
+   dev = sc->vtscsi_dev;
+
+   bzero(scsicfg, sizeof(struct virtio_scsi_config));
+
+   VTSCSI_GET_CONFIG(dev, num_queues, scsicfg);
+   VTSCSI_GET_CONFIG(dev, seg_max, scsicfg);
+   VTSCSI_GET_CONFIG(dev, max_sectors, scsicfg);
+   VTSCSI_GET_CONFIG(dev, cmd_per_lun, scsicfg);
+   VTSCSI_GET_CONFIG(dev, event_info_size, scsicfg);
+   VTSCSI_GET_CONFIG(dev, sense_size, scsicfg);
+   VTSCSI_GET_CONFIG(dev, cdb_size, scsicfg);
+   VTSCSI_GET_CONFIG(dev, max_channel, scsicfg);
+   VTSCSI_GET_CONFIG(dev, max_target, scsicfg);
+   VTSCSI_GET_CONFIG(dev, max_lun, scsicfg);
+}
+
+#undef VTSCSI_GET_CONFIG
+
 static int
 vtscsi_maximum_segments(struct vtscsi_softc *sc, int seg_max)
 {
___
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: r261150 - head/sys/dev/virtio/network

2014-01-24 Thread Bryan Venteicher
Author: bryanv
Date: Sat Jan 25 07:13:47 2014
New Revision: 261150
URL: http://svnweb.freebsd.org/changeset/base/261150

Log:
  Read and write the MAC address in the config space byte by byte

Modified:
  head/sys/dev/virtio/network/if_vtnet.c

Modified: head/sys/dev/virtio/network/if_vtnet.c
==
--- head/sys/dev/virtio/network/if_vtnet.c  Sat Jan 25 07:01:51 2014
(r261149)
+++ head/sys/dev/virtio/network/if_vtnet.c  Sat Jan 25 07:13:47 2014
(r261150)
@@ -3485,6 +3485,7 @@ static void
 vtnet_set_hwaddr(struct vtnet_softc *sc)
 {
device_t dev;
+   int i;
 
dev = sc->vtnet_dev;
 
@@ -3492,9 +3493,11 @@ vtnet_set_hwaddr(struct vtnet_softc *sc)
if (vtnet_ctrl_mac_cmd(sc, sc->vtnet_hwaddr) != 0)
device_printf(dev, "unable to set MAC address\n");
} else if (sc->vtnet_flags & VTNET_FLAG_MAC) {
-   virtio_write_device_config(dev,
-   offsetof(struct virtio_net_config, mac),
-   sc->vtnet_hwaddr, ETHER_ADDR_LEN);
+   for (i = 0; i < ETHER_ADDR_LEN; i++) {
+   virtio_write_dev_config_1(dev,
+   offsetof(struct virtio_net_config, mac) + i,
+   sc->vtnet_hwaddr[i]);
+   }
}
 }
 
@@ -3502,6 +3505,7 @@ static void
 vtnet_get_hwaddr(struct vtnet_softc *sc)
 {
device_t dev;
+   int i;
 
dev = sc->vtnet_dev;
 
@@ -3519,8 +3523,10 @@ vtnet_get_hwaddr(struct vtnet_softc *sc)
return;
}
 
-   virtio_read_device_config(dev, offsetof(struct virtio_net_config, mac),
-   sc->vtnet_hwaddr, ETHER_ADDR_LEN);
+   for (i = 0; i < ETHER_ADDR_LEN; i++) {
+   sc->vtnet_hwaddr[i] = virtio_read_dev_config_1(dev,
+   offsetof(struct virtio_net_config, mac) + i);
+   }
 }
 
 static void
___
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: r261150 - head/sys/dev/virtio/network

2014-01-24 Thread Alexey Dokuchaev
On Sat, Jan 25, 2014 at 07:13:47AM +, Bryan Venteicher wrote:
> New Revision: 261150
> URL: http://svnweb.freebsd.org/changeset/base/261150
> 
> Log:
>   Read and write the MAC address in the config space byte by byte

Commit log looks incomplete: it does not tell what is the problem and how
(why) committed change fixes it.

./danfe
___
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: r261150 - head/sys/dev/virtio/network

2014-01-24 Thread Bryan Venteicher
On Sat, Jan 25, 2014 at 1:24 AM, Alexey Dokuchaev  wrote:

> On Sat, Jan 25, 2014 at 07:13:47AM +, Bryan Venteicher wrote:
> > New Revision: 261150
> > URL: http://svnweb.freebsd.org/changeset/base/261150
> >
> > Log:
> >   Read and write the MAC address in the config space byte by byte
>
> Commit log looks incomplete: it does not tell what is the problem and how
> (why) committed change fixes it.
>
>
Same reason as for r261149.


> ./danfe
>
___
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: r261151 - head/sys/dev/virtio/network

2014-01-24 Thread Bryan Venteicher
Author: bryanv
Date: Sat Jan 25 07:35:09 2014
New Revision: 261151
URL: http://svnweb.freebsd.org/changeset/base/261151

Log:
  Also include the mbuf's csum_flags in an assert message

Modified:
  head/sys/dev/virtio/network/if_vtnet.c

Modified: head/sys/dev/virtio/network/if_vtnet.c
==
--- head/sys/dev/virtio/network/if_vtnet.c  Sat Jan 25 07:13:47 2014
(r261150)
+++ head/sys/dev/virtio/network/if_vtnet.c  Sat Jan 25 07:35:09 2014
(r261151)
@@ -2027,7 +2027,8 @@ vtnet_txq_offload(struct vtnet_txq *txq,
}
 
KASSERT(hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM,
-   ("%s: mbuf %p TSO without checksum offload", __func__, m));
+   ("%s: mbuf %p TSO without checksum offload %#x",
+   __func__, m, flags));
 
error = vtnet_txq_offload_tso(txq, m, etype, csum_start, hdr);
if (error)
___
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"