svn commit: r297308 - head/sys/ufs/ufs

2016-03-27 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 27 08:07:12 2016
New Revision: 297308
URL: https://svnweb.freebsd.org/changeset/base/297308

Log:
  Style: wrap long lines.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/ufs/ufs/ufsmount.h

Modified: head/sys/ufs/ufs/ufsmount.h
==
--- head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:00:51 2016(r297307)
+++ head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:07:12 2016(r297308)
@@ -85,11 +85,13 @@ struct ufsmount {
int64_t um_savedmaxfilesize;/* XXX - limit maxfilesize */
int um_candelete;   /* devvp supports TRIM */
int um_writesuspended;  /* suspension in progress */
-   int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, 
struct buf **);
+   int (*um_balloc)(struct vnode *, off_t, int, struct ucred *,
+   int, struct buf **);
int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **);
int (*um_truncate)(struct vnode *, off_t, int, struct ucred *);
int (*um_update)(struct vnode *, int);
-   int (*um_valloc)(struct vnode *, int, struct ucred *, struct vnode 
**);
+   int (*um_valloc)(struct vnode *, int, struct ucred *,
+   struct vnode **);
int (*um_vfree)(struct vnode *, ino_t, int);
void(*um_ifree)(struct ufsmount *, struct inode *);
int (*um_rdonly)(struct inode *);
___
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: r297309 - head/sys/compat/linux

2016-03-27 Thread Dmitry Chagin
Author: dchagin
Date: Sun Mar 27 08:10:20 2016
New Revision: 297309
URL: https://svnweb.freebsd.org/changeset/base/297309

Log:
  Whitespaces and style(9) fix. No functional changes.
  
  MFC after:1 week

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cSun Mar 27 08:07:12 2016
(r297308)
+++ head/sys/compat/linux/linux_socket.cSun Mar 27 08:10:20 2016
(r297309)
@@ -448,7 +448,7 @@ linux_to_bsd_msg_flags(int flags)
if (flags & LINUX_MSG_ERRQUEUE)
;
 #endif
-   return ret_flags;
+   return (ret_flags);
 }
 
 /*
@@ -463,15 +463,12 @@ bsd_to_linux_sockaddr(struct sockaddr *a
struct sockaddr sa;
size_t sa_len = sizeof(struct sockaddr);
int error;
-   
+
if ((error = copyin(arg, &sa, sa_len)))
return (error);
-   
+
*(u_short *)&sa = sa.sa_family;
-   
-   error = copyout(&sa, arg, sa_len);
-   
-   return (error);
+   return (copyout(&sa, arg, sa_len));
 }
 
 static int
@@ -486,10 +483,7 @@ linux_to_bsd_sockaddr(struct sockaddr *a
 
sa.sa_family = *(sa_family_t *)&sa;
sa.sa_len = len;
-
-   error = copyout(&sa, arg, sa_len);
-
-   return (error);
+   return (copyout(&sa, arg, sa_len));
 }
 
 static int
@@ -511,11 +505,7 @@ linux_sa_put(struct osockaddr *osa)
return (EINVAL);
 
sa.sa_family = bdom;
-   error = copyout(&sa, osa, sizeof(sa.sa_family));
-   if (error)
-   return (error);
-
-   return (0);
+   return (copyout(&sa, osa, sizeof(sa.sa_family)));
 }
 
 static int
@@ -912,10 +902,7 @@ linux_getsockname(struct thread *td, str
bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa);
if (error)
return (error);
-   error = linux_sa_put(PTRIN(args->addr));
-   if (error)
-   return (error);
-   return (0);
+   return (linux_sa_put(PTRIN(args->addr)));
 }
 
 int
@@ -935,10 +922,7 @@ linux_getpeername(struct thread *td, str
bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa);
if (error)
return (error);
-   error = linux_sa_put(PTRIN(args->addr));
-   if (error)
-   return (error);
-   return (0);
+   return (linux_sa_put(PTRIN(args->addr)));
 }
 
 int
@@ -1003,7 +987,7 @@ linux_send(struct thread *td, struct lin
bsd_args.flags = args->flags;
bsd_args.to = NULL;
bsd_args.tolen = 0;
-   return sys_sendto(td, &bsd_args);
+   return (sys_sendto(td, &bsd_args));
 }
 
 struct linux_recv_args {
@@ -1040,7 +1024,6 @@ linux_sendto(struct thread *td, struct l
 {
struct msghdr msg;
struct iovec aiov;
-   int error;
 
if (linux_check_hdrincl(td, args->s) == 0)
/* IP_HDRINCL set, tweak the packet before sending */
@@ -1054,9 +1037,8 @@ linux_sendto(struct thread *td, struct l
msg.msg_flags = 0;
aiov.iov_base = PTRIN(args->msg);
aiov.iov_len = args->len;
-   error = linux_sendit(td, args->s, &msg, args->flags, NULL,
-   UIO_USERSPACE);
-   return (error);
+   return (linux_sendit(td, args->s, &msg, args->flags, NULL,
+   UIO_USERSPACE));
 }
 
 int
___
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: r297310 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux

2016-03-27 Thread Dmitry Chagin
Author: dchagin
Date: Sun Mar 27 08:12:01 2016
New Revision: 297310
URL: https://svnweb.freebsd.org/changeset/base/297310

Log:
  iConvert Linux SOL_IPV6 level.
  
  MFC after:1 week

Modified:
  head/sys/amd64/linux/linux.h
  head/sys/amd64/linux32/linux.h
  head/sys/compat/linux/linux_socket.c
  head/sys/i386/linux/linux.h

Modified: head/sys/amd64/linux/linux.h
==
--- head/sys/amd64/linux/linux.hSun Mar 27 08:10:20 2016
(r297309)
+++ head/sys/amd64/linux/linux.hSun Mar 27 08:12:01 2016
(r297310)
@@ -404,6 +404,7 @@ struct l_ipc_perm {
 
 #defineLINUX_SOL_SOCKET1
 #defineLINUX_SOL_IP0
+#defineLINUX_SOL_IPV6  41
 #defineLINUX_SOL_IPX   256
 #defineLINUX_SOL_AX25  257
 #defineLINUX_SOL_TCP   6

Modified: head/sys/amd64/linux32/linux.h
==
--- head/sys/amd64/linux32/linux.h  Sun Mar 27 08:10:20 2016
(r297309)
+++ head/sys/amd64/linux32/linux.h  Sun Mar 27 08:12:01 2016
(r297310)
@@ -494,6 +494,7 @@ struct l_ipc_perm {
  */
 #defineLINUX_SOL_SOCKET1
 #defineLINUX_SOL_IP0
+#defineLINUX_SOL_IPV6  41
 #defineLINUX_SOL_IPX   256
 #defineLINUX_SOL_AX25  257
 #defineLINUX_SOL_TCP   6

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cSun Mar 27 08:10:20 2016
(r297309)
+++ head/sys/compat/linux/linux_socket.cSun Mar 27 08:12:01 2016
(r297310)
@@ -246,6 +246,8 @@ linux_to_bsd_sockopt_level(int level)
switch (level) {
case LINUX_SOL_SOCKET:
return (SOL_SOCKET);
+   case LINUX_SOL_IPV6:
+   return (IPPROTO_IPV6);
}
return (level);
 }

Modified: head/sys/i386/linux/linux.h
==
--- head/sys/i386/linux/linux.h Sun Mar 27 08:10:20 2016(r297309)
+++ head/sys/i386/linux/linux.h Sun Mar 27 08:12:01 2016(r297310)
@@ -473,6 +473,7 @@ struct l_ipc_perm {
  */
 #defineLINUX_SOL_SOCKET1
 #defineLINUX_SOL_IP0
+#defineLINUX_SOL_IPV6  41
 #defineLINUX_SOL_IPX   256
 #defineLINUX_SOL_AX25  257
 #defineLINUX_SOL_TCP   6
___
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: r297311 - in head/sys/ufs: ffs ufs

2016-03-27 Thread Konstantin Belousov
Author: kib
Date: Sun Mar 27 08:21:17 2016
New Revision: 297311
URL: https://svnweb.freebsd.org/changeset/base/297311

Log:
  Split the global taskqueue used to process all UFS trim completions,
  into per-mount taskqueue with the private taskqueue processing thread.
  This allows to drain the taskqueue on unmount, to ensure that all
  TRIMs are finished before mount structures are freed.
  
  But just draining the taskqueue where TRIM biodone geom-up completions
  are processed is not enough, since ffs_blkfree(), called by the task,
  might result in more writes.  Count inflight delayed blkfree's and
  pause() unmount until the counter drains as well.
  
  Reported by:  Nick Evans 
  Tested by:Nick Evans , pho
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/ufs/ffs/ffs_alloc.c
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/ufsmount.h

Modified: head/sys/ufs/ffs/ffs_alloc.c
==
--- head/sys/ufs/ffs/ffs_alloc.cSun Mar 27 08:12:01 2016
(r297310)
+++ head/sys/ufs/ffs/ffs_alloc.cSun Mar 27 08:21:17 2016
(r297311)
@@ -2270,8 +2270,6 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size
bdwrite(bp);
 }
 
-TASKQUEUE_DEFINE_THREAD(ffs_trim);
-
 struct ffs_blkfree_trim_params {
struct task task;
struct ufsmount *ump;
@@ -2294,6 +2292,7 @@ ffs_blkfree_trim_task(ctx, pending)
ffs_blkfree_cg(tp->ump, tp->ump->um_fs, tp->devvp, tp->bno, tp->size,
tp->inum, tp->pdephd);
vn_finished_secondary_write(UFSTOVFS(tp->ump));
+   atomic_add_int(&tp->ump->um_trim_inflight, -1);
free(tp, M_TEMP);
 }
 
@@ -2306,7 +2305,7 @@ ffs_blkfree_trim_completed(bip)
tp = bip->bio_caller2;
g_destroy_bio(bip);
TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp);
-   taskqueue_enqueue(taskqueue_ffs_trim, &tp->task);
+   taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task);
 }
 
 void
@@ -2350,6 +2349,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, i
 * reordering, TRIM might be issued after we reuse the block
 * and write some new data into it.
 */
+   atomic_add_int(&ump->um_trim_inflight, 1);
tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK);
tp->ump = ump;
tp->devvp = devvp;

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Sun Mar 27 08:12:01 2016
(r297310)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Sun Mar 27 08:21:17 2016
(r297311)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1005,6 +1006,12 @@ ffs_mountfs(devvp, mp, td)
mp->mnt_stat.f_mntonname);
ump->um_candelete = 0;
}
+   if (ump->um_candelete) {
+   ump->um_trim_tq = taskqueue_create("trim", M_WAITOK,
+   taskqueue_thread_enqueue, &ump->um_trim_tq);
+   taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS,
+   "%s trim", mp->mnt_stat.f_mntonname);
+   }
}
 
ump->um_mountp = mp;
@@ -1260,6 +1267,12 @@ ffs_unmount(mp, mntflags)
}
if (susp)
vfs_write_resume(mp, VR_START_WRITE);
+   if (ump->um_trim_tq != NULL) {
+   while (ump->um_trim_inflight != 0)
+   pause("ufsutr", hz);
+   taskqueue_drain_all(ump->um_trim_tq);
+   taskqueue_free(ump->um_trim_tq);
+   }
DROP_GIANT();
g_topology_lock();
if (ump->um_fsckpid > 0) {

Modified: head/sys/ufs/ufs/ufsmount.h
==
--- head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:12:01 2016(r297310)
+++ head/sys/ufs/ufs/ufsmount.h Sun Mar 27 08:21:17 2016(r297311)
@@ -50,6 +50,7 @@ MALLOC_DECLARE(M_UFSMNT);
 struct buf;
 struct inode;
 struct nameidata;
+struct taskqueue;
 struct timeval;
 struct ucred;
 struct uio;
@@ -85,6 +86,8 @@ struct ufsmount {
int64_t um_savedmaxfilesize;/* XXX - limit maxfilesize */
int um_candelete;   /* devvp supports TRIM */
int um_writesuspended;  /* suspension in progress */
+   u_int   um_trim_inflight;
+   struct taskqueue *um_trim_tq;
int (*um_balloc)(struct vnode *, off_t, int, struct ucred *,
int, struct buf **);
int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **);
___
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: r297312 - head/sys/netinet

2016-03-27 Thread Michael Tuexen
Author: tuexen
Date: Sun Mar 27 10:04:25 2016
New Revision: 297312
URL: https://svnweb.freebsd.org/changeset/base/297312

Log:
  Improve compilation on windows 64-bit (for the userland stack).
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_timer.c
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c
  head/sys/netinet/sctputil.h

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Sun Mar 27 08:21:17 2016
(r297311)
+++ head/sys/netinet/sctp_constants.h   Sun Mar 27 10:04:25 2016
(r297312)
@@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$");
 
 /* Largest length of a chunk */
 #define SCTP_MAX_CHUNK_LENGTH 0x
+/* Largest length of an error cause */
+#define SCTP_MAX_CAUSE_LENGTH 0x
 /* Number of addresses where we just skip the counting */
 #define SCTP_COUNT_LIMIT 40
 

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Sun Mar 27 08:21:17 2016
(r297311)
+++ head/sys/netinet/sctp_indata.c  Sun Mar 27 10:04:25 2016
(r297312)
@@ -2495,7 +2495,7 @@ sctp_process_data(struct mbuf **mm, int 
if (op_err != NULL) {
cause = mtod(op_err, struct 
sctp_gen_error_cause *);
cause->code = 
htons(SCTP_CAUSE_UNRECOG_CHUNK);
-   cause->length = 
htons(chk_length + sizeof(struct sctp_gen_error_cause));
+   cause->length = 
htons((uint16_t) (chk_length + sizeof(struct sctp_gen_error_cause)));
SCTP_BUF_LEN(op_err) = 
sizeof(struct sctp_gen_error_cause);
SCTP_BUF_NEXT(op_err) = 
SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT);
if (SCTP_BUF_NEXT(op_err) != 
NULL) {
@@ -2688,7 +2688,7 @@ sctp_process_segment_range(struct sctp_t

sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_GAP,

tp1->whoTo->flight_size,
tp1->book_size,
-   (uintptr_t) 
tp1->whoTo,
+   (uint32_t) 
(uintptr_t) tp1->whoTo,

tp1->rec.data.TSN_seq);
}
sctp_flight_size_decrease(tp1);
@@ -2897,7 +2897,7 @@ sctp_check_for_revoked(struct sctp_tcb *

sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE,
tp1->whoTo->flight_size,
tp1->book_size,
-   (uintptr_t) tp1->whoTo,
+   (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.TSN_seq);
}
sctp_flight_size_increase(tp1);
@@ -3211,7 +3211,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND,
(tp1->whoTo ? (tp1->whoTo->flight_size) : 
0),
tp1->book_size,
-   (uintptr_t) tp1->whoTo,
+   (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.TSN_seq);
}
if (tp1->whoTo) {
@@ -3523,7 +3523,7 @@ sctp_window_probe_recovery(struct sctp_t
sctp_misc_ints(SCTP_FLIGHT_LOG_DWN_WP_FWD,
tp1->whoTo ? tp1->whoTo->flight_size : 0,
tp1->book_size,
-   (uintptr_t) tp1->whoTo,
+   (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.TSN_seq);
return;
}
@@ -3542,7 +3542,7 @@ sctp_window_probe_recovery(struct sctp_t
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP,
tp1->whoTo->flight_size,
tp1->book_size,
-   (uintptr_t) tp1->whoTo,
+   (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.TSN_seq);
}
 }
@@ -3661,7 +3661,7 @@ sctp_express_handle_sack(struct sctp_tcb

sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA,

svn commit: r297313 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux

2016-03-27 Thread Dmitry Chagin
Author: dchagin
Date: Sun Mar 27 10:09:10 2016
New Revision: 297313
URL: https://svnweb.freebsd.org/changeset/base/297313

Log:
  Revert r297310 as the SOL_XXX are equal to the IPPROTO_XX except SOL_SOCKET.
  
  Pointed out by:   ae@

Modified:
  head/sys/amd64/linux/linux.h
  head/sys/amd64/linux32/linux.h
  head/sys/compat/linux/linux_socket.c
  head/sys/i386/linux/linux.h

Modified: head/sys/amd64/linux/linux.h
==
--- head/sys/amd64/linux/linux.hSun Mar 27 10:04:25 2016
(r297312)
+++ head/sys/amd64/linux/linux.hSun Mar 27 10:09:10 2016
(r297313)
@@ -404,7 +404,6 @@ struct l_ipc_perm {
 
 #defineLINUX_SOL_SOCKET1
 #defineLINUX_SOL_IP0
-#defineLINUX_SOL_IPV6  41
 #defineLINUX_SOL_IPX   256
 #defineLINUX_SOL_AX25  257
 #defineLINUX_SOL_TCP   6

Modified: head/sys/amd64/linux32/linux.h
==
--- head/sys/amd64/linux32/linux.h  Sun Mar 27 10:04:25 2016
(r297312)
+++ head/sys/amd64/linux32/linux.h  Sun Mar 27 10:09:10 2016
(r297313)
@@ -494,7 +494,6 @@ struct l_ipc_perm {
  */
 #defineLINUX_SOL_SOCKET1
 #defineLINUX_SOL_IP0
-#defineLINUX_SOL_IPV6  41
 #defineLINUX_SOL_IPX   256
 #defineLINUX_SOL_AX25  257
 #defineLINUX_SOL_TCP   6

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cSun Mar 27 10:04:25 2016
(r297312)
+++ head/sys/compat/linux/linux_socket.cSun Mar 27 10:09:10 2016
(r297313)
@@ -246,8 +246,6 @@ linux_to_bsd_sockopt_level(int level)
switch (level) {
case LINUX_SOL_SOCKET:
return (SOL_SOCKET);
-   case LINUX_SOL_IPV6:
-   return (IPPROTO_IPV6);
}
return (level);
 }

Modified: head/sys/i386/linux/linux.h
==
--- head/sys/i386/linux/linux.h Sun Mar 27 10:04:25 2016(r297312)
+++ head/sys/i386/linux/linux.h Sun Mar 27 10:09:10 2016(r297313)
@@ -473,7 +473,6 @@ struct l_ipc_perm {
  */
 #defineLINUX_SOL_SOCKET1
 #defineLINUX_SOL_IP0
-#defineLINUX_SOL_IPV6  41
 #defineLINUX_SOL_IPX   256
 #defineLINUX_SOL_AX25  257
 #defineLINUX_SOL_TCP   6
___
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: r297039 - head/sys/x86/x86

2016-03-27 Thread Konstantin Belousov
On Sun, Mar 27, 2016 at 06:49:40AM +1100, Bruce Evans wrote:
> On Sat, 26 Mar 2016, Konstantin Belousov wrote:
> 
> > On Sat, Mar 26, 2016 at 03:17:43AM +1100, Bruce Evans wrote:
> >> This uses the i8254.
> > Well, this is the part which I do not like most.  It is ridiculous
> > to calibrate relatively high-quality CPU oscillator with 8245 timer,
> > which often fed from separate, low-quality crystal which currently
> > selected by cost and exists only for legacy purposes.  At least
> 
> I haven't seen a single (hardware) system since I started measuring
> this 15-20 yeas ago on which the i8524 is not fed from the same clock
> as the TSC.  Normally there is a PLL that can derives hundreds of
> different frequencies from the same clock.  One is fed to the i8254,
> one to the ACPI timer and one to the CPU clock/TSC.
Hm, I was able to track this down in the public documents.  I was wrong,
but your description is not completely correct either.  Please see
http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/x99-chipset-pch-datasheet.pdf
page 64 for the diagram of the clock signals interconnect on Romley and
later. Also the CK420BQ (clock synthesizer) and DB1200Z (clock buffer
for PCIe and CPU) datasheets are available on the idt.com site, but
there I can only understand the claims about jitter.

>From the diagram at the page 64, main clock is fed into CPU PLL (directly
driving TSC and LAPIC timer) and into PCH (south bridge, where all other
counters reside).  In PCH, misc. PLLs are used to drive all counters except
RTC.  RTC needs its own dedicated crystal.

I was not able to find any specifications for allowed jitter in PCH PLLs,
but I would expect that above IDT chips have much better stability than
something in overheating PCH.

> 
> > some hypervisors start offering modes where old ISA peripherals
> > are not emulated, and I suspect that hardware would start do the
> > same.  Quite possible, some variants of SoCs already do this.
> 
> Bug in these hypervisors.  A slow clock like the i8254 is much easier
> to emulate than a fast one.  It is impossible to emulate real time on
> a non-real-time system anyway, so almost all calibration code is likely
> to break in inverse proportion to its accuracy on real hardware.
RTC does not require any emulation at all, only some adjustments which
are already facilitated by the virtualization hardware.

> 
> > More, we do not have any hooks to recalibrate our thought about
> > TSC frequency during normal runtime.  Often, system does have very
> > precise measurement of the timecounter drift due to ntp/ptp.
> 
> cpu_tick_calibrate() does exactly this (if the ticker is the TSC).
> 
> My version has a precise (~1-10 usec) measurement of the timecounter drift
> relative to the RTC (or vice-versa).  This is used some time after
> exit from ddb to fix up the timecounter.  This depends on RTC seconds
> interrupts being perfectly periodic with low (or at least measurable)
> latency.  This should be used to fix up the timecounter after suspend/
> resume.  An error of 1-10 usec is good enough for an ntpd server, but
> the current ACPI error in resume is not good enough for an nptd client.
> 
> >> xdel() is a specialized version of i8254 DELAY()
> >> with getit() inline.  It returns the initial and final values of the
> 
> It can use any readable timer, but only the i8254 is easy to use and
> available on all (non-broken) x86 systems.  Just the
> ifdefs/configuratation to use another timer would be very complicated.
> Using the cputicker or timecounter read functions doesn't quite work
> because these functions have unknown internals which might involve
> unusable timing or lockimg.
I think we have no choice but do something for ISA/LPC-less configurations.
We could even trust CPU report about its frequency as the last resort.
>From what I saw, the calibrated RTC frequency is very close to the
reported frequency, and if runtime recalibration based on ntp client
feedback is implemented, all would be good.
___
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: r297039 - head/sys/x86/x86

2016-03-27 Thread Poul-Henning Kamp

In message <20160327130706.ga1...@kib.kiev.ua>, Konstantin Belousov writes:

>> I haven't seen a single (hardware) system since I started measuring
>> this 15-20 yeas ago on which the i8524 is not fed from the same clock
>> as the TSC.

A very important and relevant detail here is that the *only*
clock/counter which has a standardized frequency *is* the i8254
counter.

>RTC needs its own dedicated crystal.

The RTC *crystal* may not even exist, only the RTC itself which may
be driven by gremlins on a threadmill for all we care.

Besides, getting hold of *precise* timing from the RTC is a nightmare,
it's not meant to be used for that.

>I was not able to find any specifications for allowed jitter in PCH PLLs,
>but I would expect that above IDT chips have much better stability than
>something in overheating PCH.

Jitter requirements are pretty tight for anything you're going to
PLL into the GHz range, but any quartz crystal is going to have much
better phase-noise spec than anything we can measure in the digital
noise of a modern computer.

(Often the PLL chips modulate the quartz to spread out EMI spurs,
look for "spread-spectrum" settings.)

>> > some hypervisors start offering modes where old ISA peripherals
>> > are not emulated, 

How do they expect people to run MS Flight Simulator then ?  :-)

>I think we have no choice but do something for ISA/LPC-less configurations.
>We could even trust CPU report about its frequency as the last resort.

Usually the errors will be magnificient, so a trivial sanity-check will
catch them.  Don't leave home without it.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
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: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake

2016-03-27 Thread Jilles Tjoelker
On Sun, Mar 13, 2016 at 04:29:10PM -0700, Simon J. Gerraty wrote:
> Bryan Drewery  wrote:
> > This code is only in head. My problem is now bmake can only build
> > commits after this one which breaks bisecting and older project branches
> > which haven't or can't merge in head yet.

> > Is the :@ iterator variable deletion change in bmake change necessary?

> In the sense of good hygiene, yes.
> Obviously make will work without it since its been that way for 15
> years, but this AFAIK is the only makefile affected.

I think the ability to bisect without weird local hacks is valuable,
although I rarely do this in a FreeBSD context.

-- 
Jilles Tjoelker
___
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: r297314 - head/etc/rc.d

2016-03-27 Thread Jilles Tjoelker
Author: jilles
Date: Sun Mar 27 16:27:49 2016
New Revision: 297314
URL: https://svnweb.freebsd.org/changeset/base/297314

Log:
  rc.d: Make msgs a proper rc.d script.
  
  PR:   207149
  Reported by:  Jonathan de Boyne Pollard

Modified:
  head/etc/rc.d/msgs

Modified: head/etc/rc.d/msgs
==
--- head/etc/rc.d/msgs  Sun Mar 27 10:09:10 2016(r297313)
+++ head/etc/rc.d/msgs  Sun Mar 27 16:27:49 2016(r297314)
@@ -6,8 +6,20 @@
 # PROVIDE: msgs
 # REQUIRE: LOGIN
 
-# Make a bounds file for msgs(1) if there isn't one already
-#
-if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then
-   echo 0 > /var/msgs/bounds
-fi
+. /etc/rc.subr
+
+name="msgs"
+start_cmd="msgs_start"
+stop_cmd=":"
+
+msgs_start()
+{
+   # Make a bounds file for msgs(1) if there isn't one already
+   #
+   if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; 
then
+   echo 0 > /var/msgs/bounds
+   fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
___
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: r297315 - head/etc/rc.d

2016-03-27 Thread Kristof Provost
Author: kp
Date: Sun Mar 27 17:22:27 2016
New Revision: 297315
URL: https://svnweb.freebsd.org/changeset/base/297315

Log:
  pf: Friendly error message for status if pf.ko is not loaded
  
  Check if pf.ko is loaded (i.e. /dev/pf exists) before trying to use it. This
  means that '/etc/rc.d/pf status' will no longer return 'pfctl: /dev/pf: No 
such
  file or directory' but 'pf.ko is not loaded'.
  
  PR:   205671
  Submitted by: Johannes Jost Meixner 

Modified:
  head/etc/rc.d/pf

Modified: head/etc/rc.d/pf
==
--- head/etc/rc.d/pfSun Mar 27 16:27:49 2016(r297314)
+++ head/etc/rc.d/pfSun Mar 27 17:22:27 2016(r297315)
@@ -66,7 +66,11 @@ pf_resync()
 
 pf_status()
 {
-   $pf_program -s info
+   if ! [ -c /dev/pf ] ; then
+   echo "pf.ko is not loaded"
+   else
+   $pf_program -s info
+   fi
 }
 
 run_rc_command "$1"
___
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: r297039 - head/sys/x86/x86

2016-03-27 Thread Bruce Evans

On Sun, 27 Mar 2016, Konstantin Belousov wrote:


On Sun, Mar 27, 2016 at 06:49:40AM +1100, Bruce Evans wrote:

On Sat, 26 Mar 2016, Konstantin Belousov wrote:


On Sat, Mar 26, 2016 at 03:17:43AM +1100, Bruce Evans wrote:

This uses the i8254.

Well, this is the part which I do not like most.  It is ridiculous
to calibrate relatively high-quality CPU oscillator with 8245 timer,
which often fed from separate, low-quality crystal which currently
selected by cost and exists only for legacy purposes.  At least


I haven't seen a single (hardware) system since I started measuring
this 15-20 yeas ago on which the i8524 is not fed from the same clock
as the TSC.  Normally there is a PLL that can derives hundreds of
different frequencies from the same clock.  One is fed to the i8254,
one to the ACPI timer and one to the CPU clock/TSC.

Hm, I was able to track this down in the public documents.  I was wrong,
but your description is not completely correct either.  Please see
http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/x99-chipset-pch-datasheet.pdf
page 64 for the diagram of the clock signals interconnect on Romley and
later. Also the CK420BQ (clock synthesizer) and DB1200Z (clock buffer
for PCIe and CPU) datasheets are available on the idt.com site, but
there I can only understand the claims about jitter.


Of course the details are machine-dependent.  My oldest system on which I
discovered PLL-like behaviour was from late 1997.  The PLL might not have
been in standard bus chips then.  It had a K5 (?) running at 233 MHz.
The ratio of the TSC to the i8254 was precisely 196.  This was very easy
to measure or to guess without measurement and then verify by measurements
since it is an integer.  This integer is just the one that gives the best
approximation to the nominal TSC frequency of 233 MHz starting with the
nominal i8254 frequency of 1193182.  Newer systems have much higher
resolution so the ratios are rarely integers.


From the diagram at the page 64, main clock is fed into CPU PLL (directly

driving TSC and LAPIC timer) and into PCH (south bridge, where all other
counters reside).  In PCH, misc. PLLs are used to drive all counters except
RTC.  RTC needs its own dedicated crystal.

I was not able to find any specifications for allowed jitter in PCH PLLs,
but I would expect that above IDT chips have much better stability than
something in overheating PCH.


some hypervisors start offering modes where old ISA peripherals
are not emulated, and I suspect that hardware would start do the
same.  Quite possible, some variants of SoCs already do this.


Bug in these hypervisors.  A slow clock like the i8254 is much easier
to emulate than a fast one.  It is impossible to emulate real time on
a non-real-time system anyway, so almost all calibration code is likely
to break in inverse proportion to its accuracy on real hardware.

RTC does not require any emulation at all, only some adjustments which
are already facilitated by the virtualization hardware.


If the RTC is in direct hardware and the timecounters are partly in
software, then it would be hard to preserve order and minimize (virtual)
jitter in measurements comparing the timers.  The timecounters would
robably need additinal complications to keep them in step with the RTC.
This care would usually be wasted since the RTC is rarely used like
that.  It would probably be easier to virtualise the RTC to keep it in
step with the timecounters.


xdel() is a specialized version of i8254 DELAY()
with getit() inline.  It returns the initial and final values of the


It can use any readable timer, but only the i8254 is easy to use and
available on all (non-broken) x86 systems.  Just the
ifdefs/configuratation to use another timer would be very complicated.
Using the cputicker or timecounter read functions doesn't quite work
because these functions have unknown internals which might involve
unusable timing or lockimg.

I think we have no choice but do something for ISA/LPC-less configurations.


Indeed.


We could even trust CPU report about its frequency as the last resort.
From what I saw, the calibrated RTC frequency is very close to the
reported frequency, and if runtime recalibration based on ntp client
feedback is implemented, all would be good.


phk axed my RTC calibration code (actually i8254 and TSC calibration code
starting from the RTC).  It worked perfectly except it didn't adjust for
the time to read the hardware.  The problem with it is that the RTC is no
more or less accurate than the other timers.  It should be, but isn't in
practice.  Normally it it is controlled by different hardware (crystal?)
with different temperature characteristics and different exposure to
temperature changes by being physically separate.  The i8254 is supposed
to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz.
The RTC seconds update is supposed to occur at precisely 1 Hz but usually
has an unrelated inaccuracy of similar magnitude. 

Re: svn commit: r297039 - head/sys/x86/x86

2016-03-27 Thread Konstantin Belousov
On Mon, Mar 28, 2016 at 04:22:59AM +1100, Bruce Evans wrote:
> On Sun, 27 Mar 2016, Konstantin Belousov wrote:
> > We could even trust CPU report about its frequency as the last resort.
> > From what I saw, the calibrated RTC frequency is very close to the
Err, that should have been TSC, and not RTC.

> > reported frequency, and if runtime recalibration based on ntp client
> > feedback is implemented, all would be good.
> 
> phk axed my RTC calibration code (actually i8254 and TSC calibration code
> starting from the RTC).  It worked perfectly except it didn't adjust for
> the time to read the hardware.  The problem with it is that the RTC is no
> more or less accurate than the other timers.  It should be, but isn't in
> practice.  Normally it it is controlled by different hardware (crystal?)
> with different temperature characteristics and different exposure to
> temperature changes by being physically separate.  The i8254 is supposed
> to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz.
> The RTC seconds update is supposed to occur at precisely 1 Hz but usually
> has an unrelated inaccuracy of similar magnitude.  Calibrating these clocks
> relative to each other just gives the relative difference in their
> inaccuracy.  The difference can be measured very accurately at any time.
> It varies later with temperature.  I never finished code to track the
> termperature changes and calibrate adjustments based on the temperature.
> It is simpler to start with a hard-coded i8254 frequency of 1193182 and
> adjust everything later.  ntpd handles adjustment of a single timer well
> enough.  This works because the nominal frequency of 1193182 is so standard
> that inaccuracies in it are closer to 10 ppm than the 1000 ppm that would
> break ntpd.
> 
> Bruce
___
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: r297039 - head/sys/x86/x86

2016-03-27 Thread Bruce Evans

On Sun, 27 Mar 2016, Poul-Henning Kamp wrote:



In message <20160327130706.ga1...@kib.kiev.ua>, Konstantin Belousov writes:


I haven't seen a single (hardware) system since I started measuring
this 15-20 yeas ago on which the i8524 is not fed from the same clock
as the TSC.


A very important and relevant detail here is that the *only*
clock/counter which has a standardized frequency *is* the i8254
counter.


Not even the ACPI timer?


RTC needs its own dedicated crystal.


The RTC *crystal* may not even exist, only the RTC itself which may
be driven by gremlins on a threadmill for all we care.

Besides, getting hold of *precise* timing from the RTC is a nightmare,
it's not meant to be used for that.


It can give a precision of 1/32K seconds fairly easily (but with lots of
overhead) by interrupting at 32 KHz.  1KHz is sometimes used for profiling.


I was not able to find any specifications for allowed jitter in PCH PLLs,
but I would expect that above IDT chips have much better stability than
something in overheating PCH.


Jitter requirements are pretty tight for anything you're going to
PLL into the GHz range, but any quartz crystal is going to have much
better phase-noise spec than anything we can measure in the digital
noise of a modern computer.

(Often the PLL chips modulate the quartz to spread out EMI spurs,
look for "spread-spectrum" settings.)


Jitter is what I'm most worried about for virtual systems.

Jitter is quite good for a hardware RTC.  I use the RTC for PPS mainly
to determine its quality.  Its hardware jitter is insignificant compared
with the jitter from interrupt latency.


some hypervisors start offering modes where old ISA peripherals
are not emulated,


How do they expect people to run MS Flight Simulator then ?  :-)


I think we have no choice but do something for ISA/LPC-less configurations.
We could even trust CPU report about its frequency as the last resort.


Usually the errors will be magnificient, so a trivial sanity-check will
catch them.  Don't leave home without it.


But then you have the problem of handling them.  There might be just 1
timecounter source that is emulated correctly, but you don't know which
it is.  There might be none.

Bruce
___
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: r297039 - head/sys/x86/x86

2016-03-27 Thread Poul-Henning Kamp

In message <20160328033624.n...@besplex.bde.org>, Bruce Evans writes:

>Of course the details are machine-dependent.  My oldest system on which I
>discovered PLL-like behaviour was from late 1997.  The PLL might not have
>been in standard bus chips then.  It had a K5 (?) running at 233 MHz.
>The ratio of the TSC to the i8254 was precisely 196.

Which means the PLL probably was 49:3 from the 14.31818 MHz xtal to
233.8636 MHz CPU frequncy.

>Newer systems have much higher resolution so the ratios are rarely integers.

PLL's in EMI-spec'ed environments are never unity ratio because that
would needlessly add to the EMI trouble.

>It should be, but isn't in practice.

The RTC was only expected to be better than the other timers,
in the very long run - weeks to years.  In particular, most of
the RTC xtals run 20-40K hotter than their turn-over point ~23C,
so they keep awful time while the system is running.

(The 32.768kHz xtals are designed for wristwatches where you
body-temperature keeps them at stable temperature.  Don't take
your wrist-watch off at night if you want it to precise.)

>The i8254 is supposed
>to run at precisely 1193182 Hz but usually has an inaccuracy of 10-50 Hz.

50PPM is a very common crystal spec, that would be +/- 60Hz.

(merging emails here)

>> A very important and relevant detail here is that the *only*
>> clock/counter which has a standardized frequency *is* the i8254
>> counter.
>
>Not even the ACPI timer?

Not that I'm aware of.  In most cases it runs at 14.31818 MHz, but
I've seen it as low as 1MHz and as high as 25 MHz.

>> The RTC *crystal* may not even exist, [...]
>
>It can give a precision of 1/32K seconds fairly easily (but with lots of
>overhead) by interrupting at 32 KHz.  1KHz is sometimes used for profiling.

Only if the 32.768 kHz RTC xtal exists.  These days silicon oscillators
are gaining ground in that segment.

> Jitter is what I'm most worried about for virtual systems.
> Jitter is quite good for a hardware RTC. [...]
> Its hardware jitter is insignificant compared with the jitter
> from interrupt latency.

If interrupts are involved their latency+jitter will overshadow
any other noise source, if nothing else because of the quantization
to clock/bus frequencies.

Jitter on the raw xtal is in picoseconds if not femtoseconds, as
it needs to be when you PLL it up to GHz.

>> Usually the errors will be magnificient, so a trivial sanity-check will
>> catch them.  Don't leave home without it.
>
>But then you have the problem of handling them.  There might be just 1
>timecounter source that is emulated correctly, but you don't know which
>it is.  There might be none.

Indeed:  One clock or three, never two.

John R. Vig's famous tutorial is the ultimate collection of wisdom
about care and feeding of quartz:

http://www.ieee-uffc.org/frequency-control/learning-vig-tut.asp

Highly recommended.


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
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: r297315 - head/etc/rc.d

2016-03-27 Thread Ngie Cooper (yaneurabeya)

> On Mar 27, 2016, at 10:22, Kristof Provost  wrote:
> 
> Author: kp
> Date: Sun Mar 27 17:22:27 2016
> New Revision: 297315
> URL: https://svnweb.freebsd.org/changeset/base/297315

…

> Modified: head/etc/rc.d/pf
> ==
> --- head/etc/rc.d/pf  Sun Mar 27 16:27:49 2016(r297314)
> +++ head/etc/rc.d/pf  Sun Mar 27 17:22:27 2016(r297315)
> @@ -66,7 +66,11 @@ pf_resync()
> 
> pf_status()
> {
> - $pf_program -s info
> + if ! [ -c /dev/pf ] ; then
> + echo "pf.ko is not loaded"
> + else
> + $pf_program -s info
> + fi

This might be better:

load_kld pf || return 1
$pf_program -s info
___
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: r297321 - head/usr.bin/netstat

2016-03-27 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Mar 27 20:02:21 2016
New Revision: 297321
URL: https://svnweb.freebsd.org/changeset/base/297321

Log:
  netstat: avoid returning uninitialized value in p_sockaddr().
  
  In the case the width is less than 0, we are returning an uninitialized
  value. For practical purposes the return value is ignored but initialize
  it to avoid trouble.
  
  CID:  1341619

Modified:
  head/usr.bin/netstat/route.c

Modified: head/usr.bin/netstat/route.c
==
--- head/usr.bin/netstat/route.cSun Mar 27 19:43:26 2016
(r297320)
+++ head/usr.bin/netstat/route.cSun Mar 27 20:02:21 2016
(r297321)
@@ -417,6 +417,7 @@ p_sockaddr(const char *name, struct sock
if (width < 0) {
snprintf(buf, sizeof(buf), "{:%s/%%s} ", name);
xo_emit(buf, cp);
+   protrusion = 0;
} else {
if (Wflag != 0 || numeric_addr) {
snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%s}{]:} ",
___
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: r297315 - head/etc/rc.d

2016-03-27 Thread Ian Lepore
On Sun, 2016-03-27 at 12:46 -0700, Ngie Cooper (yaneurabeya) wrote:
> > On Mar 27, 2016, at 10:22, Kristof Provost  wrote:
> > 
> > Author: kp
> > Date: Sun Mar 27 17:22:27 2016
> > New Revision: 297315
> > URL: https://svnweb.freebsd.org/changeset/base/297315
> 
> …
> 
> > Modified: head/etc/rc.d/pf
> > ===
> > ===
> > --- head/etc/rc.d/pfSun Mar 27 16:27:49 2016(r29731
> > 4)
> > +++ head/etc/rc.d/pfSun Mar 27 17:22:27 2016(r29731
> > 5)
> > @@ -66,7 +66,11 @@ pf_resync()
> > 
> > pf_status()
> > {
> > -   $pf_program -s info
> > +   if ! [ -c /dev/pf ] ; then
> > +   echo "pf.ko is not loaded"
> > +   else
> > +   $pf_program -s info
> > +   fi
> 
> This might be better:
> 
> load_kld pf || return 1
> $pf_program -s info
> 

Having a status command say "module is not loaded" makes more sense to
me than having it load the module so that it could tell you that pf is
not active (which must surely be the bottom-line status if the module
wasn't loaded to begin with).

-- Ian

___
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: r297322 - head/contrib/libc++/include

2016-03-27 Thread Dimitry Andric
Author: dim
Date: Sun Mar 27 21:20:43 2016
New Revision: 297322
URL: https://svnweb.freebsd.org/changeset/base/297322

Log:
  Pull in r255683 from upstream libc++ trunk (by Eric Fiselier):
  
[libcxx] Enable noexcept for GCC 4.6 and greater
  
Summary:
This patch allows GCC 4.6 and above to use `noexcept` as opposed to
`throw()`.
  
Is it an ABI safe change to suddenly switch on `noexcept`? I imagine
it must be because it's disabled in w/ clang in C++03 but not C++11.
  
Reviewers: danalbert, jroelofs, mclow.lists
  
Subscribers: cfe-commits
  
Differential Revision: http://reviews.llvm.org/D15516
  
  This should fix errors from gcc 4.6 and higher when compiling llvm-cov
  and/or other llvm tools.
  
  Reported by:  bdrewery

Modified:
  head/contrib/libc++/include/__config

Modified: head/contrib/libc++/include/__config
==
--- head/contrib/libc++/include/__configSun Mar 27 20:02:21 2016
(r297321)
+++ head/contrib/libc++/include/__configSun Mar 27 21:20:43 2016
(r297322)
@@ -364,14 +364,8 @@ typedef __char32_t char32_t;
 #endif
 #endif
 
-#if (__has_feature(cxx_noexcept))
-#  define _NOEXCEPT noexcept
-#  define _NOEXCEPT_(x) noexcept(x)
-#  define _NOEXCEPT_OR_FALSE(x) noexcept(x)
-#else
-#  define _NOEXCEPT throw()
-#  define _NOEXCEPT_(x)
-#  define _NOEXCEPT_OR_FALSE(x) false
+#if !(__has_feature(cxx_noexcept))
+#define _LIBCPP_HAS_NO_NOEXCEPT
 #endif
 
 #if __has_feature(underlying_type)
@@ -439,10 +433,6 @@ namespace std {
 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
 #endif
 
-#define _NOEXCEPT throw()
-#define _NOEXCEPT_(x)
-#define _NOEXCEPT_OR_FALSE(x) false
-
 #ifndef __GXX_EXPERIMENTAL_CXX0X__
 
 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
@@ -456,6 +446,7 @@ namespace std {
 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
 #define _LIBCPP_HAS_NO_STRONG_ENUMS
+#define _LIBCPP_HAS_NO_NOEXCEPT
 
 #else  // __GXX_EXPERIMENTAL_CXX0X__
 
@@ -479,6 +470,7 @@ namespace std {
 #endif  // _GNUC_VER < 404
 
 #if _GNUC_VER < 406
+#define _LIBCPP_HAS_NO_NOEXCEPT
 #define _LIBCPP_HAS_NO_NULLPTR
 #endif
 
@@ -513,15 +505,14 @@ using namespace _LIBCPP_NAMESPACE __attr
 #define _LIBCPP_HAS_NO_UNICODE_CHARS
 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#define _LIBCPP_HAS_NO_NOEXCEPT
 #define __alignof__ __alignof
 #define _LIBCPP_NORETURN __declspec(noreturn)
 #define _LIBCPP_UNUSED
 #define _ALIGNAS(x) __declspec(align(x))
 #define _LIBCPP_HAS_NO_VARIADICS
 
-#define _NOEXCEPT throw ()
-#define _NOEXCEPT_(x)
-#define _NOEXCEPT_OR_FALSE(x) false
+
 
 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
 #define _LIBCPP_END_NAMESPACE_STD  }
@@ -541,14 +532,11 @@ namespace std {
 #define _LIBCPP_NORETURN __attribute__((noreturn))
 #define _LIBCPP_UNUSED
 
-#define _NOEXCEPT throw()
-#define _NOEXCEPT_(x)
-#define _NOEXCEPT_OR_FALSE(x) false
-
 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#define _LIBCPP_HAS_NO_NOEXCEPT
 #define _LIBCPP_HAS_NO_NULLPTR
 #define _LIBCPP_HAS_NO_UNICODE_CHARS
 #define _LIBCPP_HAS_IS_BASE_OF
@@ -572,6 +560,14 @@ namespace std {
 
 #endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
 
+#ifndef _LIBCPP_HAS_NO_NOEXCEPT
+#  define _NOEXCEPT noexcept
+#  define _NOEXCEPT_(x) noexcept(x)
+#else
+#  define _NOEXCEPT throw()
+#  define _NOEXCEPT_(x)
+#endif
+
 #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
 typedef unsigned short char16_t;
 typedef unsigned int   char32_t;
___
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: r297323 - head/sys/nfs

2016-03-27 Thread Ian Lepore
Author: ian
Date: Sun Mar 27 22:21:34 2016
New Revision: 297323
URL: https://svnweb.freebsd.org/changeset/base/297323

Log:
  Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp
  server (and not when it came from a fallback method such as the ROOTDEVNAME
  option).  This makes the code in bootpc_init() choose the first interface
  that provided a rootpath name.  Previously it was choosing the first
  interface that got an IP address, which could be on a different and
  potentially unreachable subnet than the server providing the rootfs.
  
  If the rootpath name actually does come from a fallback source, then the
  code continues to use the first interface in the list that got configured.
  
  Note that this wasn't directly reported in the PR cited below, but was
  discovered while working on that PR.
  
  PR:   187094

Modified:
  head/sys/nfs/bootp_subr.c

Modified: head/sys/nfs/bootp_subr.c
==
--- head/sys/nfs/bootp_subr.c   Sun Mar 27 21:20:43 2016(r297322)
+++ head/sys/nfs/bootp_subr.c   Sun Mar 27 22:21:34 2016(r297323)
@@ -1478,6 +1478,8 @@ bootpc_decode_reply(struct nfsv3_diskles
if (p == NULL) {
p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen,
   TAG_ROOT);
+   if (p != NULL)
+   ifctx->gotrootpath = 1;
}
 #ifdef ROOTDEVNAME
if ((p == NULL || (boothowto & RB_DFLTROOT) != 0) && 
@@ -1497,7 +1499,6 @@ bootpc_decode_reply(struct nfsv3_diskles
}
printf("rootfs %s ", p);
gctx->gotrootpath = 1;
-   ifctx->gotrootpath = 1;
gctx->setrootfs = ifctx;
 
p = bootpc_tag(&gctx->tag, &ifctx->reply,
___
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: r297324 - head/sys/nfs

2016-03-27 Thread Ian Lepore
Author: ian
Date: Sun Mar 27 22:36:32 2016
New Revision: 297324
URL: https://svnweb.freebsd.org/changeset/base/297324

Log:
  Switch bootpc_adjust_interface() from returning int to void.  Its one caller
  doesn't check for errors, and all the errors that can happen result in it
  calling panic anyway, except for one that's really more of a warning (and
  is going to disappear on an upcoming commit anyway).

Modified:
  head/sys/nfs/bootp_subr.c

Modified: head/sys/nfs/bootp_subr.c
==
--- head/sys/nfs/bootp_subr.c   Sun Mar 27 22:21:34 2016(r297323)
+++ head/sys/nfs/bootp_subr.c   Sun Mar 27 22:36:32 2016(r297324)
@@ -276,7 +276,7 @@ static int  bootpc_call(struct bootpc_glo
 static voidbootpc_fakeup_interface(struct bootpc_ifcontext *ifctx,
struct thread *td);
 
-static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
+static voidbootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
struct bootpc_globalcontext *gctx, struct thread *td);
 
 static voidbootpc_decode_reply(struct nfsv3_diskless *nd,
@@ -1011,7 +1011,7 @@ bootpc_shutdown_interface(struct bootpc_
panic("%s: SIOCDIFADDR, error=%d", __func__, error);
 }
 
-static int
+static void
 bootpc_adjust_interface(struct bootpc_ifcontext *ifctx,
 struct bootpc_globalcontext *gctx, struct thread *td)
 {
@@ -1034,7 +1034,7 @@ bootpc_adjust_interface(struct bootpc_if
if (bootpc_ifctx_isresolved(ifctx) == 0) {
/* Shutdown interfaces where BOOTP failed */
bootpc_shutdown_interface(ifctx, td);
-   return (0);
+   return;
}
 
printf("Adjusted interface %s", ifctx->ireq.ifr_name);
@@ -1082,11 +1082,9 @@ bootpc_adjust_interface(struct bootpc_if
(RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB);
if (error != 0) {
printf("%s: RTM_ADD, error=%d\n", __func__, error);
-   return (error);
+   return;
}
}
-
-   return (0);
 }
 
 static int
___
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: r297325 - head/sys/nfs

2016-03-27 Thread Ian Lepore
Author: ian
Date: Sun Mar 27 22:58:56 2016
New Revision: 297325
URL: https://svnweb.freebsd.org/changeset/base/297325

Log:
  Stop setting the default route to the IP of the interface itself when the
  bootp/dhcp server doesn't provide a router option.  Doing so prevents
  setting defaultrouter= in rc.conf (it fails because there's already
  a bogus default route installed by bootpc_init).
  
  When an admin wants to use this style of proxy arp on an interface, the
  proper mechanism is to set the "use-lease-addr-for-default-route" flag
  in the dhcp server config.  That causes the lease address to be delivered
  in the routers option, and the normal handling of the routers option will
  then install the self-ip as the default route.
  
  PR:   187094

Modified:
  head/sys/nfs/bootp_subr.c

Modified: head/sys/nfs/bootp_subr.c
==
--- head/sys/nfs/bootp_subr.c   Sun Mar 27 22:36:32 2016(r297324)
+++ head/sys/nfs/bootp_subr.c   Sun Mar 27 22:58:56 2016(r297325)
@@ -1072,7 +1072,7 @@ bootpc_adjust_interface(struct bootpc_if
 
/* Add new default route */
 
-   if (ifctx->gotgw != 0 || gctx->gotgw == 0) {
+   if (ifctx->gw.sin_addr.s_addr != htonl(INADDR_ANY))
clear_sinaddr(&defdst);
clear_sinaddr(&defmask);
/* XXX MRT just table 0 */
@@ -1552,10 +1552,6 @@ bootpc_decode_reply(struct nfsv3_diskles
else
ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET);
}
-   if (ifctx->gotgw == 0) {
-   /* Use proxyarp */
-   ifctx->gw.sin_addr.s_addr = ifctx->myaddr.sin_addr.s_addr;
-   }
 }
 
 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: r297326 - head/sys/nfs

2016-03-27 Thread Ian Lepore
Author: ian
Date: Sun Mar 27 23:16:37 2016
New Revision: 297326
URL: https://svnweb.freebsd.org/changeset/base/297326

Log:
  Do not try to install a default route for each interface found, because
  only the first one will actually work and all the others just result in
  errors (which would get printed but otherwise ignored).
  
  Instead, wait until we make a choice of which interface will be used to
  mount the rootfs, and install the default route associated with it (if any).
  After doing the md_mount() call to obtain the needed info, remove the
  default route again, and transcribe the route info into the nfs_diskless
  structure.  If the system eventually chooses to mount the nfs rootfs, the
  default route will be installed again when the nfs_diskless code
  re-initializes the interface.
  
  The theory here is that since we can only have one default route, the one
  most likely to be correct for mounting the rootfs is the one that was
  delivered along with the rootpath option.

Modified:
  head/sys/nfs/bootp_subr.c

Modified: head/sys/nfs/bootp_subr.c
==
--- head/sys/nfs/bootp_subr.c   Sun Mar 27 22:58:56 2016(r297325)
+++ head/sys/nfs/bootp_subr.c   Sun Mar 27 23:16:37 2016(r297326)
@@ -1016,20 +1016,16 @@ bootpc_adjust_interface(struct bootpc_if
 struct bootpc_globalcontext *gctx, struct thread *td)
 {
int error;
-   struct sockaddr_in defdst;
-   struct sockaddr_in defmask;
struct sockaddr_in *sin;
struct ifreq *ifr;
struct in_aliasreq *ifra;
struct sockaddr_in *myaddr;
struct sockaddr_in *netmask;
-   struct sockaddr_in *gw;
 
ifr = &ifctx->ireq;
ifra = &ifctx->iareq;
myaddr = &ifctx->myaddr;
netmask = &ifctx->netmask;
-   gw = &ifctx->gw;
 
if (bootpc_ifctx_isresolved(ifctx) == 0) {
/* Shutdown interfaces where BOOTP failed */
@@ -1069,21 +1065,47 @@ bootpc_adjust_interface(struct bootpc_if
error = ifioctl(bootp_so, SIOCAIFADDR, (caddr_t)ifra, td);
if (error != 0)
panic("%s: SIOCAIFADDR, error=%d", __func__, error);
+}
+
+static void
+bootpc_add_default_route(struct bootpc_ifcontext *ifctx)
+{
+   int error;
+   struct sockaddr_in defdst;
+   struct sockaddr_in defmask;
 
-   /* Add new default route */
+   if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY))
+   return;
 
-   if (ifctx->gw.sin_addr.s_addr != htonl(INADDR_ANY))
-   clear_sinaddr(&defdst);
-   clear_sinaddr(&defmask);
-   /* XXX MRT just table 0 */
-   error = rtrequest_fib(RTM_ADD,
-   (struct sockaddr *) &defdst, (struct sockaddr *) gw,
-   (struct sockaddr *) &defmask,
-   (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB);
-   if (error != 0) {
-   printf("%s: RTM_ADD, error=%d\n", __func__, error);
-   return;
-   }
+   clear_sinaddr(&defdst);
+   clear_sinaddr(&defmask);
+
+   error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&defdst,
+   (struct sockaddr *) &ifctx->gw, (struct sockaddr *)&defmask,
+   (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB);
+   if (error != 0) {
+   printf("%s: RTM_ADD, error=%d\n", __func__, error);
+   }
+}
+
+static void
+bootpc_remove_default_route(struct bootpc_ifcontext *ifctx)
+{
+   int error;
+   struct sockaddr_in defdst;
+   struct sockaddr_in defmask;
+
+   if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY))
+   return;
+
+   clear_sinaddr(&defdst);
+   clear_sinaddr(&defmask);
+
+   error = rtrequest_fib(RTM_DELETE, (struct sockaddr *)&defdst,
+   (struct sockaddr *) &ifctx->gw, (struct sockaddr *)&defmask,
+   (RTF_UP | RTF_GATEWAY | RTF_STATIC), NULL, RT_DEFAULT_FIB);
+   if (error != 0) {
+   printf("%s: RTM_DELETE, error=%d\n", __func__, error);
}
 }
 
@@ -1743,9 +1765,11 @@ retry:
 
kern_setenv("boot.netif.name", ifctx->ifp->if_xname);
 
+   bootpc_add_default_route(ifctx);
error = md_mount(&nd->root_saddr, nd->root_hostnam,
 nd->root_fh, &nd->root_fhsize,
 &nd->root_args, td);
+   bootpc_remove_default_route(ifctx);
if (error != 0) {
if (gctx->any_root_overrides == 0)
panic("nfs_boot: mount root, error=%d", error);
@@ -1763,6 +1787,7 @@ retry:
ifctx->myaddr.sin_addr.s_addr |
~ ifctx->netmask.sin_addr.s_addr;
bcopy(&ifctx->netmask, &nd->myif.ifra_mask, sizeof(ifctx->netmask));
+   bcopy(&ifctx->gw, &nd->mygateway, sizeof(ifctx->gw));
 
 out:
while((ifctx = 

svn commit: r297328 - head/sys/dev/extres/clk

2016-03-27 Thread Alexander Kabaev
Author: kan
Date: Sun Mar 27 23:19:20 2016
New Revision: 297328
URL: https://svnweb.freebsd.org/changeset/base/297328

Log:
  Do nothing if requested clk frequency is already correct.
  
  Reviewed by: mmel

Modified:
  head/sys/dev/extres/clk/clk.c

Modified: head/sys/dev/extres/clk/clk.c
==
--- head/sys/dev/extres/clk/clk.c   Sun Mar 27 23:19:14 2016
(r297327)
+++ head/sys/dev/extres/clk/clk.c   Sun Mar 27 23:19:20 2016
(r297328)
@@ -818,6 +818,10 @@ clknode_set_freq(struct clknode *clknode
/* We have exclusive topology lock, node lock is not needed. */
CLK_TOPO_XASSERT();
 
+   /* Check for no change */
+   if (clknode->freq == freq)
+   return (0);
+
parent_freq = 0;
 
/*
___
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: r297329 - head/sys/dev/mmc

2016-03-27 Thread Alexander Kabaev
Author: kan
Date: Sun Mar 27 23:19:21 2016
New Revision: 297329
URL: https://svnweb.freebsd.org/changeset/base/297329

Log:
  Use correct response bits for MMC_RSP_R4-R7 types

Modified:
  head/sys/dev/mmc/mmcreg.h

Modified: head/sys/dev/mmc/mmcreg.h
==
--- head/sys/dev/mmc/mmcreg.h   Sun Mar 27 23:19:20 2016(r297328)
+++ head/sys/dev/mmc/mmcreg.h   Sun Mar 27 23:19:21 2016(r297329)
@@ -85,8 +85,11 @@ struct mmc_command {
 #defineMMC_RSP_R1B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE 
| MMC_RSP_BUSY)
 #defineMMC_RSP_R2  (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC)
 #defineMMC_RSP_R3  (MMC_RSP_PRESENT)
-#defineMMC_RSP_R6  (MMC_RSP_PRESENT | MMC_RSP_CRC)
-#defineMMC_RSP_R7  (MMC_RSP_PRESENT | MMC_RSP_CRC)
+#defineMMC_RSP_R4  (MMC_RSP_PRESENT)
+#defineMMC_RSP_R5  (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE)
+#defineMMC_RSP_R5B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE 
| MMC_RSP_BUSY)
+#defineMMC_RSP_R6  (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE)
+#defineMMC_RSP_R7  (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE)
 #defineMMC_RSP(x)  ((x) & MMC_RSP_MASK)
uint32_tretries;
uint32_terror;
___
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: r297327 - head/libexec/dma

2016-03-27 Thread Alexander Kabaev
Author: kan
Date: Sun Mar 27 23:19:14 2016
New Revision: 297327
URL: https://svnweb.freebsd.org/changeset/base/297327

Log:
  Do not override top level CFLAGS in libexec/dma

Modified:
  head/libexec/dma/Makefile.inc

Modified: head/libexec/dma/Makefile.inc
==
--- head/libexec/dma/Makefile.inc   Sun Mar 27 23:16:37 2016
(r297326)
+++ head/libexec/dma/Makefile.inc   Sun Mar 27 23:19:14 2016
(r297327)
@@ -4,7 +4,7 @@
 DMA_SOURCES=   ${.CURDIR}/../../../contrib/dma
 .PATH: ${DMA_SOURCES}
 
-CFLAGS=-I${DMA_SOURCES} \
+CFLAGS+= -I${DMA_SOURCES} \
-DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME \
-DCONF_PATH='"/etc/dma"' \
-DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.10"' \
___
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: r297330 - head/usr.sbin/pw

2016-03-27 Thread Warren Block
Author: wblock (doc committer)
Date: Mon Mar 28 02:05:35 2016
New Revision: 297330
URL: https://svnweb.freebsd.org/changeset/base/297330

Log:
  Adjust misleading wording of the -G option and simplify a few
  surrounding sentences.  From a discussion on -ports.
  
  Reviewed by:  David Wolfskill 

Modified:
  head/usr.sbin/pw/pw.8

Modified: head/usr.sbin/pw/pw.8
==
--- head/usr.sbin/pw/pw.8   Sun Mar 27 23:19:21 2016(r297329)
+++ head/usr.sbin/pw/pw.8   Mon Mar 28 02:05:35 2016(r297330)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 14, 2015
+.Dd March 27, 2016
 .Dt PW 8
 .Os
 .Sh NAME
@@ -420,18 +420,16 @@ Set the account's primary group to the g
 .Ar group
 may be defined by either its name or group number.
 .It Fl G Ar grouplist
-Set additional group memberships for an account.
+Set secondary group memberships for an account.
 .Ar grouplist
-is a comma, space or tab-separated list of group names or group numbers.
-The user's name is added to the group lists in
-.Pa /etc/group ,
-and
-removed from any groups not specified in
-.Ar grouplist .
-Note: a user should not be added to their primary group with
+is a comma, space, or tab-separated list of group names or group numbers.
+The user is added to the groups specified in
+.Ar grouplist ,
+and removed from all groups not specified.
+The current login session is not affected by group membership changes,
+which only take effect when the user reconnects.
+Note: do not add a user to their primary group with
 .Ar grouplist .
-Also, group membership changes do not take effect for current user login
-sessions, requiring the user to reconnect to be affected by the changes.
 .It Fl L Ar class
 This option sets the login class for the user being created.
 See
___
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: r297331 - head/sbin/devd

2016-03-27 Thread Warner Losh
Author: imp
Date: Mon Mar 28 04:22:22 2016
New Revision: 297331
URL: https://svnweb.freebsd.org/changeset/base/297331

Log:
  Sometimes, it's useful to export the entire line to an external
  program without listening to the devd socket for all events. Define
  two new pseudo variables $*, the entire event from devctl and $_,
  the entire event without the type character, since it might be easier
  to use in some circumstances.

Modified:
  head/sbin/devd/devd.cc
  head/sbin/devd/devd.conf.5

Modified: head/sbin/devd/devd.cc
==
--- head/sbin/devd/devd.cc  Mon Mar 28 02:05:35 2016(r297330)
+++ head/sbin/devd/devd.cc  Mon Mar 28 04:22:22 2016(r297331)
@@ -648,8 +648,8 @@ config::expand_one(const char *&src, str
return;
}
 
-   // $[^A-Za-z] -> $\1
-   if (!isalpha(*src)) {
+   // $[^-A-Za-z_*] -> $\1
+   if (!isalpha(*src) && *src != '_' && *src != '-' && *src != '*') {
dst += '$';
dst += *src++;
return;
@@ -793,10 +793,15 @@ process_event(char *buffer)
devdlog(LOG_INFO, "Processing event '%s'\n", buffer);
type = *buffer++;
cfg.push_var_table();
+   // $* is the entire line
+   cfg.set_variable("*", buffer - 1);
+   // $_ is the entire line without the initial character
+   cfg.set_variable("_", buffer - 1);
// No match doesn't have a device, and the format is a little
// different, so handle it separately.
switch (type) {
case notify:
+   //! (k=v)*
sp = cfg.set_vars(sp);
break;
case nomatch:

Modified: head/sbin/devd/devd.conf.5
==
--- head/sbin/devd/devd.conf.5  Mon Mar 28 02:05:35 2016(r297330)
+++ head/sbin/devd/devd.conf.5  Mon Mar 28 04:22:22 2016(r297331)
@@ -41,7 +41,7 @@
 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 .\" SOFTWARE.
 .\"
-.Dd July 11, 2015
+.Dd March 28, 2016
 .Dt DEVD.CONF 5
 .Os
 .Sh NAME
@@ -234,10 +234,17 @@ A partial list of variables and their po
 with the
 .Ic match
 statement.
+The variables are published by the bus based on characteristics of the device
+that generated the event (for device events).
+Variables for other classes of events are dependent on those events.
 .Pp
 .Bl -tag -width ".Li manufacturer" -compact
 .It Ic Variable
 .Ic Description
+.It Li *
+The entire message from the current event
+.It Li _
+The entire message from the current event, after the initial type character
 .It Li bus
 Device name of parent bus.
 .It Li cdev
___
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"