svn commit: r307390 - head/usr.sbin/efivar

2016-10-15 Thread Warner Losh
Author: imp
Date: Sun Oct 16 05:53:18 2016
New Revision: 307390
URL: https://svnweb.freebsd.org/changeset/base/307390

Log:
  style(9) nit: space after |.

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

Modified: head/usr.sbin/efivar/efivar.c
==
--- head/usr.sbin/efivar/efivar.c   Sun Oct 16 05:32:28 2016
(r307389)
+++ head/usr.sbin/efivar/efivar.c   Sun Oct 16 05:53:18 2016
(r307390)
@@ -62,7 +62,7 @@ static struct option longopts[] = {
 static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag,
lflag, Lflag, Rflag, wflag, pflag;
 static char *varname;
-static u_long attrib = EFI_VARIABLE_NON_VOLATILE 
|EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
+static u_long attrib = EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
 
 static void
 usage(void)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307388 - head/sys/powerpc/powerpc

2016-10-15 Thread Justin Hibbits
Author: jhibbits
Date: Sun Oct 16 04:22:04 2016
New Revision: 307388
URL: https://svnweb.freebsd.org/changeset/base/307388

Log:
  Fix booting on systems that use loader(8) (most of them).
  
  r306065/r306067 introduced ofw_parse_bootargs(), setting environment variables
  from Open Firmware's /chosen/bootargs property.  On systems booting with
  loader(8) (meaning, most systems), the initial static kenv is created with no
  extra space, causing kern_setenv() to panic.  Since these already have the
  environment set directly, there is no need to parse bootargs anyway.
  
  Found by: swills

Modified:
  head/sys/powerpc/powerpc/machdep.c

Modified: head/sys/powerpc/powerpc/machdep.c
==
--- head/sys/powerpc/powerpc/machdep.c  Sun Oct 16 02:55:52 2016
(r307387)
+++ head/sys/powerpc/powerpc/machdep.c  Sun Oct 16 04:22:04 2016
(r307388)
@@ -238,6 +238,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_
vm_offset_t startkernel, endkernel;
void*kmdp;
 char   *env;
+bool   ofw_bootargs = false;
 #ifdef DDB
vm_offset_t ksym_start;
vm_offset_t ksym_end;
@@ -295,6 +296,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_
bzero(__bss_start, _end - __bss_start);
 #endif
init_static_kenv(init_kenv, sizeof(init_kenv));
+   ofw_bootargs = true;
}
/* Store boot environment state */
OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry);
@@ -337,7 +339,8 @@ powerpc_init(vm_offset_t fdt, vm_offset_
 
OF_bootstrap();
 
-   ofw_parse_bootargs();
+   if (ofw_bootargs)
+   ofw_parse_bootargs();
 
/*
 * Initialize the console before printing anything.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307387 - head/usr.bin/mkimg

2016-10-15 Thread Marcel Moolenaar
Author: marcel
Date: Sun Oct 16 02:55:52 2016
New Revision: 307387
URL: https://svnweb.freebsd.org/changeset/base/307387

Log:
  Switch to using the portable partition scheme headers.

Modified:
  head/usr.bin/mkimg/Makefile
  head/usr.bin/mkimg/apm.c
  head/usr.bin/mkimg/bsd.c
  head/usr.bin/mkimg/ebr.c
  head/usr.bin/mkimg/gpt.c
  head/usr.bin/mkimg/mbr.c
  head/usr.bin/mkimg/pc98.c
  head/usr.bin/mkimg/vtoc8.c

Modified: head/usr.bin/mkimg/Makefile
==
--- head/usr.bin/mkimg/Makefile Sun Oct 16 02:43:51 2016(r307386)
+++ head/usr.bin/mkimg/Makefile Sun Oct 16 02:55:52 2016(r307387)
@@ -11,6 +11,7 @@ mkimg.o: Makefile
 
 CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION}
 CFLAGS+=-DSPARSE_WRITE
+CFLAGS+=-I${.CURDIR:H:H}/sys
 
 # List of formats to support
 SRCS+= \

Modified: head/usr.bin/mkimg/apm.c
==
--- head/usr.bin/mkimg/apm.cSun Oct 16 02:43:51 2016(r307386)
+++ head/usr.bin/mkimg/apm.cSun Oct 16 02:55:52 2016(r307387)
@@ -33,20 +33,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "endian.h"
 #include "image.h"
 #include "mkimg.h"
 #include "scheme.h"
 
-#ifndef APM_ENT_TYPE_APPLE_BOOT
-#defineAPM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap"
-#endif
-#ifndef APM_ENT_TYPE_FREEBSD_NANDFS
-#defineAPM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs"
-#endif
-
 static struct mkimg_alias apm_aliases[] = {
 {  ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) },
 {  ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) },

Modified: head/usr.bin/mkimg/bsd.c
==
--- head/usr.bin/mkimg/bsd.cSun Oct 16 02:43:51 2016(r307386)
+++ head/usr.bin/mkimg/bsd.cSun Oct 16 02:55:52 2016(r307387)
@@ -33,17 +33,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "endian.h"
 #include "image.h"
 #include "mkimg.h"
 #include "scheme.h"
 
-#ifndef FS_NANDFS
-#defineFS_NANDFS   30
-#endif
-
 static struct mkimg_alias bsd_aliases[] = {
 {  ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(FS_NANDFS) },
 {  ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(FS_SWAP) },
@@ -58,7 +54,7 @@ bsd_metadata(u_int where, lba_t blk)
 {
 
if (where == SCHEME_META_IMG_START)
-   blk += BBSIZE / secsz;
+   blk += BSD_BOOTBLOCK_SIZE / secsz;
else if (where == SCHEME_META_IMG_END)
blk = round_cylinder(blk);
else
@@ -76,21 +72,21 @@ bsd_write(lba_t imgsz, void *bootcode)
int bsdparts, error, n;
uint16_t checksum;
 
-   buf = malloc(BBSIZE);
+   buf = malloc(BSD_BOOTBLOCK_SIZE);
if (buf == NULL)
return (ENOMEM);
if (bootcode != NULL) {
-   memcpy(buf, bootcode, BBSIZE);
+   memcpy(buf, bootcode, BSD_BOOTBLOCK_SIZE);
memset(buf + secsz, 0, sizeof(struct disklabel));
} else
-   memset(buf, 0, BBSIZE);
+   memset(buf, 0, BSD_BOOTBLOCK_SIZE);
 
bsdparts = nparts + 1;  /* Account for c partition */
-   if (bsdparts < MAXPARTITIONS)
-   bsdparts = MAXPARTITIONS;
+   if (bsdparts < BSD_NPARTS_MIN)
+   bsdparts = BSD_NPARTS_MIN;
 
d = (void *)(buf + secsz);
-   le32enc(>d_magic, DISKMAGIC);
+   le32enc(>d_magic, BSD_MAGIC);
le32enc(>d_secsize, secsz);
le32enc(>d_nsectors, nsecs);
le32enc(>d_ntracks, nheads);
@@ -98,14 +94,14 @@ bsd_write(lba_t imgsz, void *bootcode)
le32enc(>d_secpercyl, nsecs * nheads);
le32enc(>d_secperunit, imgsz);
le16enc(>d_rpm, 3600);
-   le32enc(>d_magic2, DISKMAGIC);
+   le32enc(>d_magic2, BSD_MAGIC);
le16enc(>d_npartitions, bsdparts);
-   le32enc(>d_bbsize, BBSIZE);
+   le32enc(>d_bbsize, BSD_BOOTBLOCK_SIZE);
 
-   dp = >d_partitions[RAW_PART];
+   dp = >d_partitions[BSD_PART_RAW];
le32enc(>p_size, imgsz);
TAILQ_FOREACH(part, , link) {
-   n = part->index + ((part->index >= RAW_PART) ? 1 : 0);
+   n = part->index + ((part->index >= BSD_PART_RAW) ? 1 : 0);
dp = >d_partitions[n];
le32enc(>p_size, part->size);
le32enc(>p_offset, part->block);
@@ -121,7 +117,7 @@ bsd_write(lba_t imgsz, void *bootcode)
checksum ^= le16dec(p);
le16enc(>d_checksum, checksum);
 
-   error = image_write(0, buf, BBSIZE / secsz);
+   error = image_write(0, buf, BSD_BOOTBLOCK_SIZE / secsz);
free(buf);
return (error);
 }
@@ -132,8 +128,8 @@ static struct mkimg_scheme bsd_scheme = 
.aliases = bsd_aliases,
.metadata = bsd_metadata,
.write = bsd_write,
-   .nparts = 19,
-   .bootcode = BBSIZE,
+   

svn commit: r307386 - in head: etc/mtree include sys/sys sys/sys/disk

2016-10-15 Thread Marcel Moolenaar
Author: marcel
Date: Sun Oct 16 02:43:51 2016
New Revision: 307386
URL: https://svnweb.freebsd.org/changeset/base/307386

Log:
  Re-apply change 306811 or alternatively, revert change 307385.

Added:
  head/sys/sys/disk/
  head/sys/sys/disk/apm.h
 - copied, changed from r307385, head/sys/sys/apm.h
  head/sys/sys/disk/bsd.h
 - copied, changed from r307385, head/sys/sys/disklabel.h
  head/sys/sys/disk/gpt.h
 - copied, changed from r307385, head/sys/sys/gpt.h
  head/sys/sys/disk/mbr.h
 - copied, changed from r307385, head/sys/sys/diskmbr.h
  head/sys/sys/disk/pc98.h
 - copied, changed from r307385, head/sys/sys/diskpc98.h
  head/sys/sys/disk/vtoc.h
 - copied, changed from r307385, head/sys/sys/vtoc.h
Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/sys/sys/apm.h
  head/sys/sys/disklabel.h
  head/sys/sys/diskmbr.h
  head/sys/sys/diskpc98.h
  head/sys/sys/gpt.h
  head/sys/sys/vtoc.h

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Sun Oct 16 02:05:22 2016
(r307385)
+++ head/etc/mtree/BSD.include.dist Sun Oct 16 02:43:51 2016
(r307386)
@@ -336,6 +336,8 @@
 ssp
 ..
 sys
+disk
+..
 ..
 teken
 ..

Modified: head/include/Makefile
==
--- head/include/Makefile   Sun Oct 16 02:05:22 2016(r307385)
+++ head/include/Makefile   Sun Oct 16 02:43:51 2016(r307386)
@@ -59,6 +59,7 @@ LSUBDIRS= cam/ata cam/nvme cam/scsi \
security/audit \
security/mac_biba security/mac_bsdextended security/mac_lomac \
security/mac_mls security/mac_partition \
+   sys/disk \
ufs/ffs ufs/ufs
 
 LSUBSUBDIRS=   dev/mpt/mpilib

Modified: head/sys/sys/apm.h
==
--- head/sys/sys/apm.h  Sun Oct 16 02:05:22 2016(r307385)
+++ head/sys/sys/apm.h  Sun Oct 16 02:43:51 2016(r307386)
@@ -1,69 +1,5 @@
 /*-
- * Copyright (c) 2007 Marcel Moolenaar
- * 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.
- *
- * $FreeBSD$
+ * This file is in the public domain.
  */
-
-#ifndef _SYS_APM_H_
-#define_SYS_APM_H_
-
-/* Driver Descriptor Record. */
-struct apm_ddr {
-   uint16_tddr_sig;
-#defineAPM_DDR_SIG 0x4552
-   uint16_tddr_blksize;
-   uint32_tddr_blkcount;
-};
-
-#defineAPM_ENT_NAMELEN 32
-#defineAPM_ENT_TYPELEN 32
-
-/* Partition Map Entry Record. */
-struct apm_ent {
-   uint16_tent_sig;
-#defineAPM_ENT_SIG 0x504d
-   uint16_t_pad_;
-   uint32_tent_pmblkcnt;
-   uint32_tent_start;
-   uint32_tent_size;
-   charent_name[APM_ENT_NAMELEN];
-   charent_type[APM_ENT_TYPELEN];
-};
-
-#defineAPM_ENT_TYPE_SELF   "Apple_partition_map"
-#defineAPM_ENT_TYPE_UNUSED "Apple_Free"
-
-#defineAPM_ENT_TYPE_FREEBSD"FreeBSD"
-#defineAPM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs"
-#defineAPM_ENT_TYPE_FREEBSD_SWAP   "FreeBSD-swap"
-#defineAPM_ENT_TYPE_FREEBSD_UFS"FreeBSD-UFS"
-#defineAPM_ENT_TYPE_FREEBSD_VINUM  "FreeBSD-Vinum"
-#defineAPM_ENT_TYPE_FREEBSD_ZFS"FreeBSD-ZFS"
-
-#defineAPM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap"
-#defineAPM_ENT_TYPE_APPLE_HFS  "Apple_HFS"
-#defineAPM_ENT_TYPE_APPLE_UFS  "Apple_UNIX_SVR2"
-
-#endif /* _SYS_APM_H_ */

svn commit: r307385 - in head: etc/mtree include sys/sys sys/sys/disk

2016-10-15 Thread Marcel Moolenaar
Author: marcel
Date: Sun Oct 16 02:05:22 2016
New Revision: 307385
URL: https://svnweb.freebsd.org/changeset/base/307385

Log:
  Revert change 306811 so that the change can be re-done using
  svn copy instead of svn move.  This to preserve history on
  the originals headers as well.

Replaced:
  head/sys/sys/apm.h
 - copied unchanged from r306810, head/sys/sys/apm.h
  head/sys/sys/disklabel.h
 - copied unchanged from r306810, head/sys/sys/disklabel.h
  head/sys/sys/diskmbr.h
 - copied unchanged from r306810, head/sys/sys/diskmbr.h
  head/sys/sys/diskpc98.h
 - copied unchanged from r306810, head/sys/sys/diskpc98.h
  head/sys/sys/gpt.h
 - copied unchanged from r306810, head/sys/sys/gpt.h
  head/sys/sys/vtoc.h
 - copied unchanged from r306810, head/sys/sys/vtoc.h
Deleted:
  head/sys/sys/disk/
Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Sat Oct 15 23:46:55 2016
(r307384)
+++ head/etc/mtree/BSD.include.dist Sun Oct 16 02:05:22 2016
(r307385)
@@ -336,8 +336,6 @@
 ssp
 ..
 sys
-disk
-..
 ..
 teken
 ..

Modified: head/include/Makefile
==
--- head/include/Makefile   Sat Oct 15 23:46:55 2016(r307384)
+++ head/include/Makefile   Sun Oct 16 02:05:22 2016(r307385)
@@ -59,7 +59,6 @@ LSUBDIRS= cam/ata cam/nvme cam/scsi \
security/audit \
security/mac_biba security/mac_bsdextended security/mac_lomac \
security/mac_mls security/mac_partition \
-   sys/disk \
ufs/ffs ufs/ufs
 
 LSUBSUBDIRS=   dev/mpt/mpilib

Copied: head/sys/sys/apm.h (from r306810, head/sys/sys/apm.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/apm.h  Sun Oct 16 02:05:22 2016(r307385, copy of 
r306810, head/sys/sys/apm.h)
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2007 Marcel Moolenaar
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_APM_H_
+#define_SYS_APM_H_
+
+/* Driver Descriptor Record. */
+struct apm_ddr {
+   uint16_tddr_sig;
+#defineAPM_DDR_SIG 0x4552
+   uint16_tddr_blksize;
+   uint32_tddr_blkcount;
+};
+
+#defineAPM_ENT_NAMELEN 32
+#defineAPM_ENT_TYPELEN 32
+
+/* Partition Map Entry Record. */
+struct apm_ent {
+   uint16_tent_sig;
+#defineAPM_ENT_SIG 0x504d
+   uint16_t_pad_;
+   uint32_tent_pmblkcnt;
+   uint32_tent_start;
+   uint32_tent_size;
+   charent_name[APM_ENT_NAMELEN];
+   charent_type[APM_ENT_TYPELEN];
+};
+
+#defineAPM_ENT_TYPE_SELF   "Apple_partition_map"
+#defineAPM_ENT_TYPE_UNUSED "Apple_Free"
+
+#defineAPM_ENT_TYPE_FREEBSD"FreeBSD"
+#defineAPM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs"
+#defineAPM_ENT_TYPE_FREEBSD_SWAP   "FreeBSD-swap"
+#defineAPM_ENT_TYPE_FREEBSD_UFS"FreeBSD-UFS"
+#defineAPM_ENT_TYPE_FREEBSD_VINUM  "FreeBSD-Vinum"
+#defineAPM_ENT_TYPE_FREEBSD_ZFS"FreeBSD-ZFS"
+
+#defineAPM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap"
+#defineAPM_ENT_TYPE_APPLE_HFS  "Apple_HFS"
+#defineAPM_ENT_TYPE_APPLE_UFS  "Apple_UNIX_SVR2"
+
+#endif /* _SYS_APM_H_ */

Copied: 

svn commit: r307384 - head/usr.sbin/pmcstat

2016-10-15 Thread Mark Johnston
Author: markj
Date: Sat Oct 15 23:46:55 2016
New Revision: 307384
URL: https://svnweb.freebsd.org/changeset/base/307384

Log:
  Remove an unused field from struct pmcstat_image.
  
  MFC after:3 days

Modified:
  head/usr.sbin/pmcstat/pmcstat_log.h

Modified: head/usr.sbin/pmcstat/pmcstat_log.h
==
--- head/usr.sbin/pmcstat/pmcstat_log.h Sat Oct 15 22:49:04 2016
(r307383)
+++ head/usr.sbin/pmcstat/pmcstat_log.h Sat Oct 15 23:46:55 2016
(r307384)
@@ -76,7 +76,6 @@ enum pmcstat_image_type {
 
 struct pmcstat_image {
LIST_ENTRY(pmcstat_image) pi_next;  /* hash link */
-   TAILQ_ENTRY(pmcstat_image) pi_lru;  /* LRU list */
pmcstat_interned_string pi_execpath;/* cookie */
pmcstat_interned_string pi_samplename;  /* sample path name */
pmcstat_interned_string pi_fullpath;/* path to FS object */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307382 - in head/sys: arm/conf conf dev/gpio

2016-10-15 Thread Jared McNeill
Author: jmcneill
Date: Sat Oct 15 20:04:14 2016
New Revision: 307382
URL: https://svnweb.freebsd.org/changeset/base/307382

Log:
  Add driver for GPIO controlled regulator.
  
  Reviewed by:  gonzo, manu, mmel
  Differential Revision:https://reviews.freebsd.org/D8257

Added:
  head/sys/dev/gpio/gpioregulator.c   (contents, props changed)
Modified:
  head/sys/arm/conf/GENERIC
  head/sys/conf/files

Modified: head/sys/arm/conf/GENERIC
==
--- head/sys/arm/conf/GENERIC   Sat Oct 15 19:55:07 2016(r307381)
+++ head/sys/arm/conf/GENERIC   Sat Oct 15 20:04:14 2016(r307382)
@@ -112,6 +112,7 @@ device  icee
 # GPIO
 device gpio
 device gpioled
+device gpioregulator
 
 # SPI
 device spibus

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Oct 15 19:55:07 2016(r307381)
+++ head/sys/conf/files Sat Oct 15 20:04:14 2016(r307382)
@@ -1573,6 +1573,7 @@ dev/gpio/gpioc.c  optional gpio   
\
dependency  "gpio_if.h"
 dev/gpio/gpioiic.c optional gpioiic
 dev/gpio/gpioled.c optional gpioled
+dev/gpio/gpioregulator.c   optional gpioregulator fdt ext_resources
 dev/gpio/gpiospi.c optional gpiospi
 dev/gpio/gpio_if.m optional gpio
 dev/gpio/gpiobus_if.m  optional gpio

Added: head/sys/dev/gpio/gpioregulator.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/gpio/gpioregulator.c   Sat Oct 15 20:04:14 2016
(r307382)
@@ -0,0 +1,348 @@
+/*-
+ * Copyright (c) 2016 Jared McNeill 
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * GPIO controlled regulators
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include "regdev_if.h"
+
+struct gpioregulator_state {
+   int val;
+   uint32_tmask;
+};
+
+struct gpioregulator_init_def {
+   struct regnode_init_def reg_init_def;
+   struct gpiobus_pin  *enable_pin;
+   int enable_pin_valid;
+   int startup_delay_us;
+   int nstates;
+   struct gpioregulator_state  *states;
+   int npins;
+   struct gpiobus_pin  **pins;
+};
+
+struct gpioregulator_reg_sc {
+   struct regnode  *regnode;
+   device_tbase_dev;
+   struct regnode_std_param*param;
+   struct gpioregulator_init_def   *def;
+};
+
+struct gpioregulator_softc {
+   device_tdev;
+   struct gpioregulator_reg_sc *reg_sc;
+   struct gpioregulator_init_def   init_def;
+};
+
+static int
+gpioregulator_regnode_init(struct regnode *regnode)
+{
+   struct gpioregulator_reg_sc *sc;
+   int error, n;
+
+   sc = regnode_get_softc(regnode);
+
+   if (sc->def->enable_pin_valid == 1) {
+   error = gpio_pin_setflags(sc->def->enable_pin, GPIO_PIN_OUTPUT);
+   if (error != 0)
+   return (error);
+   }
+
+   for (n = 0; n < sc->def->npins; n++) {
+   error = gpio_pin_setflags(sc->def->pins[n], GPIO_PIN_OUTPUT);
+   if (error != 0)
+   return (error);
+ 

svn commit: r307381 - head/usr.bin/sdiff

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 19:55:07 2016
New Revision: 307381
URL: https://svnweb.freebsd.org/changeset/base/307381

Log:
  Fix typos in sdiff(1) message and improve display

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

Modified: head/usr.bin/sdiff/sdiff.c
==
--- head/usr.bin/sdiff/sdiff.c  Sat Oct 15 18:20:15 2016(r307380)
+++ head/usr.bin/sdiff/sdiff.c  Sat Oct 15 19:55:07 2016(r307381)
@@ -137,24 +137,25 @@ static struct option longopts[] = {
 };
 
 static const char *help_msg[] = {
-   "\nusage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 
file2\n",
-   "\t-l, --left-column, Only print the left column for identical lines.",
-   "\t-o OUTFILE, --output=OUTFILE, nteractively merge file1 and file2 
into outfile.",
-   "\t-s, --suppress-common-lines, Skip identical lines.",
-   "\t-w WIDTH, --width=WIDTH, Print a maximum of WIDTH characters on each 
line.",
-   "\tOptions passed to diff(1) are:",
-   "\t\t-a, --text, Treat file1 and file2 as text files.",
-   "\t\t-b, --ignore-trailing-cr, Ignore trailing blank spaces.",
-   "\t\t-d, --minimal, Minimize diff size.",
-   "\t\t-I RE, --ignore-matching-lines=RE, Ignore changes whose line 
matches RE.",
-   "\t\t-i, --ignore-case, Do a case-insensitive comparison.",
-   "\t\t-t, --expand-tabs Expand tabs to spaces.",
-   "\t\t-W, --ignore-all-spaces, Ignore all spaces.",
-   "\t\t--speed-large-files, Assume large file with scattered changes.",
-   "\t\t--strip-trailing-cr, Strip trailing carriage return.",
-   "\t\t--ignore-file-name-case, Ignore case of file names.",
-   "\t\t--no-ignore-file-name-case, Do not ignore file name case",
-   "\t\t--tabsize NUM, Change size of tabs (default 8.)",
+   "usage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 
file2\n",
+   "-l, --left-column: only print the left column for identical lines.",
+   "-o OUTFILE, --output=OUTFILE: interactively merge file1 and file2 into 
outfile.",
+   "-s, --suppress-common-lines: skip identical lines.",
+   "-w WIDTH, --width=WIDTH: print a maximum of WIDTH characters on each 
line.",
+   "",
+   "Options passed to diff(1) are:",
+   "\t-a, --text: treat file1 and file2 as text files.",
+   "\t-b, --ignore-trailing-cr: ignore trailing blank spaces.",
+   "\t-d, --minimal: minimize diff size.",
+   "\t-I RE, --ignore-matching-lines=RE: ignore changes whose line matches 
RE.",
+   "\t-i, --ignore-case: do a case-insensitive comparison.",
+   "\t-t, --expand-tabs: sxpand tabs to spaces.",
+   "\t-W, --ignore-all-spaces: ignore all spaces.",
+   "\t--speed-large-files: assume large file with scattered changes.",
+   "\t--strip-trailing-cr: strip trailing carriage return.",
+   "\t--ignore-file-name-case: ignore case of file names.",
+   "\t--no-ignore-file-name-case: do not ignore file name case",
+   "\t--tabsize NUM: change size of tabs (default 8.)",
 
NULL,
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307380 - head/sys/sys

2016-10-15 Thread Navdeep Parhar
Author: np
Date: Sat Oct 15 18:20:15 2016
New Revision: 307380
URL: https://svnweb.freebsd.org/changeset/base/307380

Log:
  Fix typo in comments.

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Sat Oct 15 17:49:41 2016(r307379)
+++ head/sys/sys/mbuf.h Sat Oct 15 18:20:15 2016(r307380)
@@ -335,7 +335,7 @@ struct mbuf {
 #defineM_HASHTYPE_RSS_TCP_IPV6 M_HASHTYPE_HASH(4) /* TCPv6 
4-tuple */
 #defineM_HASHTYPE_RSS_IPV6_EX  M_HASHTYPE_HASH(5) /* IPv6 
2-tuple +
* ext hdrs */
-#defineM_HASHTYPE_RSS_TCP_IPV6_EX  M_HASHTYPE_HASH(6) /* TCPv6 
4-tiple +
+#defineM_HASHTYPE_RSS_TCP_IPV6_EX  M_HASHTYPE_HASH(6) /* TCPv6 
4-tuple +
* ext hdrs */
 /* Non-standard RSS hash types */
 #defineM_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_HASH(7) /* IPv4 UDP 
4-tuple*/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307379 - head/sys/arm/allwinner

2016-10-15 Thread Emmanuel Vadot
Author: manu
Date: Sat Oct 15 17:49:41 2016
New Revision: 307379
URL: https://svnweb.freebsd.org/changeset/base/307379

Log:
  axp209: Add support for regulators
  
  Except for LDO4, all regulators are supported.
  
  MFC after:1 week

Modified:
  head/sys/arm/allwinner/axp209.c
  head/sys/arm/allwinner/axp209reg.h

Modified: head/sys/arm/allwinner/axp209.c
==
--- head/sys/arm/allwinner/axp209.c Sat Oct 15 17:39:40 2016
(r307378)
+++ head/sys/arm/allwinner/axp209.c Sat Oct 15 17:49:41 2016
(r307379)
@@ -50,14 +50,92 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include "iicbus_if.h"
 #include "gpio_if.h"
+#include "regdev_if.h"
+
+MALLOC_DEFINE(M_AXP209_REG, "Axp209 regulator", "Axp209 power regulator");
+
+struct axp209_regdef {
+   intptr_tid;
+   char*name;
+   uint8_t enable_reg;
+   uint8_t enable_mask;
+   uint8_t voltage_reg;
+   uint8_t voltage_mask;
+   uint8_t voltage_shift;
+   int voltage_min;
+   int voltage_max;
+   int voltage_step;
+   int voltage_nstep;
+};
+
+static struct axp209_regdef axp209_regdefs[] = {
+   {
+   .id = AXP209_REG_ID_DCDC2,
+   .name = "dcdc2",
+   .enable_reg = AXP209_POWERCTL,
+   .enable_mask = AXP209_POWERCTL_DCDC2,
+   .voltage_reg = AXP209_REG_DCDC2_VOLTAGE,
+   .voltage_mask = 0x3f,
+   .voltage_min = 700,
+   .voltage_max = 2275,
+   .voltage_step = 25,
+   .voltage_nstep = 64,
+   },
+   {
+   .id = AXP209_REG_ID_DCDC3,
+   .name = "dcdc3",
+   .enable_reg = AXP209_POWERCTL,
+   .enable_mask = AXP209_POWERCTL_DCDC3,
+   .voltage_reg = AXP209_REG_DCDC3_VOLTAGE,
+   .voltage_mask = 0x7f,
+   .voltage_min = 700,
+   .voltage_max = 3500,
+   .voltage_step = 25,
+   .voltage_nstep = 128,
+   },
+   {
+   .id = AXP209_REG_ID_LDO2,
+   .name = "ldo2",
+   .enable_reg = AXP209_POWERCTL,
+   .enable_mask = AXP209_POWERCTL_LDO2,
+   .voltage_reg = AXP209_REG_LDO24_VOLTAGE,
+   .voltage_mask = 0xf0,
+   .voltage_shift = 4,
+   .voltage_min = 1800,
+   .voltage_max = 3300,
+   .voltage_step = 100,
+   .voltage_nstep = 16,
+   },
+   {
+   .id = AXP209_REG_ID_LDO3,
+   .name = "ldo3",
+   .enable_reg = AXP209_POWERCTL,
+   .enable_mask = AXP209_POWERCTL_LDO3,
+   .voltage_reg = AXP209_REG_LDO3_VOLTAGE,
+   .voltage_mask = 0x7f,
+   .voltage_min = 700,
+   .voltage_max = 2275,
+   .voltage_step = 25,
+   .voltage_nstep = 128,
+   },
+};
+
+struct axp209_reg_sc {
+   struct regnode  *regnode;
+   device_tbase_dev;
+   struct axp209_regdef*def;
+   phandle_t   xref;
+   struct regnode_std_param *param;
+};
 
 struct axp209_softc {
device_tdev;
@@ -67,6 +145,10 @@ struct axp209_softc {
struct intr_config_hook intr_hook;
device_tgpiodev;
struct mtx  mtx;
+
+   /* Regulators */
+   struct axp209_reg_sc**regs;
+   int nregs;
 };
 
 /* GPIO3 is different, don't expose it for now */
@@ -125,6 +207,115 @@ axp209_write(device_t dev, uint8_t reg, 
 }
 
 static int
+axp209_regnode_init(struct regnode *regnode)
+{
+   return (0);
+}
+
+static int
+axp209_regnode_enable(struct regnode *regnode, bool enable, int *udelay)
+{
+   struct axp209_reg_sc *sc;
+   uint8_t val;
+
+   sc = regnode_get_softc(regnode);
+
+   axp209_read(sc->base_dev, sc->def->enable_reg, , 1);
+   if (enable)
+   val |= sc->def->enable_mask;
+   else
+   val &= ~sc->def->enable_mask;
+   axp209_write(sc->base_dev, sc->def->enable_reg, val);
+
+   *udelay = 0;
+
+   return (0);
+}
+
+static void
+axp209_regnode_reg_to_voltage(struct axp209_reg_sc *sc, uint8_t val, int *uv)
+{
+   if (val < sc->def->voltage_nstep)
+   *uv = sc->def->voltage_min + val * sc->def->voltage_step;
+   else
+   *uv = sc->def->voltage_min +
+  (sc->def->voltage_nstep * sc->def->voltage_step);
+   *uv *= 1000;
+}
+
+static int
+axp209_regnode_voltage_to_reg(struct axp209_reg_sc *sc, int min_uvolt,
+int max_uvolt, uint8_t *val)
+{
+   

svn commit: r307377 - head/sys/arm64/include

2016-10-15 Thread Andrew Turner
Author: andrew
Date: Sat Oct 15 16:29:06 2016
New Revision: 307377
URL: https://svnweb.freebsd.org/changeset/base/307377

Log:
  Fix the build, struct vfpstate needs to be visible to userspace as it's
  part of struct pcb which is in a header used in libutil.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/include/vfp.h

Modified: head/sys/arm64/include/vfp.h
==
--- head/sys/arm64/include/vfp.hSat Oct 15 15:55:04 2016
(r307376)
+++ head/sys/arm64/include/vfp.hSat Oct 15 16:29:06 2016
(r307377)
@@ -32,7 +32,6 @@
 #ifndef _MACHINE_VFP_H_
 #define_MACHINE_VFP_H_
 
-#ifdef _KERNEL
 
 #ifndef LOCORE
 struct vfpstate {
@@ -41,6 +40,7 @@ struct vfpstate {
uint32_tvfp_fpsr;
 };
 
+#ifdef _KERNEL
 void   vfp_init(void);
 void   vfp_discard(struct thread *);
 void   vfp_restore_state(void);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307376 - head

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 15:55:04 2016
New Revision: 307376
URL: https://svnweb.freebsd.org/changeset/base/307376

Log:
  Improve wording
  
  Submitted by: lidl

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sat Oct 15 14:42:41 2016(r307375)
+++ head/UPDATING   Sat Oct 15 15:55:04 2016(r307376)
@@ -34,7 +34,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 20161015:
GNU rcs has been removed from base.  It is available as packages:
- rcs: Latest GPLv3 GNU rcs version.
-   - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base.
+   - rcs57: Copy of the latest version of GNU rcs (GPLv2) before it was
+   removed from base.
 
 20161008:
Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r306346 - head/sys/kern

2016-10-15 Thread Eric van Gyzen
On 10/04/2016 15:56, Gleb Smirnoff wrote:
>   Eric,
>
> E> @@ -924,7 +924,7 @@ __mtx_assert(const volatile uintptr_t *c
> E>  {
> E>const struct mtx *m;
> E>  
> E> -  if (panicstr != NULL || dumping)
> E> +  if (panicstr != NULL || dumping || SCHEDULER_STOPPED())
> E>return;
>
> I wonder if all this disjunct can be reduced just to SCHEDULER_STOPPED()?
> Positive panicstr and dumping imply scheduler stopped.

If I read correctly, that's /almost/ true, but the scheduler is only stopped
#ifdef SMP and we're panicking, so we need the full expression to cover the !SMP
and reboot(RB_DUMP) cases.

Eric
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307374 - in head: sys/cam/ctl usr.sbin/ctladm

2016-10-15 Thread Alexander Motin
Author: mav
Date: Sat Oct 15 14:40:34 2016
New Revision: 307374
URL: https://svnweb.freebsd.org/changeset/base/307374

Log:
  Add LU option to control reported provisioning type.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/usr.sbin/ctladm/ctladm.8

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sat Oct 15 13:45:12 2016(r307373)
+++ head/sys/cam/ctl/ctl.c  Sat Oct 15 14:40:34 2016(r307374)
@@ -10040,6 +10040,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
 {
struct scsi_vpd_logical_block_prov *lbp_ptr;
struct ctl_lun *lun;
+   const char *value;
 
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -10077,7 +10078,14 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 |
SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP;
-   lbp_ptr->prov_type = SVPD_LBP_THIN;
+   value = ctl_get_opt(>be_lun->options, "provisioning_type");
+   if (value != NULL) {
+   if (strcmp(value, "resource") == 0)
+   lbp_ptr->prov_type = SVPD_LBP_RESOURCE;
+   else if (strcmp(value, "thin") == 0)
+   lbp_ptr->prov_type = SVPD_LBP_THIN;
+   } else
+   lbp_ptr->prov_type = SVPD_LBP_THIN;
}
 
ctl_set_success(ctsio);

Modified: head/usr.sbin/ctladm/ctladm.8
==
--- head/usr.sbin/ctladm/ctladm.8   Sat Oct 15 13:45:12 2016
(r307373)
+++ head/usr.sbin/ctladm/ctladm.8   Sat Oct 15 14:40:34 2016
(r307374)
@@ -903,8 +903,14 @@ Specifies medium rotation rate of the de
 .It Va formfactor
 Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25",
 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8".
+.It Va provisioning_type
+When UNMAP support is enabled, this option specifies provisioning type:
+"resource", "thin" or "unknown".
+Default value is "thin".
+Logical units without UNMAP support are reported as fully provisioned.
 .It Va unmap
-Set to "on", enables UNMAP support for the LUN, if supported by the backend.
+Setting to "on" or "off" controls UNMAP support for the logical unit.
+Default value is "on" if supported by the backend.
 .It Va unmap_max_lba
 .It Va unmap_max_descr
 Specify maximum allowed number of LBAs and block descriptors per UNMAP
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307372 - head/usr.bin/sdiff

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 13:45:09 2016
New Revision: 307372
URL: https://svnweb.freebsd.org/changeset/base/307372

Log:
  Move cleanup() into the edit.c file which is the only users of that function
  Remove common.{c,h}

Deleted:
  head/usr.bin/sdiff/common.c
  head/usr.bin/sdiff/common.h
Modified:
  head/usr.bin/sdiff/Makefile
  head/usr.bin/sdiff/edit.c

Modified: head/usr.bin/sdiff/Makefile
==
--- head/usr.bin/sdiff/Makefile Sat Oct 15 13:44:13 2016(r307371)
+++ head/usr.bin/sdiff/Makefile Sat Oct 15 13:45:09 2016(r307372)
@@ -3,7 +3,7 @@
 .include 
 
 PROG=  sdiff
-SRCS=  common.c edit.c sdiff.c
+SRCS=  edit.c sdiff.c
 WARNS= 3
 
 MAN1=  sdiff.1

Modified: head/usr.bin/sdiff/edit.c
==
--- head/usr.bin/sdiff/edit.c   Sat Oct 15 13:44:13 2016(r307371)
+++ head/usr.bin/sdiff/edit.c   Sat Oct 15 13:45:09 2016(r307372)
@@ -21,9 +21,17 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "common.h"
 #include "extern.h"
 
+static void
+cleanup(const char *filename)
+{
+
+   if (unlink(filename))
+   err(2, "could not delete: %s", filename);
+   exit(2);
+}
+
 /*
  * Execute an editor on the specified pathname, which is interpreted
  * from the shell.  This means flags may be included.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307368 - head/usr.bin/sdiff

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 13:41:58 2016
New Revision: 307368
URL: https://svnweb.freebsd.org/changeset/base/307368

Log:
  Remove the common.h include which is actually not used in sdiff.c

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

Modified: head/usr.bin/sdiff/sdiff.c
==
--- head/usr.bin/sdiff/sdiff.c  Sat Oct 15 13:39:30 2016(r307367)
+++ head/usr.bin/sdiff/sdiff.c  Sat Oct 15 13:41:58 2016(r307368)
@@ -27,7 +27,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "common.h"
 #include "extern.h"
 
 #define DIFF_PATH  "/usr/bin/diff"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307366 - head/sys/arm/allwinner/clk

2016-10-15 Thread Jared McNeill
Author: jmcneill
Date: Sat Oct 15 13:27:01 2016
New Revision: 307366
URL: https://svnweb.freebsd.org/changeset/base/307366

Log:
  Match "allwinner,sun8i-h3-apb0-gates-clk" compatible string.

Modified:
  head/sys/arm/allwinner/clk/aw_gate.c

Modified: head/sys/arm/allwinner/clk/aw_gate.c
==
--- head/sys/arm/allwinner/clk/aw_gate.cSat Oct 15 13:17:27 2016
(r307365)
+++ head/sys/arm/allwinner/clk/aw_gate.cSat Oct 15 13:27:01 2016
(r307366)
@@ -91,6 +91,8 @@ static struct ofw_compat_data compat_dat
 
{ "allwinner,sun8i-h3-bus-gates-clk",
  (uintptr_t)"Allwinner Bus Clock Gates" },
+   { "allwinner,sun8i-h3-apb0-gates-clk",
+ (uintptr_t)"Allwinner APB0 Clock Gates" },
 
{ "allwinner,sun9i-a80-apbs-gates-clk",
  (uintptr_t)"Allwinner APBS Clock Gates" },
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307365 - head/lib/libucl

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 13:17:27 2016
New Revision: 307365
URL: https://svnweb.freebsd.org/changeset/base/307365

Log:
  Use SRCTOP to find the sources of libucl

Modified:
  head/lib/libucl/Makefile

Modified: head/lib/libucl/Makefile
==
--- head/lib/libucl/MakefileSat Oct 15 13:16:52 2016(r307364)
+++ head/lib/libucl/MakefileSat Oct 15 13:17:27 2016(r307365)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-LIBUCL=${.CURDIR}/../../contrib/libucl
+LIBUCL=${SRCTOP}/contrib/libucl
 
 PACKAGE=lib${LIB}
 LIB=   ucl
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307364 - head/lib/libdevdctl

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 13:16:52 2016
New Revision: 307364
URL: https://svnweb.freebsd.org/changeset/base/307364

Log:
  directly create the socket with SOCK_NONBLOCK instead of calling fcntl(2)

Modified:
  head/lib/libdevdctl/consumer.cc

Modified: head/lib/libdevdctl/consumer.cc
==
--- head/lib/libdevdctl/consumer.cc Sat Oct 15 12:42:47 2016
(r307363)
+++ head/lib/libdevdctl/consumer.cc Sat Oct 15 13:16:52 2016
(r307364)
@@ -108,11 +108,9 @@ Consumer::ConnectToDevd()
strlcpy(devdAddr.sun_path, s_devdSockPath, sizeof(devdAddr.sun_path));
sLen = SUN_LEN();
 
-   m_devdSockFD = socket(AF_UNIX, SOCK_SEQPACKET, 0);
+   m_devdSockFD = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
if (m_devdSockFD == -1)
err(1, "Unable to create socket");
-if (fcntl(m_devdSockFD, F_SETFL, O_NONBLOCK) < 0)
-err(1, "fcntl");
result = connect(m_devdSockFD,
 reinterpret_cast(),
 sLen);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307356 - head

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 12:32:59 2016
New Revision: 307356
URL: https://svnweb.freebsd.org/changeset/base/307356

Log:
  Fix typo
  
  Reported by:  "N.J. Mann" <n...@njm.me.uk>

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sat Oct 15 12:28:14 2016(r307355)
+++ head/UPDATING   Sat Oct 15 12:32:59 2016(r307356)
@@ -32,7 +32,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20161015:
-   GNU rcs has been removed rom base.  It is available as packages:
+   GNU rcs has been removed from base.  It is available as packages:
- rcs: Latest GPLv3 GNU rcs version.
- rcs57: Copy of the latest version of GNU rcs (GPLv2) from base.
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307354 - head/sys/arm/allwinner/clk

2016-10-15 Thread Jared McNeill
Author: jmcneill
Date: Sat Oct 15 12:23:54 2016
New Revision: 307354
URL: https://svnweb.freebsd.org/changeset/base/307354

Log:
  Provide a complete A23 PLL1 factor table, from 60MHz to 1872MHz.

Modified:
  head/sys/arm/allwinner/clk/aw_pll.c

Modified: head/sys/arm/allwinner/clk/aw_pll.c
==
--- head/sys/arm/allwinner/clk/aw_pll.c Sat Oct 15 12:22:06 2016
(r307353)
+++ head/sys/arm/allwinner/clk/aw_pll.c Sat Oct 15 12:23:54 2016
(r307354)
@@ -193,12 +193,76 @@ struct aw_pll_factor {
{ .n = (_n), .k = (_k), .m = (_m), .p = (_p), .freq = (_freq) }
 
 static struct aw_pll_factor aw_a23_pll1_factors[] = {
+   PLLFACTOR(9, 0, 0, 2, 6000),
+   PLLFACTOR(10, 0, 0, 2, 6600),
+   PLLFACTOR(11, 0, 0, 2, 7200),
+   PLLFACTOR(12, 0, 0, 2, 7800),
+   PLLFACTOR(13, 0, 0, 2, 8400),
+   PLLFACTOR(14, 0, 0, 2, 9000),
+   PLLFACTOR(15, 0, 0, 2, 9600),
+   PLLFACTOR(16, 0, 0, 2, 10200),
+   PLLFACTOR(17, 0, 0, 2, 10800),
+   PLLFACTOR(18, 0, 0, 2, 11400),
+   PLLFACTOR(9, 0, 0, 1, 12000),
+   PLLFACTOR(10, 0, 0, 1, 13200),
+   PLLFACTOR(11, 0, 0, 1, 14400),
+   PLLFACTOR(12, 0, 0, 1, 15600),
+   PLLFACTOR(13, 0, 0, 1, 16800),
+   PLLFACTOR(14, 0, 0, 1, 18000),
+   PLLFACTOR(15, 0, 0, 1, 19200),
+   PLLFACTOR(16, 0, 0, 1, 20400),
+   PLLFACTOR(17, 0, 0, 1, 21600),
+   PLLFACTOR(18, 0, 0, 1, 22800),
+   PLLFACTOR(9, 0, 0, 0, 24000),
+   PLLFACTOR(10, 0, 0, 0, 26400),
+   PLLFACTOR(11, 0, 0, 0, 28800),
+   PLLFACTOR(12, 0, 0, 0, 31200),
+   PLLFACTOR(13, 0, 0, 0, 33600),
+   PLLFACTOR(14, 0, 0, 0, 36000),
+   PLLFACTOR(15, 0, 0, 0, 38400),
PLLFACTOR(16, 0, 0, 0, 40800),
+   PLLFACTOR(17, 0, 0, 0, 43200),
+   PLLFACTOR(18, 0, 0, 0, 45600),
+   PLLFACTOR(19, 0, 0, 0, 48000),
+   PLLFACTOR(20, 0, 0, 0, 50400),
+   PLLFACTOR(21, 0, 0, 0, 52800),
+   PLLFACTOR(22, 0, 0, 0, 55200),
+   PLLFACTOR(23, 0, 0, 0, 57600),
+   PLLFACTOR(24, 0, 0, 0, 6),
+   PLLFACTOR(25, 0, 0, 0, 62400),
PLLFACTOR(26, 0, 0, 0, 64800),
+   PLLFACTOR(27, 0, 0, 0, 67200),
+   PLLFACTOR(28, 0, 0, 0, 69600),
+   PLLFACTOR(29, 0, 0, 0, 72000),
+   PLLFACTOR(15, 1, 0, 0, 76800),
+   PLLFACTOR(10, 2, 0, 0, 79200),
PLLFACTOR(16, 1, 0, 0, 81600),
+   PLLFACTOR(17, 1, 0, 0, 86400),
+   PLLFACTOR(18, 1, 0, 0, 91200),
+   PLLFACTOR(12, 2, 0, 0, 93600),
+   PLLFACTOR(19, 1, 0, 0, 96000),
PLLFACTOR(20, 1, 0, 0, 100800),
+   PLLFACTOR(21, 1, 0, 0, 105600),
+   PLLFACTOR(14, 2, 0, 0, 108000),
+   PLLFACTOR(22, 1, 0, 0, 110400),
+   PLLFACTOR(23, 1, 0, 0, 115200),
PLLFACTOR(24, 1, 0, 0, 12),
+   PLLFACTOR(16, 2, 0, 0, 122400),
+   PLLFACTOR(25, 1, 0, 0, 124800),
PLLFACTOR(26, 1, 0, 0, 129600),
+   PLLFACTOR(27, 1, 0, 0, 134400),
+   PLLFACTOR(18, 2, 0, 0, 136800),
+   PLLFACTOR(28, 1, 0, 0, 139200),
+   PLLFACTOR(29, 1, 0, 0, 144000),
+   PLLFACTOR(20, 2, 0, 0, 151200),
+   PLLFACTOR(15, 3, 0, 0, 153600),
+   PLLFACTOR(21, 2, 0, 0, 158400),
+   PLLFACTOR(16, 3, 0, 0, 163200),
+   PLLFACTOR(22, 2, 0, 0, 165600),
+   PLLFACTOR(23, 2, 0, 0, 172800),
+   PLLFACTOR(24, 2, 0, 0, 18),
+   PLLFACTOR(18, 3, 0, 0, 182400),
+   PLLFACTOR(25, 2, 0, 0, 187200),
 };
 
 enum aw_pll_type {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307352 - head/share/man/man5

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 12:11:30 2016
New Revision: 307352
URL: https://svnweb.freebsd.org/changeset/base/307352

Log:
  Regen

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sat Oct 15 12:07:37 2016
(r307351)
+++ head/share/man/man5/src.conf.5  Sat Oct 15 12:11:30 2016
(r307352)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z 
emaste
 .\" $FreeBSD$
-.Dd October 10, 2016
+.Dd October 15, 2016
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1322,11 +1322,6 @@ This includes
 .Xr rlogin 1 ,
 .Xr rsh 1 ,
 etc.
-.It Va WITH_RCS
-.\" from FreeBSD: head/tools/build/options/WITH_RCS 305931 2016-09-18 
15:01:11Z bapt
-Set to build
-.Xr rcs 1
-and related utilities.
 .It Va WITHOUT_RESCUE
 .\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 
07:50:50Z ru
 Set to not build
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307351 - in head: . etc/mtree gnu/usr.bin gnu/usr.bin/rcs share/doc/psd share/doc/psd/13.rcs tools/build/mk tools/build/options

2016-10-15 Thread Baptiste Daroussin
Author: bapt
Date: Sat Oct 15 12:07:37 2016
New Revision: 307351
URL: https://svnweb.freebsd.org/changeset/base/307351

Log:
  Remove GNU rcs from base.
  
  GNU rcs is still available as a package:
  - rcs: Latest GPLv3 GNU rcs version.
  - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base.
  
  Relnotes: yes

Deleted:
  head/gnu/usr.bin/rcs/
  head/share/doc/psd/13.rcs/
  head/tools/build/options/WITH_RCS
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/etc/mtree/BSD.usr.dist
  head/gnu/usr.bin/Makefile
  head/share/doc/psd/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Oct 15 10:29:33 2016(r307350)
+++ head/ObsoleteFiles.inc  Sat Oct 15 12:07:37 2016(r307351)
@@ -38,6 +38,30 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20161015: Remove GNU rcs
+OLD_FILES+=usr/bin/ci
+OLD_FILES+=usr/bin/co
+OLD_FILES+=usr/bin/merge
+OLD_FILES+=usr/bin/rcs
+OLD_FILES+=usr/bin/rcsclean
+OLD_FILES+=usr/bin/rcsdiff
+OLD_FILES+=usr/bin/rcsfreeze
+OLD_FILES+=usr/bin/rcsmerge
+OLD_FILES+=usr/bin/rlog
+OLD_FILES+=usr/share/doc/psd/13.rcs/paper.ascii.gz
+OLD_FILES+=usr/share/doc/psd/13.rcs/rcs_func.ascii.gz
+OLD_DIRS+=usr/share/doc/psd/13.rcs
+OLD_FILES+=usr/share/man/man1/ci.1.gz
+OLD_FILES+=usr/share/man/man1/co.1.gz
+OLD_FILES+=usr/share/man/man1/merge.1.gz
+OLD_FILES+=usr/share/man/man1/rcs.1.gz
+OLD_FILES+=usr/share/man/man1/rcsclean.1.gz
+OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz
+OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz
+OLD_FILES+=usr/share/man/man1/rcsintro.1.gz
+OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz
+OLD_FILES+=usr/share/man/man1/rlog.1.gz
+OLD_FILES+=usr/share/man/man5/rcsfile.5.gz
 # 20161010: remove link to removed m_getclr(9) macro
 OLD_FILES+=usr/share/man/man9/m_getclr.9.gz
 # 20161003: MK_ELFCOPY_AS_OBJCOPY option retired

Modified: head/UPDATING
==
--- head/UPDATING   Sat Oct 15 10:29:33 2016(r307350)
+++ head/UPDATING   Sat Oct 15 12:07:37 2016(r307351)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20161015:
+   GNU rcs has been removed rom base.  It is available as packages:
+   - rcs: Latest GPLv3 GNU rcs version.
+   - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base.
+
 20161008:
Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control
modules now requires that the kernel configuration contain the

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Sat Oct 15 10:29:33 2016(r307350)
+++ head/etc/mtree/BSD.usr.dist Sat Oct 15 12:07:37 2016(r307351)
@@ -228,8 +228,6 @@
 ..
 12.make
 ..
-13.rcs
-..
 15.yacc
 ..
 16.lex

Modified: head/gnu/usr.bin/Makefile
==
--- head/gnu/usr.bin/Makefile   Sat Oct 15 10:29:33 2016(r307350)
+++ head/gnu/usr.bin/Makefile   Sat Oct 15 12:07:37 2016(r307351)
@@ -11,7 +11,6 @@ SUBDIR= ${_binutils} \
${_gperf} \
grep \
${_groff} \
-   ${_rcs} \
${_tests}
 
 SUBDIR_DEPEND_gdb= ${_binutils}
@@ -29,10 +28,6 @@ _groff=  groff
 _dtc=  dtc
 .endif
 
-.if ${MK_RCS} != "no"
-_rcs=  rcs
-.endif
-
 .if ${MK_TESTS} != "no"
 _tests=tests
 .endif

Modified: head/share/doc/psd/Makefile
==
--- head/share/doc/psd/Makefile Sat Oct 15 10:29:33 2016(r307350)
+++ head/share/doc/psd/Makefile Sat Oct 15 12:07:37 2016(r307351)
@@ -20,7 +20,6 @@ SUBDIR=   title \
05.sysman \
06.Clang \
12.make \
-   13.rcs \
15.yacc \
16.lex \
17.m4 \

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Oct 15 10:29:33 
2016(r307350)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Oct 15 12:07:37 
2016(r307351)
@@ -6810,29 +6810,6 @@ OLD_FILES+=usr/share/man/man8/rshd.8.gz
 OLD_FILES+=usr/share/man/man8/rwhod.8.gz
 .endif
 
-.if ${MK_RCS} == no
-OLD_FILES+=usr/bin/ci
-OLD_FILES+=usr/bin/co
-OLD_FILES+=usr/bin/merge
-OLD_FILES+=usr/bin/rcs
-OLD_FILES+=usr/bin/rcsclean
-OLD_FILES+=usr/bin/rcsdiff
-OLD_FILES+=usr/bin/rcsfreeze
-OLD_FILES+=usr/bin/rcsmerge
-OLD_FILES+=usr/bin/

Re: svn commit: r307321 - in head/sys/arm64: arm64 include

2016-10-15 Thread Konrad Witaszczyk
Hi Andrew,

On 10/14/2016 17:53, Andrew Turner wrote:
> Author: andrew
> Date: Fri Oct 14 15:53:48 2016
> New Revision: 307321
> URL: https://svnweb.freebsd.org/changeset/base/307321
> 
> Log:
>   Rework how we store the VFP registers in the pcb. This will be used when
>   creating a floating-point context within the kernel without having to move
>   the stored values in memory.
>   
>   Sponsored by:   The FreeBSD Foundation
> 
> Modified:
>   head/sys/arm64/arm64/machdep.c
>   head/sys/arm64/arm64/vfp.c
>   head/sys/arm64/arm64/vm_machdep.c
>   head/sys/arm64/include/pcb.h
>   head/sys/arm64/include/vfp.h

[...]

> Modified: head/sys/arm64/include/pcb.h
> ==
> --- head/sys/arm64/include/pcb.h  Fri Oct 14 15:16:44 2016
> (r307320)
> +++ head/sys/arm64/include/pcb.h  Fri Oct 14 15:53:48 2016
> (r307321)
> @@ -31,6 +31,8 @@
>  
>  #ifndef LOCORE
>  
> +#include 
> +
>  struct trapframe;
>  
>  #define  PCB_LR  30
> @@ -49,13 +51,17 @@ struct pcb {
>  #define  PCB_SINGLE_STEP_SHIFT   0
>  #define  PCB_SINGLE_STEP (1 << PCB_SINGLE_STEP_SHIFT)
>  
> - /* Place last to simplify the asm to access the rest if the struct */
> - __uint128_t pcb_vfp[32];
> - uint32_tpcb_fpcr;
> - uint32_tpcb_fpsr;
> + struct vfpstate *pcb_fpusaved;
>   int pcb_fpflags;
>  #define  PCB_FP_STARTED  0x01
>   u_int   pcb_vfpcpu; /* Last cpu this thread ran VFP code */
> +
> + /*
> +  * The userspace VFP state. The pcb_fpusaved pointer will point to
> +  * this unless the kernel has allocated a VFP context.
> +  * Place last to simplify the asm to access the rest if the struct.
> +  */
> + struct vfpstate pcb_fpustate;
>  };
>  
>  #ifdef _KERNEL
> 
> Modified: head/sys/arm64/include/vfp.h
> ==
> --- head/sys/arm64/include/vfp.h  Fri Oct 14 15:16:44 2016
> (r307320)
> +++ head/sys/arm64/include/vfp.h  Fri Oct 14 15:53:48 2016
> (r307321)
> @@ -35,6 +35,12 @@
>  #ifdef _KERNEL
>  
>  #ifndef LOCORE
> +struct vfpstate {
> + __uint128_t vfp_regs[32];
> + uint32_tvfp_fpcr;
> + uint32_tvfp_fpsr;
> +};
> +
>  void vfp_init(void);
>  void vfp_discard(struct thread *);
>  void vfp_restore_state(void);

These changes break buildworld for arm64:
In file included from 
/usr/home/def/FreeBSD/ekcd/repo/lib/libutil/kinfo_getfile.c:5:
In file included from
/usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/sys/user.h:38:
/usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/machine/pcb.h:64:18:
error: field has incomplete type 'struct vfpstate'
struct vfpstate pcb_fpustate;
^
/usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/machine/pcb.h:54:9:
note: forward declaration of 'struct vfpstate'
struct vfpstate *pcb_fpusaved;
   ^
1 error generated.
--- kinfo_getfile.o ---
*** [kinfo_getfile.o] Error code 1

You might want to consider making vfpstate available for userland as in arm
case. If so I'm attaching a patch for it.


Konrad
diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h
index de99118..9429247 100644
--- a/sys/arm64/include/vfp.h
+++ b/sys/arm64/include/vfp.h
@@ -32,15 +32,15 @@
 #ifndef _MACHINE_VFP_H_
 #define	_MACHINE_VFP_H_
 
-#ifdef _KERNEL
-
 #ifndef LOCORE
+
 struct vfpstate {
 	__uint128_t	vfp_regs[32];
 	uint32_t	vfp_fpcr;
 	uint32_t	vfp_fpsr;
 };
 
+#ifdef _KERNEL
 void	vfp_init(void);
 void	vfp_discard(struct thread *);
 void	vfp_restore_state(void);


signature.asc
Description: OpenPGP digital signature


Re: svn commit: r307257 - in head/sys: arm/broadcom/bcm2835 arm64/broadcom arm64/broadcom/bcm2837 arm64/conf conf

2016-10-15 Thread Andrew Turner
On Fri, 14 Oct 2016 10:23:24 -0700
Oleksandr Tymoshenko  wrote:

> > On Oct 14, 2016, at 1:31 AM, Andrew Turner 
> > wrote:
> > 
> > On Fri, 14 Oct 2016 03:37:36 + (UTC)
> > Oleksandr Tymoshenko >
> > wrote: 
> >> 
> >> Added: head/sys/arm64/conf/RPI3  
> > 
> > Why a new kernel config and not GENERIC?  
> I thought about it. But no SMP support yet. When we have SMP support
> we can get rid of RPI3 config. 

The RPI3 config should then include GENERIC and add nooption SMP. We
should possible name it GENERIC-UP or similar.

Andrew
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307350 - in head: sys/cam/ctl usr.sbin/ctladm

2016-10-15 Thread Alexander Motin
Author: mav
Date: Sat Oct 15 10:29:33 2016
New Revision: 307350
URL: https://svnweb.freebsd.org/changeset/base/307350

Log:
  Add LUN options to limit UNMAP and WRITE SAME sizes.
  
  CTL itself has no limits on on UNMAP and WRITE SAME sizes.  But depending
  on backends large requests may take too much time.  To avoid that new
  configuration options allow to hint initiator maximal sizes it should not
  exceed.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_backend.c
  head/usr.sbin/ctladm/ctladm.8

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Sat Oct 15 09:54:22 2016(r307349)
+++ head/sys/cam/ctl/ctl.c  Sat Oct 15 10:29:33 2016(r307350)
@@ -9903,6 +9903,7 @@ ctl_inquiry_evpd_block_limits(struct ctl
 {
struct scsi_vpd_block_limits *bl_ptr;
struct ctl_lun *lun;
+   uint64_t ival;
 
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -9941,8 +9942,14 @@ ctl_inquiry_evpd_block_limits(struct ctl
if (lun != NULL) {
scsi_ulto4b(lun->be_lun->opttxferlen, bl_ptr->opt_txfer_len);
if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
-   scsi_ulto4b(0x, bl_ptr->max_unmap_lba_cnt);
-   scsi_ulto4b(0x, bl_ptr->max_unmap_blk_cnt);
+   ival = 0x;
+   ctl_get_opt_number(>be_lun->options,
+   "unmap_max_lba", );
+   scsi_ulto4b(ival, bl_ptr->max_unmap_lba_cnt);
+   ival = 0x;
+   ctl_get_opt_number(>be_lun->options,
+   "unmap_max_descr", );
+   scsi_ulto4b(ival, bl_ptr->max_unmap_blk_cnt);
if (lun->be_lun->ublockexp != 0) {
scsi_ulto4b((1 << lun->be_lun->ublockexp),
bl_ptr->opt_unmap_grain);
@@ -9956,8 +9963,10 @@ ctl_inquiry_evpd_block_limits(struct ctl
scsi_ulto4b(0, bl_ptr->atomic_transfer_length_granularity);
scsi_ulto4b(0, 
bl_ptr->max_atomic_transfer_length_with_atomic_boundary);
scsi_ulto4b(0, bl_ptr->max_atomic_boundary_size);
+   ival = UINT64_MAX;
+   ctl_get_opt_number(>be_lun->options, "write_same_max_lba", 
);
+   scsi_u64to8b(ival, bl_ptr->max_write_same_length);
}
-   scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length);
 
ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;

Modified: head/sys/cam/ctl/ctl.h
==
--- head/sys/cam/ctl/ctl.h  Sat Oct 15 09:54:22 2016(r307349)
+++ head/sys/cam/ctl/ctl.h  Sat Oct 15 10:29:33 2016(r307350)
@@ -217,6 +217,7 @@ void ctl_update_opts(ctl_options_t *opts
 struct ctl_be_arg *args);
 void ctl_free_opts(ctl_options_t *opts);
 char * ctl_get_opt(ctl_options_t *opts, const char *name);
+int ctl_get_opt_number(ctl_options_t *opts, const char *name, uint64_t *num);
 int ctl_expand_number(const char *buf, uint64_t *num);
 
 #endif /* _KERNEL */

Modified: head/sys/cam/ctl/ctl_backend.c
==
--- head/sys/cam/ctl/ctl_backend.c  Sat Oct 15 09:54:22 2016
(r307349)
+++ head/sys/cam/ctl/ctl_backend.c  Sat Oct 15 10:29:33 2016
(r307350)
@@ -243,3 +243,14 @@ ctl_get_opt(ctl_options_t *opts, const c
}
return (NULL);
 }
+
+int
+ctl_get_opt_number(ctl_options_t *opts, const char *name, uint64_t *val)
+{
+   const char *value;
+
+   value = ctl_get_opt(opts, name);
+   if (value == NULL)
+   return (-2);
+   return (ctl_expand_number(value, val));
+}

Modified: head/usr.sbin/ctladm/ctladm.8
==
--- head/usr.sbin/ctladm/ctladm.8   Sat Oct 15 09:54:22 2016
(r307349)
+++ head/usr.sbin/ctladm/ctladm.8   Sat Oct 15 10:29:33 2016
(r307350)
@@ -35,7 +35,7 @@
 .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $
 .\" $FreeBSD$
 .\"
-.Dd September 26, 2015
+.Dd October 15, 2016
 .Dt CTLADM 8
 .Os
 .Sh NAME
@@ -905,6 +905,13 @@ Specifies nominal form factor of the dev
 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8".
 .It Va unmap
 Set to "on", enables UNMAP support for the LUN, if supported by the backend.
+.It Va unmap_max_lba
+.It Va unmap_max_descr
+Specify maximum allowed number of LBAs and block descriptors per UNMAP
+command to report in Block Limits VPD page.
+.It Va write_same_max_lba
+Specify maximum allowed number of LBAs per WRITE SAME command to report
+in Block Limits VPD page.
 .It Va avail-threshold
 .It 

svn commit: r307349 - head/sys/arm64/arm64

2016-10-15 Thread Andrew Turner
Author: andrew
Date: Sat Oct 15 09:54:22 2016
New Revision: 307349
URL: https://svnweb.freebsd.org/changeset/base/307349

Log:
  Check we are in a critical section when calling vfp_discard. As we may call
  it with a NULL thread pointer only check when it is non-NULL.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/vfp.c

Modified: head/sys/arm64/arm64/vfp.c
==
--- head/sys/arm64/arm64/vfp.c  Sat Oct 15 09:10:35 2016(r307348)
+++ head/sys/arm64/arm64/vfp.c  Sat Oct 15 09:54:22 2016(r307349)
@@ -79,6 +79,10 @@ void
 vfp_discard(struct thread *td)
 {
 
+#ifdef INVARIANTS
+   if (td != NULL)
+   CRITICAL_ASSERT(td);
+#endif
if (PCPU_GET(fpcurthread) == td)
PCPU_SET(fpcurthread, NULL);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307348 - head/sys/dev/acpi_support

2016-10-15 Thread Andriy Gapon
Author: avg
Date: Sat Oct 15 09:10:35 2016
New Revision: 307348
URL: https://svnweb.freebsd.org/changeset/base/307348

Log:
  aibs / atk0110: add support for querying sensors via GGRP and GITM
  
  Comparing to the Linux driver there is still one missing feature.
  The Linux driver finds and enables "Embedded Controller" item in
  the 0x11 group if it's not enabled yet.
  
  I tested the new method, Torfinn Ingolfsen tested the old method
  and helped to fix several bugs in the earlier versions of the patch.
  
  Tested by:Torfinn Ingolfsen 
  Reviewed by:  rpaulo
  MFC after:3 weeks
  Differential Revision: https://reviews.freebsd.org/D8227

Modified:
  head/sys/dev/acpi_support/atk0110.c

Modified: head/sys/dev/acpi_support/atk0110.c
==
--- head/sys/dev/acpi_support/atk0110.c Sat Oct 15 09:09:25 2016
(r307347)
+++ head/sys/dev/acpi_support/atk0110.c Sat Oct 15 09:10:35 2016
(r307348)
@@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -51,18 +52,23 @@ ACPI_SERIAL_DECL(aibs, "aibs");
 #define AIBS_MORE_SENSORS
 #define AIBS_VERBOSE
 
-enum aibs_type {
-   AIBS_VOLT,
-   AIBS_TEMP,
-   AIBS_FAN
-};
+#defineAIBS_GROUP_SENSORS  0x06
+
+#define AIBS_SENS_TYPE(x)  (((x) >> 16) & 0xff)
+#define AIBS_SENS_TYPE_VOLT2
+#define AIBS_SENS_TYPE_TEMP3
+#define AIBS_SENS_TYPE_FAN 4
+
+#defineAIBS_SENS_TYPE_VOLT_NAME"volt"
+#defineAIBS_SENS_TYPE_VOLT_TEMP"temp"
+#defineAIBS_SENS_TYPE_VOLT_FAN "fan"
 
 struct aibs_sensor {
ACPI_INTEGERv;
ACPI_INTEGERi;
ACPI_INTEGERl;
ACPI_INTEGERh;
-   enum aibs_type  t;
+   int t;
 };
 
 struct aibs_softc {
@@ -72,14 +78,23 @@ struct aibs_softc {
struct aibs_sensor  *sc_asens_volt;
struct aibs_sensor  *sc_asens_temp;
struct aibs_sensor  *sc_asens_fan;
+   struct aibs_sensor  *sc_asens_all;
+
+   struct sysctl_oid   *sc_volt_sysctl;
+   struct sysctl_oid   *sc_temp_sysctl;
+   struct sysctl_oid   *sc_fan_sysctl;
+
+   boolsc_ggrp_method;
 };
 
 static int aibs_probe(device_t);
 static int aibs_attach(device_t);
 static int aibs_detach(device_t);
 static int aibs_sysctl(SYSCTL_HANDLER_ARGS);
+static int aibs_sysctl_ggrp(SYSCTL_HANDLER_ARGS);
 
-static void aibs_attach_sif(struct aibs_softc *, enum aibs_type);
+static int aibs_attach_ggrp(struct aibs_softc *);
+static int aibs_attach_sif(struct aibs_softc *, int);
 
 static device_method_t aibs_methods[] = {
DEVMETHOD(device_probe, aibs_probe),
@@ -109,54 +124,240 @@ aibs_probe(device_t dev)
 {
if (acpi_disabled("aibs") ||
ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids) == NULL)
-   return ENXIO;
+   return (ENXIO);
 
device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)");
-   return 0;
+   return (0);
 }
 
 static int
 aibs_attach(device_t dev)
 {
struct aibs_softc *sc = device_get_softc(dev);
+   int err;
 
sc->sc_dev = dev;
sc->sc_ah = acpi_get_handle(dev);
 
-   aibs_attach_sif(sc, AIBS_VOLT);
-   aibs_attach_sif(sc, AIBS_TEMP);
-   aibs_attach_sif(sc, AIBS_FAN);
+   sc->sc_ggrp_method = false;
+   err = aibs_attach_sif(sc, AIBS_SENS_TYPE_VOLT);
+   if (err == 0)
+   err = aibs_attach_sif(sc, AIBS_SENS_TYPE_TEMP);
+   if (err == 0)
+   err = aibs_attach_sif(sc, AIBS_SENS_TYPE_FAN);
+
+   if (err == 0)
+   return (0);
+
+   /* Clean up whatever was allocated earlier. */
+   if (sc->sc_volt_sysctl != NULL)
+   sysctl_remove_oid(sc->sc_volt_sysctl, true, true);
+   if (sc->sc_temp_sysctl != NULL)
+   sysctl_remove_oid(sc->sc_temp_sysctl, true, true);
+   if (sc->sc_fan_sysctl != NULL)
+   sysctl_remove_oid(sc->sc_fan_sysctl, true, true);
+   aibs_detach(dev);
+
+   sc->sc_ggrp_method = true;
+   err = aibs_attach_ggrp(sc);
+   return (err);
+}
+
+static int
+aibs_add_sensor(struct aibs_softc *sc, ACPI_OBJECT *o,
+struct aibs_sensor* sensor, const char ** descr)
+{
+   int off;
 
-   return 0;
+   /*
+* Packages for the old and new methods are quite
+* similar except that the new package has two
+* new (unknown / unused) fields after the name field.
+*/
+   if (sc->sc_ggrp_method)
+   off = 4;
+   else
+   off = 2;
+
+   if (o->Type != ACPI_TYPE_PACKAGE) {
+   device_printf(sc->sc_dev,
+   "sensor object is not a package: %i type\n",
+o->Type);
+   return (ENXIO);
+   }
+   if 

svn commit: r307343 - head/lib/libc/stdlib

2016-10-15 Thread Ed Schouten
Author: ed
Date: Sat Oct 15 08:09:55 2016
New Revision: 307343
URL: https://svnweb.freebsd.org/changeset/base/307343

Log:
  Improve phrasing of the STANDARDS section.
  
  Reported by:  wblock
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D8205

Modified:
  head/lib/libc/stdlib/tsearch.3

Modified: head/lib/libc/stdlib/tsearch.3
==
--- head/lib/libc/stdlib/tsearch.3  Sat Oct 15 07:38:27 2016
(r307342)
+++ head/lib/libc/stdlib/tsearch.3  Sat Oct 15 08:09:55 2016
(r307343)
@@ -142,10 +142,10 @@ The
 .Fa posix_tnode
 type is not part of
 .St -p1003.1-2008 ,
-but it is expected to be standardized by future versions of the standard.
+but is expected to be standardized by future versions of the standard.
 It is defined as
 .Fa void
 for source-level compatibility.
 Using
 .Fa posix_tnode
-makes it easier to distinguish between nodes and keys.
+makes distinguishing between nodes and keys easier.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r307339 - head/usr.sbin/efivar

2016-10-15 Thread Warner Losh
Author: imp
Date: Sat Oct 15 06:16:35 2016
New Revision: 307339
URL: https://svnweb.freebsd.org/changeset/base/307339

Log:
  Implement -t. Use symbolic names in place of the magical 0x7.
  
  Submitted by: ambrisko@

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

Modified: head/usr.sbin/efivar/efivar.c
==
--- head/usr.sbin/efivar/efivar.c   Sat Oct 15 05:53:09 2016
(r307338)
+++ head/usr.sbin/efivar/efivar.c   Sat Oct 15 06:16:35 2016
(r307339)
@@ -62,7 +62,7 @@ static struct option longopts[] = {
 static int aflag, Aflag, bflag, dflag, Dflag, Hflag, Nflag,
lflag, Lflag, Rflag, wflag, pflag;
 static char *varname;
-static u_long attrib = 0x7;
+static u_long attrib = EFI_VARIABLE_NON_VOLATILE 
|EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
 
 static void
 usage(void)
@@ -294,11 +294,13 @@ parse_args(int argc, char **argv)
case 'R':
Rflag++;
break;
+   case 't':
+   attrib = strtoul(optarg, NULL, 16);
+   break;
case 'w':
wflag++;
break;
case 'f':
-   case 't':
case 0:
errx(1, "unknown or unimplemented option\n");
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"