svn commit: r269086 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2014-07-25 Thread Xin LI
Author: delphij
Date: Fri Jul 25 06:53:20 2014
New Revision: 269086
URL: http://svnweb.freebsd.org/changeset/base/269086

Log:
  As of r268075, the responsibility of rounding up buffer to optimal size have
  been transferred from zio_compress_data to its caller.  Therefore, passing
  the 'minblocksize' down will be a no-op.
  
  Eliminate the parameter to reduce diff against upstream.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Fri Jul 25 
03:24:00 2014(r269085)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Fri Jul 25 
06:53:20 2014(r269086)
@@ -5205,7 +5205,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd
len = l2hdr-b_asize;
cdata = zio_data_buf_alloc(len);
csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr-b_tmp_cdata,
-   cdata, l2hdr-b_asize, (size_t)(1ULL  
l2hdr-b_dev-l2ad_vdev-vdev_ashift));
+   cdata, l2hdr-b_asize);
 
rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE);
if (rounded  csize) {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h  
Fri Jul 25 03:24:00 2014(r269085)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h  
Fri Jul 25 06:53:20 2014(r269086)
@@ -81,7 +81,7 @@ extern int lz4_decompress(void *src, voi
  * Compress and decompress data if necessary.
  */
 extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst,
-size_t s_len, size_t minblocksize);
+size_t s_len);
 extern int zio_decompress_data(enum zio_compress c, void *src, void *dst,
 size_t s_len, size_t d_len);
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Fri Jul 25 
03:24:00 2014(r269085)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Fri Jul 25 
06:53:20 2014(r269086)
@@ -1160,10 +1160,8 @@ zio_write_bp_init(zio_t **ziop)
}
 
if (compress != ZIO_COMPRESS_OFF) {
-   metaslab_class_t *mc = spa_normal_class(spa);
void *cbuf = zio_buf_alloc(lsize);
-   psize = zio_compress_data(compress, zio-io_data, cbuf, lsize,
-   (size_t)metaslab_class_get_minblocksize(mc));
+   psize = zio_compress_data(compress, zio-io_data, cbuf, lsize);
if (psize == 0 || psize == lsize) {
compress = ZIO_COMPRESS_OFF;
zio_buf_free(cbuf, lsize);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c  Fri Jul 
25 03:24:00 2014(r269085)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c  Fri Jul 
25 06:53:20 2014(r269086)
@@ -97,8 +97,7 @@ zio_compress_select(enum zio_compress ch
 }
 
 size_t
-zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len,
-size_t minblocksize)
+zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len)
 {
uint64_t *word, *word_end;
size_t c_len, d_len;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269087 - head/share/man/man7

2014-07-25 Thread Kevin Lo
Author: kevlo
Date: Fri Jul 25 10:27:36 2014
New Revision: 269087
URL: http://svnweb.freebsd.org/changeset/base/269087

Log:
  Add net80211 and minor cleanup.

Modified:
  head/share/man/man7/hier.7

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Fri Jul 25 06:53:20 2014(r269086)
+++ head/share/man/man7/hier.7  Fri Jul 25 10:27:36 2014(r269087)
@@ -28,7 +28,7 @@
 .\@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\ $FreeBSD$
 .\
-.Dd December 25, 2013
+.Dd July 25, 2014
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -222,6 +222,8 @@ WaveLAN driver
 .El
 .It Pa fs/
 .Bl -tag -width .Pa kerberos5/ -compact
+.It Pa cd9660/
+iso9660 file system
 .It Pa fdescfs/
 per-process file descriptors file system
 .It Pa fifofs/
@@ -261,11 +263,6 @@ STRIPE GEOM class
 .Pp
 .It Pa isc/
 ISC utility library libisc include files
-.It Pa isofs/
-.Bl -tag -width .Pa kerberos5/ -compact
-.It Pa cd9660/
-iso9660 file system
-.El
 .It Pa libmilter/
 C include files for libmilter,
 the
@@ -275,6 +272,10 @@ mail filter API
 machine-specific C include files
 .It Pa net/
 miscellaneous network C include files
+.It Pa net80211/
+C include files for 802.11 wireless networking;
+see
+.Xr net80211 4
 .It Pa netinet/
 C include files for Internet standard protocols;
 see
___
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: r269088 - head/sys/cam/ctl

2014-07-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jul 25 11:29:45 2014
New Revision: 269088
URL: http://svnweb.freebsd.org/changeset/base/269088

Log:
  Fix ctl(4) kldload failure that manifested like this:
  
  link_elf_obj: symbol icl_pdu_new_bhs undefined
  
  PR:   192031
  Submitted by: Nils Beyer (earlier version)
  MFC after:3 days
  Sponsored by: FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Fri Jul 25 10:27:36 2014
(r269087)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Fri Jul 25 11:29:45 2014
(r269088)
@@ -179,6 +179,7 @@ static struct ctl_frontend cfiscsi_front
.ioctl = cfiscsi_ioctl,
 };
 CTL_FRONTEND_DECLARE(ctlcfiscsi, cfiscsi_frontend);
+MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1);
 
 static struct icl_pdu *
 cfiscsi_pdu_new_response(struct icl_pdu *request, int flags)
___
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: r268811 - in head: contrib/byacc contrib/byacc/package contrib/byacc/package/debian contrib/byacc/package/pkgsrc contrib/byacc/test contrib/byacc/test/btyacc contrib/byacc/test/yacc us

2014-07-25 Thread Julio Merino
On Thu, Jul 17, 2014 at 6:22 PM, Baptiste Daroussin b...@freebsd.org wrote:
 Author: bapt
 Date: Thu Jul 17 22:22:38 2014
 New Revision: 268811
 URL: http://svnweb.freebsd.org/changeset/base/268811

 Log:
   Update to byacc 20140715 (only concerns regression tests being fixed)
   Directly use regression test from upstream

   PR:   191020
   Submitted by: gcooper (yaneurab...@gmail.com)

 Added:
   head/usr.bin/yacc/tests/yacc_tests.sh   (contents, props changed)

The tests handling in this change is severely broken.

The following files were removed from /usr/tests:

-/usr/tests/usr.bin/yacc/Kyuafile
-/usr/tests/usr.bin/yacc/ftp.y
-/usr/tests/usr.bin/yacc/legacy_test
-/usr/tests/usr.bin/yacc/regress.00.out
-/usr/tests/usr.bin/yacc/regress.01.out
-/usr/tests/usr.bin/yacc/regress.02.out
-/usr/tests/usr.bin/yacc/regress.03.out
-/usr/tests/usr.bin/yacc/regress.04.out
-/usr/tests/usr.bin/yacc/regress.05.out
-/usr/tests/usr.bin/yacc/regress.06.out
-/usr/tests/usr.bin/yacc/regress.07.out
-/usr/tests/usr.bin/yacc/regress.08.out
-/usr/tests/usr.bin/yacc/regress.09.out
-/usr/tests/usr.bin/yacc/regress.10.out
-/usr/tests/usr.bin/yacc/regress.11.out
-/usr/tests/usr.bin/yacc/regress.12.out
-/usr/tests/usr.bin/yacc/regress.13.out
-/usr/tests/usr.bin/yacc/regress.14.out
-/usr/tests/usr.bin/yacc/regress.sh
-/usr/tests/usr.bin/yacc/undefined.y

... yet no entries exist in OptionalObsoleteFiles.mk for them.

Also, note that the Kyuafile is now gone so these tests are useless
where they are as they cannot be executed.

Please fix.
___
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: r269089 - head/games/fortune/datfiles

2014-07-25 Thread Allan Jude
Author: allanjude (doc committer)
Date: Fri Jul 25 14:47:44 2014
New Revision: 269089
URL: http://svnweb.freebsd.org/changeset/base/269089

Log:
  Update the freebsd-tips example to use drill instead of dig since bind is no 
longer in base
  
  CR:   D460
  Approved by:  bcr (mentor)

Modified:
  head/games/fortune/datfiles/freebsd-tips

Modified: head/games/fortune/datfiles/freebsd-tips
==
--- head/games/fortune/datfiles/freebsd-tipsFri Jul 25 11:29:45 2014
(r269088)
+++ head/games/fortune/datfiles/freebsd-tipsFri Jul 25 14:47:44 2014
(r269089)
@@ -231,10 +231,10 @@ is running FreeBSD at the time) to quick
 To erase a line you've written at the command prompt, use Ctrl-U.
-- Dru gene...@istar.ca
 %
-To find out the hostname associated with an IP address, use
+To find the hostname associated with an IP address, use
 
-   dig -x IP_address
-   -- Dru gene...@istar.ca
+   drill -x IP_address
+   -- Allan Jude allanj...@freebsd.org
 %
 To obtain a neat PostScript rendering of a manual page, use ``-t'' switch
 of the man(1) utility: ``man -t topic''.  For example:
___
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: r269091 - head/sbin/setkey

2014-07-25 Thread Warren Block
Author: wblock (doc committer)
Date: Fri Jul 25 17:09:48 2014
New Revision: 269091
URL: http://svnweb.freebsd.org/changeset/base/269091

Log:
  Fix spelling of Camellia algorithm.  While here, replace blank lines
  between examples with actual .Pp breaks.
  
  PR:   192067
  Submitted by: dmitry2...@yandex.ru
  MFC after:1 week

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Fri Jul 25 15:07:07 2014(r269090)
+++ head/sbin/setkey/setkey.8   Fri Jul 25 17:09:48 2014(r269091)
@@ -29,7 +29,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd May 13, 2006
+.Dd July 25, 2014
 .Dt SETKEY 8
 .Os
 .\
@@ -514,7 +514,7 @@ the SA from the key exchange daemon.
 A value of
 .Li default
 tells the kernel to use the system wide default protocol
-e.g.\ the one from the
+e.g.,\ the one from the
 .Li esp_trans_deflev
 sysctl variable, when the kernel processes the packet.
 A value of
@@ -627,7 +627,7 @@ des-deriv   64  ipsec-ciph-des-derived-01
 3des-deriv 192 no document
 rijndael-cbc   128/192/256 rfc3602
 aes-ctr160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03
-camllia-cbc128/192/256 rfc4312
+camellia-cbc   128/192/256 rfc4312
 .Ed
 .Pp
 Note that the first 128/192/256 bits of a key for
@@ -656,47 +656,46 @@ des-cbc encryption algorithm.
 .Bd -literal -offset indent
 add 3ffe:501:4819::1 3ffe:501:481d::1 esp 123457
-E des-cbc 0x3ffe05014819 ;
-
+.Pp
 .Ed
 .\
 Add an authentication SA between two FQDN specified hosts:
 .Bd -literal -offset indent
 add -6 myhost.example.com yourhost.example.com ah 123456
-A hmac-sha1 AH SA configuration! ;
-
+.Pp
 .Ed
 Use both ESP and AH between two numerically specified hosts:
 .Bd -literal -offset indent
 add 10.0.11.41 10.0.11.33 esp 0x10001
-E des-cbc 0x3ffe05014819
-A hmac-md5 authentication!! ;
-
+.Pp
 .Ed
 Get the SA information associated with first example above:
 .Bd -literal -offset indent
 get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ;
-
+.Pp
 .Ed
 Flush all entries from the database:
 .Bd -literal -offset indent
 flush ;
-
+.Pp
 .Ed
 Dump the ESP entries from the database:
 .Bd -literal -offset indent
 dump esp ;
-
+.Pp
 .Ed
 Add a security policy between two networks that uses ESP in tunnel mode:
 .Bd -literal -offset indent
 spdadd 10.0.11.41/32[21] 10.0.11.33/32[any] any
-P out ipsec esp/tunnel/192.168.0.1-192.168.1.2/require ;
-
+.Pp
 .Ed
 Use TCP MD5 between two numerically specified hosts:
 .Bd -literal -offset indent
 add 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 TCP-MD5 BGP secret ;
-
 .Ed
 .\
 .Sh SEE ALSO
___
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: r269092 - head/usr.bin/elfdump

2014-07-25 Thread Ed Maste
Author: emaste
Date: Fri Jul 25 18:20:56 2014
New Revision: 269092
URL: http://svnweb.freebsd.org/changeset/base/269092

Log:
  elfdump: Improve section type reporting
  
  The SHT range 0x7000-0x7fff is processor-specific.  Pass the
  ELF machine type header to sh_types so the section header type name can
  be reported correctly for the given processor.
  
  For all ranges report the actual value for unknown types.
  
  Add MIPS-specific type SHT_MIPS_OPTIONS.
  
  CR:   D483
  Reviewed by:  sbruno, marcel
  Sponsored by: DARPA, AFRL

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Fri Jul 25 17:09:48 2014
(r269091)
+++ head/usr.bin/elfdump/elfdump.c  Fri Jul 25 18:20:56 2014
(r269092)
@@ -303,40 +303,76 @@ static const char *p_flags[] = {
 
 /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */
 static const char *
-sh_types(u_int64_t sht) {
-   switch (sht) {
-   case 0: return SHT_NULL;
-   case 1: return SHT_PROGBITS;
-   case 2: return SHT_SYMTAB;
-   case 3: return SHT_STRTAB;
-   case 4: return SHT_RELA;
-   case 5: return SHT_HASH;
-   case 6: return SHT_DYNAMIC;
-   case 7: return SHT_NOTE;
-   case 8: return SHT_NOBITS;
-   case 9: return SHT_REL;
-   case 10: return SHT_SHLIB;
-   case 11: return SHT_DYNSYM;
-   case 14: return SHT_INIT_ARRAY;
-   case 15: return SHT_FINI_ARRAY;
-   case 16: return SHT_PREINIT_ARRAY;
-   case 17: return SHT_GROUP;
-   case 18: return SHT_SYMTAB_SHNDX;
-   /* 0x6000 - 0x6fff operating system-specific semantics */
-   case 0x6ff0: return XXX:VERSYM;
-   case 0x6ff4: return SHT_SUNW_dof;
-   case 0x6ff7: return SHT_GNU_LIBLIST;
-   case 0x6ffc: return XXX:VERDEF;
-   case 0x6ffd: return SHT_SUNW(GNU)_verdef;
-   case 0x6ffe: return SHT_SUNW(GNU)_verneed;
-   case 0x6fff: return SHT_SUNW(GNU)_versym;
-   /* 0x7000 - 0x7fff processor-specific semantics */
-   case 0x7000: return SHT_IA_64_EXT;
-   case 0x7001: return SHT_IA_64_UNWIND;
-   case 0x7ffd: return XXX:AUXILIARY;
-   case 0x7fff: return XXX:FILTER;
-   /* 0x8000 - 0x application programs */
-   default: return ERROR: SHT NOT DEFINED;
+sh_types(uint64_t machine, uint64_t sht) {
+   static char unknown_buf[64]; 
+
+   if (sht  0x6000) {
+   switch (sht) {
+   case 0: return SHT_NULL;
+   case 1: return SHT_PROGBITS;
+   case 2: return SHT_SYMTAB;
+   case 3: return SHT_STRTAB;
+   case 4: return SHT_RELA;
+   case 5: return SHT_HASH;
+   case 6: return SHT_DYNAMIC;
+   case 7: return SHT_NOTE;
+   case 8: return SHT_NOBITS;
+   case 9: return SHT_REL;
+   case 10: return SHT_SHLIB;
+   case 11: return SHT_DYNSYM;
+   case 14: return SHT_INIT_ARRAY;
+   case 15: return SHT_FINI_ARRAY;
+   case 16: return SHT_PREINIT_ARRAY;
+   case 17: return SHT_GROUP;
+   case 18: return SHT_SYMTAB_SHNDX;
+   }
+   snprintf(unknown_buf, sizeof(unknown_buf),
+   ERROR: SHT %ju NOT DEFINED, (uintmax_t)sht);
+   return (unknown_buf);
+   } else if (sht  0x7000) {
+   /* 0x6000-0x6fff operating system-specific semantics */
+   switch (sht) {
+   case 0x6ff0: return XXX:VERSYM;
+   case 0x6ff4: return SHT_SUNW_dof;
+   case 0x6ff7: return SHT_GNU_LIBLIST;
+   case 0x6ffc: return XXX:VERDEF;
+   case 0x6ffd: return SHT_SUNW(GNU)_verdef;
+   case 0x6ffe: return SHT_SUNW(GNU)_verneed;
+   case 0x6fff: return SHT_SUNW(GNU)_versym;
+   }
+   snprintf(unknown_buf, sizeof(unknown_buf),
+   ERROR: OS-SPECIFIC SHT 0x%jx NOT DEFINED,
+(uintmax_t)sht);
+   return (unknown_buf);
+   } else if (sht  0x8000) {
+   /* 0x7000-0x7fff processor-specific semantics */
+   switch (machine) {
+   case EM_MIPS:
+   switch (sht) {
+   case 0x700d: return SHT_MIPS_OPTIONS;
+   }
+   break;
+   case EM_IA_64:
+   switch (sht) {
+   case 0x7000: return SHT_IA_64_EXT;
+   case 0x7001: return SHT_IA_64_UNWIND;
+   }
+   break;
+   }
+   switch (sht) {
+   case 

svn commit: r269093 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-07-25 Thread Xin LI
Author: delphij
Date: Fri Jul 25 18:41:56 2014
New Revision: 269093
URL: http://svnweb.freebsd.org/changeset/base/269093

Log:
  Transform the I/O when vdev_physical_ashift is greater than
  SPA_MINBLOCKSHIFT.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Fri Jul 25 
18:20:56 2014(r269092)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Fri Jul 25 
18:41:56 2014(r269093)
@@ -2622,7 +2622,8 @@ zio_vdev_io_start(zio_t **ziop)
 
align = 1ULL  vd-vdev_top-vdev_ashift;
 
-   if (!(zio-io_flags  ZIO_FLAG_PHYSICAL) 
+   if ((!(zio-io_flags  ZIO_FLAG_PHYSICAL) ||
+   (vd-vdev_top-vdev_physical_ashift  SPA_MINBLOCKSHIFT)) 
P2PHASE(zio-io_size, align) != 0) {
/* Transform logical writes to be a full physical block size. */
uint64_t asize = P2ROUNDUP(zio-io_size, align);
___
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: r269094 - head/usr.sbin/bhyve

2014-07-25 Thread Neel Natu
Author: neel
Date: Fri Jul 25 20:18:35 2014
New Revision: 269094
URL: http://svnweb.freebsd.org/changeset/base/269094

Log:
  Simplify the meaning of return values from the inout handlers. After this
  change 0 means success and non-zero means failure.
  
  This also helps to eliminate VMEXIT_POWEROFF and VMEXIT_RESET as return values
  from VM-exit handlers.
  
  CR:   D480
  Reviewed by:  grehan, jhb

Modified:
  head/usr.sbin/bhyve/atkbdc.c
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/bhyverun.h
  head/usr.sbin/bhyve/inout.c
  head/usr.sbin/bhyve/inout.h
  head/usr.sbin/bhyve/pm.c

Modified: head/usr.sbin/bhyve/atkbdc.c
==
--- head/usr.sbin/bhyve/atkbdc.cFri Jul 25 18:41:56 2014
(r269093)
+++ head/usr.sbin/bhyve/atkbdc.cFri Jul 25 20:18:35 2014
(r269094)
@@ -31,6 +31,10 @@ __FBSDID($FreeBSD$);
 
 #include machine/vmm.h
 
+#include vmmapi.h
+
+#include assert.h
+#include errno.h
 #include stdio.h
 
 #include inout.h
@@ -48,29 +52,30 @@ atkbdc_data_handler(struct vmctx *ctx, i
 uint32_t *eax, void *arg)
 {
if (bytes != 1)
-   return (INOUT_ERROR);
+   return (-1);
 
*eax = 0;
 
-   return (INOUT_OK);
+   return (0);
 }
 
 static int
 atkbdc_sts_ctl_handler(struct vmctx *ctx, int vcpu, int in, int port,
 int bytes, uint32_t *eax, void *arg)
 {
-   int retval;
+   int error, retval;
 
if (bytes != 1)
-   return (INOUT_ERROR);
+   return (-1);
 
-   retval = INOUT_OK;
+   retval = 0;
if (in) {
*eax = KBD_SYS_FLAG;/* system passed POST */
} else {
switch (*eax) {
case KBDC_RESET:/* Pulse reset line. */
-   retval = INOUT_RESET;
+   error = vm_suspend(ctx, VM_SUSPEND_RESET);
+   assert(error == 0 || errno == EALREADY);
break;
}
}

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Fri Jul 25 18:41:56 2014
(r269093)
+++ head/usr.sbin/bhyve/bhyverun.c  Fri Jul 25 20:18:35 2014
(r269094)
@@ -107,8 +107,6 @@ struct bhyvestats {
 uint64_tvmexit_inst_emul;
 uint64_tcpu_switch_rotate;
 uint64_tcpu_switch_direct;
-int io_reset;
-   int io_poweroff;
 } stats;
 
 struct mt_vmm_info {
@@ -331,27 +329,18 @@ vmexit_inout(struct vmctx *ctx, struct v
}
 
error = emulate_inout(ctx, vcpu, vme, strictio);
-   if (error == INOUT_OK  in  !string) {
+   if (!error  in  !string) {
error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX,
vme-u.inout.eax);
+   assert(error == 0);
}
 
-   switch (error) {
-   case INOUT_OK:
-   return (VMEXIT_CONTINUE);
-   case INOUT_RESTART:
-   return (VMEXIT_RESTART);
-   case INOUT_RESET:
-   stats.io_reset++;
-   return (VMEXIT_RESET);
-   case INOUT_POWEROFF:
-   stats.io_poweroff++;
-   return (VMEXIT_POWEROFF);
-   default:
-   fprintf(stderr, Unhandled %s%c 0x%04x\n,
-   in ? in : out,
-   bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port);
+   if (error) {
+   fprintf(stderr, Unhandled %s%c 0x%04x\n, in ? in : out,
+   bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port);
return (VMEXIT_ABORT);
+   } else {
+   return (VMEXIT_CONTINUE);
}
 }
 
@@ -581,7 +570,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin
 {
int error, rc, prevcpu;
enum vm_exitcode exitcode;
-   enum vm_suspend_how how;
cpuset_t active_cpus;
 
if (vcpumap[vcpu] != NULL) {
@@ -616,16 +604,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin
case VMEXIT_RESTART:
 rip = vmexit[vcpu].rip;
break;
-   case VMEXIT_RESET:
-   case VMEXIT_POWEROFF:
-   if (rc == VMEXIT_RESET)
-   how = VM_SUSPEND_RESET;
-   else
-   how = VM_SUSPEND_POWEROFF;
-   error = vm_suspend(ctx, how);
-   assert(error == 0 || errno == EALREADY);
-rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length;
-   break;
case VMEXIT_ABORT:
abort();
default:

Modified: head/usr.sbin/bhyve/bhyverun.h
==
--- head/usr.sbin/bhyve/bhyverun.h  Fri Jul 

svn commit: r269095 - head/sys/kern

2014-07-25 Thread Daniel Eischen
Author: deischen
Date: Fri Jul 25 20:21:02 2014
New Revision: 269095
URL: http://svnweb.freebsd.org/changeset/base/269095

Log:
  Insert new threads at the end of the thread list in the process
  instead of at the beginning.  This allows an intra process signal
  to be sent to the oldest thread with the signal unmasked - which,
  if it still exists, is the main thread.  This mimics behavior
  found in Linux and Solaris.

Modified:
  head/sys/kern/kern_thread.c

Modified: head/sys/kern/kern_thread.c
==
--- head/sys/kern/kern_thread.c Fri Jul 25 20:18:35 2014(r269094)
+++ head/sys/kern/kern_thread.c Fri Jul 25 20:21:02 2014(r269095)
@@ -546,7 +546,7 @@ thread_link(struct thread *td, struct pr
LIST_INIT(td-td_lprof[1]);
sigqueue_init(td-td_sigqueue, p);
callout_init(td-td_slpcallout, CALLOUT_MPSAFE);
-   TAILQ_INSERT_HEAD(p-p_threads, td, td_plist);
+   TAILQ_INSERT_TAIL(p-p_threads, td, td_plist);
p-p_numthreads++;
 }
 
___
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: r269097 - head/tools/test/netfibs

2014-07-25 Thread Xin LI
Author: delphij
Date: Fri Jul 25 20:49:59 2014
New Revision: 269097
URL: http://svnweb.freebsd.org/changeset/base/269097

Log:
  Use the right length.
  
  Submitted by: Sascha Wildner
  MFC after:2 weeks

Modified:
  head/tools/test/netfibs/reflect.c

Modified: head/tools/test/netfibs/reflect.c
==
--- head/tools/test/netfibs/reflect.c   Fri Jul 25 20:44:04 2014
(r269096)
+++ head/tools/test/netfibs/reflect.c   Fri Jul 25 20:49:59 2014
(r269097)
@@ -94,7 +94,7 @@ reflect_conn(int s, char *buf, size_t bu
fprintf(stderr,  %s: %s\n, testcase, buf);
 
if (reflectfib != (u_int)-1)
-   l = snprintf(buf, sizeof(buf), FIB %u\n, reflectfib);
+   l = snprintf(buf, buflen, FIB %u\n, reflectfib);
 
/* If debug is on, log. */
if (debug  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: r269098 - in head/tools/regression/net80211: ccmp wep

2014-07-25 Thread Xin LI
Author: delphij
Date: Fri Jul 25 20:54:10 2014
New Revision: 269098
URL: http://svnweb.freebsd.org/changeset/base/269098

Log:
  Use the right lengths.
  
  Submitted by: Sascha Wildner
  MFC after:2 weeks

Modified:
  head/tools/regression/net80211/ccmp/test_ccmp.c
  head/tools/regression/net80211/wep/test_wep.c

Modified: head/tools/regression/net80211/ccmp/test_ccmp.c
==
--- head/tools/regression/net80211/ccmp/test_ccmp.c Fri Jul 25 20:49:59 
2014(r269097)
+++ head/tools/regression/net80211/ccmp/test_ccmp.c Fri Jul 25 20:54:10 
2014(r269098)
@@ -680,7 +680,7 @@ runtest(struct ieee80211com *ic, struct 
printf(FAIL: decap botch; data does not compare\n);
printtest(t);
cmpfail(mtod(m, const void *), m-m_pkthdr.len,
-   t-plaintext, sizeof(t-plaintext));
+   t-plaintext, t_plaintext_len);
goto bad;
}
m_freem(m);

Modified: head/tools/regression/net80211/wep/test_wep.c
==
--- head/tools/regression/net80211/wep/test_wep.c   Fri Jul 25 20:49:59 
2014(r269097)
+++ head/tools/regression/net80211/wep/test_wep.c   Fri Jul 25 20:54:10 
2014(r269098)
@@ -242,7 +242,7 @@ runtest(struct ieee80211com *ic, struct 
} else if (memcmp(mtod(m, const void *), t-plaintext, 
t-plaintext_len)) {
printf(FAIL: decap botch; data does not compare\n);
cmpfail(mtod(m, const void *), m-m_pkthdr.len,
-   t-plaintext, sizeof(t-plaintext));
+   t-plaintext, t-plaintext_len);
goto bad;
}
 
___
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: r269099 - head/share/mk

2014-07-25 Thread Warner Losh
Author: imp
Date: Fri Jul 25 21:10:30 2014
New Revision: 269099
URL: http://svnweb.freebsd.org/changeset/base/269099

Log:
  Document an important, but easy to overlook without grepping the
  entire tree, detail about LDFLAGS.

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEFri Jul 25 20:54:10 2014(r269098)
+++ head/share/mk/bsd.READMEFri Jul 25 21:10:30 2014(r269099)
@@ -231,7 +231,9 @@ LDADD   Additional loader objects.  Usual
 
LDADD=-lutil -lcompat
 
-LDFLAGSAdditional loader flags.
+LDFLAGSAdditional loader flags. Passed to the loader via CC,
+   since that's used to link programs as well, so loader
+   specific flags need to be prefixed with -Wl, to work.
 
 LINKS  The list of binary links; should be full pathnames, the
linked-to file coming first, followed by the linked
___
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: r269100 - head/cddl/contrib/opensolaris/cmd/zpool

2014-07-25 Thread Xin LI
Author: delphij
Date: Fri Jul 25 22:58:55 2014
New Revision: 269100
URL: http://svnweb.freebsd.org/changeset/base/269100

Log:
  Diff reduction against Illumos.
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Jul 25 21:10:30 
2014(r269099)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Jul 25 22:58:55 
2014(r269100)
@@ -26,7 +26,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 14, 2014
+.Dd July 25, 2014
 .Dt ZPOOL 8
 .Os
 .Sh NAME
@@ -556,7 +556,12 @@ will decrease while
 .Sy free
 increases.
 .It Sy expandsize
-This property has currently no value on FreeBSD.
+Amount of uninitialized space within the pool or device that can be used to
+increase the total capacity of the pool.
+Uninitialized space consists of
+any space on an EFI labeled vdev which has not been brought online
+.Pq i.e. zpool online -e .
+This space occurs when a LUN is dynamically expanded.
 .It Sy guid
 A unique identifier for the pool.
 .It Sy health
@@ -1391,7 +1396,10 @@ instead of arbitrary space.
 .It Fl p
 Display numbers in parsable (exact) values.
 .It Fl v
-Show more detailed information.
+Verbose statistics. Reports usage statistics for individual
+.Em vdevs
+within
+the pool, in addition to the pool-wide statistics.
 .It Fl o Ar property Ns Op , Ns Ar ...
 Comma-separated list of properties to display. See the
 .Qq Sx Properties
@@ -1400,6 +1408,7 @@ section for a list of valid properties. 
 .Sy size ,
 .Sy used ,
 .Sy available ,
+.Sy expandsize ,
 .Sy capacity  ,
 .Sy health ,
 .Sy altroot .
@@ -1785,9 +1794,9 @@ is immediately available to any datasets
 The following command lists all available pools on the system.
 .Bd -literal -offset 2n
 .Li # Ic zpool list
-NAME   SIZE  ALLOC   FREECAP  DEDUP  HEALTH  ALTROOT
-pool  2.70T   473G  2.24T17%  1.00x  ONLINE  -
-test  1.98G  89.5K  1.98G 0%  1.00x  ONLINE  -
+NAME   SIZE  ALLOC   FREE  EXPANDSZCAP  DEDUP  HEALTH  ALTROOT
+pool  2.70T   473G  2.24T -17%  1.00x  ONLINE  -
+test  1.98G  89.5K  1.98G - 0%  1.00x  ONLINE  -
 .Ed
 .It Sy Example 7 No Listing All Properties for a Pool
 .Pp

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cFri Jul 25 
21:10:30 2014(r269099)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cFri Jul 25 
22:58:55 2014(r269100)
@@ -3031,7 +3031,7 @@ zpool_do_list(int argc, char **argv)
int ret;
list_cbdata_t cb = { 0 };
static char default_props[] =
-   name,size,allocated,free,capacity,dedupratio,
+   name,size,allocated,free,expandsize,capacity,dedupratio,
health,altroot;
char *props = default_props;
unsigned long interval = 0, 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


svn commit: r269105 - in head/sys: arm/arm kern mips/mips powerpc/powerpc sparc64/sparc64 sys x86/x86

2014-07-25 Thread Gavin Atkinson
Author: gavin
Date: Fri Jul 25 23:52:53 2014
New Revision: 269105
URL: http://svnweb.freebsd.org/changeset/base/269105

Log:
  Add error return to dumpsys(), and use it in doadump().
  
  This commit does not add error returns to minidumpsys() or
  textdump_dumpsys(); those can also be added later.
  
  Submitted by: Conrad Meyer (EMC / Isilon storage division)

Modified:
  head/sys/arm/arm/dump_machdep.c
  head/sys/kern/kern_shutdown.c
  head/sys/mips/mips/dump_machdep.c
  head/sys/powerpc/powerpc/dump_machdep.c
  head/sys/sparc64/sparc64/dump_machdep.c
  head/sys/sys/conf.h
  head/sys/x86/x86/dump_machdep.c

Modified: head/sys/arm/arm/dump_machdep.c
==
--- head/sys/arm/arm/dump_machdep.c Fri Jul 25 23:36:39 2014
(r269104)
+++ head/sys/arm/arm/dump_machdep.c Fri Jul 25 23:52:53 2014
(r269105)
@@ -271,7 +271,7 @@ foreach_chunk(callback_t cb, void *arg)
return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
Elf_Ehdr ehdr;
@@ -282,7 +282,7 @@ dumpsys(struct dumperinfo *di)
 
if (do_minidump) {
minidumpsys(di);
-   return;
+   return (0);
}
 
bzero(ehdr, sizeof(ehdr));
@@ -368,7 +368,7 @@ dumpsys(struct dumperinfo *di)
/* Signal completion, signoff and exit stage left. */
dump_write(di, NULL, 0, 0, 0);
printf(\nDump complete\n);
-   return;
+   return (0);
 
  fail:
if (error  0)
@@ -380,4 +380,5 @@ dumpsys(struct dumperinfo *di)
printf(\nDump failed. Partition too small.\n);
else
printf(\n** DUMP FAILED (ERROR %d) **\n, error);
+   return (error);
 }

Modified: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Fri Jul 25 23:36:39 2014
(r269104)
+++ head/sys/kern/kern_shutdown.c   Fri Jul 25 23:52:53 2014
(r269105)
@@ -249,7 +249,9 @@ int
 doadump(boolean_t textdump)
 {
boolean_t coredump;
+   int error;
 
+   error = 0;
if (dumping)
return (EBUSY);
if (dumper.dumper == NULL)
@@ -267,10 +269,10 @@ doadump(boolean_t textdump)
}
 #endif
if (coredump)
-   dumpsys(dumper);
+   error = dumpsys(dumper);
 
dumping--;
-   return (0);
+   return (error);
 }
 
 static int

Modified: head/sys/mips/mips/dump_machdep.c
==
--- head/sys/mips/mips/dump_machdep.c   Fri Jul 25 23:36:39 2014
(r269104)
+++ head/sys/mips/mips/dump_machdep.c   Fri Jul 25 23:52:53 2014
(r269105)
@@ -257,7 +257,7 @@ foreach_chunk(callback_t cb, void *arg)
return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
Elf_Ehdr ehdr;
@@ -268,7 +268,7 @@ dumpsys(struct dumperinfo *di)
 
if (do_minidump) {
minidumpsys(di);
-   return;
+   return (0);
}
 
bzero(ehdr, sizeof(ehdr));
@@ -354,7 +354,7 @@ dumpsys(struct dumperinfo *di)
/* Signal completion, signoff and exit stage left. */
dump_write(di, NULL, 0, 0, 0);
printf(\nDump complete\n);
-   return;
+   return (0);
 
  fail:
if (error  0)
@@ -366,4 +366,5 @@ dumpsys(struct dumperinfo *di)
printf(\nDump failed. Partition too small.\n);
else
printf(\n** DUMP FAILED (ERROR %d) **\n, error);
+   return (error);
 }

Modified: head/sys/powerpc/powerpc/dump_machdep.c
==
--- head/sys/powerpc/powerpc/dump_machdep.c Fri Jul 25 23:36:39 2014
(r269104)
+++ head/sys/powerpc/powerpc/dump_machdep.c Fri Jul 25 23:52:53 2014
(r269105)
@@ -205,7 +205,7 @@ foreach_chunk(callback_t cb, void *arg)
return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
Elf_Ehdr ehdr;
@@ -299,7 +299,7 @@ dumpsys(struct dumperinfo *di)
/* Signal completion, signoff and exit stage left. */
dump_write(di, NULL, 0, 0, 0);
printf(\nDump complete\n);
-   return;
+   return (0);
 
  fail:
if (error  0)
@@ -311,4 +311,5 @@ dumpsys(struct dumperinfo *di)
printf(\nDump failed. Partition too small.\n);
else
printf(\n** DUMP FAILED (ERROR %d) **\n, error);
+   return (error);
 }

Modified: head/sys/sparc64/sparc64/dump_machdep.c
==
--- head/sys/sparc64/sparc64/dump_machdep.c Fri Jul 25 23:36:39 2014
(r269104)
+++ head/sys/sparc64/sparc64/dump_machdep.c Fri Jul 25 23:52:53 2014
(r269105)
@@ -142,7 +142,7 @@ blk_dump(struct dumperinfo *di, vm_paddr
return (error);
 }
 
-void
+int
 

Re: svn commit: r268494 - in head: lib/libsbuf sys/kern sys/sys

2014-07-25 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 07/10/14 06:08, Pietro Cerutti wrote:
 Author: gahr (ports committer) Date: Thu Jul 10 13:08:51 2014 New
 Revision: 268494 URL:
 http://svnweb.freebsd.org/changeset/base/268494
 
 Log: Implement Short/Small String Optimization in SBUF(9) and
 change lengths and positions in the API from ssize_t and int to
 size_t.
 
 CR:   D388 Approved by:   des, bapt

Please fix the ABI breakage by creating the compatibility shims or
revert this change for now.

Once a library have converted to use versioned symbols, we are
promising not to break ABI compatibility and it's not Okay to break
that promise.

Cheers,
- -- 
Xin LI delp...@delphij.nethttps://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0

iQIcBAEBCgAGBQJT0u+vAAoJEJW2GBstM+nsokoP/jz6o84f/NAwlWeMjBdYEXBk
vYBLZN8tWNNwppykdkiFps67HYBgaVI2rIKHfcIRaNT4BG1MdQ78jaes6NEukbBz
wJAeggpsJh8DuzfBEKDuXSG7VGfdrjaPa5PwfANgnwxFy8aagZA1xAyy6l9lUIqq
J+hWtmIbZSttn3nlyYQXVjcsCaOaCAn4HMBdfAMNV+4LJtNNDGhrwL5kUncLAru3
9PdFqgjJPuvbaI10L6vSIbthHnAj8pVtNsRj7W54zjkMvhfweT66hajDNMvmgc5O
9BcFNqCmtemqpVDf3gRPfwTIaoPgbHnJnZPrJ+Ria2D/S3HnFRr96wCGYiy6yP1x
G9Raf8/6qKDZ3WxjCJIOly6KVbKQxroy7SL59SW1h5LX9mgq5lqrkDeL9lRiLzwB
7LNzrGfvVUsufnLy0DQk9tiMGx4UTTjUFYcWWGK6m214lxJ/4+Zv6DlYU4m21Teg
OqsuL/W78j0/1x0j+d7tHP4uucISQHF8suehXhGTbdpio7Mi4G6SzeZfqpYXW6HP
ZwRvDJuiG8Q6o1V3Uhf+HvvEifjzm4779nycSyzq7T2qlRRU9Gs6rdJmRcR6E+pR
1iVQPNSDh4M/6GQ/NySxY8Xd1pdSvYumDzjh12RULY2agHuccYRhkRQWLLBqtV/U
wrS+hdXjlum9ZCoZRsn6
=FR8o
-END PGP SIGNATURE-
___
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: r269106 - head/tools/tools/cxgbetool

2014-07-25 Thread Navdeep Parhar
Author: np
Date: Sat Jul 26 00:51:45 2014
New Revision: 269106
URL: http://svnweb.freebsd.org/changeset/base/269106

Log:
  Add a 'raw' parameter to the 'modinfo' subcommand.  This is handy when
  trying to figure out why a QSFP+/SFP+ connector or cable wasn't
  identified correctly by cxgbe(4).  Its output looks like this:
  
  # cxgbetool t5nex0 modinfo 0 raw
  00:  03 04 21 00  00 00 00 00  ..!. 
  08:  04 00 00 00  67 00 00 00   g...
  10:  00 00 05 00  41 6d 70 68   Amph
  18:  65 6e 6f 6c  20 20 20 20  enol
  20:  20 20 20 20  00 41 50 48   .APH
  28:  35 37 31 35  34 30 30 30  5715 4000
  30:  33 20 20 20  20 20 20 20  3
  38:  4b 20 20 20  01 00 00 fa  K
  40:  00 00 00 00  41 50 46 31   APF1
  48:  30 30 34 30  30 33 30 30  0040 0300
  50:  30 33 20 20  31 30 30 31  03   1001
  58:  33 30 20 20  00 00 00 97  30   
  
  MFC after:3 days

Modified:
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/tools/tools/cxgbetool/cxgbetool.c
==
--- head/tools/tools/cxgbetool/cxgbetool.c  Fri Jul 25 23:52:53 2014
(r269105)
+++ head/tools/tools/cxgbetool/cxgbetool.c  Sat Jul 26 00:51:45 2014
(r269106)
@@ -95,7 +95,7 @@ usage(FILE *fp)
\ti2c port devaddr addr [len] read from i2c device\n
\tloadfw fw-image.bin   install firmware\n
\tmemdump addr lendump a memory range\n
-   \tmodinfo port  optics/cable information\n
+   \tmodinfo port [raw]optics/cable information\n
\treg address[=val]   read/write register\n
\treg64 address[=val] read/write 64 bit register\n
\tregdump [module] ...  dump registers\n
@@ -1873,6 +1873,41 @@ tracer_cmd(int argc, const char *argv[])
 }
 
 static int
+modinfo_raw(int port_id)
+{
+   uint8_t offset;
+   struct t4_i2c_data i2cd;
+   int rc;
+
+   for (offset = 0; offset  96; offset += sizeof(i2cd.data)) {
+   bzero(i2cd, sizeof(i2cd));
+   i2cd.port_id = port_id;
+   i2cd.dev_addr = 0xa0;
+   i2cd.offset = offset;
+   i2cd.len = sizeof(i2cd.data);
+   rc = doit(CHELSIO_T4_GET_I2C, i2cd);
+   if (rc != 0)
+   return (rc);
+   printf(%02x:  %02x %02x %02x %02x  %02x %02x %02x %02x,
+   offset, i2cd.data[0], i2cd.data[1], i2cd.data[2],
+   i2cd.data[3], i2cd.data[4], i2cd.data[5], i2cd.data[6],
+   i2cd.data[7]);
+
+   printf(  %c%c%c%c %c%c%c%c\n,
+   isprint(i2cd.data[0]) ? i2cd.data[0] : '.',
+   isprint(i2cd.data[1]) ? i2cd.data[1] : '.',
+   isprint(i2cd.data[2]) ? i2cd.data[2] : '.',
+   isprint(i2cd.data[3]) ? i2cd.data[3] : '.',
+   isprint(i2cd.data[4]) ? i2cd.data[4] : '.',
+   isprint(i2cd.data[5]) ? i2cd.data[5] : '.',
+   isprint(i2cd.data[6]) ? i2cd.data[6] : '.',
+   isprint(i2cd.data[7]) ? i2cd.data[7] : '.');
+   }
+
+   return (0);
+}
+
+static int
 modinfo(int argc, const char *argv[])
 {
long port;
@@ -1881,17 +1916,31 @@ modinfo(int argc, const char *argv[])
int rc, i;
uint16_t temp, vcc, tx_bias, tx_power, rx_power;
 
-   if (argc != 1) {
+   if (argc  1) {
warnx(must supply a port);
return (EINVAL);
}
 
+   if (argc  2) {
+   warnx(too many arguments);
+   return (EINVAL);
+   }
+
p = str_to_number(argv[0], port, NULL);
if (*p || port  UCHAR_MAX) {
warnx(invalid port id \%s\, argv[0]);
return (EINVAL);
}
 
+   if (argc == 2) {
+   if (!strcmp(argv[1], raw))
+   return (modinfo_raw(port));
+   else {
+   warnx(second argument can only be \raw\);
+   return (EINVAL);
+   }
+   }
+
bzero(i2cd, sizeof(i2cd));
i2cd.len = 1;
i2cd.port_id = port;
___
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: r269108 - head/sys/amd64/vmm

2014-07-25 Thread Neel Natu
Author: neel
Date: Sat Jul 26 02:51:46 2014
New Revision: 269108
URL: http://svnweb.freebsd.org/changeset/base/269108

Log:
  Don't return -1 from the push emulation handler. Negative return values are
  interpreted specially on return from sys_ioctl() and may cause undesirable
  side-effects like restarting the system call.

Modified:
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Sat Jul 26 02:41:18 2014
(r269107)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Sat Jul 26 02:51:46 2014
(r269108)
@@ -781,10 +781,17 @@ emulate_push(void *vm, int vcpuid, uint6
 
error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, PROT_WRITE,
copyinfo, nitems(copyinfo));
-   if (error == -1)
-   return (-1);/* Unrecoverable error */
-   else if (error == 1)
-   return (0); /* Return to guest to handle page fault */
+   if (error == -1) {
+   /*
+* XXX cannot return a negative error value here because it
+* ends up being the return value of the VM_RUN() ioctl and
+* is interpreted as a pseudo-error (for e.g. ERESTART).
+*/
+   return (EFAULT);
+   } else if (error == 1) {
+   /* Resume guest execution to handle page fault */
+   return (0);
+   }
 
error = memread(vm, vcpuid, mmio_gpa, val, size, arg);
if (error == 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: r269109 - in head/sys/amd64: include vmm vmm/intel

2014-07-25 Thread Neel Natu
Author: neel
Date: Sat Jul 26 02:53:51 2014
New Revision: 269109
URL: http://svnweb.freebsd.org/changeset/base/269109

Log:
  If a vcpu has issued a HLT instruction with interrupts disabled then it sleeps
  forever in vm_handle_hlt().
  
  This is usually not an issue as long as one of the other vcpus properly resets
  or powers off the virtual machine. However, if the bhyve(8) process is killed
  with a signal the halted vcpu cannot be woken up because it's sleep cannot be
  interrupted.
  
  Fix this by waking up periodically and returning from vm_handle_hlt() if
  TDF_ASTPENDING is set.
  
  Reported by:  Leon Dang
  Sponsored by: Nahanni Systems

Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/vmm.c

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hSat Jul 26 02:51:46 2014
(r269108)
+++ head/sys/amd64/include/vmm.hSat Jul 26 02:53:51 2014
(r269109)
@@ -270,6 +270,14 @@ vcpu_is_running(struct vm *vm, int vcpu,
return (vcpu_get_state(vm, vcpu, hostcpu) == VCPU_RUNNING);
 }
 
+#ifdef _SYS_PROC_H_
+static int __inline
+vcpu_should_yield(struct vm *vm, int vcpu)
+{
+   return (curthread-td_flags  (TDF_ASTPENDING | TDF_NEEDRESCHED));
+}
+#endif
+
 void *vcpu_stats(struct vm *vm, int vcpu);
 void vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr);
 struct vmspace *vm_get_vmspace(struct vm *vm);

Modified: head/sys/amd64/vmm/intel/vmx.c
==
--- head/sys/amd64/vmm/intel/vmx.c  Sat Jul 26 02:51:46 2014
(r269108)
+++ head/sys/amd64/vmm/intel/vmx.c  Sat Jul 26 02:53:51 2014
(r269109)
@@ -2559,7 +2559,7 @@ vmx_run(void *arg, int vcpu, register_t 
break;
}
 
-   if (curthread-td_flags  (TDF_ASTPENDING | TDF_NEEDRESCHED)) {
+   if (vcpu_should_yield(vm, vcpu)) {
enable_intr();
vm_exit_astpending(vmx-vm, vcpu, vmcs_guest_rip());
vmx_astpending_trace(vmx, vcpu, vmexit-rip);

Modified: head/sys/amd64/vmm/vmm.c
==
--- head/sys/amd64/vmm/vmm.cSat Jul 26 02:51:46 2014(r269108)
+++ head/sys/amd64/vmm/vmm.cSat Jul 26 02:53:51 2014(r269109)
@@ -1105,6 +1105,10 @@ vm_handle_hlt(struct vm *vm, int vcpuid,
}
}
 
+   /* Don't go to sleep if the vcpu thread needs to yield */
+   if (vcpu_should_yield(vm, vcpuid))
+   break;
+
/*
 * Some Linux guests implement halt by having all vcpus
 * execute HLT with interrupts disabled. 'halted_cpus' keeps
@@ -1128,7 +1132,11 @@ vm_handle_hlt(struct vm *vm, int vcpuid,
 
t = ticks;
vcpu_require_state_locked(vcpu, VCPU_SLEEPING);
-   msleep_spin(vcpu, vcpu-mtx, wmesg, 0);
+   /*
+* XXX msleep_spin() cannot be interrupted by signals so
+* wake up periodically to check pending signals.
+*/
+   msleep_spin(vcpu, vcpu-mtx, wmesg, hz);
vcpu_require_state_locked(vcpu, VCPU_FROZEN);
vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r269110 - head/sys/boot/arm/at91/libat91

2014-07-25 Thread Ian Lepore
Author: ian
Date: Sat Jul 26 03:19:13 2014
New Revision: 269110
URL: http://svnweb.freebsd.org/changeset/base/269110

Log:
  Silence a clang warning about a while loop with an empty body.

Modified:
  head/sys/boot/arm/at91/libat91/emac.c

Modified: head/sys/boot/arm/at91/libat91/emac.c
==
--- head/sys/boot/arm/at91/libat91/emac.c   Sat Jul 26 02:53:51 2014
(r269109)
+++ head/sys/boot/arm/at91/libat91/emac.c   Sat Jul 26 03:19:13 2014
(r269110)
@@ -96,7 +96,8 @@ GetServerAddress(void)
memcpy(p_ARP-target_ip, serverIPAddr, 4);
 
// wait until transmit is available
-   while (!(*AT91C_EMAC_TSR  AT91C_EMAC_BNQ)) ;
+   while (!(*AT91C_EMAC_TSR  AT91C_EMAC_BNQ)) 
+   continue;
 
*AT91C_EMAC_TSR |= AT91C_EMAC_COMP;
*AT91C_EMAC_TAR = (unsigned)transmitBuffer;
@@ -157,7 +158,8 @@ Send_TFTP_Packet(char *tftpData, unsigne
 
udpHdr-udp_cksum = SWAP16(t_checksum);
 
-   while (!(*AT91C_EMAC_TSR  AT91C_EMAC_BNQ)) ;
+   while (!(*AT91C_EMAC_TSR  AT91C_EMAC_BNQ))
+   continue;
 
*AT91C_EMAC_TSR |= AT91C_EMAC_COMP;
*AT91C_EMAC_TAR = (unsigned)tftpSendPacket;
___
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: r269111 - in head/sys/boot/arm/at91: boot0 boot0iic boot0spi boot2 bootiic bootspi

2014-07-25 Thread Ian Lepore
Author: ian
Date: Sat Jul 26 03:33:19 2014
New Revision: 269111
URL: http://svnweb.freebsd.org/changeset/base/269111

Log:
  Eliminate no previous prototype for main warnings.

Modified:
  head/sys/boot/arm/at91/boot0/main.c
  head/sys/boot/arm/at91/boot0iic/main.c
  head/sys/boot/arm/at91/boot0spi/main.c
  head/sys/boot/arm/at91/boot2/boot2.c
  head/sys/boot/arm/at91/bootiic/main.c
  head/sys/boot/arm/at91/bootspi/main.c

Modified: head/sys/boot/arm/at91/boot0/main.c
==
--- head/sys/boot/arm/at91/boot0/main.c Sat Jul 26 03:19:13 2014
(r269110)
+++ head/sys/boot/arm/at91/boot0/main.c Sat Jul 26 03:33:19 2014
(r269111)
@@ -30,6 +30,8 @@
 
 typedef void fn_t(void);
 
+int main(void);
+
 int
 main(void)
 {

Modified: head/sys/boot/arm/at91/boot0iic/main.c
==
--- head/sys/boot/arm/at91/boot0iic/main.c  Sat Jul 26 03:19:13 2014
(r269110)
+++ head/sys/boot/arm/at91/boot0iic/main.c  Sat Jul 26 03:33:19 2014
(r269111)
@@ -28,6 +28,8 @@
 #include lib.h
 #include at91rm9200_lowlevel.h
 
+int main(void);
+
 int
 main(void)
 {

Modified: head/sys/boot/arm/at91/boot0spi/main.c
==
--- head/sys/boot/arm/at91/boot0spi/main.c  Sat Jul 26 03:19:13 2014
(r269110)
+++ head/sys/boot/arm/at91/boot0spi/main.c  Sat Jul 26 03:33:19 2014
(r269111)
@@ -31,7 +31,9 @@
 
 #define OFFSET 0
 
-void
+int main(void);
+
+int
 main(void)
 {
int len, i, j, off, sec;
@@ -59,4 +61,5 @@ main(void)
continue;
printf(Done\n);
reset();
+   return (1);
 }

Modified: head/sys/boot/arm/at91/boot2/boot2.c
==
--- head/sys/boot/arm/at91/boot2/boot2.cSat Jul 26 03:19:13 2014
(r269110)
+++ head/sys/boot/arm/at91/boot2/boot2.cSat Jul 26 03:33:19 2014
(r269111)
@@ -93,6 +93,7 @@ static char kname[1024];
 static uint32_t opts;
 static uint8_t dsk_meta;
 
+int main(void);
 static void load(void);
 static int parse(void);
 static int dskread(void *, unsigned, unsigned);
@@ -190,6 +191,7 @@ main(void)
else
load();
}
+   return (1);
 }
 
 static void

Modified: head/sys/boot/arm/at91/bootiic/main.c
==
--- head/sys/boot/arm/at91/bootiic/main.c   Sat Jul 26 03:19:13 2014
(r269110)
+++ head/sys/boot/arm/at91/bootiic/main.c   Sat Jul 26 03:33:19 2014
(r269111)
@@ -28,6 +28,8 @@
 #include emac.h
 #include lib.h
 
+int main(void);
+
 /*
  * .KB_C_FN_DEFINITION_START
  * int main(void)

Modified: head/sys/boot/arm/at91/bootspi/main.c
==
--- head/sys/boot/arm/at91/bootspi/main.c   Sat Jul 26 03:19:13 2014
(r269110)
+++ head/sys/boot/arm/at91/bootspi/main.c   Sat Jul 26 03:33:19 2014
(r269111)
@@ -43,6 +43,8 @@
 #include spi_flash.h
 #include ee.h
 
+int main(void);
+
 int
 main(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


svn commit: r269112 - head/sys/boot/arm/at91/boot2

2014-07-25 Thread Ian Lepore
Author: ian
Date: Sat Jul 26 04:09:43 2014
New Revision: 269112
URL: http://svnweb.freebsd.org/changeset/base/269112

Log:
  The 'flags' variable is conflicting with some inline code in a header file
  (variable flags shadows a global...), just rename this variable to
  wish away the problem.

Modified:
  head/sys/boot/arm/at91/boot2/boot2.c

Modified: head/sys/boot/arm/at91/boot2/boot2.c
==
--- head/sys/boot/arm/at91/boot2/boot2.cSat Jul 26 03:33:19 2014
(r269111)
+++ head/sys/boot/arm/at91/boot2/boot2.cSat Jul 26 04:09:43 2014
(r269112)
@@ -77,7 +77,7 @@ extern uint32_t _end;
 #define OPT_CHECK(opt) ((opts)  OPT_SET(opt))
 
 static const char optstr[NOPT] = agnrsv;
-static const unsigned char flags[NOPT] = {
+static const unsigned char bootflags[NOPT] = {
RBX_ASKNAME,
RBX_GDB,
RBX_NOINTR,
@@ -265,7 +265,7 @@ parse()
for (i = 0; c != optstr[i]; i++)
if (i == NOPT - 1)
return -1;
-   opts ^= OPT_SET(flags[i]);
+   opts ^= OPT_SET(bootflags[i]);
}
} else {
arg--;
___
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: r269113 - head/sys/boot/arm/at91/libat91

2014-07-25 Thread Ian Lepore
Author: ian
Date: Sat Jul 26 04:16:04 2014
New Revision: 269113
URL: http://svnweb.freebsd.org/changeset/base/269113

Log:
  Enable at91 systems to boot from high capacity SD cards.
  
  This also fixes a few minor violations of the SD protocol, such as running
  the bus at high speed during the card identification sequence.
  
  The sdcard_init() routine now probes for SDHC cards so that later read
  requests can make needed adjustments between block and byte offsets based
  on card type.
  
  There is a new MCI_readblocks() function that takes block number and block
  count parameters instead of byte-offset values.  Using this routine, boot
  loader code can load a kernel from any location on an SDHC or standard SD.
  
  The old MCI_read() interface remains unchanged so that existing customized
  boot loader code will still keep working without changes.  Using this
  routine, boot loaders can load a kernel from anywhere in the first 4GB of
  an SDHC card (or of course any location on a standard SD card).
  
  A new sdcard_use4wire() routine allows boot loaders to request 4-bit
  transfers; it should be called after sdcard_init().  The sdcard_init()
  routine no longer assumes the hardware is 4-wire capable and by default
  sets things up for 1-bit transfers.  (4-wire mode is unreliable on
  at91rm9200, works on later SoCs.)
  
  PR:   155894
  Submitted by: me.  years ago.

Modified:
  head/sys/boot/arm/at91/libat91/mci_device.h
  head/sys/boot/arm/at91/libat91/sd-card.c
  head/sys/boot/arm/at91/libat91/sd-card.h

Modified: head/sys/boot/arm/at91/libat91/mci_device.h
==
--- head/sys/boot/arm/at91/libat91/mci_device.h Sat Jul 26 04:09:43 2014
(r269112)
+++ head/sys/boot/arm/at91/libat91/mci_device.h Sat Jul 26 04:16:04 2014
(r269113)
@@ -90,6 +90,8 @@ typedef struct _AT91S_MciDevice
 {
volatile unsigned char  state;
unsigned char   SDCard_bus_width;
+   unsigned char   IsSDv2;
+   unsigned char   IsSDHC;
unsigned intRCA;// RCA
unsigned intREAD_BL_LEN;
 #ifdef REPORT_SIZE
@@ -202,7 +204,9 @@ typedef struct _AT91S_MciDevice
  MMC_MAXLAT)
 #define GO_INACTIVE_STATE_CMD \
  (15 | MMC_RSPTYP_NO)
-
+#define SD_SEND_IF_COND_CMD \
+ (8 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \
+ MMC_MAXLAT)
 //*
 //* Class 2 commands: Block oriented Read commands
 //*
@@ -264,7 +268,7 @@ typedef struct _AT91S_MciDevice
 #define SDCARD_STATUS_CMD  (13 | 
MMC_SPCMD_NONE| MMC_RSPTYP_48 | MMC_TRCMD_NO  | MMC_MAXLAT)
 #define SDCARD_SEND_NUM_WR_BLOCKS_CMD  (22 | MMC_SPCMD_NONE| 
MMC_RSPTYP_48 | MMC_TRCMD_NO  | MMC_MAXLAT)
 #define SDCARD_SET_WR_BLK_ERASE_COUNT_CMD  (23 | MMC_SPCMD_NONE| 
MMC_RSPTYP_48 | MMC_TRCMD_NO  | MMC_MAXLAT)
-#define SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE| 
MMC_RSPTYP_48 | MMC_TRCMD_NO )
+#define SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE| 
MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT)
 #define SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MMC_SPCMD_NONE| MMC_RSPTYP_48 
| MMC_TRCMD_NO  | MMC_MAXLAT)
 #define SDCARD_SEND_SCR_CMD(51 | MMC_SPCMD_NONE
| MMC_RSPTYP_48 | MMC_TRCMD_NO  | MMC_MAXLAT)
 
@@ -306,7 +310,8 @@ typedef struct _AT91S_MciDevice
 #define AT91C_VDD_33_34(1  21)
 #define AT91C_VDD_34_35(1  22)
 #define AT91C_VDD_35_36(1  23)
-#define AT91C_CARD_POWER_UP_BUSY   (1U  31)
+#define AT91C_CCS  (1  30)
+#define AT91C_CARD_POWER_UP_DONE   (1U  31)
 
 #define AT91C_MMC_HOST_VOLTAGE_RANGE   (AT91C_VDD_27_28 | AT91C_VDD_28_29  | \
 AT91C_VDD_29_30 | AT91C_VDD_30_31 | AT91C_VDD_31_32 | AT91C_VDD_32_33)

Modified: head/sys/boot/arm/at91/libat91/sd-card.c
==
--- head/sys/boot/arm/at91/libat91/sd-card.cSat Jul 26 04:09:43 2014
(r269112)
+++ head/sys/boot/arm/at91/libat91/sd-card.cSat Jul 26 04:16:04 2014
(r269113)
@@ -47,35 +47,38 @@
 #include lib.h
 #include sd-card.h
 
-#define AT91C_MCI_TIMEOUT  100   /* For AT91F_MCIDeviceWaitReady */
-#define BUFFER_SIZE_MCI_DEVICE 512
-#define MASTER_CLOCK   6000
+#define AT91C_MCI_TIMEOUT   100   /* For AT91F_MCIDeviceWaitReady */
+#define SD_BLOCK_SIZE   512
 
 //* Global Variables
-AT91S_MciDeviceMCI_Device;
-char   Buffer[BUFFER_SIZE_MCI_DEVICE];
+static AT91S_MciDevice  MCI_Device;
 
 /**
 **Error return codes
 

svn commit: r269114 - in head: lib/csu/i386-elf share/mk sys/boot/mips/beri/boot2 sys/conf

2014-07-25 Thread Simon J. Gerraty
Author: sjg
Date: Sat Jul 26 04:38:09 2014
New Revision: 269114
URL: http://svnweb.freebsd.org/changeset/base/269114

Log:
  Reviewed by: imp
  
  LDFLAGS is supposed to be given to CC not LD.
  Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD

Modified:
  head/lib/csu/i386-elf/Makefile
  head/share/mk/sys.mk
  head/sys/boot/mips/beri/boot2/Makefile
  head/sys/conf/Makefile.arm
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/lib/csu/i386-elf/Makefile
==
--- head/lib/csu/i386-elf/Makefile  Sat Jul 26 04:16:04 2014
(r269113)
+++ head/lib/csu/i386-elf/Makefile  Sat Jul 26 04:38:09 2014
(r269114)
@@ -26,7 +26,7 @@ gcrt1_c.o: gcrt1_c.s
${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s
 
 gcrt1.o: gcrt1_c.o crt1_s.o
-   ${LD} ${LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
+   ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
 
 crt1_c.s: crt1_c.c
${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
@@ -36,7 +36,7 @@ crt1_c.o: crt1_c.s
${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s
 
 crt1.o:crt1_c.o crt1_s.o
-   ${LD} ${LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
+   ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
objcopy --localize-symbol _start1 crt1.o
 
 Scrt1_c.s: crt1_c.c
@@ -47,7 +47,7 @@ Scrt1_c.o: Scrt1_c.s
${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s
 
 Scrt1.o: Scrt1_c.o crt1_s.o
-   ${LD} ${LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
+   ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
objcopy --localize-symbol _start1 Scrt1.o
 
 .include bsd.prog.mk

Modified: head/share/mk/sys.mk
==
--- head/share/mk/sys.mkSat Jul 26 04:16:04 2014(r269113)
+++ head/share/mk/sys.mkSat Jul 26 04:38:09 2014(r269114)
@@ -117,7 +117,8 @@ LEX ?=  lex
 LFLAGS ?=
 
 LD ?=  ld
-LDFLAGS?=
+LDFLAGS?=  # LDFLAGS is for CC, 
+_LDFLAGS   =   ${LDFLAGS:S/-Wl,//g}# strip -Wl, for LD
 
 LINT   ?=  lint
 LINTFLAGS  ?=  -cghapbx

Modified: head/sys/boot/mips/beri/boot2/Makefile
==
--- head/sys/boot/mips/beri/boot2/Makefile  Sat Jul 26 04:16:04 2014
(r269113)
+++ head/sys/boot/mips/beri/boot2/Makefile  Sat Jul 26 04:38:09 2014
(r269114)
@@ -73,7 +73,7 @@ LDFLAGS=  -nostdlib   \
 CFLAGS+=   -I${.CURDIR}/../common
 
 flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o
-   ${LD} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \
+   ${LD} ${_LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET}
\
${.ALLSRC} ${LIBSTAND}
 flashboot: flashboot.elf
objcopy -S -O binary ${.TARGET}.elf ${.TARGET}
@@ -81,7 +81,7 @@ flashboot.md5: flashboot
md5 flashboot  flashboot.md5
 
 jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o
-   ${LD} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET}  \
+   ${LD} ${_LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \
${.ALLSRC} ${LIBSTAND}
 jtagboot.md5: jtagboot
md5 jtagboot  jtagboot.md5

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Sat Jul 26 04:16:04 2014(r269113)
+++ head/sys/conf/Makefile.arm  Sat Jul 26 04:38:09 2014(r269114)
@@ -55,7 +55,7 @@ CFLAGS.clang += -mllvm -arm-enable-ehabi
 # hack because genassym.c includes sys/bus.h which includes these.
 genassym.o: bus_if.h device_if.h
 
-SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \
+SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${_LDFLAGS} \
  -warn-common -export-dynamic -dynamic-linker /red/herring -o \
   ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL +=;sed s/ + SIZEOF_HEADERS// ldscript.$M\

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Sat Jul 26 04:16:04 2014(r269113)
+++ head/sys/conf/kern.pre.mk   Sat Jul 26 04:38:09 2014(r269114)
@@ -177,7 +177,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
 SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
 SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
 SYSTEM_OBJS+= hack.So
-SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${LDFLAGS} --no-warn-mismatch \
+SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \
-warn-common -export-dynamic -dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \

Modified: head/sys/conf/kmod.mk