Re: svn commit: r264243 - in head/etc: . rc.d

2014-06-11 Thread Maxim Konovalov
Hi Davin,

It looks like this change has some issues with the aliases startup
configuration, see the following report for more details:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190880

Would you mind if I assign this ticket to you?

On Mon, 7 Apr 2014, 22:40-, Devin Teske wrote:

> Author: dteske
> Date: Mon Apr  7 22:40:29 2014
> New Revision: 264243
> URL: http://svnweb.freebsd.org/changeset/base/264243
>
> Log:
>   Loosen the processing of *_IF_aliasN vars to be less strict. Previously,
>   the first alias had to be _alias0 and processing stopped at the first non-
>   defined variable (preventing gaps). Allowing gaps gives the administrator
>   the ability to group aliases in an adhoc manner and also lifts the
>   requirement to renumber aliases simply to comment-out an existing one.
>   Aliases are processed in numerical ascending order.
>
>   Discussed on:   -rc
>   MFC after:  1 week
>
> Modified:
>   head/etc/network.subr
>   head/etc/rc.d/mdconfig
>   head/etc/rc.d/mdconfig2
>   head/etc/rc.subr
>
> Modified: head/etc/network.subr
> ==
> --- head/etc/network.subr Mon Apr  7 22:37:13 2014(r264242)
> +++ head/etc/network.subr Mon Apr  7 22:40:29 2014(r264243)
> @@ -283,10 +283,8 @@ get_if_var()
>   fi
>
>   _if=$1
> - _punct=". - / +"
> - for _punct_c in $_punct; do
> - _if=`ltr ${_if} ${_punct_c} '_'`
> - done
> + _punct=".-/+"
> + ltr ${_if} "${_punct}" '_' _if
>   _var=$2
>   _default=$3
>
> @@ -1076,6 +1074,7 @@ ifalias_af_common_handler()
>  ifalias_af_common()
>  {
>   local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf
> + local _punct=".-/+"
>
>   _ret=1
>   _aliasn=
> @@ -1083,10 +1082,14 @@ ifalias_af_common()
>   _af=$2
>   _action=$3
>
> + # Normalize $_if before using it in a pattern to list_vars()
> + ltr "$_if" "$_punct" "_" _if
> +
>   # ifconfig_IF_aliasN which starts with $_af
> - alias=0
> - while : ; do
> - ifconfig_args=`get_if_var $_if ifconfig_IF_alias${alias}`
> + for alias in `list_vars ifconfig_${_if}_alias[0-9]\* |
> + sort_lite -nk1.$((9+${#_if}+7))`
> + do
> + eval ifconfig_args=\"\$$alias\"
>   _iaf=
>   case $ifconfig_args in
>   inet\ *)_iaf=inet ;;
> @@ -1107,15 +1110,15 @@ ifalias_af_common()
>   warn "\$ifconfig_${_if}_alias${alias} needs " \
>   "\"inet\" keyword for an IPv4 address."
>   esac
> - alias=$(($alias + 1))
>   done
>
>   # backward compatibility: ipv6_ifconfig_IF_aliasN.
>   case $_af in
>   inet6)
> - alias=0
> - while : ; do
> - ifconfig_args=`get_if_var $_if 
> ipv6_ifconfig_IF_alias${alias}`
> + for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* |
> + sort_lite -nk1.$((14+${#_if}+7))`
> + do
> + eval ifconfig_args=\"\$$alias\"
>   case ${_action}:"${ifconfig_args}" in
>   *:"")
>   break
> @@ -1127,7 +1130,6 @@ ifalias_af_common()
>   "instead."
>   ;;
>   esac
> - alias=$(($alias + 1))
>   done
>   esac
>
>
> Modified: head/etc/rc.d/mdconfig
> ==
> --- head/etc/rc.d/mdconfigMon Apr  7 22:37:13 2014(r264242)
> +++ head/etc/rc.d/mdconfigMon Apr  7 22:40:29 2014(r264243)
> @@ -181,17 +181,14 @@ fi
>
>  load_rc_config $name
>
> -_mdconfig_unit=0
>  if [ -z "${_mdconfig_list}" ]; then
> - while :; do
> - eval _mdconfig_config=\$mdconfig_md${_mdconfig_unit}
> - if [ -z "${_mdconfig_config}" ]; then
> - break
> - else
> - _mdconfig_list="${_mdconfig_list}${_mdconfig_list:+ 
> }md${_mdconfig_unit}"
> - _mdconfig_unit=$((${_mdconfig_unit} + 1))
> - fi
> + for _mdconfig_config in `list_vars mdconfig_md[0-9]\* |
> + sort_lite -nk1.12`
> + do
> + _mdconfig_unit=${_mdconfig_config#mdconfig_md}
> + _mdconfig_list="$_mdconfig_list md$_mdconfig_unit"
>   done
> + _mdconfig_list="${_mdconfig_list# }"
>  fi
>
>  run_rc_command "${_mdconfig_cmd}"
>
> Modified: head/etc/rc.d/mdconfig2
> ==
> --- head/etc/rc.d/mdconfig2   Mon Apr  7 22:37:13 2014(r264242)
> +++ head/etc/rc.d/mdconfig2   Mon Apr  7 22:40:29 2014(r264243)
> @@ -211,17 +211,14 @@ fi
>
>  load_rc_config $name
>
> -_mdconfig2_unit=0
>  if [ -z "${_mdconfig2_list}" ]; then
> -  

svn commit: r267351 - head/sys/kern

2014-06-11 Thread Alexander Motin
Author: mav
Date: Wed Jun 11 08:14:08 2014
New Revision: 267351
URL: http://svnweb.freebsd.org/changeset/base/267351

Log:
  Move root_mount_hold() functionality to separate mutex.
  
  It has nothing to share with mutex protecting list of mounted file systems.

Modified:
  head/sys/kern/vfs_mountroot.c

Modified: head/sys/kern/vfs_mountroot.c
==
--- head/sys/kern/vfs_mountroot.c   Wed Jun 11 06:45:52 2014
(r267350)
+++ head/sys/kern/vfs_mountroot.c   Wed Jun 11 08:14:08 2014
(r267351)
@@ -97,6 +97,9 @@ struct vnode *rootvnode;
 
 char *rootdevnames[2] = {NULL, NULL};
 
+struct mtx root_holds_mtx;
+MTX_SYSINIT(root_holds, &root_holds_mtx, "root_holds", MTX_DEF);
+
 struct root_hold_token {
const char  *who;
LIST_ENTRY(root_hold_token) list;
@@ -131,9 +134,9 @@ root_mount_hold(const char *identifier)
 
h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
h->who = identifier;
-   mtx_lock(&mountlist_mtx);
+   mtx_lock(&root_holds_mtx);
LIST_INSERT_HEAD(&root_holds, h, list);
-   mtx_unlock(&mountlist_mtx);
+   mtx_unlock(&root_holds_mtx);
return (h);
 }
 
@@ -143,10 +146,10 @@ root_mount_rel(struct root_hold_token *h
 
if (h == NULL)
return;
-   mtx_lock(&mountlist_mtx);
+   mtx_lock(&root_holds_mtx);
LIST_REMOVE(h, list);
wakeup(&root_holds);
-   mtx_unlock(&mountlist_mtx);
+   mtx_unlock(&root_holds_mtx);
free(h, M_DEVBUF);
 }
 
@@ -168,12 +171,12 @@ root_mount_wait(void)
 */
KASSERT(curthread->td_proc->p_pid != 0,
("root_mount_wait: cannot be called from the swapper thread"));
-   mtx_lock(&mountlist_mtx);
+   mtx_lock(&root_holds_mtx);
while (!root_mount_complete) {
-   msleep(&root_mount_complete, &mountlist_mtx, PZERO, "rootwait",
+   msleep(&root_mount_complete, &root_holds_mtx, PZERO, "rootwait",
hz);
}
-   mtx_unlock(&mountlist_mtx);
+   mtx_unlock(&root_holds_mtx);
 }
 
 static void
@@ -908,9 +911,9 @@ vfs_mountroot_wait(void)
DROP_GIANT();
g_waitidle();
PICKUP_GIANT();
-   mtx_lock(&mountlist_mtx);
+   mtx_lock(&root_holds_mtx);
if (LIST_EMPTY(&root_holds)) {
-   mtx_unlock(&mountlist_mtx);
+   mtx_unlock(&root_holds_mtx);
break;
}
if (ppsratecheck(&lastfail, &curfail, 1)) {
@@ -919,7 +922,7 @@ vfs_mountroot_wait(void)
printf(" %s", h->who);
printf("\n");
}
-   msleep(&root_holds, &mountlist_mtx, PZERO | PDROP, "roothold",
+   msleep(&root_holds, &root_holds_mtx, PZERO | PDROP, "roothold",
hz);
}
 }
@@ -979,10 +982,10 @@ vfs_mountroot(void)
vref(prison0.pr_root);
mtx_unlock(&prison0.pr_mtx);
 
-   mtx_lock(&mountlist_mtx);
+   mtx_lock(&root_holds_mtx);
atomic_store_rel_int(&root_mount_complete, 1);
wakeup(&root_mount_complete);
-   mtx_unlock(&mountlist_mtx);
+   mtx_unlock(&root_holds_mtx);
 
EVENTHANDLER_INVOKE(mountroot);
 }
___
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: r267354 - in head/sys/arm: conf freescale/vybrid

2014-06-11 Thread Ruslan Bukin
Author: br
Date: Wed Jun 11 10:03:06 2014
New Revision: 267354
URL: http://svnweb.freebsd.org/changeset/base/267354

Log:
  Add a driver for Serial Peripheral Interface (SPI).

Added:
  head/sys/arm/freescale/vybrid/vf_spi.c   (contents, props changed)
Modified:
  head/sys/arm/conf/VYBRID
  head/sys/arm/freescale/vybrid/files.vybrid

Modified: head/sys/arm/conf/VYBRID
==
--- head/sys/arm/conf/VYBRIDWed Jun 11 09:31:09 2014(r267353)
+++ head/sys/arm/conf/VYBRIDWed Jun 11 10:03:06 2014(r267354)
@@ -141,6 +141,10 @@ device bpf # Berkeley 
packet filter
 
 device sound
 
+# SPI
+device spibus
+device vf_spi
+
 # Framebuffer
 device vt
 device kbdmux

Modified: head/sys/arm/freescale/vybrid/files.vybrid
==
--- head/sys/arm/freescale/vybrid/files.vybrid  Wed Jun 11 09:31:09 2014
(r267353)
+++ head/sys/arm/freescale/vybrid/files.vybrid  Wed Jun 11 10:03:06 2014
(r267354)
@@ -31,4 +31,5 @@ arm/freescale/vybrid/vf_ehci.coptiona
 arm/freescale/vybrid/vf_gpio.c optionalgpio
 arm/freescale/vybrid/vf_uart.c optionaluart
 arm/freescale/vybrid/vf_sai.c  optionalsound
+arm/freescale/vybrid/vf_spi.c  optionalvf_spi
 dev/ffec/if_ffec.c optionalffec

Added: head/sys/arm/freescale/vybrid/vf_spi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/vybrid/vf_spi.c  Wed Jun 11 10:03:06 2014
(r267354)
@@ -0,0 +1,293 @@
+/*-
+ * Copyright (c) 2014 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Vybrid Family Serial Peripheral Interface (SPI)
+ * Chapter 47, Vybrid Reference Manual, Rev. 5, 07/2013
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "spibus_if.h"
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#defineSPI_FIFO_SIZE   4
+
+#defineSPI_MCR 0x00/* Module Configuration */
+#define MCR_MSTR   (1 << 31)   /* Master/Slave Mode Select */
+#define MCR_CONT_SCKE  (1 << 30)   /* Continuous SCK Enable */
+#define MCR_FRZ(1 << 27)   /* Freeze */
+#define MCR_PCSIS_S16  /* Peripheral Chip Select */
+#define MCR_PCSIS_M0x3f
+#define MCR_MDIS   (1 << 14)   /* Module Disable */
+#define MCR_CLR_TXF(1 << 11)   /* Clear TX FIFO */
+#define MCR_CLR_RXF(1 << 10)   /* Clear RX FIFO */
+#define MCR_HALT   (1 << 0)/* Starts and stops SPI 
transfers */
+#defineSPI_TCR 0x08/* Transfer Count */
+#defineSPI_CTAR0   0x0C/* Clock and Transfer 
Attributes */
+#defineSPI_CTAR0_SLAVE 0x0C/* Clock and Transfer 
Attributes */
+#defineSPI_CTAR1   0x10/* Clock and Transfer 
Attributes */
+#defineSPI_CTAR2   0x14/* Clock and Transfer 
Attributes */
+#defineSPI_CTAR3   0x18/* Clock and Transfer 
Attributes */
+#define CTAR_FMSZ_M0xf
+#define CTAR_FMSZ_S27  /* Frame S

svn commit: r267355 - head/sys/sys

2014-06-11 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 11 10:13:08 2014
New Revision: 267355
URL: http://svnweb.freebsd.org/changeset/base/267355

Log:
  Add UUIDs for DragonFlyBSD's partition types.
  
  MFC after:2 weeks

Modified:
  head/sys/sys/gpt.h

Modified: head/sys/sys/gpt.h
==
--- head/sys/sys/gpt.h  Wed Jun 11 10:03:06 2014(r267354)
+++ head/sys/sys/gpt.h  Wed Jun 11 10:13:08 2014(r267355)
@@ -161,6 +161,25 @@ struct gpt_ent {
 #defineGPT_ENT_TYPE_NETBSD_CGD \
{0x2db519ec,0xb10f,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}}
 
+#define GPT_ENT_TYPE_DRAGONFLY_LABEL32 \
+   {0x9d087404,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_SWAP\
+   {0x9d58fdbd,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_UFS1\
+   {0x9d94ce7c,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_VINUM   \
+   {0x9dd4478f,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_CCD \
+   {0xdbd5211b,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_LABEL64 \
+   {0x3d48ce54,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_LEGACY  \
+   {0xbd215ab2,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_HAMMER  \
+   {0x61dc63ac,0x6e38,0x11dc,0x85,0x13,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+#define GPT_ENT_TYPE_DRAGONFLY_HAMMER2 \
+   {0x5cbb9ad1,0x862d,0x11dc,0xa9,0x4d,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}}
+
 /*
  * Boot partition used by GRUB 2.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267356 - head/sys/sys

2014-06-11 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 11 10:14:40 2014
New Revision: 267356
URL: http://svnweb.freebsd.org/changeset/base/267356

Log:
  Add DragonFlyBSD's Hammer FS types and type names.
  
  MFC after:2 weeks

Modified:
  head/sys/sys/disklabel.h

Modified: head/sys/sys/disklabel.h
==
--- head/sys/sys/disklabel.hWed Jun 11 10:13:08 2014(r267355)
+++ head/sys/sys/disklabel.hWed Jun 11 10:14:40 2014(r267356)
@@ -229,6 +229,8 @@ static const char *dktypenames[] = {
 #defineFS_NTFS 18  /* Windows/NT file system */
 #defineFS_CCD  20  /* concatenated disk component 
*/
 #defineFS_JFS2 21  /* IBM JFS2 */
+#defineFS_HAMMER   22  /* DragonFlyBSD Hammer FS */
+#defineFS_HAMMER2  23  /* DragonFlyBSD Hammer2 FS */
 #defineFS_UDF  24  /* UDF */
 #defineFS_EFS  26  /* SGI's Extent File system */
 #defineFS_ZFS  27  /* Sun's ZFS */
@@ -258,8 +260,8 @@ static const char *fstypenames[] = {
"?",
"ccd",
"jfs",
-   "?",
-   "?",
+   "HAMMER",
+   "HAMMER2",
"UDF",
"?",
"EFS",
___
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: r267357 - head/sys/geom/part

2014-06-11 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 11 10:19:11 2014
New Revision: 267357
URL: http://svnweb.freebsd.org/changeset/base/267357

Log:
  Add aliases for DragonFlyBSD's partition types.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part.h
  head/sys/geom/part/g_part_bsd.c
  head/sys/geom/part/g_part_gpt.c

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Wed Jun 11 10:14:40 2014(r267356)
+++ head/sys/geom/part/g_part.c Wed Jun 11 10:19:11 2014(r267357)
@@ -108,6 +108,15 @@ struct g_part_alias_list {
{ "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG },
{ "vmware-reserved", G_PART_ALIAS_VMRESERVED },
{ "vmware-vsanhdr", G_PART_ALIAS_VMVSANHDR },
+   { "dragonfly-label32", G_PART_ALIAS_DFBSD },
+   { "dragonfly-label64", G_PART_ALIAS_DFBSD64 },
+   { "dragonfly-swap", G_PART_ALIAS_DFBSD_SWAP },
+   { "dragonfly-ufs", G_PART_ALIAS_DFBSD_UFS },
+   { "dragonfly-vinum", G_PART_ALIAS_DFBSD_VINUM },
+   { "dragonfly-ccd", G_PART_ALIAS_DFBSD_CCD },
+   { "dragonfly-legacy", G_PART_ALIAS_DFBSD_LEGACY },
+   { "dragonfly-hammer", G_PART_ALIAS_DFBSD_HAMMER },
+   { "dragonfly-hammer2", G_PART_ALIAS_DFBSD_HAMMER2 },
 };
 
 SYSCTL_DECL(_kern_geom);

Modified: head/sys/geom/part/g_part.h
==
--- head/sys/geom/part/g_part.h Wed Jun 11 10:14:40 2014(r267356)
+++ head/sys/geom/part/g_part.h Wed Jun 11 10:19:11 2014(r267357)
@@ -75,6 +75,15 @@ enum g_part_alias {
G_PART_ALIAS_VMKDIAG,   /* A VMware vmkDiagnostic partition 
entry */
G_PART_ALIAS_VMRESERVED,/* A VMware reserved partition entry */
G_PART_ALIAS_VMVSANHDR, /* A VMware vSAN header partition entry 
*/
+   G_PART_ALIAS_DFBSD, /* A DfBSD label32 partition entry */
+   G_PART_ALIAS_DFBSD64,   /* A DfBSD label64 partition entry */
+   G_PART_ALIAS_DFBSD_SWAP,/* A DfBSD swap partition entry */
+   G_PART_ALIAS_DFBSD_UFS, /* A DfBSD UFS partition entry */
+   G_PART_ALIAS_DFBSD_VINUM,   /* A DfBSD Vinum partition entry */
+   G_PART_ALIAS_DFBSD_CCD, /* A DfBSD CCD partition entry */
+   G_PART_ALIAS_DFBSD_LEGACY,  /* A DfBSD legacy partition entry */
+   G_PART_ALIAS_DFBSD_HAMMER,  /* A DfBSD HAMMER FS partition entry */
+   G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */
/* Keep the following last */
G_PART_ALIAS_COUNT
 };

Modified: head/sys/geom/part/g_part_bsd.c
==
--- head/sys/geom/part/g_part_bsd.c Wed Jun 11 10:14:40 2014
(r267356)
+++ head/sys/geom/part/g_part_bsd.c Wed Jun 11 10:19:11 2014
(r267357)
@@ -112,12 +112,26 @@ static struct g_part_scheme g_part_bsd_s
 };
 G_PART_SCHEME_DECLARE(g_part_bsd);
 
+static struct g_part_bsd_alias {
+   uint8_t type;
+   int alias;
+} bsd_alias_match[] = {
+   { FS_BSDFFS,G_PART_ALIAS_FREEBSD_UFS },
+   { FS_SWAP,  G_PART_ALIAS_FREEBSD_SWAP },
+   { FS_ZFS,   G_PART_ALIAS_FREEBSD_ZFS },
+   { FS_VINUM, G_PART_ALIAS_FREEBSD_VINUM },
+   { FS_NANDFS,G_PART_ALIAS_FREEBSD_NANDFS },
+   { FS_HAMMER,G_PART_ALIAS_DFBSD_HAMMER },
+   { FS_HAMMER2,   G_PART_ALIAS_DFBSD_HAMMER2 },
+};
+
 static int
 bsd_parse_type(const char *type, uint8_t *fstype)
 {
const char *alias;
char *endp;
long lt;
+   int i;
 
if (type[0] == '!') {
lt = strtol(type + 1, &endp, 0);
@@ -126,30 +140,13 @@ bsd_parse_type(const char *type, uint8_t
*fstype = (u_int)lt;
return (0);
}
-   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS);
-   if (!strcasecmp(type, alias)) {
-   *fstype = FS_NANDFS;
-   return (0);
-   }
-   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP);
-   if (!strcasecmp(type, alias)) {
-   *fstype = FS_SWAP;
-   return (0);
-   }
-   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS);
-   if (!strcasecmp(type, alias)) {
-   *fstype = FS_BSDFFS;
-   return (0);
-   }
-   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM);
-   if (!strcasecmp(type, alias)) {
-   *fstype = FS_VINUM;
-   return (0);
-   }
-   alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS);
-   if (!strcasecmp(type, alias)) {
-   *fstype = FS_ZFS;
-   return (0);
+   for (i = 0;
+   i < sizeof(bsd_alias_match) / sizeof(bsd_alias_match[0]); i++) {
+   alias = g_part_alias_name(bsd_alias_match[i].alias);
+   if (strcasecmp(type, al

svn commit: r267358 - head/sys/geom/part

2014-06-11 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 11 10:23:49 2014
New Revision: 267358
URL: http://svnweb.freebsd.org/changeset/base/267358

Log:
  Allow swapping to DragonFlyBSD's swap partition.
  
  MFC after:2 weeks

Modified:
  head/sys/geom/part/g_part_gpt.c

Modified: head/sys/geom/part/g_part_gpt.c
==
--- head/sys/geom/part/g_part_gpt.c Wed Jun 11 10:19:11 2014
(r267357)
+++ head/sys/geom/part/g_part_gpt.c Wed Jun 11 10:23:49 2014
(r267358)
@@ -724,7 +724,8 @@ g_part_gpt_dumpto(struct g_part_table *t
 
entry = (struct g_part_gpt_entry *)baseentry;
return ((EQUUID(&entry->ent.ent_type, &gpt_uuid_freebsd_swap) ||
-   EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap)) ? 1 : 0);
+   EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap) ||
+   EQUUID(&entry->ent.ent_type, &gpt_uuid_dfbsd_swap)) ? 1 : 0);
 }
 
 static 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: r267359 - in head: sbin/geom/class/part sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64

2014-06-11 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 11 10:42:34 2014
New Revision: 267359
URL: http://svnweb.freebsd.org/changeset/base/267359

Log:
  Add disklabel64 support to GEOM_PART class.
  
  This partitioning scheme is used in DragonFlyBSD. It is similar to
  BSD disklabel, but has the following improvements:
  * metadata has own dedicated place and isn't accessible through partitions;
  * all offsets are 64-bit;
  * supports 16 partitions by default (has reserved place for more);
  * has reserved place for backup label (but not yet implemented);
  * has UUIDs for partitions and partition types;
  
  No objections from:   geom
  MFC after:2 weeks
  Relnotes: yes

Added:
  head/sys/geom/part/g_part_bsd64.c   (contents, props changed)
  head/sys/modules/geom/geom_part/geom_part_bsd64/
  head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile   (contents, props 
changed)
Modified:
  head/sbin/geom/class/part/gpart.8
  head/sys/modules/geom/geom_part/Makefile

Modified: head/sbin/geom/class/part/gpart.8
==
--- head/sbin/geom/class/part/gpart.8   Wed Jun 11 10:23:49 2014
(r267358)
+++ head/sbin/geom/class/part/gpart.8   Wed Jun 11 10:42:34 2014
(r267359)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 2, 2014
+.Dd June 11, 2014
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -491,6 +491,12 @@ called
 Requires the
 .Cm GEOM_PART_BSD
 kernel option.
+.It Cm BSD64
+64-bit implementation of BSD disklabel used in DragonFlyBSD to subdivide MBR
+or GPT partitions.
+Requires the
+.Cm GEOM_PART_BSD64
+kernel option.
 .It Cm LDM
 The Logical Disk Manager is an implementation of volume manager for
 Microsoft Windows NT.

Added: head/sys/geom/part/g_part_bsd64.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/geom/part/g_part_bsd64.c   Wed Jun 11 10:42:34 2014
(r267359)
@@ -0,0 +1,667 @@
+/*-
+ * Copyright (c) 2014 Andrey V. Elsukov 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "g_part_if.h"
+
+FEATURE(geom_part_bsd64, "GEOM partitioning class for 64-bit BSD disklabels");
+
+/* XXX: move this to sys/disklabel64.h */
+#defineDISKMAGIC64 ((uint32_t)0xc4464c59)
+#defineMAXPARTITIONS64 16
+#defineRESPARTITIONS64 32
+
+struct disklabel64 {
+   char  d_reserved0[512]; /* reserved or unused */
+   u_int32_t d_magic;  /* the magic number */
+   u_int32_t d_crc;/* crc32() d_magic thru last part */
+   u_int32_t d_align;  /* partition alignment requirement */
+   u_int32_t d_npartitions;/* number of partitions */
+   struct uuid d_stor_uuid;/* unique uuid for label */
+
+   u_int64_t d_total_size; /* total size incl everything (bytes) */
+   u_int64_t d_bbase;  /* boot area base offset (bytes) */
+   /* boot area is pbase - bbase */
+   u_int64_t d_pbase;  /* first allocatable offset (bytes) */
+   u_int64_t d_pstop;  /* last allocatable offset+1 (bytes) */
+   u_int64_t d_abase;  /* location of backup copy if not 0 */
+
+   u_chard_packname[64];
+   u_chard_reserved[64];
+
+   /*
+* Note: offsets are relative to the base of the slice, NOT to
+* d_pbase.  Unlike 32 bit disklabels the on-disk format for
+  

svn commit: r267360 - head/sys/conf

2014-06-11 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 11 10:48:11 2014
New Revision: 267360
URL: http://svnweb.freebsd.org/changeset/base/267360

Log:
  Add disklabel64 support
  
  MFC after:2 weeks

Modified:
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Jun 11 10:42:34 2014(r267359)
+++ head/sys/conf/NOTES Wed Jun 11 10:48:11 2014(r267360)
@@ -162,6 +162,7 @@ options GEOM_MULTIPATH  # Disk multipat
 optionsGEOM_NOP# Test class.
 optionsGEOM_PART_APM   # Apple partitioning
 optionsGEOM_PART_BSD   # BSD disklabel
+optionsGEOM_PART_BSD64 # BSD disklabel64
 optionsGEOM_PART_EBR   # Extended Boot Records
 optionsGEOM_PART_EBR_COMPAT# Backward compatible partition names
 optionsGEOM_PART_GPT   # GPT partitioning

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Jun 11 10:42:34 2014(r267359)
+++ head/sys/conf/files Wed Jun 11 10:48:11 2014(r267360)
@@ -2756,6 +2756,7 @@ geom/part/g_part.cstandard
 geom/part/g_part_if.m  standard
 geom/part/g_part_apm.c optional geom_part_apm
 geom/part/g_part_bsd.c optional geom_part_bsd
+geom/part/g_part_bsd64.c   optional geom_part_bsd64
 geom/part/g_part_ebr.c optional geom_part_ebr
 geom/part/g_part_gpt.c optional geom_part_gpt
 geom/part/g_part_ldm.c optional geom_part_ldm

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Wed Jun 11 10:42:34 2014(r267359)
+++ head/sys/conf/options   Wed Jun 11 10:48:11 2014(r267360)
@@ -111,6 +111,7 @@ GEOM_MULTIPATH  opt_geom.h
 GEOM_NOP   opt_geom.h
 GEOM_PART_APM  opt_geom.h
 GEOM_PART_BSD  opt_geom.h
+GEOM_PART_BSD64opt_geom.h
 GEOM_PART_EBR  opt_geom.h
 GEOM_PART_EBR_COMPAT   opt_geom.h
 GEOM_PART_GPT  opt_geom.h
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267361 - head/sys/net

2014-06-11 Thread Alexander V. Chernikov
Author: melifaro
Date: Wed Jun 11 11:27:44 2014
New Revision: 267361
URL: http://svnweb.freebsd.org/changeset/base/267361

Log:
  Improve logic besides net.bpf.optimize_writers.
  Direct bpf(4) consumers should now work fine with this tunable turned on.
  In fact, the only case when optimized_writers can change program
  behavior is direct bpf(4) consumer setting its read filter to
  catch-all one.
  
  MFC after:2 weeks
  Sponsored by: Yandex LLC

Modified:
  head/sys/net/bpf.c

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Wed Jun 11 10:48:11 2014(r267360)
+++ head/sys/net/bpf.c  Wed Jun 11 11:27:44 2014(r267361)
@@ -643,6 +643,67 @@ bpf_attachd(struct bpf_d *d, struct bpf_
 }
 
 /*
+ * Check if we need to upgrade our descriptor @d from write-only mode.
+ */
+static int
+bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct bpf_insn *fcode, int 
flen)
+{
+   int is_snap, need_upgrade;
+
+   /*
+* Check if we've already upgraded or new filter is empty.
+*/
+   if (d->bd_writer == 0 || fcode == NULL)
+   return (0);
+
+   need_upgrade = 0;
+
+   /*
+* Check if cmd looks like snaplen setting from
+* pcap_bpf.c:pcap_open_live().
+* Note we're not checking .k value here:
+* while pcap_open_live() definitely sets to to non-zero value,
+* we'd prefer to treat k=0 (deny ALL) case the same way: e.g.
+* do not consider upgrading immediately
+*/
+   if (cmd == BIOCSETF && flen == 1 && fcode[0].code == (BPF_RET | BPF_K))
+   is_snap = 1;
+   else
+   is_snap = 0;
+
+   if (is_snap == 0) {
+   /*
+* We're setting first filter and it doesn't look like
+* setting snaplen.  We're probably using bpf directly.
+* Upgrade immediately.
+*/
+   need_upgrade = 1;
+   } else {
+   /*
+* Do not require upgrade by first BIOCSETF
+* (used to set snaplen) by pcap_open_live().
+*/
+
+   if (--d->bd_writer == 0) {
+   /*
+* First snaplen filter has already
+* been set. This is probably catch-all
+* filter
+*/
+   need_upgrade = 1;
+   }
+   }
+
+   CTR5(KTR_NET,
+   "%s: filter function set by pid %d, "
+   "bd_writer counter %d, snap %d upgrade %d",
+   __func__, d->bd_pid, d->bd_writer,
+   is_snap, need_upgrade);
+
+   return (need_upgrade);
+}
+
+/*
  * Add d to the list of active bp filters.
  * Reuqires bpf_attachd() to be called before
  */
@@ -1802,17 +1863,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro
if (cmd == BIOCSETF)
reset_d(d);
 
-   if (fcode != NULL) {
-   /*
-* Do not require upgrade by first BIOCSETF
-* (used to set snaplen) by pcap_open_live().
-*/
-   if (d->bd_writer != 0 && --d->bd_writer == 0)
-   need_upgrade = 1;
-   CTR4(KTR_NET, "%s: filter function set by pid %d, "
-   "bd_writer counter %d, need_upgrade %d",
-   __func__, d->bd_pid, d->bd_writer, need_upgrade);
-   }
+   need_upgrade = bpf_check_upgrade(cmd, d, fcode, flen);
}
BPFD_UNLOCK(d);
if (d->bd_bif != NULL)
@@ -1825,7 +1876,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro
 #endif
 
/* Move d to active readers list. */
-   if (need_upgrade)
+   if (need_upgrade != 0)
bpf_upgraded(d);
 
BPF_UNLOCK();
___
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: r267337 - in head: tools/tools/vt/fontcvt usr.bin usr.bin/vtfontcvt

2014-06-11 Thread Alexey Dokuchaev
On Tue, Jun 10, 2014 at 06:29:45PM +, Ed Maste wrote:
> New Revision: 267337
> URL: http://svnweb.freebsd.org/changeset/base/267337
> 
> Log:
>   vt fontcvt: move to usr.bin/vtfontcvt
>   
>   vtfontcvt is useful for end users to convert arbitrary bitmap fonts
>   for use by vt(4).  It can also be used as a build tool, allowing us
>   to keep the source font data in the src tree rather than uuencoded
>   binaries.

Thank you!  I'm not very happy with default font, and would like to make my
own one.  Having it in the base is appreciated. :)

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

2014-06-11 Thread Alexander Motin
Author: mav
Date: Wed Jun 11 12:56:49 2014
New Revision: 267362
URL: http://svnweb.freebsd.org/changeset/base/267362

Log:
  Remove unneeded mountlist_mtx acquisition from sync_fsync().
  
  All struct mount fields accessed by sync_fsync() are protected by MNT_MTX.

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Jun 11 11:27:44 2014(r267361)
+++ head/sys/kern/vfs_subr.cWed Jun 11 12:56:49 2014(r267362)
@@ -3656,11 +3656,8 @@ sync_fsync(struct vop_fsync_args *ap)
 * Walk the list of vnodes pushing all that are dirty and
 * not already on the sync list.
 */
-   mtx_lock(&mountlist_mtx);
-   if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK) != 0) {
-   mtx_unlock(&mountlist_mtx);
+   if (vfs_busy(mp, MBF_NOWAIT) != 0)
return (0);
-   }
if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) {
vfs_unbusy(mp);
return (0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267357 - head/sys/geom/part

2014-06-11 Thread Dmitry Morozovsky
On Wed, 11 Jun 2014, Andrey V. Elsukov wrote:

> Author: ae
> Date: Wed Jun 11 10:19:11 2014
> New Revision: 267357
> URL: http://svnweb.freebsd.org/changeset/base/267357
> 
> Log:
>   Add aliases for DragonFlyBSD's partition types.

These should be documented in sbin/geom/class/part/gpart.8 also.

[snip]

-- 
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer: ma...@freebsd.org ]

*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- ma...@rinet.ru ***

___
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: r267363 - in head/sys: arm/at91 arm/cavium/cns11xx dev/ae dev/age dev/alc dev/ale dev/bfe dev/bge dev/dc dev/jme dev/msk dev/nge dev/re dev/sf dev/sge dev/sis dev/sk dev/ste dev/stge de...

2014-06-11 Thread John Baldwin
Author: jhb
Date: Wed Jun 11 14:53:58 2014
New Revision: 267363
URL: http://svnweb.freebsd.org/changeset/base/267363

Log:
  Fix various NIC drivers to properly cleanup static DMA resources.
  In particular, don't check the value of the bus_dma map against NULL
  to determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded.
  Instead, assume that bus_dmamap_load() succeeeded (and thus that
  bus_dmamap_unload() should be called) if the bus address for a resource
  is non-zero, and assume that bus_dmamem_alloc() succeeded (and thus
  that bus_dmamem_free() should be called) if the virtual address for a
  resource is not NULL.
  
  In many cases these bugs could result in leaks when a driver was detached.
  
  Reviewed by:  yongari
  MFC after:2 weeks

Modified:
  head/sys/arm/at91/if_macb.c
  head/sys/arm/cavium/cns11xx/if_ece.c
  head/sys/dev/ae/if_ae.c
  head/sys/dev/age/if_age.c
  head/sys/dev/alc/if_alc.c
  head/sys/dev/ale/if_ale.c
  head/sys/dev/bfe/if_bfe.c
  head/sys/dev/bge/if_bge.c
  head/sys/dev/dc/if_dc.c
  head/sys/dev/jme/if_jme.c
  head/sys/dev/msk/if_msk.c
  head/sys/dev/nge/if_nge.c
  head/sys/dev/re/if_re.c
  head/sys/dev/sf/if_sf.c
  head/sys/dev/sge/if_sge.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sk/if_sk.c
  head/sys/dev/ste/if_ste.c
  head/sys/dev/stge/if_stge.c
  head/sys/dev/vge/if_vge.c
  head/sys/dev/vr/if_vr.c
  head/sys/dev/vte/if_vte.c
  head/sys/mips/atheros/if_arge.c
  head/sys/mips/idt/if_kr.c
  head/sys/pci/if_rl.c

Modified: head/sys/arm/at91/if_macb.c
==
--- head/sys/arm/at91/if_macb.c Wed Jun 11 12:56:49 2014(r267362)
+++ head/sys/arm/at91/if_macb.c Wed Jun 11 14:53:58 2014(r267363)
@@ -258,14 +258,14 @@ macb_free_desc_dma_tx(struct macb_softc 
 
/* TX descriptor ring. */
if (sc->dmatag_data_tx != NULL) {
-   if (sc->dmamap_ring_tx != NULL)
+   if (sc->ring_paddr_tx != 0)
bus_dmamap_unload(sc->dmatag_data_tx,
sc->dmamap_ring_tx);
-   if (sc->dmamap_ring_tx != NULL && sc->desc_tx != NULL)
+   if (sc->desc_tx != NULL)
bus_dmamem_free(sc->dmatag_data_tx, sc->desc_tx,
sc->dmamap_ring_tx);
-   sc->dmamap_ring_tx = NULL;
-   sc->dmamap_ring_tx = NULL;
+   sc->ring_paddr_tx = 0;
+   sc->desc_tx = NULL;
bus_dma_tag_destroy(sc->dmatag_data_tx);
sc->dmatag_data_tx = NULL;
}
@@ -389,15 +389,14 @@ macb_free_desc_dma_rx(struct macb_softc 
}
/* RX descriptor ring. */
if (sc->dmatag_data_rx != NULL) {
-   if (sc->dmamap_ring_rx != NULL)
+   if (sc->ring_paddr_rx != 0)
bus_dmamap_unload(sc->dmatag_data_rx,
sc->dmamap_ring_rx);
-   if (sc->dmamap_ring_rx != NULL &&
-   sc->desc_rx != NULL)
+   if (sc->desc_rx != NULL)
bus_dmamem_free(sc->dmatag_data_rx, sc->desc_rx,
sc->dmamap_ring_rx);
+   sc->ring_paddr_rx = 0;
sc->desc_rx = NULL;
-   sc->dmamap_ring_rx = NULL;
bus_dma_tag_destroy(sc->dmatag_data_rx);
sc->dmatag_data_rx = NULL;
}

Modified: head/sys/arm/cavium/cns11xx/if_ece.c
==
--- head/sys/arm/cavium/cns11xx/if_ece.cWed Jun 11 12:56:49 2014
(r267362)
+++ head/sys/arm/cavium/cns11xx/if_ece.cWed Jun 11 14:53:58 2014
(r267363)
@@ -565,13 +565,15 @@ ece_free_desc_dma_tx(struct ece_softc *s
}
}
 
-   if (sc->dmamap_ring_tx) {
+   if (sc->ring_paddr_tx) {
bus_dmamap_unload(sc->dmatag_data_tx, sc->dmamap_ring_tx);
-   if (sc->desc_tx) {
-   bus_dmamem_free(sc->dmatag_data_tx,
-   sc->desc_tx, sc->dmamap_ring_tx);
-   }
-   sc->dmamap_ring_tx = 0;
+   sc->ring_paddr_tx = 0;
+   }
+
+   if (sc->desc_tx) {
+   bus_dmamem_free(sc->dmatag_data_tx,
+   sc->desc_tx, sc->dmamap_ring_tx);
+   sc->desc_tx = NULL;
}
 
if (sc->dmatag_data_tx) {
@@ -679,18 +681,24 @@ ece_free_desc_dma_rx(struct ece_softc *s
for (i = 0; i < ECE_MAX_RX_BUFFERS; i++) {
if (sc->rx_desc[i].buff) {
m_freem(sc->rx_desc[i].buff);
-   sc->rx_desc[i].buff= 0;
+   sc->rx_desc[i].buff = NULL;
}
}
 
-   if (sc->dmatag_data_rx) {
+   if (sc->ring_paddr_rx) {
bus_dmamap_unload(sc->dmatag_data_rx, sc->dmamap_ring_rx);
+   sc->ring_paddr_rx = 0;
+   }
+

Re: svn commit: r267359 - in head: sbin/geom/class/part sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64

2014-06-11 Thread Nathan Whitehorn

On 06/11/14 03:42, Andrey V. Elsukov wrote:

Author: ae
Date: Wed Jun 11 10:42:34 2014
New Revision: 267359
URL: http://svnweb.freebsd.org/changeset/base/267359

Log:
   Add disklabel64 support to GEOM_PART class.
   
   This partitioning scheme is used in DragonFlyBSD. It is similar to

   BSD disklabel, but has the following improvements:
   * metadata has own dedicated place and isn't accessible through partitions;
   * all offsets are 64-bit;
   * supports 16 partitions by default (has reserved place for more);
   * has reserved place for backup label (but not yet implemented);
   * has UUIDs for partitions and partition types;
   



Is this something worth adding to the installer/sade partition types 
menu? On the one hand, we support it. On the other hand, it's not 
bootable on any architecture. So I can't make up my mind.

-Nathan
___
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: r267364 - head/sys/vm

2014-06-11 Thread Alan Cox
Author: alc
Date: Wed Jun 11 16:11:12 2014
New Revision: 267364
URL: http://svnweb.freebsd.org/changeset/base/267364

Log:
  Correct a bug in the management of the population map on big-endian
  machines.  Specifically, there was a mismatch between how the routine
  allocation and deallocation operations accessed the population map
  and how the aggressively optimized reservation-breaking operation
  accessed it.  So, problems only occurred when reservations were broken.
  This change makes the routine operations access the population map in
  the same way as the reservation breaking operation.
  
  This bug was introduced in r25.
  
  PR:   187080
  Tested by:jmg (on an "armeb" machine)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_reserv.c
==
--- head/sys/vm/vm_reserv.c Wed Jun 11 14:53:58 2014(r267363)
+++ head/sys/vm/vm_reserv.c Wed Jun 11 16:11:12 2014(r267364)
@@ -108,6 +108,46 @@ typedefu_long  popmap_t;
 #defineNPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP)
 
 /*
+ * Clear a bit in the population map.
+ */
+static __inline void
+popmap_clear(popmap_t popmap[], int i)
+{
+
+   popmap[i / NBPOPMAP] &= ~(1UL << (i % NBPOPMAP));
+}
+
+/*
+ * Set a bit in the population map.
+ */
+static __inline void
+popmap_set(popmap_t popmap[], int i)
+{
+
+   popmap[i / NBPOPMAP] |= 1UL << (i % NBPOPMAP);
+}
+
+/*
+ * Is a bit in the population map clear?
+ */
+static __inline boolean_t
+popmap_is_clear(popmap_t popmap[], int i)
+{
+
+   return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) == 0);
+}
+
+/*
+ * Is a bit in the population map set?
+ */
+static __inline boolean_t
+popmap_is_set(popmap_t popmap[], int i)
+{
+
+   return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) != 0);
+}
+
+/*
  * The reservation structure
  *
  * A reservation structure is constructed whenever a large physical page is
@@ -241,7 +281,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
KASSERT(rv->object != NULL,
("vm_reserv_depopulate: reserv %p is free", rv));
-   KASSERT(isset(rv->popmap, index),
+   KASSERT(popmap_is_set(rv->popmap, index),
("vm_reserv_depopulate: reserv %p's popmap[%d] is clear", rv,
index));
KASSERT(rv->popcnt > 0,
@@ -255,7 +295,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int
rv));
rv->pages->psind = 0;
}
-   clrbit(rv->popmap, index);
+   popmap_clear(rv->popmap, index);
rv->popcnt--;
if (rv->popcnt == 0) {
LIST_REMOVE(rv, objq);
@@ -302,7 +342,7 @@ vm_reserv_populate(vm_reserv_t rv, int i
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
KASSERT(rv->object != NULL,
("vm_reserv_populate: reserv %p is free", rv));
-   KASSERT(isclr(rv->popmap, index),
+   KASSERT(popmap_is_clear(rv->popmap, index),
("vm_reserv_populate: reserv %p's popmap[%d] is set", rv,
index));
KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES,
@@ -313,7 +353,7 @@ vm_reserv_populate(vm_reserv_t rv, int i
TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq);
rv->inpartpopq = FALSE;
}
-   setbit(rv->popmap, index);
+   popmap_set(rv->popmap, index);
rv->popcnt++;
if (rv->popcnt < VM_LEVEL_0_NPAGES) {
rv->inpartpopq = TRUE;
@@ -503,7 +543,7 @@ found:
return (NULL);
/* Handle vm_page_rename(m, new_object, ...). */
for (i = 0; i < npages; i++)
-   if (isset(rv->popmap, index + i))
+   if (popmap_is_set(rv->popmap, index + i))
return (NULL);
for (i = 0; i < npages; i++)
vm_reserv_populate(rv, index + i);
@@ -628,7 +668,7 @@ found:
index = VM_RESERV_INDEX(object, pindex);
m = &rv->pages[index];
/* Handle vm_page_rename(m, new_object, ...). */
-   if (isset(rv->popmap, index))
+   if (popmap_is_set(rv->popmap, index))
return (NULL);
vm_reserv_populate(rv, index);
return (m);
@@ -662,9 +702,9 @@ vm_reserv_break(vm_reserv_t rv, vm_page_
 * to the physical memory allocator.
 */
i = m - rv->pages;
-   KASSERT(isclr(rv->popmap, i),
+   KASSERT(popmap_is_clear(rv->popmap, i),
("vm_reserv_break: reserv %p's popmap is corrupted", rv));
-   setbit(rv->popmap, i);
+   popmap_set(rv->popmap, i);
rv->popcnt++;
}
i = hi = 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-unsubsc

svn commit: r267365 - in head/sys/dev: aha ahb aic7xxx de

2014-06-11 Thread John Baldwin
Author: jhb
Date: Wed Jun 11 17:03:14 2014
New Revision: 267365
URL: http://svnweb.freebsd.org/changeset/base/267365

Log:
  Fix a few more drivers that were explicitly destroying the bus_dma
  map created by bus_dmamem_alloc().

Modified:
  head/sys/dev/aha/aha.c
  head/sys/dev/ahb/ahb.c
  head/sys/dev/aic7xxx/aic79xx.c
  head/sys/dev/aic7xxx/aic7xxx.c
  head/sys/dev/de/if_de.c

Modified: head/sys/dev/aha/aha.c
==
--- head/sys/dev/aha/aha.c  Wed Jun 11 16:11:12 2014(r267364)
+++ head/sys/dev/aha/aha.c  Wed Jun 11 17:03:14 2014(r267365)
@@ -209,7 +209,6 @@ aha_free(struct aha_softc *aha)
case 6:
bus_dmamem_free(aha->ccb_dmat, aha->aha_ccb_array,
aha->ccb_dmamap);
-   bus_dmamap_destroy(aha->ccb_dmat, aha->ccb_dmamap);
case 5:
bus_dma_tag_destroy(aha->ccb_dmat);
case 4:
@@ -217,7 +216,6 @@ aha_free(struct aha_softc *aha)
case 3:
bus_dmamem_free(aha->mailbox_dmat, aha->in_boxes,
aha->mailbox_dmamap);
-   bus_dmamap_destroy(aha->mailbox_dmat, aha->mailbox_dmamap);
case 2:
bus_dma_tag_destroy(aha->buffer_dmat);
case 1:

Modified: head/sys/dev/ahb/ahb.c
==
--- head/sys/dev/ahb/ahb.c  Wed Jun 11 16:11:12 2014(r267364)
+++ head/sys/dev/ahb/ahb.c  Wed Jun 11 17:03:14 2014(r267365)
@@ -421,7 +421,6 @@ ahbfree(struct ahb_softc *ahb)
case 3:
bus_dmamem_free(ahb->ecb_dmat, ahb->ecb_array,
ahb->ecb_dmamap);
-   bus_dmamap_destroy(ahb->ecb_dmat, ahb->ecb_dmamap);
case 2:
bus_dma_tag_destroy(ahb->ecb_dmat);
case 1:

Modified: head/sys/dev/aic7xxx/aic79xx.c
==
--- head/sys/dev/aic7xxx/aic79xx.c  Wed Jun 11 16:11:12 2014
(r267364)
+++ head/sys/dev/aic7xxx/aic79xx.c  Wed Jun 11 17:03:14 2014
(r267365)
@@ -5413,8 +5413,6 @@ ahd_free(struct ahd_softc *ahd)
case 3:
aic_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo,
ahd->shared_data_map.dmamap);
-   aic_dmamap_destroy(ahd, ahd->shared_data_dmat,
-  ahd->shared_data_map.dmamap);
/* FALLTHROUGH */
case 2:
aic_dma_tag_destroy(ahd, ahd->shared_data_dmat);

Modified: head/sys/dev/aic7xxx/aic7xxx.c
==
--- head/sys/dev/aic7xxx/aic7xxx.c  Wed Jun 11 16:11:12 2014
(r267364)
+++ head/sys/dev/aic7xxx/aic7xxx.c  Wed Jun 11 17:03:14 2014
(r267365)
@@ -4061,8 +4061,6 @@ ahc_free(struct ahc_softc *ahc)
case 3:
aic_dmamem_free(ahc, ahc->shared_data_dmat, ahc->qoutfifo,
ahc->shared_data_dmamap);
-   aic_dmamap_destroy(ahc, ahc->shared_data_dmat,
-  ahc->shared_data_dmamap);
/* FALLTHROUGH */
case 2:
aic_dma_tag_destroy(ahc, ahc->shared_data_dmat);
@@ -4501,8 +4499,6 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
case 5:
aic_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense,
scb_data->sense_dmamap);
-   aic_dmamap_destroy(ahc, scb_data->sense_dmat,
-  scb_data->sense_dmamap);
case 4:
aic_dma_tag_destroy(ahc, scb_data->sense_dmat);
case 3:
@@ -4511,8 +4507,6 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
case 2:
aic_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs,
scb_data->hscb_dmamap);
-   aic_dmamap_destroy(ahc, scb_data->hscb_dmat,
-  scb_data->hscb_dmamap);
case 1:
aic_dma_tag_destroy(ahc, scb_data->hscb_dmat);
break;

Modified: head/sys/dev/de/if_de.c
==
--- head/sys/dev/de/if_de.c Wed Jun 11 16:11:12 2014(r267364)
+++ head/sys/dev/de/if_de.c Wed Jun 11 17:03:14 2014(r267365)
@@ -4558,7 +4558,6 @@ tulip_busdma_cleanup(tulip_softc_t * con
 if (sc->tulip_setupbuf != NULL) {
bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf,
sc->tulip_setup_map);
-   bus_dmamap_destroy(sc->tulip_setup_tag, sc->tulip_setup_map);
sc->tulip_setup_map = NULL;
sc->tulip_setupbuf = NULL;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send 

svn commit: r267366 - head/usr.bin/vtfontcvt

2014-06-11 Thread Ed Maste
Author: emaste
Date: Wed Jun 11 17:19:57 2014
New Revision: 267366
URL: http://svnweb.freebsd.org/changeset/base/267366

Log:
  Avoid leaking file pointer on error
  
  CID:  1222506, 1222505

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

Modified: head/usr.bin/vtfontcvt/vtfontcvt.c
==
--- head/usr.bin/vtfontcvt/vtfontcvt.c  Wed Jun 11 17:03:14 2014
(r267365)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c  Wed Jun 11 17:19:57 2014
(r267366)
@@ -331,6 +331,7 @@ parse_file(const char *filename, unsigne
 {
FILE *fp;
size_t len;
+   int rv;
 
fp = fopen(filename, "r");
if (fp == NULL) {
@@ -339,8 +340,11 @@ parse_file(const char *filename, unsigne
}
len = strlen(filename);
if (len > 4 && strcasecmp(filename + len - 4, ".hex") == 0)
-   return parse_hex(fp, map_idx);
-   return parse_bdf(fp, map_idx);
+   rv = parse_hex(fp, map_idx);
+   else
+   rv = parse_bdf(fp, map_idx);
+   fclose(fp);
+   return (rv);
 }
 
 static void
@@ -447,6 +451,7 @@ write_fnt(const char *filename)
fh.map_count[3] = htobe32(map_folded_count[3]);
if (fwrite(&fh, sizeof fh, 1, fp) != 1) {
perror(filename);
+   fclose(fp);
return (1);
}
 
@@ -456,9 +461,11 @@ write_fnt(const char *filename)
write_mappings(fp, VFNT_MAP_BOLD) != 0 ||
write_mappings(fp, 3) != 0) {
perror(filename);
+   fclose(fp);
return (1);
}
 
+   fclose(fp);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267368 - in head/sys/dev: hpt27xx hptmv hptrr

2014-06-11 Thread Xin LI
Author: delphij
Date: Wed Jun 11 18:24:51 2014
New Revision: 267368
URL: http://svnweb.freebsd.org/changeset/base/267368

Log:
  Apply vendor fixes to the High Point drivers:
  
   - Don't call xpt_free_path() in os_query_remove_device() and
 always return TRUE.
   - Update os_buildsgl() to support build logical SG table which
 will be used by lower RAID module.
   - Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target
 missing.
  
  Many thanks to HighPoint for providing this driver update.
  
  Submitted by: Steve Chang
  Reviewed by:  mav
  MFC after:3 days

Modified:
  head/sys/dev/hpt27xx/hpt27xx_os_bsd.c
  head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
  head/sys/dev/hptmv/entry.c
  head/sys/dev/hptrr/hptrr_os_bsd.c
  head/sys/dev/hptrr/hptrr_osm_bsd.c

Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c
==
--- head/sys/dev/hpt27xx/hpt27xx_os_bsd.c   Wed Jun 11 17:48:07 2014
(r267367)
+++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c   Wed Jun 11 18:24:51 2014
(r267368)
@@ -324,21 +324,7 @@ int os_revalidate_device(void *osext, in
 
 int os_query_remove_device(void *osext, int id)
 {
-   PVBUS_EXT   vbus_ext = (PVBUS_EXT)osext;
-   struct cam_periph   *periph = NULL;
-struct cam_path*path;
-intstatus,retval = 0;
-
-status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0);
-if (status == CAM_REQ_CMP) {
-   if((periph = cam_periph_find(path, "da")) != NULL){
-   if(periph->refcount >= 1)   
-   retval = -1;
-   }
-   xpt_free_path(path);
-}
-
-return retval;
+   return 0;
 }
 
 HPT_U8 os_get_vbus_seq(void *osext)

Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==
--- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c  Wed Jun 11 17:48:07 2014
(r267367)
+++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c  Wed Jun 11 18:24:51 2014
(r267368)
@@ -483,6 +483,16 @@ static void os_cmddone(PCOMMAND pCmd)
 
 static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical)
 {
+   POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv;
+   union ccb *ccb = ext->ccb;
+
+   if (logical) {
+   os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr);
+   pSg->size = ccb->csio.dxfer_len;
+   pSg->eot = 1;
+   return TRUE;
+   }
+
/* since we have provided physical sg, nobody will ask us to build 
physical sg */
HPT_ASSERT(0);
return FALSE;
@@ -555,7 +565,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e
vd = ldm_find_target(vbus, ccb->ccb_h.target_id);
 
if (!vd) {
-   ccb->ccb_h.status = CAM_TID_INVALID;
+   ccb->ccb_h.status = CAM_SEL_TIMEOUT;
xpt_done(ccb);
return;
}

Modified: head/sys/dev/hptmv/entry.c
==
--- head/sys/dev/hptmv/entry.c  Wed Jun 11 17:48:07 2014(r267367)
+++ head/sys/dev/hptmv/entry.c  Wed Jun 11 18:24:51 2014(r267368)
@@ -2016,7 +2016,7 @@ hpt_probe(device_t dev)
{
KdPrintI((CONTROLLER_NAME " found\n"));
device_set_desc(dev, CONTROLLER_NAME);
-   return 0;
+   return (BUS_PROBE_DEFAULT);
}
else
return(ENXIO);
@@ -2623,7 +2623,14 @@ launch_worker_thread(void)
 
 int HPTLIBAPI fOsBuildSgl(_VBUS_ARG PCommand pCmd, FPSCAT_GATH pSg, int 
logical)
 {
-
+   union ccb *ccb = (union ccb *)pCmd->pOrgCommand;
+ 
+   if (logical) {
+   pSg->dSgAddress = (ULONG_PTR)(UCHAR *)ccb->csio.data_ptr;
+   pSg->wSgSize = ccb->csio.dxfer_len;
+   pSg->wSgFlag = SG_FLAG_EOT;
+   return TRUE;
+   }
/* since we have provided physical sg, nobody will ask us to build 
physical sg */
HPT_ASSERT(0);
return FALSE;

Modified: head/sys/dev/hptrr/hptrr_os_bsd.c
==
--- head/sys/dev/hptrr/hptrr_os_bsd.c   Wed Jun 11 17:48:07 2014
(r267367)
+++ head/sys/dev/hptrr/hptrr_os_bsd.c   Wed Jun 11 18:24:51 2014
(r267368)
@@ -256,21 +256,7 @@ int os_revalidate_device(void *osext, in
 
 int os_query_remove_device(void *osext, int id)
 {
-   PVBUS_EXT   vbus_ext = (PVBUS_EXT)osext;
-   struct cam_periph   *periph = NULL;
-struct cam_path*path;
-intstatus,retval = 0;
-
-status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0);
-if (status == CAM_REQ_CMP) {
-   if((periph = cam_p

svn commit: r267371 - head/lib/libfetch

2014-06-11 Thread Baptiste Daroussin
Author: bapt
Date: Wed Jun 11 20:20:14 2014
New Revision: 267371
URL: http://svnweb.freebsd.org/changeset/base/267371

Log:
  Use Mt macro to properly format mailto links (patch from Franco Fichtner 
 for Dragonfly)
  
  Reviewed by:  des
  Approved by:  des
  Obtained from:Dragonfly
  MFC after:1 week

Modified:
  head/lib/libfetch/fetch.3

Modified: head/lib/libfetch/fetch.3
==
--- head/lib/libfetch/fetch.3   Wed Jun 11 19:27:32 2014(r267370)
+++ head/lib/libfetch/fetch.3   Wed Jun 11 20:20:14 2014(r267371)
@@ -774,27 +774,27 @@ library first appeared in
 The
 .Nm fetch
 library was mostly written by
-.An Dag-Erling Sm\(/orgrav Aq d...@freebsd.org
+.An Dag-Erling Sm\(/orgrav Aq Mt d...@freebsd.org
 with numerous suggestions and contributions from
-.An Jordan K. Hubbard Aq j...@freebsd.org ,
-.An Eugene Skepner Aq e...@qub.com ,
-.An Hajimu Umemoto Aq u...@freebsd.org ,
-.An Henry Whincup Aq he...@techiebod.com ,
-.An Jukka A. Ukkonen Aq j...@iki.fi ,
-.An Jean-Fran\(,cois Dockes Aq j...@dockes.org ,
-.An Michael Gmelin Aq free...@grem.de
+.An Jordan K. Hubbard Aq Mt j...@freebsd.org ,
+.An Eugene Skepner Aq Mt e...@qub.com ,
+.An Hajimu Umemoto Aq Mt u...@freebsd.org ,
+.An Henry Whincup Aq Mt he...@techiebod.com ,
+.An Jukka A. Ukkonen Aq Mt j...@iki.fi ,
+.An Jean-Fran\(,cois Dockes Aq Mt j...@dockes.org ,
+.An Michael Gmelin Aq Mt free...@grem.de
 and others.
 It replaces the older
 .Nm ftpio
 library written by
-.An Poul-Henning Kamp Aq p...@freebsd.org
+.An Poul-Henning Kamp Aq Mt p...@freebsd.org
 and
-.An Jordan K. Hubbard Aq j...@freebsd.org .
+.An Jordan K. Hubbard Aq Mt j...@freebsd.org .
 .Pp
 This manual page was written by
-.An Dag-Erling Sm\(/orgrav Aq d...@freebsd.org
+.An Dag-Erling Sm\(/orgrav Aq Mt d...@freebsd.org
 and
-.An Michael Gmelin Aq free...@grem.de .
+.An Michael Gmelin Aq Mt free...@grem.de .
 .Sh BUGS
 Some parts of the library are not yet implemented.
 The most notable
___
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: r267372 - head/sys/contrib/x86emu

2014-06-11 Thread Xin LI
Author: delphij
Date: Wed Jun 11 20:22:14 2014
New Revision: 267372
URL: http://svnweb.freebsd.org/changeset/base/267372

Log:
  Fix decoding of MOVSX.
  
  Submitted by: Wolf Ramovsky 
via core (peter)
  MFC after:2 weeks

Modified:
  head/sys/contrib/x86emu/x86emu.c

Modified: head/sys/contrib/x86emu/x86emu.c
==
--- head/sys/contrib/x86emu/x86emu.cWed Jun 11 20:20:14 2014
(r267371)
+++ head/sys/contrib/x86emu/x86emu.cWed Jun 11 20:22:14 2014
(r267372)
@@ -5610,6 +5610,7 @@ x86emuOp2_32_movsx_byte_R_RM(struct x86e
 {
uint32_t *destreg;
 
+   fetch_decode_modrm(emu);
destreg = decode_rh_long_register(emu);
*destreg = (int32_t)(int8_t)decode_and_fetch_byte(emu);
 }
___
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: r267373 - head/sys/contrib/x86emu

2014-06-11 Thread Xin LI
Author: delphij
Date: Wed Jun 11 20:31:41 2014
New Revision: 267373
URL: http://svnweb.freebsd.org/changeset/base/267373

Log:
  Fix decoding of LEA when address-size prefix (67h) is present.
  
  This is loosly based on Xorg changeset f57bc0e by Christian
  Zander.
  
  Submitted by: Wolf Ramovsky 
via core (peter)
  MFC after:2 weeks

Modified:
  head/sys/contrib/x86emu/x86emu.c

Modified: head/sys/contrib/x86emu/x86emu.c
==
--- head/sys/contrib/x86emu/x86emu.cWed Jun 11 20:22:14 2014
(r267372)
+++ head/sys/contrib/x86emu/x86emu.cWed Jun 11 20:31:41 2014
(r267373)
@@ -2151,21 +2151,24 @@ x86emuOp_mov_word_RM_SR(struct x86emu *e
 static void
 x86emuOp_lea_word_R_M(struct x86emu *emu)
 {
-   uint16_t *srcreg;
uint32_t destoffset;
 
-/*
- * TODO: Need to handle address size prefix!
- *
- * lea  eax,[eax+ebx*2] ??
- */
fetch_decode_modrm(emu);
if (emu->cur_mod == 3)
x86emu_halt_sys(emu);
 
-   srcreg = decode_rh_word_register(emu);
destoffset = decode_rl_address(emu);
-   *srcreg = (uint16_t) destoffset;
+   if (emu->x86.mode & SYSMODE_PREFIX_ADDR) {
+   uint32_t *srcreg;
+
+   srcreg = decode_rh_long_register(emu);
+   *srcreg = (uint32_t) destoffset;
+   } else {
+   uint16_t *srcreg;
+
+   srcreg = decode_rh_word_register(emu);
+   *srcreg = (uint16_t) destoffset;
+   }
 }
 
 /*
___
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: r267374 - head/sys/contrib/x86emu

2014-06-11 Thread Xin LI
Author: delphij
Date: Wed Jun 11 20:38:14 2014
New Revision: 267374
URL: http://svnweb.freebsd.org/changeset/base/267374

Log:
  Fix decoding of near CALL when address-size prefix (67h) is present.
  
  Submitted by: Wolf Ramovsky 
via core (peter)
  MFC after:2 weeks

Modified:
  head/sys/contrib/x86emu/x86emu.c

Modified: head/sys/contrib/x86emu/x86emu.c
==
--- head/sys/contrib/x86emu/x86emu.cWed Jun 11 20:31:41 2014
(r267373)
+++ head/sys/contrib/x86emu/x86emu.cWed Jun 11 20:38:14 2014
(r267374)
@@ -3753,12 +3753,19 @@ x86emuOp_out_word_IMM_AX(struct x86emu *
 static void
 x86emuOp_call_near_IMM(struct x86emu *emu)
 {
-   int16_t ip;
-
-   ip = (int16_t) fetch_word_imm(emu);
-   ip += (int16_t) emu->x86.R_IP;  /* CHECK SIGN */
-   push_word(emu, emu->x86.R_IP);
-   emu->x86.R_IP = ip;
+   if (emu->x86.mode & SYSMODE_PREFIX_DATA) {
+   int32_t ip;
+   ip = (int32_t) fetch_long_imm(emu);
+   ip += (int32_t) emu->x86.R_EIP;
+   push_long(emu, emu->x86.R_EIP);
+   emu->x86.R_EIP = ip;
+   } else {
+   int16_t ip;
+   ip = (int16_t) fetch_word_imm(emu);
+   ip += (int16_t) emu->x86.R_IP;  /* CHECK SIGN */
+   push_word(emu, emu->x86.R_IP);
+   emu->x86.R_IP = ip;
+   }
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267375 - in head/sys/dev: qlxgb qlxgbe qlxge

2014-06-11 Thread John Baldwin
Author: jhb
Date: Wed Jun 11 20:44:02 2014
New Revision: 267375
URL: http://svnweb.freebsd.org/changeset/base/267375

Log:
  Unload maps for DMA buffers allocated via bus_dmamem_alloc() before
  freeing the buffers.
  
  Reviewed by:  davidcs

Modified:
  head/sys/dev/qlxgb/qla_os.c
  head/sys/dev/qlxgbe/ql_os.c
  head/sys/dev/qlxge/qls_os.c

Modified: head/sys/dev/qlxgb/qla_os.c
==
--- head/sys/dev/qlxgb/qla_os.c Wed Jun 11 20:38:14 2014(r267374)
+++ head/sys/dev/qlxgb/qla_os.c Wed Jun 11 20:44:02 2014(r267375)
@@ -602,6 +602,7 @@ qla_alloc_dmabuf_exit:
 void
 qla_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf)
 {
+bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map);
 bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map);
 bus_dma_tag_destroy(dma_buf->dma_tag);
 }

Modified: head/sys/dev/qlxgbe/ql_os.c
==
--- head/sys/dev/qlxgbe/ql_os.c Wed Jun 11 20:38:14 2014(r267374)
+++ head/sys/dev/qlxgbe/ql_os.c Wed Jun 11 20:44:02 2014(r267375)
@@ -681,6 +681,7 @@ ql_alloc_dmabuf_exit:
 void
 ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf)
 {
+bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map);
 bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map);
 bus_dma_tag_destroy(dma_buf->dma_tag);
 }

Modified: head/sys/dev/qlxge/qls_os.c
==
--- head/sys/dev/qlxge/qls_os.c Wed Jun 11 20:38:14 2014(r267374)
+++ head/sys/dev/qlxge/qls_os.c Wed Jun 11 20:44:02 2014(r267375)
@@ -670,6 +670,7 @@ qls_alloc_dmabuf_exit:
 void
 qls_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf)
 {
+bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map);
 bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map);
 bus_dma_tag_destroy(dma_buf->dma_tag);
 }
___
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: r267376 - head/lib/libz

2014-06-11 Thread Baptiste Daroussin
Author: bapt
Date: Wed Jun 11 20:44:54 2014
New Revision: 267376
URL: http://svnweb.freebsd.org/changeset/base/267376

Log:
  Add a zlib pkg-config file (more and more ports requires it)
  
  Approved by:  delphij
  MFC after:1 week

Added:
  head/lib/libz/zlib.pc   (contents, props changed)
Modified:
  head/lib/libz/Makefile

Modified: head/lib/libz/Makefile
==
--- head/lib/libz/Makefile  Wed Jun 11 20:44:02 2014(r267375)
+++ head/lib/libz/Makefile  Wed Jun 11 20:44:54 2014(r267376)
@@ -66,6 +66,10 @@ test: example minigzip
(export LD_LIBRARY_PATH=. ; \
echo hello world | ./minigzip | ./minigzip -d )
 
+beforeinstall:
+   ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+   ${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+
 .include 
 
 ## XXX: clang integrated-as doesn't grok .intel_syntax directives yet

Added: head/lib/libz/zlib.pc
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libz/zlib.pc   Wed Jun 11 20:44:54 2014(r267376)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+sharedlibdir=${libdir}
+includedir=${prefix}/include
+
+Name: zlib
+Description: zlib compression library
+Version: 1.2.8
+
+Requires:
+Libs: -L${libdir} -L${sharedlibdir} -lz
+Cflags: -I${includedir}
___
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: r267377 - head/sys/dev/bce

2014-06-11 Thread John Baldwin
Author: jhb
Date: Wed Jun 11 20:46:23 2014
New Revision: 267377
URL: http://svnweb.freebsd.org/changeset/base/267377

Log:
  - Unmap static DMA buffers allocated via bus_dmemem_alloc() before
freeing them instead of after.
  - Check the bus address of a static DMA buffer to decide if the associated
map should be unloaded.
  - Don't try to destroy bus dma maps for static DMA buffers.
  
  Reviewed by:  davidcs

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

Modified: head/sys/dev/bce/if_bce.c
==
--- head/sys/dev/bce/if_bce.c   Wed Jun 11 20:44:54 2014(r267376)
+++ head/sys/dev/bce/if_bce.c   Wed Jun 11 20:46:23 2014(r267377)
@@ -3251,6 +3251,13 @@ bce_dma_free(struct bce_softc *sc)
DBENTER(BCE_VERBOSE_RESET | BCE_VERBOSE_UNLOAD | BCE_VERBOSE_CTX);
 
/* Free, unmap, and destroy the status block. */
+   if (sc->status_block_paddr != 0) {
+   bus_dmamap_unload(
+   sc->status_tag,
+   sc->status_map);
+   sc->status_block_paddr = 0;
+   }
+
if (sc->status_block != NULL) {
bus_dmamem_free(
   sc->status_tag,
@@ -3259,15 +3266,6 @@ bce_dma_free(struct bce_softc *sc)
sc->status_block = NULL;
}
 
-   if (sc->status_map != NULL) {
-   bus_dmamap_unload(
-   sc->status_tag,
-   sc->status_map);
-   bus_dmamap_destroy(sc->status_tag,
-   sc->status_map);
-   sc->status_map = NULL;
-   }
-
if (sc->status_tag != NULL) {
bus_dma_tag_destroy(sc->status_tag);
sc->status_tag = NULL;
@@ -3275,21 +3273,19 @@ bce_dma_free(struct bce_softc *sc)
 
 
/* Free, unmap, and destroy the statistics block. */
-   if (sc->stats_block != NULL) {
-   bus_dmamem_free(
+   if (sc->stats_block_paddr != 0) {
+   bus_dmamap_unload(
sc->stats_tag,
-   sc->stats_block,
sc->stats_map);
-   sc->stats_block = NULL;
+   sc->stats_block_paddr = 0;
}
 
-   if (sc->stats_map != NULL) {
-   bus_dmamap_unload(
+   if (sc->stats_block != NULL) {
+   bus_dmamem_free(
sc->stats_tag,
+   sc->stats_block,
sc->stats_map);
-   bus_dmamap_destroy(sc->stats_tag,
-   sc->stats_map);
-   sc->stats_map = NULL;
+   sc->stats_block = NULL;
}
 
if (sc->stats_tag != NULL) {
@@ -3301,22 +3297,19 @@ bce_dma_free(struct bce_softc *sc)
/* Free, unmap and destroy all context memory pages. */
if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) {
for (i = 0; i < sc->ctx_pages; i++ ) {
-   if (sc->ctx_block[i] != NULL) {
-   bus_dmamem_free(
+   if (sc->ctx_paddr[i] != 0) {
+   bus_dmamap_unload(
sc->ctx_tag,
-   sc->ctx_block[i],
sc->ctx_map[i]);
-   sc->ctx_block[i] = NULL;
+   sc->ctx_paddr[i] = 0;
}
 
-   if (sc->ctx_map[i] != NULL) {
-   bus_dmamap_unload(
-   sc->ctx_tag,
-   sc->ctx_map[i]);
-   bus_dmamap_destroy(
+   if (sc->ctx_block[i] != NULL) {
+   bus_dmamem_free(
sc->ctx_tag,
+   sc->ctx_block[i],
sc->ctx_map[i]);
-   sc->ctx_map[i] = NULL;
+   sc->ctx_block[i] = NULL;
}
}
 
@@ -3330,22 +3323,19 @@ bce_dma_free(struct bce_softc *sc)
 
/* Free, unmap and destroy all TX buffer descriptor chain pages. */
for (i = 0; i < sc->tx_pages; i++ ) {
-   if (sc->tx_bd_chain[i] != NULL) {
-   bus_dmamem_free(
+   if (sc->tx_bd_chain_paddr[i] != 0) {
+   bus_dmamap_unload(
sc->tx_bd_chain_tag,
-   sc->tx_bd_chain[i],
sc->tx_bd_chain_map[i]);
-   sc->tx_bd_chain[i] = NULL;
+   sc->tx_bd_chain_paddr[i] = 0;
}
 
-   if (sc->tx_bd_chain_map[i] != NULL) {
-   bus_dmamap_unload(
-   sc->tx_bd_chain_tag,
-   sc->tx_bd_chain_map[i]);
-   bus_dmamap_destroy(

svn commit: r267378 - head/lib/libz

2014-06-11 Thread Xin LI
Author: delphij
Date: Wed Jun 11 20:48:40 2014
New Revision: 267378
URL: http://svnweb.freebsd.org/changeset/base/267378

Log:
  Fix path for zlib examples, this have no runtime effect and was
  overlooked when I was doing zlib update.
  
  MFC after:2 weeks

Modified:
  head/lib/libz/Makefile

Modified: head/lib/libz/Makefile
==
--- head/lib/libz/Makefile  Wed Jun 11 20:46:23 2014(r267377)
+++ head/lib/libz/Makefile  Wed Jun 11 20:48:40 2014(r267378)
@@ -55,6 +55,8 @@ CFLAGS+=  -DSYMBOL_VERSIONING
 
 INCS=  zconf.h zlib.h
 
+.PATH: ${.CURDIR}/test
+
 minigzip:  all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
 
___
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: r267371 - head/lib/libfetch

2014-06-11 Thread Sergey Kandaurov
On 12 June 2014 00:20, Baptiste Daroussin  wrote:
> Author: bapt
> Date: Wed Jun 11 20:20:14 2014
> New Revision: 267371
> URL: http://svnweb.freebsd.org/changeset/base/267371
>
> Log:
>   Use Mt macro to properly format mailto links (patch from Franco Fichtner 
>  for Dragonfly)

This doesn't look like a complete change touching fetch.1 and others.
The commit log is also a very long line (like this one).
The Mt macro is undocumented in the groff documentation (despite, it is used
there).

-- 
wbr,
pluknet
___
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: r267371 - head/lib/libfetch

2014-06-11 Thread Baptiste Daroussin
On Thu, Jun 12, 2014 at 01:37:46AM +0400, Sergey Kandaurov wrote:
> On 12 June 2014 00:20, Baptiste Daroussin  wrote:
> > Author: bapt
> > Date: Wed Jun 11 20:20:14 2014
> > New Revision: 267371
> > URL: http://svnweb.freebsd.org/changeset/base/267371
> >
> > Log:
> >   Use Mt macro to properly format mailto links (patch from Franco Fichtner 
> >  for Dragonfly)
> 
> This doesn't look like a complete change touching fetch.1 and others.
> The commit log is also a very long line (like this one).
> The Mt macro is undocumented in the groff documentation (despite, it is used
> there).

Sorry for the commit line

I was just trying to sync changes from Dragonfly touching libfetch so only
concerning libfetch.3

The macro is documented in newer version of mandoc/mdocml so will get the
documentation when this will be updated.

regards,
Bapt


pgpbHVjE0eLgk.pgp
Description: PGP signature


Re: svn commit: r267359 - in head: sbin/geom/class/part sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64

2014-06-11 Thread Andrey V. Elsukov
On 11.06.2014 19:09, Nathan Whitehorn wrote:
>>Add disklabel64 support to GEOM_PART class.
>>   This partitioning scheme is used in DragonFlyBSD. It is similar to
>>BSD disklabel, but has the following improvements:
>>* metadata has own dedicated place and isn't accessible through
>> partitions;
>>* all offsets are 64-bit;
>>* supports 16 partitions by default (has reserved place for more);
>>* has reserved place for backup label (but not yet implemented);
>>* has UUIDs for partitions and partition types;
>>   
> 
> Is this something worth adding to the installer/sade partition types
> menu? On the one hand, we support it. On the other hand, it's not
> bootable on any architecture. So I can't make up my mind.

Hi,

I think it isn't intended for the installer, until we haven't any bootcode.

-- 
WBR, Andrey V. Elsukov
___
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"