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

2017-03-10 Thread Jeremie Le Hen
Author: jlh
Date: Fri Mar 10 09:58:10 2017
New Revision: 314995
URL: https://svnweb.freebsd.org/changeset/base/314995

Log:
  Add a very natural, binary version of the ASCII table.
  
  Reviewed by:  bcr, eadler
  Obtained from:
https://garbagecollected.org/2017/01/31/four-column-ascii/
  MFC after:1 day
  Differential Revision:https://reviews.freebsd.org/D9902

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

Modified: head/share/man/man7/ascii.7
==
--- head/share/man/man7/ascii.7 Fri Mar 10 06:25:54 2017(r314994)
+++ head/share/man/man7/ascii.7 Fri Mar 10 09:58:10 2017(r314995)
@@ -28,12 +28,12 @@
 .\"@(#)ascii.7 8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2016
+.Dd March 10, 2017
 .Dt ASCII 7
 .Os
 .Sh NAME
 .Nm ascii
-.Nd octal, hexadecimal and decimal
+.Nd octal, hexadecimal, decimal and binary
 .Tn ASCII
 character sets
 .Sh DESCRIPTION
@@ -102,6 +102,46 @@ set:
 112  p   113  q   114  r   115  s   116  t   117  u   118  v   119  w
 120  x   121  y   122  z   123  {   124  |   125  }   126  ~   127 DEL
 .Ed
+.Pp
+The
+.Nm binary
+set:
+.Bd -literal -offset left
+ 00 01 10 11
+
+NUL SP  @  ` 0
+SOH  !  A  a 1
+STX  "  B  b 00010
+ETX  #  C  c 00011
+EOT  $  D  d 00100
+ENQ  %  E  e 00101
+ACK  &  F  f 00110
+BEL  '  G  g 00111
+ BS  (  H  h 01000
+ HT  )  I  i 01001
+ LF  *  J  j 01010
+ VT  +  K  k 01011
+ FF  ,  L  l 01100
+ CR  -  M  m 01101
+ SO  .  N  n 01110
+ SI  /  O  o 0
+DLE  0  P  p 1
+DC1  1  Q  q 10001
+DC2  2  R  r 10010
+DC3  3  S  s 10011
+DC4  4  T  t 10100
+NAK  5  U  u 10101
+SYN  6  V  v 10110
+ETB  7  W  w 10111
+CAN  8  X  x 11000
+ EM  9  Y  y 11001
+SUB  :  Z  z 11010
+ESC  ;  [  { 11011
+ FS  <  \  | 11100
+ GS  =  ]  } 11101
+ RS  >  ^  - 0
+ US  ?  _DEL 1
+.Ed
 .Sh FILES
 .Bl -tag -width /usr/share/misc/ascii -compact
 .It Pa /usr/share/misc/ascii
___
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: r314996 - head/sys/kern

2017-03-10 Thread Mahdi Mokhtari
Author: mmokhi (ports committer)
Date: Fri Mar 10 10:09:44 2017
New Revision: 314996
URL: https://svnweb.freebsd.org/changeset/base/314996

Log:
  Fix NULL pointer dereference and panic with shm file pread/pwrite.
  
  PR:   217429
  Reported by:  Tim Newsham 
  Reviewed by:  kib
  Approved by:  dchagin
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9844

Modified:
  head/sys/kern/sys_generic.c

Modified: head/sys/kern/sys_generic.c
==
--- head/sys/kern/sys_generic.c Fri Mar 10 09:58:10 2017(r314995)
+++ head/sys/kern/sys_generic.c Fri Mar 10 10:09:44 2017(r314996)
@@ -334,7 +334,8 @@ kern_preadv(td, fd, auio, offset)
return (error);
if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE))
error = ESPIPE;
-   else if (offset < 0 && fp->f_vnode->v_type != VCHR)
+   else if (offset < 0 &&
+   (fp->f_vnode == NULL || fp->f_vnode->v_type != VCHR))
error = EINVAL;
else
error = dofileread(td, fd, fp, auio, offset, FOF_OFFSET);
@@ -548,7 +549,8 @@ kern_pwritev(td, fd, auio, offset)
return (error);
if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE))
error = ESPIPE;
-   else if (offset < 0 && fp->f_vnode->v_type != VCHR)
+   else if (offset < 0 &&
+   (fp->f_vnode == NULL || fp->f_vnode->v_type != VCHR))
error = EINVAL;
else
error = dofilewrite(td, fd, fp, auio, offset, FOF_OFFSET);
___
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: r314997 - head/sys/dev/syscons

2017-03-10 Thread Bruce Evans
Author: bde
Date: Fri Mar 10 10:25:48 2017
New Revision: 314997
URL: https://svnweb.freebsd.org/changeset/base/314997

Log:
  Fix compilation on sparc64.  The frame buffer address is in a field that
  is unavailable on sparc64 only.  This makes the new ec_putc() a non-op
  on sparc64 but still calls it.  On other non-x86 arches, it should
  compile but might not work.
  
  Reported by:  gjb

Modified:
  head/sys/dev/syscons/syscons.c

Modified: head/sys/dev/syscons/syscons.c
==
--- head/sys/dev/syscons/syscons.c  Fri Mar 10 10:09:44 2017
(r314996)
+++ head/sys/dev/syscons/syscons.c  Fri Mar 10 10:25:48 2017
(r314997)
@@ -277,7 +277,9 @@ static  u_int   ec_scroffset;
  * set (likely non-fake) graphics mode to get a null initial ec_putc().
  */
 static scr_statfake_main_console = {
+#ifndef __sparc64__
.scr.vtb_buffer = 0xb8000,
+#endif
.xsize = 80,
.ysize = 25,
 #if !defined(__amd64__) && !defined(__i386__)
@@ -290,6 +292,7 @@ static  scr_statfake_main_console = {
 static void
 ec_putc(int c)
 {
+#ifndef __sparc64__
u_short *scrptr;
u_int ind;
int attr, column, mysize, width, xsize, yborder, ysize;
@@ -321,6 +324,7 @@ ec_putc(int c)
do
scrptr[ind++ % mysize] = (attr << 8) | c;
while (--width != 0);
+#endif /* !__sparc64__ */
 }
 
 #undef main_console
___
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: r314998 - head/sys/dev/mpt

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 10:35:52 2017
New Revision: 314998
URL: https://svnweb.freebsd.org/changeset/base/314998

Log:
  Fix FC target mode in mpt(4), broken in multiple ways.
  
   - Not set BufferLength caused receive of empty ATIOs.
   - CDB length guessing was broken at least for RC16.
   - mpt_req_untimeout() was called with wrong req parameter.
   - Sense data reporting was broken in several ways.
  
  With this change my LSI7204EP-LC can pass at least basic tests as target.
  The code is still far from perfect, but finally I found second hw/driver
  after isp(4) that really can work in CAM target mode.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/mpt/mpt.h
  head/sys/dev/mpt/mpt_cam.c

Modified: head/sys/dev/mpt/mpt.h
==
--- head/sys/dev/mpt/mpt.h  Fri Mar 10 10:25:48 2017(r314997)
+++ head/sys/dev/mpt/mpt.h  Fri Mar 10 10:35:52 2017(r314998)
@@ -949,24 +949,6 @@ void mpt_prtc(struct mpt_softc *, const 
__printflike(2, 3);
 
 / Target Mode Related ***/
-static __inline int mpt_cdblen(uint8_t, int);
-static __inline int
-mpt_cdblen(uint8_t cdb0, int maxlen)
-{
-   int group = cdb0 >> 5;
-   switch (group) {
-   case 0:
-   return (6);
-   case 1:
-   return (10);
-   case 4:
-   case 5:
-   return (12);
-   default:
-   return (16);
-   }
-}
-
 #ifdef INVARIANTS
 static __inline request_t * mpt_tag_2_req(struct mpt_softc *, uint32_t);
 static __inline request_t *

Modified: head/sys/dev/mpt/mpt_cam.c
==
--- head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 10:25:48 2017(r314997)
+++ head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 10:35:52 2017(r314998)
@@ -145,7 +145,7 @@ static void mpt_target_start_io(struct m
 static cam_status mpt_abort_target_ccb(struct mpt_softc *, union ccb *);
 static int mpt_abort_target_cmd(struct mpt_softc *, request_t *);
 static void mpt_scsi_tgt_status(struct mpt_softc *, union ccb *, request_t *,
-uint8_t, uint8_t const *);
+uint8_t, uint8_t const *, u_int);
 static void
 mpt_scsi_tgt_tsk_mgmt(struct mpt_softc *, request_t *, mpt_task_mgmt_t,
 tgt_resource_t *, int);
@@ -4168,6 +4168,7 @@ mpt_post_target_command(struct mpt_softc
fc = req->req_vbuf;
fc->BufferCount = 1;
fc->Function = MPI_FUNCTION_TARGET_CMD_BUFFER_POST;
+   fc->BufferLength = MIN(MPT_REQUEST_AREA - MPT_RQSL(mpt), UINT8_MAX);
fc->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id);
 
cb = &fc->Buffer[0];
@@ -4458,8 +4459,6 @@ mpt_target_start_io(struct mpt_softc *mp
ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
}
} else {
-   uint8_t *sp = NULL, sense[MPT_SENSE_SIZE];
-
/*
 * XXX: I don't know why this seems to happen, but
 * XXX: completing the CCB seems to make things happy.
@@ -4476,12 +4475,10 @@ mpt_target_start_io(struct mpt_softc *mp
xpt_done(ccb);
return;
}
-   if (ccb->ccb_h.flags & CAM_SEND_SENSE) {
-   sp = sense;
-   memcpy(sp, &csio->sense_data,
-  min(csio->sense_len, MPT_SENSE_SIZE));
-   }
-   mpt_scsi_tgt_status(mpt, ccb, cmd_req, csio->scsi_status, sp);
+   mpt_scsi_tgt_status(mpt, ccb, cmd_req, csio->scsi_status,
+   (void *)&csio->sense_data,
+   (ccb->ccb_h.flags & CAM_SEND_SENSE) ?
+csio->sense_len : 0);
}
 }
 
@@ -4503,7 +4500,7 @@ mpt_scsi_tgt_local(struct mpt_softc *mpt
tgt = MPT_TGT_STATE(mpt, cmd_req);
if (length == 0 || tgt->resid == 0) {
tgt->resid = 0;
-   mpt_scsi_tgt_status(mpt, NULL, cmd_req, 0, NULL);
+   mpt_scsi_tgt_status(mpt, NULL, cmd_req, 0, NULL, 0);
return;
}
 
@@ -4656,7 +4653,7 @@ mpt_abort_target_cmd(struct mpt_softc *m
 
 static void
 mpt_scsi_tgt_status(struct mpt_softc *mpt, union ccb *ccb, request_t *cmd_req,
-uint8_t status, uint8_t const *sense_data)
+uint8_t status, uint8_t const *sense_data, u_int sense_len)
 {
uint8_t *cmd_vbuf;
mpt_tgt_state_t *tgt;
@@ -4730,37 +4727,22 @@ mpt_scsi_tgt_status(struct mpt_softc *mp
 */
memset(rsp, 0, sizeof (MPI_TARGET_FCP_RSP_BUFFER));
 
-   rsp[2] = status;
+   rsp[2] = htobe32(status);
+#defineMIN_FCP_RESPONSE_SIZE   24
+#ifndefWE_TRUST_AUTO_GOOD_STATUS
+   resplen = MIN_FCP_RESPONSE_SIZE;
+#endif
if (tgt->resid) {
-   rsp[2] |= 0x800;/*  NEED MNEMONIC */
+   

svn commit: r315000 - head/sys/dev/syscons

2017-03-10 Thread Bruce Evans
Author: bde
Date: Fri Mar 10 11:44:09 2017
New Revision: 315000
URL: https://svnweb.freebsd.org/changeset/base/315000

Log:
  Start fixing some bugs in attribute handling.
  
  This change just does cleanups missed in r56043 17 years ago.  The
  default attributes were still stored in structs for the purpose of
  changing them and passing around pointers to the defaults, but r56043
  added another layer that made the defaults invariant and only used for
  initialization and reset.  Just use the defaults directly.  This was
  already done for the kernel defaults.  The defaults for reverse
  attributes aren't actually used, but are ignored in layers that no
  longer support them.

Modified:
  head/sys/dev/syscons/syscons.c

Modified: head/sys/dev/syscons/syscons.c
==
--- head/sys/dev/syscons/syscons.c  Fri Mar 10 10:58:31 2017
(r314999)
+++ head/sys/dev/syscons/syscons.c  Fri Mar 10 11:44:09 2017
(r315000)
@@ -91,16 +91,6 @@ __FBSDID("$FreeBSD$");
 /* NULL-safe version of "tty_opened()" */
 #definetty_opened_ns(tp)   ((tp) != NULL && tty_opened(tp))
 
-typedef struct default_attr {
-   int std_color;  /* normal hardware color */
-   int rev_color;  /* reverse hardware color */
-} default_attr;
-
-static default_attr user_default = {
-SC_NORM_ATTR,
-SC_NORM_REV_ATTR,
-};
-
 static u_char  sc_kattrtab[MAXCPU];
 
 static int sc_console_unit = -1;
@@ -3162,9 +3152,7 @@ scinit(int unit, int flags)
 
if (sc_init_emulator(scp, SC_DFLT_TERM))
sc_init_emulator(scp, "*");
-   (*scp->tsw->te_default_attr)(scp,
-user_default.std_color,
-user_default.rev_color);
+   (*scp->tsw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR);
} else {
/* assert(sc_malloc) */
sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF,
@@ -3578,8 +3566,7 @@ sc_init_emulator(scr_stat *scp, char *na
 scp->rndr = rndr;
 scp->rndr->init(scp);
 
-/* XXX */
-(*sw->te_default_attr)(scp, user_default.std_color, 
user_default.rev_color);
+(*sw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR);
 sc_clear_screen(scp);
 
 return 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"


Re: svn commit: r314989 - head/usr.bin/vmstat

2017-03-10 Thread Pedro Giffuni



On 3/10/2017 2:45 AM, Bruce Evans wrote:

On Fri, 10 Mar 2017, Marcelo Araujo wrote:


...
Log:
 Use nitems() from sys/param.h and also remove the cast.

 Reviewed by:markj
 MFC after:3 weeks.
 Differential Revision:https://reviews.freebsd.org/D9937
...
Modified: head/usr.bin/vmstat/vmstat.c
== 


--- head/usr.bin/vmstat/vmstat.cFri Mar 10 04:30:31 2017 (r314988)
+++ head/usr.bin/vmstat/vmstat.cFri Mar 10 04:49:40 2017 (r314989)
@@ -288,17 +288,13 @@ retry_nlist:
namelist[X_SUM].n_name = "_cnt";
goto retry_nlist;
}
-for (c = 0;
- c < (int)(sizeof(namelist)/sizeof(namelist[0]));
- c++)
+for (c = 0; c < nitems(namelist); c++)
if (namelist[c].n_type == 0)
bufsize += strlen(namelist[c].n_name) + 1;


This undoes fixes to compile at WARNS=2 in r87690 and now breaks at 
WARNS=3.

vmstat is still compiled at WARNS=1.

nitems suffers from the same unsigned poisoning as the sizeof() 
expression
(since it reduces to the same expression.  Casting to int in the 
expression

to fix the warning would break exotic cases.  Of course, nitems is
undocumented so no one knows when it is supposed to work).

vmstat compiles with no errors at WARNS=2.  At WARNS=3, it used to 
compile

with 9 excessive warnings (about the good style of omitting redundant
initializers).  Now it compiles with 10 excessive warnings.  1 more about
comparison between signed unsigned.  This warning is a compiler bug.  
Both

gcc-4.2.1 and clang-3.9.0 have it.  It is enabled by -W, which is put in
CFLAGS at WARNS >= 3, or by -Wsign-compare.

These compilers even complain about:

int c;

for (c = 0; c < 1U; c++)
foo();

where it is extremely clear that c never gets converted to a wrong value
when it is promoted to unsigned for the comparison.  Compilers should
only warn about sign mismatches if they can't figure out the ranges or
if they can figure out the ranges but dangerous promotiions occur.
Compilers do excessive unrolling and other optimizations of loops like
the above, and they must figure out the ranges for this.



I haven't looked at the code but it would seem like you can unsign c and 
avoid the cast.


Pedro.


___
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: r315001 - head/sys/dev/mpt

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 13:14:06 2017
New Revision: 315001
URL: https://svnweb.freebsd.org/changeset/base/315001

Log:
  Fix panic on wildcard target LUN disable.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/mpt/mpt_cam.c

Modified: head/sys/dev/mpt/mpt_cam.c
==
--- head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 11:44:09 2017(r315000)
+++ head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 13:14:06 2017(r315001)
@@ -4319,7 +4319,7 @@ mpt_disable_lun(struct mpt_softc *mpt, t
mpt->trt[lun].enabled = 0;
}
for (i = 0; i < MPT_MAX_LUNS; i++) {
-   if (mpt->trt[lun].enabled) {
+   if (mpt->trt[i].enabled) {
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"


svn commit: r315002 - head/sys/dev/mpt

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 13:39:16 2017
New Revision: 315002
URL: https://svnweb.freebsd.org/changeset/base/315002

Log:
  Improve residuals reporting in target mode.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/mpt/mpt.h
  head/sys/dev/mpt/mpt_cam.c

Modified: head/sys/dev/mpt/mpt.h
==
--- head/sys/dev/mpt/mpt.h  Fri Mar 10 13:14:06 2017(r315001)
+++ head/sys/dev/mpt/mpt.h  Fri Mar 10 13:39:16 2017(r315002)
@@ -331,8 +331,8 @@ typedef struct mpt_config_params {
 / MPI Target State Info 
***/
 typedef struct {
uint32_t reply_desc;/* current reply descriptor */
-   uint32_t resid; /* current data residual */
uint32_t bytes_xfered;  /* current relative offset */
+   int resid;  /* current data residual */
union ccb *ccb; /* pointer to currently active ccb */
request_t *req; /* pointer to currently active assist request */
uint32_t

Modified: head/sys/dev/mpt/mpt_cam.c
==
--- head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 13:14:06 2017(r315001)
+++ head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 13:39:16 2017(r315002)
@@ -4430,6 +4430,7 @@ mpt_target_start_io(struct mpt_softc *mp
/*
 * XXX Should be done after data transfer completes?
 */
+   csio->resid = csio->dxfer_len - ta->DataLength;
tgt->resid -= csio->dxfer_len;
tgt->bytes_xfered += csio->dxfer_len;
 
@@ -4732,7 +4733,11 @@ mpt_scsi_tgt_status(struct mpt_softc *mp
 #ifndefWE_TRUST_AUTO_GOOD_STATUS
resplen = MIN_FCP_RESPONSE_SIZE;
 #endif
-   if (tgt->resid) {
+   if (tgt->resid < 0) {
+   rsp[2] |= htobe32(0x400); /*  NEED MNEMONIC */
+   rsp[3] = htobe32(-tgt->resid);
+   resplen = MIN_FCP_RESPONSE_SIZE;
+   } else if (tgt->resid > 0) {
rsp[2] |= htobe32(0x800); /*  NEED MNEMONIC */
rsp[3] = htobe32(tgt->resid);
resplen = MIN_FCP_RESPONSE_SIZE;
___
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: r315003 - head/sys/dev/syscons

2017-03-10 Thread Bruce Evans
Author: bde
Date: Fri Mar 10 14:25:38 2017
New Revision: 315003
URL: https://svnweb.freebsd.org/changeset/base/315003

Log:
  Rename scteken_revattr() to scteken_sc_to_te_attr().  scteken_revattr()
  looked like it might handle reverse attributes, but it actually handles
  conversion of attributes in the direction indicated by the new name.
  Reverse attributes are just broken.
  
  Rename scteken_attr() to scteken_te_to_sc_attr().  scteken_attr() looked
  like it might give teken attributes, but it actually gives sc attributes.
  
  Change scteken_te_to_sc_attr() to return int instead of unsigned int.
  u_char would be enough, and it promotes to int, and syscons uses int
  or u_short for its attributes everywhere else (u_short holds a shifted
  form and it promotes to int too).

Modified:
  head/sys/dev/syscons/scterm-teken.c

Modified: head/sys/dev/syscons/scterm-teken.c
==
--- head/sys/dev/syscons/scterm-teken.c Fri Mar 10 13:39:16 2017
(r315002)
+++ head/sys/dev/syscons/scterm-teken.c Fri Mar 10 14:25:38 2017
(r315003)
@@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-static void scteken_revattr(unsigned char, teken_attr_t *);
-static unsigned int scteken_attr(const teken_attr_t *);
+static void scteken_sc_to_te_attr(unsigned char, teken_attr_t *);
+static int scteken_te_to_sc_attr(const teken_attr_t *);
 
 static sc_term_init_t  scteken_init;
 static sc_term_term_t  scteken_term;
@@ -176,7 +176,7 @@ scteken_puts(scr_stat *scp, u_char *buf,
if (kernel) {
/* Use special colors for kernel messages. */
backup = *teken_get_curattr(&ts->ts_teken);
-   scteken_revattr(sc_kattr(), &kattr);
+   scteken_sc_to_te_attr(sc_kattr(), &kattr);
teken_set_curattr(&ts->ts_teken, &kattr);
teken_input(&ts->ts_teken, buf, len);
teken_set_curattr(&ts->ts_teken, &backup);
@@ -193,19 +193,19 @@ scteken_ioctl(scr_stat *scp, struct tty 
 {
teken_stat *ts = scp->ts;
vid_info_t *vi;
-   unsigned int attr;
+   int attr;
 
switch (cmd) {
case GIO_ATTR:  /* get current attributes */
*(int*)data =
-   scteken_attr(teken_get_curattr(&ts->ts_teken));
+   scteken_te_to_sc_attr(teken_get_curattr(&ts->ts_teken));
return (0);
case CONS_GETINFO:  /* get current (virtual) console info */
vi = (vid_info_t *)data;
if (vi->size != sizeof(struct vid_info))
return EINVAL;
 
-   attr = scteken_attr(teken_get_defattr(&ts->ts_teken));
+   attr = scteken_te_to_sc_attr(teken_get_defattr(&ts->ts_teken));
vi->mv_norm.fore = attr & 0x0f;
vi->mv_norm.back = (attr >> 4) & 0x0f;
vi->mv_rev.fore = vi->mv_norm.back;
@@ -225,7 +225,7 @@ scteken_default_attr(scr_stat *scp, int 
teken_stat *ts = scp->ts;
teken_attr_t ta;
 
-   scteken_revattr(color, &ta);
+   scteken_sc_to_te_attr(color, &ta);
teken_set_defattr(&ts->ts_teken, &ta);
 }
 
@@ -321,7 +321,7 @@ static const unsigned char bgcolors[TC_N
 };
 
 static void
-scteken_revattr(unsigned char color, teken_attr_t *a)
+scteken_sc_to_te_attr(unsigned char color, teken_attr_t *a)
 {
teken_color_t fg, bg;
 
@@ -360,10 +360,10 @@ scteken_revattr(unsigned char color, tek
}
 }
 
-static unsigned int
-scteken_attr(const teken_attr_t *a)
+static int
+scteken_te_to_sc_attr(const teken_attr_t *a)
 {
-   unsigned int attr = 0;
+   int attr = 0;
teken_color_t fg, bg;
 
if (a->ta_format & TF_REVERSE) {
@@ -558,7 +558,7 @@ scteken_putchar(void *arg, const teken_p
 * characters. Simply print a space and assume that the left
 * hand side describes the entire character.
 */
-   attr = scteken_attr(a) << 8;
+   attr = scteken_te_to_sc_attr(a) << 8;
if (a->ta_format & TF_CJK_RIGHT)
c = ' ';
 #ifdef TEKEN_UTF8
@@ -590,7 +590,7 @@ scteken_fill(void *arg, const teken_rect
unsigned int width;
int attr, row;
 
-   attr = scteken_attr(a) << 8;
+   attr = scteken_te_to_sc_attr(a) << 8;
 #ifdef TEKEN_UTF8
scteken_get_cp437(&c, &attr);
 #endif /* TEKEN_UTF8 */
___
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: r315004 - head/sys/dev/mpt

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 14:44:59 2017
New Revision: 315004
URL: https://svnweb.freebsd.org/changeset/base/315004

Log:
  Add PIM_EXTLUNS support to mpt(4).
  
  Target mode is still limited to 256 LUNs due to the way driver is written,
  but initiator can now use full 8 byte LUN space.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/mpt/mpt_cam.c
  head/sys/dev/mpt/mpt_debug.c

Modified: head/sys/dev/mpt/mpt_cam.c
==
--- head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 14:25:38 2017(r315003)
+++ head/sys/dev/mpt/mpt_cam.c  Fri Mar 10 14:44:59 2017(r315004)
@@ -133,7 +133,7 @@ static void mpt_recovery_thread(void *ar
 static void mpt_recover_commands(struct mpt_softc *mpt);
 
 static int mpt_scsi_send_tmf(struct mpt_softc *, u_int, u_int, u_int,
-u_int, u_int, u_int, int);
+target_id_t, lun_id_t, u_int, int);
 
 static void mpt_fc_post_els(struct mpt_softc *mpt, request_t *, int);
 static void mpt_post_target_command(struct mpt_softc *, request_t *, int);
@@ -2133,13 +2133,7 @@ mpt_start(struct cam_sim *sim, union ccb
/* Which physical device to do the I/O on */
mpt_req->TargetID = tgt;
 
-   /* We assume a single level LUN type */
-   if (ccb->ccb_h.target_lun >= MPT_MAX_LUNS) {
-   mpt_req->LUN[0] = 0x40 | ((ccb->ccb_h.target_lun >> 8) & 0x3f);
-   mpt_req->LUN[1] = ccb->ccb_h.target_lun & 0xff;
-   } else {
-   mpt_req->LUN[1] = ccb->ccb_h.target_lun;
-   }
+   be64enc(mpt_req->LUN, CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun));
 
/* Set the direction of the transfer */
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
@@ -3585,7 +3579,8 @@ mpt_action(struct cam_sim *sim, union cc
 */
cpi->protocol = PROTO_SCSI;
if (mpt->is_fc) {
-   cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
+   cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED |
+   PIM_EXTLUNS;
cpi->base_transfer_speed = 10;
cpi->hba_inquiry = PI_TAG_ABLE;
cpi->transport = XPORT_FC;
@@ -3597,14 +3592,16 @@ mpt_action(struct cam_sim *sim, union cc
cpi->xport_specific.fc.bitrate =
10 * mpt->mpt_fcport_speed;
} else if (mpt->is_sas) {
-   cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
+   cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED |
+   PIM_EXTLUNS;
cpi->base_transfer_speed = 30;
cpi->hba_inquiry = PI_TAG_ABLE;
cpi->transport = XPORT_SAS;
cpi->transport_version = 0;
cpi->protocol_version = SCSI_REV_SPC2;
} else {
-   cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED;
+   cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED |
+   PIM_EXTLUNS;
cpi->base_transfer_speed = 3300;
cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16;
cpi->transport = XPORT_SPI;
@@ -3913,7 +3910,8 @@ mpt_recovery_thread(void *arg)
 
 static int
 mpt_scsi_send_tmf(struct mpt_softc *mpt, u_int type, u_int flags,
-u_int channel, u_int target, u_int lun, u_int abort_ctx, int sleep_ok)
+u_int channel, target_id_t target, lun_id_t lun, u_int abort_ctx,
+int sleep_ok)
 {
MSG_SCSI_TASK_MGMT *tmf_req;
int error;
@@ -3941,12 +3939,7 @@ mpt_scsi_send_tmf(struct mpt_softc *mpt,
tmf_req->MsgFlags = flags;
tmf_req->MsgContext =
htole32(mpt->tmf_req->index | scsi_tmf_handler_id);
-   if (lun > MPT_MAX_LUNS) {
-   tmf_req->LUN[0] = 0x40 | ((lun >> 8) & 0x3f);
-   tmf_req->LUN[1] = lun & 0xff;
-   } else {
-   tmf_req->LUN[1] = lun;
-   }
+   be64enc(tmf_req->LUN, CAM_EXTLUN_BYTE_SWIZZLE(lun));
tmf_req->TaskMsgContext = abort_ctx;
 
mpt_lprt(mpt, MPT_PRT_DEBUG,
@@ -4413,13 +4406,7 @@ mpt_target_start_io(struct mpt_softc *mp
ta->Function = MPI_FUNCTION_TARGET_ASSIST;
ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id);
ta->ReplyWord = htole32(tgt->reply_desc);
-   if (csio->ccb_h.target_lun > MPT_MAX_LUNS) {
-   ta->LUN[0] =
-   0x40 | ((csio->ccb_h.target_lun >> 8) & 0x3f);
-   ta->LUN[1] = csio->ccb_h.target_lun & 0xff;
-   } else {
-   ta->LUN[1] = csio->ccb_h.target_lun;
-   }
+   be64enc(ta->LUN, 
CAM_EXTLUN_BYTE_SWIZZLE(csio->ccb_h.target_lun));
 
ta->RelativeOffset = tgt->bytes_xf

svn commit: r315005 - in head/bin/sh: . tests/expansion

2017-03-10 Thread Jilles Tjoelker
Author: jilles
Date: Fri Mar 10 16:04:00 2017
New Revision: 315005
URL: https://svnweb.freebsd.org/changeset/base/315005

Log:
  sh: Fix executing wrong command with ${unsetvar#$(cmdsubst)}$(cmdsubst).
  
  The parsed internal representation of words consists of a byte string with a
  list of nodes (commands in command substitution). Each unescaped CTLBACKQ or
  CTLBACKQ | CTLQUOTE byte corresponds to an entry in the list.
  
  If param in ${param#%##%%word} is not set, the word is not expanded (in a
  deviation of POSIX shared with other ash variants and ksh93). Erroneously,
  the pointer in the list of commands (argbackq) was not advanced. This caused
  the wrong command to be executed later if the outer word contained another
  command substitution.
  
  Example:
echo "${unsetvar#$(echo a)}$(echo b)"
  wrote "a" but should write "b".
  
  MFC after:1 week

Added:
  head/bin/sh/tests/expansion/cmdsubst23.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c
  head/bin/sh/tests/expansion/Makefile

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cFri Mar 10 14:44:59 2017(r315004)
+++ head/bin/sh/expand.cFri Mar 10 16:04:00 2017(r315005)
@@ -769,8 +769,10 @@ again: /* jump here after setting a vari
case VSTRIMLEFTMAX:
case VSTRIMRIGHT:
case VSTRIMRIGHTMAX:
-   if (!set)
+   if (!set) {
+   set = 1;
break;
+   }
/*
 * Terminate the string and start recording the pattern
 * right after it

Modified: head/bin/sh/tests/expansion/Makefile
==
--- head/bin/sh/tests/expansion/MakefileFri Mar 10 14:44:59 2017
(r315004)
+++ head/bin/sh/tests/expansion/MakefileFri Mar 10 16:04:00 2017
(r315005)
@@ -44,6 +44,7 @@ ${PACKAGE}FILES+= cmdsubst19.0
 ${PACKAGE}FILES+=  cmdsubst20.0
 ${PACKAGE}FILES+=  cmdsubst21.0
 ${PACKAGE}FILES+=  cmdsubst22.0
+${PACKAGE}FILES+=  cmdsubst23.0
 ${PACKAGE}FILES+=  export1.0
 ${PACKAGE}FILES+=  export2.0
 ${PACKAGE}FILES+=  export3.0

Added: head/bin/sh/tests/expansion/cmdsubst23.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/expansion/cmdsubst23.0Fri Mar 10 16:04:00 2017
(r315005)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+unset n
+x=abcd
+[ "X${n#$(echo a)}X${x#$(echo ab)}X$(echo abc)X" = XXcdXabcX ]
___
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: r315006 - head/usr.bin/localedef

2017-03-10 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Mar 10 16:06:14 2017
New Revision: 315006
URL: https://svnweb.freebsd.org/changeset/base/315006

Log:
  localedef(1): Fix mismatch.
  
  Obtained from:illumos
  X-MFC with:   r314974

Modified:
  head/usr.bin/localedef/ctype.c

Modified: head/usr.bin/localedef/ctype.c
==
--- head/usr.bin/localedef/ctype.c  Fri Mar 10 16:04:00 2017
(r315005)
+++ head/usr.bin/localedef/ctype.c  Fri Mar 10 16:06:14 2017
(r315006)
@@ -384,7 +384,7 @@ dump_ctype(void)
conflict++;
if ((ctn->ctype & _ISSPACE) && (ctn->ctype & _ISGRAPH))
conflict++;
-   if ((ctn->ctype & _ISCNTRL) & _ISPRINT)
+   if ((ctn->ctype & _ISCNTRL) && (ctn->ctype & _ISPRINT))
conflict++;
if ((wc == ' ') && (ctn->ctype & (_ISPUNCT|_ISGRAPH)))
conflict++;
___
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: r315007 - head/usr.bin/localedef

2017-03-10 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Mar 10 16:12:16 2017
New Revision: 315007
URL: https://svnweb.freebsd.org/changeset/base/315007

Log:
  localedef(1): Add comment markings for license.

Modified:
  head/usr.bin/localedef/charmap.c
  head/usr.bin/localedef/collate.c
  head/usr.bin/localedef/ctype.c
  head/usr.bin/localedef/localedef.c
  head/usr.bin/localedef/localedef.h
  head/usr.bin/localedef/messages.c
  head/usr.bin/localedef/monetary.c
  head/usr.bin/localedef/numeric.c
  head/usr.bin/localedef/parser.y
  head/usr.bin/localedef/scanner.c
  head/usr.bin/localedef/time.c
  head/usr.bin/localedef/wide.c

Modified: head/usr.bin/localedef/charmap.c
==
--- head/usr.bin/localedef/charmap.cFri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/charmap.cFri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/collate.c
==
--- head/usr.bin/localedef/collate.cFri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/collate.cFri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/ctype.c
==
--- head/usr.bin/localedef/ctype.c  Fri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/ctype.c  Fri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2012 Garrett D'Amore   All rights reserved.
  * Copyright 2015 John Marino 

Modified: head/usr.bin/localedef/localedef.c
==
--- head/usr.bin/localedef/localedef.c  Fri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/localedef.c  Fri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/localedef.h
==
--- head/usr.bin/localedef/localedef.h  Fri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/localedef.h  Fri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/messages.c
==
--- head/usr.bin/localedef/messages.c   Fri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/messages.c   Fri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/monetary.c
==
--- head/usr.bin/localedef/monetary.c   Fri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/monetary.c   Fri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/numeric.c
==
--- head/usr.bin/localedef/numeric.cFri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/numeric.cFri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/parser.y
==
--- head/usr.bin/localedef/parser.y Fri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/parser.y Fri Mar 10 16:12:16 2017
(r315007)
@@ -1,5 +1,5 @@
 %{
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/scanner.c
==
--- head/usr.bin/localedef/scanner.cFri Mar 10 16:06:14 2017
(r315006)
+++ head/usr.bin/localedef/scanner.cFri Mar 10 16:12:16 2017
(r315007)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2015 John Marino 
  *

Modified: head/usr.bin/localedef/time.c
==
--- head/usr.bin/localedef/time.c   Fri Mar 10 16:06:14 2017
(r315006)
+++

svn commit: r315008 - head/sys/boot/i386/libi386

2017-03-10 Thread Sean Bruno
Author: sbruno
Date: Fri Mar 10 17:14:08 2017
New Revision: 315008
URL: https://svnweb.freebsd.org/changeset/base/315008

Log:
  r314948 seems to be missing a variable or two that will break
  TFTP/MFSRoot booting via PXE.  For the TFTP_LOADER case, go ahead and
  fire off the old bootp() request to ensure that whatever is missing is
  populated.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/boot/i386/libi386/pxe.c

Modified: head/sys/boot/i386/libi386/pxe.c
==
--- head/sys/boot/i386/libi386/pxe.cFri Mar 10 16:12:16 2017
(r315007)
+++ head/sys/boot/i386/libi386/pxe.cFri Mar 10 17:14:08 2017
(r315008)
@@ -301,6 +301,9 @@ pxe_open(struct open_file *f, ...)
printf("pxe_open: loaded RFC1048 data from PXE 
Cache\n");
}
 
+#ifdef LOADER_TFTP_SUPPORT
+   bootp(pxe_sock, BOOTP_PXE);
+#endif
if (rootip.s_addr == 0)
rootip.s_addr = bootplayer.sip;
if (gateip.s_addr == 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: r315009 - in head/contrib/dtc: . Documentation libfdt scripts

2017-03-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 10 17:36:05 2017
New Revision: 315009
URL: https://svnweb.freebsd.org/changeset/base/315009

Log:
  Merge from vendor branch importing dtc 1.4.3
  
  Major new feature in this import is FDT overlay support

Added:
  head/contrib/dtc/Documentation/dt-object-internal.txt
 - copied unchanged from r314985, 
vendor/dtc/dist/Documentation/dt-object-internal.txt
  head/contrib/dtc/README
 - copied unchanged from r314985, vendor/dtc/dist/README
  head/contrib/dtc/libfdt/fdt_addresses.c
 - copied unchanged from r314985, vendor/dtc/dist/libfdt/fdt_addresses.c
  head/contrib/dtc/libfdt/fdt_overlay.c
 - copied unchanged from r314985, vendor/dtc/dist/libfdt/fdt_overlay.c
  head/contrib/dtc/scripts/kup-dtc
 - copied unchanged from r314985, vendor/dtc/dist/scripts/kup-dtc
Modified:
  head/contrib/dtc/Documentation/manual.txt
  head/contrib/dtc/Makefile
  head/contrib/dtc/checks.c
  head/contrib/dtc/data.c
  head/contrib/dtc/dtc-lexer.l
  head/contrib/dtc/dtc-parser.y
  head/contrib/dtc/dtc.c
  head/contrib/dtc/dtc.h
  head/contrib/dtc/fdtdump.c
  head/contrib/dtc/fdtget.c
  head/contrib/dtc/fdtput.c
  head/contrib/dtc/flattree.c
  head/contrib/dtc/fstree.c
  head/contrib/dtc/libfdt/Makefile.libfdt
  head/contrib/dtc/libfdt/fdt.c
  head/contrib/dtc/libfdt/fdt_ro.c
  head/contrib/dtc/libfdt/fdt_rw.c
  head/contrib/dtc/libfdt/fdt_strerror.c
  head/contrib/dtc/libfdt/fdt_wip.c
  head/contrib/dtc/libfdt/libfdt.h
  head/contrib/dtc/libfdt/libfdt_env.h
  head/contrib/dtc/libfdt/libfdt_internal.h
  head/contrib/dtc/libfdt/version.lds
  head/contrib/dtc/livetree.c
  head/contrib/dtc/srcpos.c
  head/contrib/dtc/srcpos.h
  head/contrib/dtc/treesource.c
  head/contrib/dtc/util.c
  head/contrib/dtc/util.h
Directory Properties:
  head/contrib/dtc/   (props changed)

Copied: head/contrib/dtc/Documentation/dt-object-internal.txt (from r314985, 
vendor/dtc/dist/Documentation/dt-object-internal.txt)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/dtc/Documentation/dt-object-internal.txt   Fri Mar 10 
17:36:05 2017(r315009, copy of r314985, 
vendor/dtc/dist/Documentation/dt-object-internal.txt)
@@ -0,0 +1,310 @@
+Device Tree Dynamic Object format internals
+---
+
+The Device Tree for most platforms is a static representation of
+the hardware capabilities. This is insufficient for platforms
+that need to dynamically insert Device Tree fragments into the
+live tree.
+
+This document explains the the Device Tree object format and
+modifications made to the Device Tree compiler, which make it possible.
+
+1. Simplified Problem Definition
+
+
+Assume we have a platform which boots using following simplified Device Tree.
+
+ foo.dts -
+   /* FOO platform */
+   / {
+   compatible = "corp,foo";
+
+   /* shared resources */
+   res: res {
+   };
+
+   /* On chip peripherals */
+   ocp: ocp {
+   /* peripherals that are always instantiated */
+   peripheral1 { ... };
+   };
+   };
+ foo.dts -
+
+We have a number of peripherals that after probing (using some undefined 
method)
+should result in different Device Tree configuration.
+
+We cannot boot with this static tree because due to the configuration of the
+foo platform there exist multiple conficting peripherals DT fragments.
+
+So for the bar peripheral we would have this:
+
+ foo+bar.dts -
+   /* FOO platform + bar peripheral */
+   / {
+   compatible = "corp,foo";
+
+   /* shared resources */
+   res: res {
+   };
+
+   /* On chip peripherals */
+   ocp: ocp {
+   /* peripherals that are always instantiated */
+   peripheral1 { ... };
+
+   /* bar peripheral */
+   bar {
+   compatible = "corp,bar";
+   ... /* various properties and child nodes */
+   };
+   };
+   };
+ foo+bar.dts -
+
+While for the baz peripheral we would have this:
+
+ foo+baz.dts -
+   /* FOO platform + baz peripheral */
+   / {
+   compatible = "corp,foo";
+
+   /* shared resources */
+   res: res {
+   /* baz resources */
+   baz_res: res_baz { ... };
+   };
+
+   /* 

svn commit: r315010 - head/gnu/usr.bin/dtc

2017-03-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 10 17:37:55 2017
New Revision: 315010
URL: https://svnweb.freebsd.org/changeset/base/315010

Log:
  [dtc] regenerate version file if upstream Makefile has been changed
  
  Keep version file in sync by adding dependency to upstream Makefile

Modified:
  head/gnu/usr.bin/dtc/Makefile

Modified: head/gnu/usr.bin/dtc/Makefile
==
--- head/gnu/usr.bin/dtc/Makefile   Fri Mar 10 17:36:05 2017
(r315009)
+++ head/gnu/usr.bin/dtc/Makefile   Fri Mar 10 17:37:55 2017
(r315010)
@@ -34,7 +34,7 @@ OBJS+= dtc-parser.tab.o dtc-lexer.lex.o
 CLEANFILES+= dtc-parser.tab.o dtc-lexer.lex.o dtc-parser.tab.c \
dtc-parser.tab.h dtc-lexer.lex.c ${DTCVERSIONFILE}
 
-${DTCVERSIONFILE}:
+${DTCVERSIONFILE}: ${DTCDIR}/Makefile
@echo '#define DTC_VERSION "DTC ${DTCVERSION}"' > ${DTCVERSIONFILE}
 
 dtc-parser.tab.o:  dtc-parser.tab.c dtc-parser.tab.h
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Sean Bruno


On 02/15/17 03:06, Roger Pau Monné wrote:
> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
>> Author: sbruno
>> Date: Tue Jan 10 03:23:22 2017
>> New Revision: 311849
>> URL: https://svnweb.freebsd.org/changeset/base/311849
>>
>> Log:
>>   Migrate e1000 to the IFLIB framework:
>>   - em(4) igb(4) and lem(4)
>>   - deprecate the igb device from kernel configurations
>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
> 
> This linking causes mfsBSD to choke when building an image from HEAD. It tries
> to issue the following command:
> 
> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
> 
> Which fails when finding the symbol link. I can send a patch to change that to
> -Rp, which would work fine, but wouldn't it be better to either completely
> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
> 
> I'm wondering if for example anyone strips down it's /boot/kernel/ manually, 
> by
> removing unused modules, and what would happen if if_em.ko is removed but not
> if_igb.ko.
> 
> Roger.
> 
> 

Well, this was my naive attempt to make upgrades for users to be
non-eventful in the event they have "if_igb_load=YES" in their
loader.conf instead of having it built into their kernel.

If the -Rp works, I'll add that instead.

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Rodney W. Grimes
-- Start of PGP signed section.
[ Charset windows-1252 unsupported, converting... ]
> 
> 
> On 02/15/17 03:06, Roger Pau Monn? wrote:
> > On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
> >> Author: sbruno
> >> Date: Tue Jan 10 03:23:22 2017
> >> New Revision: 311849
> >> URL: https://svnweb.freebsd.org/changeset/base/311849
> >>
> >> Log:
> >>   Migrate e1000 to the IFLIB framework:
> >>   - em(4) igb(4) and lem(4)
> >>   - deprecate the igb device from kernel configurations
> >>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko

What about if you make that a hard link?
Would that fix the CP issue too?

> > 
> > This linking causes mfsBSD to choke when building an image from HEAD. It 
> > tries
> > to issue the following command:
> > 
> > ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
> > 
> > Which fails when finding the symbol link. I can send a patch to change that 
> > to
> > -Rp, which would work fine, but wouldn't it be better to either completely
> > remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
> > 
> > I'm wondering if for example anyone strips down it's /boot/kernel/ 
> > manually, by
> > removing unused modules, and what would happen if if_em.ko is removed but 
> > not
> > if_igb.ko.
> > 
> > Roger.
> > 
> > 
> 
> Well, this was my naive attempt to make upgrades for users to be
> non-eventful in the event they have "if_igb_load=YES" in their
> loader.conf instead of having it built into their kernel.
> 
> If the -Rp works, I'll add that instead.
> 
> sean
> 
-- End of PGP section, PGP failed!

-- 
Rod Grimes rgri...@freebsd.org
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Warner Losh
On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
>
>
> On 02/15/17 03:06, Roger Pau Monné wrote:
>> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
>>> Author: sbruno
>>> Date: Tue Jan 10 03:23:22 2017
>>> New Revision: 311849
>>> URL: https://svnweb.freebsd.org/changeset/base/311849
>>>
>>> Log:
>>>   Migrate e1000 to the IFLIB framework:
>>>   - em(4) igb(4) and lem(4)
>>>   - deprecate the igb device from kernel configurations
>>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
>>
>> This linking causes mfsBSD to choke when building an image from HEAD. It 
>> tries
>> to issue the following command:
>>
>> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
>>
>> Which fails when finding the symbol link. I can send a patch to change that 
>> to
>> -Rp, which would work fine, but wouldn't it be better to either completely
>> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
>>
>> I'm wondering if for example anyone strips down it's /boot/kernel/ manually, 
>> by
>> removing unused modules, and what would happen if if_em.ko is removed but not
>> if_igb.ko.
>>
>> Roger.
>>
>>
>
> Well, this was my naive attempt to make upgrades for users to be
> non-eventful in the event they have "if_igb_load=YES" in their
> loader.conf instead of having it built into their kernel.
>
> If the -Rp works, I'll add that instead.

The module name is encoded in the module itself. The boot loader looks
it up to see which module to load. Maybe there's a way to fix it so
both load from one file?

Warner
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Ryan Stone
There's also the issue that running "ifconfig igb0 blah" during startup
will cause if_igb to be automatically loaded by ifconfig.

I guess we could add a dummy if_igb.ko that just has a dependency on
if_em.ko

On Fri, Mar 10, 2017 at 1:13 PM, Warner Losh  wrote:

> On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
> >
> >
> > On 02/15/17 03:06, Roger Pau Monné wrote:
> >> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
> >>> Author: sbruno
> >>> Date: Tue Jan 10 03:23:22 2017
> >>> New Revision: 311849
> >>> URL: https://svnweb.freebsd.org/changeset/base/311849
> >>>
> >>> Log:
> >>>   Migrate e1000 to the IFLIB framework:
> >>>   - em(4) igb(4) and lem(4)
> >>>   - deprecate the igb device from kernel configurations
> >>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
> >>
> >> This linking causes mfsBSD to choke when building an image from HEAD.
> It tries
> >> to issue the following command:
> >>
> >> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
> >>
> >> Which fails when finding the symbol link. I can send a patch to change
> that to
> >> -Rp, which would work fine, but wouldn't it be better to either
> completely
> >> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
> >>
> >> I'm wondering if for example anyone strips down it's /boot/kernel/
> manually, by
> >> removing unused modules, and what would happen if if_em.ko is removed
> but not
> >> if_igb.ko.
> >>
> >> Roger.
> >>
> >>
> >
> > Well, this was my naive attempt to make upgrades for users to be
> > non-eventful in the event they have "if_igb_load=YES" in their
> > loader.conf instead of having it built into their kernel.
> >
> > If the -Rp works, I'll add that instead.
>
> The module name is encoded in the module itself. The boot loader looks
> it up to see which module to load. Maybe there's a way to fix it so
> both load from one file?
>
> Warner
>
>
___
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: r315016 - in head: contrib/llvm/lib/Transforms/IPO contrib/llvm/lib/Transforms/Scalar contrib/llvm/tools/clang/lib/Basic contrib/llvm/tools/clang/lib/Serialization lib/clang/include/cla...

2017-03-10 Thread Dimitry Andric
Author: dim
Date: Fri Mar 10 19:02:41 2017
New Revision: 315016
URL: https://svnweb.freebsd.org/changeset/base/315016

Log:
  Update clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 release.
  We were already very close to the last release candidate, so this is a
  pretty minor update.
  
  Relnotes: yes
  MFC after:1 month
  X-MFC-With:   r314564

Modified:
  head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
  head/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp
  head/contrib/llvm/tools/clang/lib/Basic/Version.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp
  head/lib/clang/include/clang/Basic/Version.inc
  head/lib/clang/include/lld/Config/Version.inc
Directory Properties:
  head/contrib/compiler-rt/   (props changed)
  head/contrib/libc++/   (props changed)
  head/contrib/llvm/   (props changed)
  head/contrib/llvm/tools/clang/   (props changed)
  head/contrib/llvm/tools/lld/   (props changed)
  head/contrib/llvm/tools/lldb/   (props changed)

Modified: head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
==
--- head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp Fri Mar 10 
18:56:23 2017(r315015)
+++ head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp Fri Mar 10 
19:02:41 2017(r315016)
@@ -141,8 +141,8 @@ static cl::opt PreInlineThreshold(
  "(default = 75)"));
 
 static cl::opt EnableGVNHoist(
-"enable-gvn-hoist", cl::init(true), cl::Hidden,
-cl::desc("Enable the GVN hoisting pass (default = on)"));
+"enable-gvn-hoist", cl::init(false), cl::Hidden,
+cl::desc("Enable the GVN hoisting pass"));
 
 static cl::opt
 DisableLibCallsShrinkWrap("disable-libcalls-shrinkwrap", cl::init(false),

Modified: head/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp
==
--- head/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cppFri Mar 10 
18:56:23 2017(r315015)
+++ head/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cppFri Mar 10 
19:02:41 2017(r315016)
@@ -200,13 +200,11 @@ static void combineKnownMetadata(Instruc
 class GVNHoist {
 public:
   GVNHoist(DominatorTree *DT, AliasAnalysis *AA, MemoryDependenceResults *MD,
-   MemorySSA *MSSA, bool OptForMinSize)
-  : DT(DT), AA(AA), MD(MD), MSSA(MSSA), OptForMinSize(OptForMinSize),
-HoistingGeps(OptForMinSize), HoistedCtr(0) {
-  // Hoist as far as possible when optimizing for code-size.
-  if (OptForMinSize)
-MaxNumberOfBBSInPath = -1;
-  }
+   MemorySSA *MSSA)
+  : DT(DT), AA(AA), MD(MD), MSSA(MSSA),
+HoistingGeps(false),
+HoistedCtr(0)
+  { }
 
   bool run(Function &F) {
 VN.setDomTree(DT);
@@ -251,7 +249,6 @@ private:
   AliasAnalysis *AA;
   MemoryDependenceResults *MD;
   MemorySSA *MSSA;
-  const bool OptForMinSize;
   const bool HoistingGeps;
   DenseMap DFSNumber;
   BBSideEffectsSet BBSideEffects;
@@ -505,11 +502,6 @@ private:
   bool safeToHoistScalar(const BasicBlock *HoistBB,
  SmallPtrSetImpl &WL,
  int &NBBsOnAllPaths) {
-// Enable scalar hoisting at -Oz as it is safe to hoist scalars to a place
-// where they are partially needed.
-if (OptForMinSize)
-  return true;
-
 // Check that the hoisted expression is needed on all paths.
 if (!hoistingFromAllPaths(HoistBB, WL))
   return false;
@@ -923,13 +915,8 @@ private:
 Intr->getIntrinsicID() == Intrinsic::assume)
   continue;
   }
-  if (Call->mayHaveSideEffects()) {
-if (!OptForMinSize)
-  break;
-// We may continue hoisting across calls which write to memory.
-if (Call->mayThrow())
-  break;
-  }
+  if (Call->mayHaveSideEffects())
+break;
 
   if (Call->isConvergent())
 break;
@@ -971,7 +958,7 @@ public:
 auto &MD = getAnalysis().getMemDep();
 auto &MSSA = getAnalysis().getMSSA();
 
-GVNHoist G(&DT, &AA, &MD, &MSSA, F.optForMinSize());
+GVNHoist G(&DT, &AA, &MD, &MSSA);
 return G.run(F);
   }
 
@@ -991,7 +978,7 @@ PreservedAnalyses GVNHoistPass::run(Func
   AliasAnalysis &AA = AM.getResult(F);
   MemoryDependenceResults &MD = AM.getResult(F);
   MemorySSA &MSSA = AM.getResult(F).getMSSA();
-  GVNHoist G(&DT, &AA, &MD, &MSSA, F.optForMinSize());
+  GVNHoist G(&DT, &AA, &MD, &MSSA);
   if (!G.run(F))
 return PreservedAnalyses::all();
 

Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp
==
--- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Fri Mar 10 18:56:23 
2017(r315015)
+++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Fri Mar 10 19:02:41 
2017(r315016)
@@ -36,7 +36,7 @@ std::string getCla

svn commit: r315017 - head/usr.bin/netstat

2017-03-10 Thread Gleb Smirnoff
Author: glebius
Date: Fri Mar 10 19:08:31 2017
New Revision: 315017
URL: https://svnweb.freebsd.org/changeset/base/315017

Log:
  Typo.

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

Modified: head/usr.bin/netstat/inet.c
==
--- head/usr.bin/netstat/inet.c Fri Mar 10 19:02:41 2017(r315016)
+++ head/usr.bin/netstat/inet.c Fri Mar 10 19:08:31 2017(r315017)
@@ -469,7 +469,7 @@ protopr(u_long off, const char *name, in
2 * (int)sizeof(void *),
(u_long)inp->inp_ppcb);
else
-   xo_emit("{q:adddress/%*lx} ",
+   xo_emit("{q:address/%*lx} ",
2 * (int)sizeof(void *),
(u_long)so->so_pcb);
}
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Navdeep Parhar
On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
> There's also the issue that running "ifconfig igb0 blah" during startup will
> cause if_igb to be automatically loaded by ifconfig.
>
> I guess we could add a dummy if_igb.ko that just has a dependency on
> if_em.ko

I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
added a list of ifnet names -> kld map to ifconfig instead.  It would
have been an ugly hack but much simpler.

Regards,
Navdeep

>
> On Fri, Mar 10, 2017 at 1:13 PM, Warner Losh  wrote:
>>
>> On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
>> >
>> >
>> > On 02/15/17 03:06, Roger Pau Monné wrote:
>> >> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
>> >>> Author: sbruno
>> >>> Date: Tue Jan 10 03:23:22 2017
>> >>> New Revision: 311849
>> >>> URL: https://svnweb.freebsd.org/changeset/base/311849
>> >>>
>> >>> Log:
>> >>>   Migrate e1000 to the IFLIB framework:
>> >>>   - em(4) igb(4) and lem(4)
>> >>>   - deprecate the igb device from kernel configurations
>> >>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
>> >>
>> >> This linking causes mfsBSD to choke when building an image from HEAD.
>> >> It tries
>> >> to issue the following command:
>> >>
>> >> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
>> >>
>> >> Which fails when finding the symbol link. I can send a patch to change
>> >> that to
>> >> -Rp, which would work fine, but wouldn't it be better to either
>> >> completely
>> >> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
>> >>
>> >> I'm wondering if for example anyone strips down it's /boot/kernel/
>> >> manually, by
>> >> removing unused modules, and what would happen if if_em.ko is removed
>> >> but not
>> >> if_igb.ko.
>> >>
>> >> Roger.
>> >>
>> >>
>> >
>> > Well, this was my naive attempt to make upgrades for users to be
>> > non-eventful in the event they have "if_igb_load=YES" in their
>> > loader.conf instead of having it built into their kernel.
>> >
>> > If the -Rp works, I'll add that instead.
>>
>> The module name is encoded in the module itself. The boot loader looks
>> it up to see which module to load. Maybe there's a way to fix it so
>> both load from one file?
>>
>> Warner
>>
>
___
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: r315018 - head/sbin/kldstat

2017-03-10 Thread Mark Johnston
Author: markj
Date: Fri Mar 10 19:13:38 2017
New Revision: 315018
URL: https://svnweb.freebsd.org/changeset/base/315018

Log:
  Typo.
  
  MFC after:3 days

Modified:
  head/sbin/kldstat/kldstat.c

Modified: head/sbin/kldstat/kldstat.c
==
--- head/sbin/kldstat/kldstat.c Fri Mar 10 19:08:31 2017(r315017)
+++ head/sbin/kldstat/kldstat.c Fri Mar 10 19:13:38 2017(r315018)
@@ -97,7 +97,7 @@ printfile(int fileid, int verbose, int h
 static void
 usage(void)
 {
-fprintf(stderr, "usage: kldstata[-d] [-h] [-q] [-v] [-i id] [-n 
filename]\n");
+fprintf(stderr, "usage: kldstat [-d] [-h] [-q] [-v] [-i id] [-n 
filename]\n");
 fprintf(stderr, "   kldstat [-d] [-q] [-m modname]\n");
 exit(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: r314989 - head/usr.bin/vmstat

2017-03-10 Thread Ngie Cooper

> On Mar 10, 2017, at 03:59, Pedro Giffuni  wrote:
> 
>> On 3/10/2017 2:45 AM, Bruce Evans wrote:
>>> On Fri, 10 Mar 2017, Marcelo Araujo wrote:
>>> 
>>> ...
>>> Log:
>>> Use nitems() from sys/param.h and also remove the cast.
>>> 
>>> Reviewed by:markj
>>> MFC after:3 weeks.
>>> Differential Revision:https://reviews.freebsd.org/D9937
>>> ...
>>> Modified: head/usr.bin/vmstat/vmstat.c
>>> ==
>>>  
>>> --- head/usr.bin/vmstat/vmstat.cFri Mar 10 04:30:31 2017 (r314988)
>>> +++ head/usr.bin/vmstat/vmstat.cFri Mar 10 04:49:40 2017 (r314989)
>>> @@ -288,17 +288,13 @@ retry_nlist:
>>>namelist[X_SUM].n_name = "_cnt";
>>>goto retry_nlist;
>>>}
>>> -for (c = 0;
>>> - c < (int)(sizeof(namelist)/sizeof(namelist[0]));
>>> - c++)
>>> +for (c = 0; c < nitems(namelist); c++)
>>>if (namelist[c].n_type == 0)
>>>bufsize += strlen(namelist[c].n_name) + 1;
>> 
>> This undoes fixes to compile at WARNS=2 in r87690 and now breaks at WARNS=3.
>> vmstat is still compiled at WARNS=1.
>> 
>> nitems suffers from the same unsigned poisoning as the sizeof() expression
>> (since it reduces to the same expression.  Casting to int in the expression
>> to fix the warning would break exotic cases.  Of course, nitems is
>> undocumented so no one knows when it is supposed to work).
>> 
>> vmstat compiles with no errors at WARNS=2.  At WARNS=3, it used to compile
>> with 9 excessive warnings (about the good style of omitting redundant
>> initializers).  Now it compiles with 10 excessive warnings.  1 more about
>> comparison between signed unsigned.  This warning is a compiler bug.  Both
>> gcc-4.2.1 and clang-3.9.0 have it.  It is enabled by -W, which is put in
>> CFLAGS at WARNS >= 3, or by -Wsign-compare.
>> 
>> These compilers even complain about:
>> 
>>int c;
>> 
>>for (c = 0; c < 1U; c++)
>>foo();
>> 
>> where it is extremely clear that c never gets converted to a wrong value
>> when it is promoted to unsigned for the comparison.  Compilers should
>> only warn about sign mismatches if they can't figure out the ranges or
>> if they can figure out the ranges but dangerous promotiions occur.
>> Compilers do excessive unrolling and other optimizations of loops like
>> the above, and they must figure out the ranges for this.
>> 
> 
> I haven't looked at the code but it would seem like you can unsign c and 
> avoid the cast.

Yeah. This might introduce a domino effect though of changes.
Cheers!
-Ngie
___
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: r315019 - head/sys/boot/fdt

2017-03-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 10 19:15:57 2017
New Revision: 315019
URL: https://svnweb.freebsd.org/changeset/base/315019

Log:
  [loader][fdt] Fix applying overlays without __local_fixups__ node
  
  Do not return error if __local_fixups__ node is missing in DTB overlay
  because local fixup data is optional.
  
  Reported by:  Manuel Stuhn
  MFC after:1 week

Modified:
  head/sys/boot/fdt/fdt_overlay.c

Modified: head/sys/boot/fdt/fdt_overlay.c
==
--- head/sys/boot/fdt/fdt_overlay.c Fri Mar 10 19:13:38 2017
(r315018)
+++ head/sys/boot/fdt/fdt_overlay.c Fri Mar 10 19:15:57 2017
(r315019)
@@ -358,21 +358,26 @@ static int
 fdt_overlay_do_local_fixups(void *main_fdtp, void *overlay_fdtp)
 {
int overlay_local_fixups_o;
-   int len;
+   int len, rv;
const char *fixups;
uint32_t phandle_offset;
 
overlay_local_fixups_o = fdt_path_offset(overlay_fdtp, 
"/__local_fixups__");
 
-   if (overlay_local_fixups_o < 0)
-   return (-1);
+   if (overlay_local_fixups_o < 0) {
+   /* If not local fixups - do nothing */
+   if (overlay_local_fixups_o == -FDT_ERR_NOTFOUND)
+   return (0);
+   return (overlay_local_fixups_o);
+   }
 
phandle_offset = fdt_max_phandle(main_fdtp);
fdt_increase_phandles(overlay_fdtp, phandle_offset);
fixups = fdt_getprop_w(overlay_fdtp, overlay_local_fixups_o, "fixup", 
&len);
if (fixups) {
-   if (fdt_do_local_fixup(overlay_fdtp, fixups, len, 
phandle_offset) < 0)
-   return (-1);
+   rv = fdt_do_local_fixup(overlay_fdtp, fixups, len, 
phandle_offset);
+   if (rv < 0)
+   return (rv);
}
 
return (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: r315022 - head/sys/cam/ctl

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 19:43:45 2017
New Revision: 315022
URL: https://svnweb.freebsd.org/changeset/base/315022

Log:
  Request change of SIM target role only when it is different.
  
  Separate WWNs change into separate request to know what actually failed.
  
  MFC after:2 weeks

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

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Mar 10 19:34:14 2017(r315021)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Mar 10 19:43:45 2017(r315022)
@@ -1492,18 +1492,14 @@ out:
 static void
 ctlfe_onoffline(void *arg, int online)
 {
-   struct ctlfe_softc *bus_softc;
+   struct ctlfe_softc *bus_softc = arg;
union ccb *ccb;
cam_status status;
struct cam_path *path;
-   int set_wwnn;
-
-   bus_softc = (struct ctlfe_softc *)arg;
-
-   set_wwnn = 0;
+   int set_wwnn = 0;
 
status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_id,
-   CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
+   CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
if (status != CAM_REQ_CMP) {
printf("%s: unable to create path!\n", __func__);
return;
@@ -1513,21 +1509,9 @@ ctlfe_onoffline(void *arg, int online)
ccb->ccb_h.func_code = XPT_GET_SIM_KNOB;
xpt_action(ccb);
 
-   /*
-* Copan WWN format:
-*
-* Bits 63-60:  0x5 NAA, IEEE registered name
-* Bits 59-36:  0x000ED5IEEE Company name assigned to Copan
-* Bits 35-12:  Copan SSN (Sequential Serial Number)
-* Bits 11-8:   Type of port:
-*  1 == N-Port
-*  2 == F-Port
-*  3 == NL-Port
-* Bits 7-0:0 == Node Name, >0 == Port Number
-*/
+   /* Check whether we should change WWNs. */
if (online != 0) {
if ((ccb->knob.xport_specific.valid & KNOB_VALID_ADDRESS) != 0){
-
printf("%s: %s current WWNN %#jx\n", __func__,
   bus_softc->port_name,
   ccb->knob.xport_specific.fc.wwnn);
@@ -1560,43 +1544,59 @@ ctlfe_onoffline(void *arg, int online)
false, 0,
true, ccb->knob.xport_specific.fc.wwpn);
}
-
-
-   if (set_wwnn != 0) {
-   printf("%s: %s new WWNN %#jx\n", __func__,
-  bus_softc->port_name,
-   ccb->knob.xport_specific.fc.wwnn);
-   printf("%s: %s new WWPN %#jx\n", __func__,
-  bus_softc->port_name,
-  ccb->knob.xport_specific.fc.wwpn);
-   }
} else {
printf("%s: %s has no valid WWNN/WWPN\n", __func__,
   bus_softc->port_name);
+   if (bus_softc->port.wwnn != 0) {
+   ccb->knob.xport_specific.fc.wwnn =
+   bus_softc->port.wwnn;
+   set_wwnn = 1;
+   }
+   if (bus_softc->port.wwpn != 0) {
+   ccb->knob.xport_specific.fc.wwpn =
+   bus_softc->port.wwpn;
+   set_wwnn = 1;
+   }
+   }
+   }
+   if (set_wwnn) {
+   ccb->ccb_h.func_code = XPT_SET_SIM_KNOB;
+   ccb->knob.xport_specific.valid = KNOB_VALID_ADDRESS;
+   xpt_action(ccb);
+   if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+   printf("%s: %s (path id %d) failed set WWNs: %#x\n",
+   __func__, bus_softc->port_name, bus_softc->path_id,
+   ccb->ccb_h.status);
+   } else {
+   printf("%s: %s new WWNN %#jx\n", __func__,
+  bus_softc->port_name,
+  ccb->knob.xport_specific.fc.wwnn);
+   printf("%s: %s new WWPN %#jx\n", __func__,
+  bus_softc->port_name,
+  ccb->knob.xport_specific.fc.wwpn);
}
}
-   ccb->ccb_h.func_code = XPT_SET_SIM_KNOB;
-   ccb->knob.xport_specific.valid = KNOB_VALID_ROLE;
-   if (set_wwnn != 0)
-   ccb->knob.xport_specific.valid |= KNOB_VALID_ADDRESS;
-
-   if (online != 0)
-   ccb->knob.xport_specific.fc.role |= KNOB_ROLE_TARGET;
-   else
-   ccb->knob.xport_specific

Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Adrian Chadd
s/ifconfig/put-it-in-a-config-file-in-share-so-we-dont-have-to-patch-ifconfig-every-time-we-change-this-kthxbai/g


-adrian


On 10 March 2017 at 11:12, Navdeep Parhar  wrote:
> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
>> There's also the issue that running "ifconfig igb0 blah" during startup will
>> cause if_igb to be automatically loaded by ifconfig.
>>
>> I guess we could add a dummy if_igb.ko that just has a dependency on
>> if_em.ko
>
> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
> added a list of ifnet names -> kld map to ifconfig instead.  It would
> have been an ugly hack but much simpler.
>
> Regards,
> Navdeep
>
>>
>> On Fri, Mar 10, 2017 at 1:13 PM, Warner Losh  wrote:
>>>
>>> On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
>>> >
>>> >
>>> > On 02/15/17 03:06, Roger Pau Monné wrote:
>>> >> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
>>> >>> Author: sbruno
>>> >>> Date: Tue Jan 10 03:23:22 2017
>>> >>> New Revision: 311849
>>> >>> URL: https://svnweb.freebsd.org/changeset/base/311849
>>> >>>
>>> >>> Log:
>>> >>>   Migrate e1000 to the IFLIB framework:
>>> >>>   - em(4) igb(4) and lem(4)
>>> >>>   - deprecate the igb device from kernel configurations
>>> >>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
>>> >>
>>> >> This linking causes mfsBSD to choke when building an image from HEAD.
>>> >> It tries
>>> >> to issue the following command:
>>> >>
>>> >> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
>>> >>
>>> >> Which fails when finding the symbol link. I can send a patch to change
>>> >> that to
>>> >> -Rp, which would work fine, but wouldn't it be better to either
>>> >> completely
>>> >> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
>>> >>
>>> >> I'm wondering if for example anyone strips down it's /boot/kernel/
>>> >> manually, by
>>> >> removing unused modules, and what would happen if if_em.ko is removed
>>> >> but not
>>> >> if_igb.ko.
>>> >>
>>> >> Roger.
>>> >>
>>> >>
>>> >
>>> > Well, this was my naive attempt to make upgrades for users to be
>>> > non-eventful in the event they have "if_igb_load=YES" in their
>>> > loader.conf instead of having it built into their kernel.
>>> >
>>> > If the -Rp works, I'll add that instead.
>>>
>>> The module name is encoded in the module itself. The boot loader looks
>>> it up to see which module to load. Maybe there's a way to fix it so
>>> both load from one file?
>>>
>>> Warner
>>>
>>
>
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Warner Losh
It's already in loader.hints. The bug is that ifconfig doesn't use a
library (which others can use) to find the module by name, but rather
assumes a particular filename -> module name mapping.

Warner

On Fri, Mar 10, 2017 at 1:07 PM, Adrian Chadd  wrote:
> s/ifconfig/put-it-in-a-config-file-in-share-so-we-dont-have-to-patch-ifconfig-every-time-we-change-this-kthxbai/g
>
>
> -adrian
>
>
> On 10 March 2017 at 11:12, Navdeep Parhar  wrote:
>> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
>>> There's also the issue that running "ifconfig igb0 blah" during startup will
>>> cause if_igb to be automatically loaded by ifconfig.
>>>
>>> I guess we could add a dummy if_igb.ko that just has a dependency on
>>> if_em.ko
>>
>> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
>> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
>> added a list of ifnet names -> kld map to ifconfig instead.  It would
>> have been an ugly hack but much simpler.
>>
>> Regards,
>> Navdeep
>>
>>>
>>> On Fri, Mar 10, 2017 at 1:13 PM, Warner Losh  wrote:

 On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
 >
 >
 > On 02/15/17 03:06, Roger Pau Monné wrote:
 >> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
 >>> Author: sbruno
 >>> Date: Tue Jan 10 03:23:22 2017
 >>> New Revision: 311849
 >>> URL: https://svnweb.freebsd.org/changeset/base/311849
 >>>
 >>> Log:
 >>>   Migrate e1000 to the IFLIB framework:
 >>>   - em(4) igb(4) and lem(4)
 >>>   - deprecate the igb device from kernel configurations
 >>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
 >>
 >> This linking causes mfsBSD to choke when building an image from HEAD.
 >> It tries
 >> to issue the following command:
 >>
 >> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
 >>
 >> Which fails when finding the symbol link. I can send a patch to change
 >> that to
 >> -Rp, which would work fine, but wouldn't it be better to either
 >> completely
 >> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
 >>
 >> I'm wondering if for example anyone strips down it's /boot/kernel/
 >> manually, by
 >> removing unused modules, and what would happen if if_em.ko is removed
 >> but not
 >> if_igb.ko.
 >>
 >> Roger.
 >>
 >>
 >
 > Well, this was my naive attempt to make upgrades for users to be
 > non-eventful in the event they have "if_igb_load=YES" in their
 > loader.conf instead of having it built into their kernel.
 >
 > If the -Rp works, I'll add that instead.

 The module name is encoded in the module itself. The boot loader looks
 it up to see which module to load. Maybe there's a way to fix it so
 both load from one file?

 Warner

>>>
>>
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Adrian Chadd
On 10 March 2017 at 12:09, Warner Losh  wrote:
> It's already in loader.hints. The bug is that ifconfig doesn't use a
> library (which others can use) to find the module by name, but rather
> assumes a particular filename -> module name mapping.

Sounds like a GSoC project. :-)



-adrian

> Warner
>
> On Fri, Mar 10, 2017 at 1:07 PM, Adrian Chadd  wrote:
>> s/ifconfig/put-it-in-a-config-file-in-share-so-we-dont-have-to-patch-ifconfig-every-time-we-change-this-kthxbai/g
>>
>>
>> -adrian
>>
>>
>> On 10 March 2017 at 11:12, Navdeep Parhar  wrote:
>>> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
 There's also the issue that running "ifconfig igb0 blah" during startup 
 will
 cause if_igb to be automatically loaded by ifconfig.

 I guess we could add a dummy if_igb.ko that just has a dependency on
 if_em.ko
>>>
>>> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
>>> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
>>> added a list of ifnet names -> kld map to ifconfig instead.  It would
>>> have been an ugly hack but much simpler.
>>>
>>> Regards,
>>> Navdeep
>>>

 On Fri, Mar 10, 2017 at 1:13 PM, Warner Losh  wrote:
>
> On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
> >
> >
> > On 02/15/17 03:06, Roger Pau Monné wrote:
> >> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
> >>> Author: sbruno
> >>> Date: Tue Jan 10 03:23:22 2017
> >>> New Revision: 311849
> >>> URL: https://svnweb.freebsd.org/changeset/base/311849
> >>>
> >>> Log:
> >>>   Migrate e1000 to the IFLIB framework:
> >>>   - em(4) igb(4) and lem(4)
> >>>   - deprecate the igb device from kernel configurations
> >>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
> >>
> >> This linking causes mfsBSD to choke when building an image from HEAD.
> >> It tries
> >> to issue the following command:
> >>
> >> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
> >>
> >> Which fails when finding the symbol link. I can send a patch to change
> >> that to
> >> -Rp, which would work fine, but wouldn't it be better to either
> >> completely
> >> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
> >>
> >> I'm wondering if for example anyone strips down it's /boot/kernel/
> >> manually, by
> >> removing unused modules, and what would happen if if_em.ko is removed
> >> but not
> >> if_igb.ko.
> >>
> >> Roger.
> >>
> >>
> >
> > Well, this was my naive attempt to make upgrades for users to be
> > non-eventful in the event they have "if_igb_load=YES" in their
> > loader.conf instead of having it built into their kernel.
> >
> > If the -Rp works, I'll add that instead.
>
> The module name is encoded in the module itself. The boot loader looks
> it up to see which module to load. Maybe there's a way to fix it so
> both load from one file?
>
> Warner
>

>>>
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Warner Losh
On Fri, Mar 10, 2017 at 1:10 PM, Adrian Chadd  wrote:
> On 10 March 2017 at 12:09, Warner Losh  wrote:
>> It's already in loader.hints. The bug is that ifconfig doesn't use a
>> library (which others can use) to find the module by name, but rather
>> assumes a particular filename -> module name mapping.
>
> Sounds like a GSoC project. :-)

Done properly, it could also solve the auto-loading of drivers issue
:) Many of the pieces are there, though marking pci drivers would need
to be done in earnest.

Warner

>
> -adrian
>
>> Warner
>>
>> On Fri, Mar 10, 2017 at 1:07 PM, Adrian Chadd  wrote:
>>> s/ifconfig/put-it-in-a-config-file-in-share-so-we-dont-have-to-patch-ifconfig-every-time-we-change-this-kthxbai/g
>>>
>>>
>>> -adrian
>>>
>>>
>>> On 10 March 2017 at 11:12, Navdeep Parhar  wrote:
 On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
> There's also the issue that running "ifconfig igb0 blah" during startup 
> will
> cause if_igb to be automatically loaded by ifconfig.
>
> I guess we could add a dummy if_igb.ko that just has a dependency on
> if_em.ko

 I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
 drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
 added a list of ifnet names -> kld map to ifconfig instead.  It would
 have been an ugly hack but much simpler.

 Regards,
 Navdeep

>
> On Fri, Mar 10, 2017 at 1:13 PM, Warner Losh  wrote:
>>
>> On Fri, Mar 10, 2017 at 11:06 AM, Sean Bruno  wrote:
>> >
>> >
>> > On 02/15/17 03:06, Roger Pau Monné wrote:
>> >> On Tue, Jan 10, 2017 at 03:23:22AM +, Sean Bruno wrote:
>> >>> Author: sbruno
>> >>> Date: Tue Jan 10 03:23:22 2017
>> >>> New Revision: 311849
>> >>> URL: https://svnweb.freebsd.org/changeset/base/311849
>> >>>
>> >>> Log:
>> >>>   Migrate e1000 to the IFLIB framework:
>> >>>   - em(4) igb(4) and lem(4)
>> >>>   - deprecate the igb device from kernel configurations
>> >>>   - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
>> >>
>> >> This linking causes mfsBSD to choke when building an image from HEAD.
>> >> It tries
>> >> to issue the following command:
>> >>
>> >> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
>> >>
>> >> Which fails when finding the symbol link. I can send a patch to change
>> >> that to
>> >> -Rp, which would work fine, but wouldn't it be better to either
>> >> completely
>> >> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
>> >>
>> >> I'm wondering if for example anyone strips down it's /boot/kernel/
>> >> manually, by
>> >> removing unused modules, and what would happen if if_em.ko is removed
>> >> but not
>> >> if_igb.ko.
>> >>
>> >> Roger.
>> >>
>> >>
>> >
>> > Well, this was my naive attempt to make upgrades for users to be
>> > non-eventful in the event they have "if_igb_load=YES" in their
>> > loader.conf instead of having it built into their kernel.
>> >
>> > If the -Rp works, I'll add that instead.
>>
>> The module name is encoded in the module itself. The boot loader looks
>> it up to see which module to load. Maybe there's a way to fix it so
>> both load from one file?
>>
>> Warner
>>
>

___
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: r315025 - head/sys/cam/ctl

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 20:20:00 2017
New Revision: 315025
URL: https://svnweb.freebsd.org/changeset/base/315025

Log:
  Switch work_queue from TAILQ to STAILQ.
  
  It is mostly FIFO and we don't need random removal there.
  
  MFC after:2 weeks

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

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Mar 10 20:07:38 2017(r315024)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Mar 10 20:20:00 2017(r315025)
@@ -105,7 +105,7 @@ struct ctlfe_lun_softc {
int  atios_alloced; /* Number of ATIOs not freed */
int  inots_alloced; /* Number of INOTs not freed */
struct task refdrain_task;
-   TAILQ_HEAD(, ccb_hdr) work_queue;
+   STAILQ_HEAD(, ccb_hdr) work_queue;
STAILQ_ENTRY(ctlfe_lun_softc) links;
 };
 
@@ -460,7 +460,7 @@ ctlferegister(struct cam_periph *periph,
softc = (struct ctlfe_lun_softc *)arg;
bus_softc = softc->parent_softc;

-   TAILQ_INIT(&softc->work_queue);
+   STAILQ_INIT(&softc->work_queue);
softc->periph = periph;
periph->softc = softc;
 
@@ -749,14 +749,13 @@ ctlfestart(struct cam_periph *periph, un
softc = (struct ctlfe_lun_softc *)periph->softc;
 
 next:
-   ccb_h = TAILQ_FIRST(&softc->work_queue);
+   /* Take the ATIO off the work queue */
+   ccb_h = STAILQ_FIRST(&softc->work_queue);
if (ccb_h == NULL) {
xpt_release_ccb(start_ccb);
return;
}
-
-   /* Take the ATIO off the work queue */
-   TAILQ_REMOVE(&softc->work_queue, ccb_h, periph_links.tqe);
+   STAILQ_REMOVE_HEAD(&softc->work_queue, periph_links.stqe);
atio = (struct ccb_accept_tio *)ccb_h;
io = (union ctl_io *)ccb_h->io_ptr;
csio = &start_ccb->csio;
@@ -881,7 +880,7 @@ next:
/*
 * If we still have work to do, ask for another CCB.
 */
-   if (!TAILQ_EMPTY(&softc->work_queue))
+   if (!STAILQ_EMPTY(&softc->work_queue))
xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 }
 
@@ -1207,8 +1206,8 @@ ctlfedone(struct cam_periph *periph, uni
io->scsiio.io_hdr.status = CTL_STATUS_NONE;
io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED;
xpt_release_ccb(done_ccb);
-   TAILQ_INSERT_HEAD(&softc->work_queue, &atio->ccb_h,
- periph_links.tqe);
+   STAILQ_INSERT_HEAD(&softc->work_queue, &atio->ccb_h,
+ periph_links.stqe);
xpt_schedule(periph, CAM_PRIORITY_NORMAL);
break;
}
@@ -1823,7 +1822,7 @@ ctlfe_dump_queue(struct ctlfe_lun_softc 
periph = softc->periph;
num_items = 0;
 
-   TAILQ_FOREACH(hdr, &softc->work_queue, periph_links.tqe) {
+   STAILQ_FOREACH(hdr, &softc->work_queue, periph_links.stqe) {
union ctl_io *io = hdr->io_ptr;
 
num_items++;
@@ -1878,8 +1877,8 @@ ctlfe_datamove(union ctl_io *io)
io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED;
if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE)
io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED;
-   TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h,
- periph_links.tqe);
+   STAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h,
+ periph_links.stqe);
xpt_schedule(periph, CAM_PRIORITY_NORMAL);
cam_periph_unlock(periph);
 }
@@ -1931,8 +1930,8 @@ ctlfe_done(union ctl_io *io)
return;
} else {
io->io_hdr.flags |= CTL_FLAG_STATUS_QUEUED;
-   TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h,
- periph_links.tqe);
+   STAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h,
+ periph_links.stqe);
xpt_schedule(periph, CAM_PRIORITY_NORMAL);
}
 
___
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: r314808 - in head: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake

2017-03-10 Thread Bryan Drewery
On 3/6/17 3:02 PM, Simon J. Gerraty wrote:
> Author: sjg
> Date: Mon Mar  6 23:02:33 2017
> New Revision: 314808
> URL: https://svnweb.freebsd.org/changeset/base/314808
> 
> Log:
>   Merge bmake-20170301
> 
> Modified:
>   head/contrib/bmake/ChangeLog
>   head/contrib/bmake/Makefile
>   head/contrib/bmake/PSD.doc/tutorial.ms
>   head/contrib/bmake/bmake.1
>   head/contrib/bmake/bmake.cat1
>   head/contrib/bmake/dir.c
>   head/contrib/bmake/main.c
>   head/contrib/bmake/make.1
>   head/contrib/bmake/meta.c
>   head/contrib/bmake/mk/ChangeLog
>   head/contrib/bmake/mk/dirdeps.mk
>   head/contrib/bmake/mk/dpadd.mk
>   head/contrib/bmake/mk/install-mk
>   head/contrib/bmake/mk/meta.stage.mk
>   head/contrib/bmake/mk/meta2deps.py
>   head/contrib/bmake/mk/prog.mk
>   head/contrib/bmake/mk/subdir.mk
>   head/contrib/bmake/mk/sys.mk
>   head/contrib/bmake/mk/sys.vars.mk
>   head/contrib/bmake/os.sh
>   head/contrib/bmake/parse.c
>   head/contrib/bmake/unit-tests/varmisc.exp
>   head/contrib/bmake/unit-tests/varmisc.mk
>   head/contrib/bmake/var.c
>   head/usr.bin/bmake/Makefile
> Directory Properties:
>   head/contrib/bmake/   (props changed)
> 
> Modified: head/contrib/bmake/ChangeLog
> ==
> --- head/contrib/bmake/ChangeLog  Mon Mar  6 22:46:49 2017
> (r314807)
> +++ head/contrib/bmake/ChangeLog  Mon Mar  6 23:02:33 2017
> (r314808)
> @@ -1,3 +1,32 @@
> +2017-03-01  Simon J. Gerraty  
> +
> + * Makefile (_MAKE_VERSION): 20170301
> +   Merge with NetBSD make, pick up
> +   o main.c: use -C arg as is rather than getcwd()
> + if they identify the same directory.
> +

This change is broken for relative paths specified to -C.  I had just
convinced someone that -C was flawless last week and now it's actually
broken!

> ~/git/freebsd/lib/libthr # make -C ../libnetbsd obj
> /usr/obj../libnetbsd created for ../libnetbsd
> ~/git/freebsd/lib/libthr # rm -rf /usr/obj../libnetbsd
> ~/git/freebsd/lib/libthr # make -C ../libthr -V .OBJDIR
> make: "../libthr/../libthr/Makefile" line 14: Could not find src.opts.mk
> make: "../libthr/../libthr/Makefile" line 55: Malformed conditional 
> (${MK_INSTALLLIB} != "no")
> make: "../libthr/../libthr/Makefile" line 61: Malformed conditional 
> (${MK_PROFILE} != "no")
> make: "../libthr/../libthr/Makefile" line 65: Malformed conditional 
> (${MK_TESTS} != "no")
> make: Fatal errors encountered -- cannot continue
> make: stopped in ../libthr
> ~/git/freebsd/lib/libthr # make -C ../libnetbsd  -V .OBJDIR
> make: "/usr/share/mk/bsd.obj.mk" line 1: here
> ../libnetbsd/../libnetbsd
> ~/git/freebsd/lib/libthr # make -m .../share/mk -C ../libnetbsd  -V .OBJDIR
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 45: OBJDIR: 
> ../libnetbsd/../libnetbsd
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 46: CURDIR: ../libnetbsd
> ../libnetbsd/../libnetbsd

2 problems:
1. .OBJDIR is somehow duplicate ${.CURDIR}${.CURDIR}
2. The default MAKESYSPATH of .../share/mk doesn't work with -C .., it
ends up reaching out to /usr/share/mk.  An explicit -m works though.

Reverting it:

> ~/git/freebsd/lib/libthr # make -C ../libnetbsd  -V .OBJDIR
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 45: OBJDIR: 
> /root/git/freebsd/lib/libnetbsd
> make: "/root/git/freebsd/share/mk/bsd.obj.mk" line 46: CURDIR: 
> /root/git/freebsd/lib/libnetbsd
> /root/git/freebsd/lib/libnetbsd


Can this piece please be reverted for now while relative paths get more
testing?

> diff --git contrib/bmake/main.c contrib/bmake/main.c
> index 087438927355..870eefd6e591 100644
> --- contrib/bmake/main.c
> +++ contrib/bmake/main.c
> @@ -389,6 +389,7 @@ MainParseArgs(int argc, char **argv)
> int arginc;
> char *argvalue;
> const char *getopt_def;
> +   struct stat sa, sb;
> char *optscan;
> Boolean inOption, dashDash = FALSE;
> char found_path[MAXPATHLEN + 1];/* for searching for sys.mk */
> @@ -457,6 +458,11 @@ rearg:
> (void)fprintf(stderr, "%s: %s.\n", progname, 
> strerror(errno));
> exit(2);
> }
> +   if (stat(argvalue, &sa) != -1 &&
> +   stat(curdir, &sb) != -1 &&
> +   sa.st_ino == sb.st_ino &&
> +   sa.st_dev == sb.st_dev)
> +   strncpy(curdir, argvalue, MAXPATHLEN);
> ignorePWD = TRUE;
> break;
> case 'D':



-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread John Baldwin
On Friday, March 10, 2017 11:12:45 AM Navdeep Parhar wrote:
> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
> > There's also the issue that running "ifconfig igb0 blah" during startup will
> > cause if_igb to be automatically loaded by ifconfig.
> >
> > I guess we could add a dummy if_igb.ko that just has a dependency on
> > if_em.ko
> 
> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
> added a list of ifnet names -> kld map to ifconfig instead.  It would
> have been an ugly hack but much simpler.

For now I think having an if_igb.c that is like if_cc.c and if_cxl.c
is probably the simplest way to go.

-- 
John Baldwin
___
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: r315030 - head/sys/cam/ctl

2017-03-10 Thread Alexander Motin
Author: mav
Date: Fri Mar 10 21:09:33 2017
New Revision: 315030
URL: https://svnweb.freebsd.org/changeset/base/315030

Log:
  Abort all ATIOs and INOTs queued to SIM on LUN disable.
  
  Some SIMs may not abort them implicitly, that either fail the LUN disable
  request or just make us wait for those CCBs forever.  With this change
  I can successfully disable LUNs on mpt(4).  For isp(4), which aborts them
  implicitly, this change should be irrelevant.
  
  MFC after:2 weeks

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

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Mar 10 20:48:38 2017(r315029)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Mar 10 21:09:33 2017(r315030)
@@ -106,6 +106,8 @@ struct ctlfe_lun_softc {
int  inots_alloced; /* Number of INOTs not freed */
struct task refdrain_task;
STAILQ_HEAD(, ccb_hdr) work_queue;
+   LIST_HEAD(, ccb_hdr) atio_list; /* List of ATIOs queued to SIM. */
+   LIST_HEAD(, ccb_hdr) inot_list; /* List of INOTs queued to SIM. */
STAILQ_ENTRY(ctlfe_lun_softc) links;
 };
 
@@ -453,7 +455,7 @@ ctlferegister(struct cam_periph *periph,
 {
struct ctlfe_softc *bus_softc;
struct ctlfe_lun_softc *softc;
-   union ccb en_lun_ccb;
+   union ccb ccb;
cam_status status;
int i;
 
@@ -461,19 +463,21 @@ ctlferegister(struct cam_periph *periph,
bus_softc = softc->parent_softc;

STAILQ_INIT(&softc->work_queue);
+   LIST_INIT(&softc->atio_list);
+   LIST_INIT(&softc->inot_list);
softc->periph = periph;
periph->softc = softc;
 
-   xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
-   en_lun_ccb.ccb_h.func_code = XPT_EN_LUN;
-   en_lun_ccb.cel.grp6_len = 0;
-   en_lun_ccb.cel.grp7_len = 0;
-   en_lun_ccb.cel.enable = 1;
-   xpt_action(&en_lun_ccb);
-   status = (en_lun_ccb.ccb_h.status & CAM_STATUS_MASK);
+   xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
+   ccb.ccb_h.func_code = XPT_EN_LUN;
+   ccb.cel.grp6_len = 0;
+   ccb.cel.grp7_len = 0;
+   ccb.cel.enable = 1;
+   xpt_action(&ccb);
+   status = (ccb.ccb_h.status & CAM_STATUS_MASK);
if (status != CAM_REQ_CMP) {
xpt_print(periph->path, "%s: Enable LUN failed, status 0x%x\n", 
- __func__, en_lun_ccb.ccb_h.status);
+ __func__, ccb.ccb_h.status);
return (status);
}
 
@@ -507,6 +511,7 @@ ctlferegister(struct cam_periph *periph,
PRIV_INFO(new_io) = cmd_info;
softc->atios_alloced++;
new_ccb->ccb_h.io_ptr = new_io;
+   LIST_INSERT_HEAD(&softc->atio_list, &new_ccb->ccb_h, 
periph_links.le);
 
xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1);
new_ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO;
@@ -553,6 +558,7 @@ ctlferegister(struct cam_periph *periph,
}
softc->inots_alloced++;
new_ccb->ccb_h.io_ptr = new_io;
+   LIST_INSERT_HEAD(&softc->inot_list, &new_ccb->ccb_h, 
periph_links.le);
 
xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1);
new_ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY;
@@ -589,23 +595,34 @@ ctlferegister(struct cam_periph *periph,
 static void
 ctlfeoninvalidate(struct cam_periph *periph)
 {
-   union ccb en_lun_ccb;
-   cam_status status;
+   struct ctlfe_lun_softc *softc = (struct ctlfe_lun_softc *)periph->softc;
struct ctlfe_softc *bus_softc;
-   struct ctlfe_lun_softc *softc;
-
-   softc = (struct ctlfe_lun_softc *)periph->softc;
+   union ccb ccb;
+   struct ccb_hdr *hdr;
+   cam_status status;
 
-   xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
-   en_lun_ccb.ccb_h.func_code = XPT_EN_LUN;
-   en_lun_ccb.cel.grp6_len = 0;
-   en_lun_ccb.cel.grp7_len = 0;
-   en_lun_ccb.cel.enable = 0;
-   xpt_action(&en_lun_ccb);
-   status = (en_lun_ccb.ccb_h.status & CAM_STATUS_MASK);
+   /* Abort all ATIOs and INOTs queued to SIM. */
+   xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
+   ccb.ccb_h.func_code = XPT_ABORT;
+   LIST_FOREACH(hdr, &softc->atio_list, periph_links.le) {
+   ccb.cab.abort_ccb = (union ccb *)hdr;
+   xpt_action(&ccb);
+   }
+   LIST_FOREACH(hdr, &softc->inot_list, periph_links.le) {
+   ccb.cab.abort_ccb = (union ccb *)hdr;
+   xpt_action(&ccb);
+   }
+
+   /* Disable the LUN in SIM. */
+   ccb.ccb_h.func_code = XPT_EN_LUN;
+   ccb.cel.grp6_len = 0;
+   ccb.cel.grp7_len = 0;
+   ccb.cel.enable = 0;
+   xpt_action(&ccb);
+   status = (ccb.ccb_h.status & CAM_STATUS_MASK);
if

Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Warner Losh
On Fri, Mar 10, 2017 at 1:21 PM, John Baldwin  wrote:
> On Friday, March 10, 2017 11:12:45 AM Navdeep Parhar wrote:
>> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
>> > There's also the issue that running "ifconfig igb0 blah" during startup 
>> > will
>> > cause if_igb to be automatically loaded by ifconfig.
>> >
>> > I guess we could add a dummy if_igb.ko that just has a dependency on
>> > if_em.ko
>>
>> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
>> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
>> added a list of ifnet names -> kld map to ifconfig instead.  It would
>> have been an ugly hack but much simpler.
>
> For now I think having an if_igb.c that is like if_cc.c and if_cxl.c
> is probably the simplest way to go.

It's certainly the easiest way forward. + if_igb.ko module, right?

Warner
___
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: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Sean Bruno


On 03/10/17 13:21, John Baldwin wrote:
> On Friday, March 10, 2017 11:12:45 AM Navdeep Parhar wrote:
>> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
>>> There's also the issue that running "ifconfig igb0 blah" during startup will
>>> cause if_igb to be automatically loaded by ifconfig.
>>>
>>> I guess we could add a dummy if_igb.ko that just has a dependency on
>>> if_em.ko
>>
>> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
>> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
>> added a list of ifnet names -> kld map to ifconfig instead.  It would
>> have been an ugly hack but much simpler.
> 
> For now I think having an if_igb.c that is like if_cc.c and if_cxl.c
> is probably the simplest way to go.
> 

Gotcha. Will do.

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r315031 - head/sys/tools/fdt

2017-03-10 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Mar 10 22:45:07 2017
New Revision: 315031
URL: https://svnweb.freebsd.org/changeset/base/315031

Log:
  [fdt] Make DTBs generated by make_dtb.sh overlay-ready
  
  Generate symbols node when compiling dts files so they can be modified
  during boot-time by applying overlays.

Modified:
  head/sys/tools/fdt/make_dtb.sh

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Fri Mar 10 21:09:33 2017
(r315030)
+++ head/sys/tools/fdt/make_dtb.sh  Fri Mar 10 22:45:07 2017
(r315031)
@@ -20,5 +20,5 @@ for d in ${dts}; do
 dtb=${dtb_path}/`basename $d .dts`.dtb
 echo "converting $d -> $dtb"
 cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I 
$S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | 
-   dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i 
$S/gnu/dts/${MACHINE}
+   dtc -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i 
$S/gnu/dts/${MACHINE}
 done
___
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: r315032 - head/lib/libc/tests/iconv

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:02:05 2017
New Revision: 315032
URL: https://svnweb.freebsd.org/changeset/base/315032

Log:
  Increase WARNS for iconv tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libc/tests/iconv/Makefile

Modified: head/lib/libc/tests/iconv/Makefile
==
--- head/lib/libc/tests/iconv/Makefile  Fri Mar 10 22:45:07 2017
(r315031)
+++ head/lib/libc/tests/iconv/Makefile  Sat Mar 11 00:02:05 2017
(r315032)
@@ -3,5 +3,6 @@
 TESTSDIR=  ${TESTSBASE}/lib/libc/iconv
 
 ATF_TESTS_C+=  iconvctl_test
+WARNS?=2
 
 .include 
___
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: r315033 - head/lib/libc/tests/nss

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:03:41 2017
New Revision: 315033
URL: https://svnweb.freebsd.org/changeset/base/315033

Log:
  Increase WARNS for nss tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libc/tests/nss/Makefile

Modified: head/lib/libc/tests/nss/Makefile
==
--- head/lib/libc/tests/nss/MakefileSat Mar 11 00:02:05 2017
(r315032)
+++ head/lib/libc/tests/nss/MakefileSat Mar 11 00:03:41 2017
(r315033)
@@ -10,6 +10,7 @@ BINDIR=   ${TESTSDIR}
 
 ${PACKAGE}FILES+=  mach
 
+WARNS?=1
 CFLAGS+=   -I${SRCTOP}/tests
 
 ATF_TESTS_C+=  getaddrinfo_test
___
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: r315034 - head/lib/msun/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:04:59 2017
New Revision: 315034
URL: https://svnweb.freebsd.org/changeset/base/315034

Log:
  Document that the msun tests require WARNS=0
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.  This
  change is technically a noop, but it documents that the msun tests don't
  work with any warnings enabled, at least not on all architectures.
  
  Reviewed by:  ngie
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/msun/tests/Makefile

Modified: head/lib/msun/tests/Makefile
==
--- head/lib/msun/tests/MakefileSat Mar 11 00:03:41 2017
(r315033)
+++ head/lib/msun/tests/MakefileSat Mar 11 00:04:59 2017
(r315034)
@@ -4,6 +4,8 @@
 
 TESTSRC=   ${SRCTOP}/contrib/netbsd-tests/lib/libm
 
+WARNS?=0
+
 # All architectures on FreeBSD have fenv.h
 CFLAGS+=   -DHAVE_FENV_H
 
___
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: r315035 - head/lib/libcrypt/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:07:04 2017
New Revision: 315035
URL: https://svnweb.freebsd.org/changeset/base/315035

Log:
  Increase WARNS for libcrypt tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libcrypt/tests/Makefile

Modified: head/lib/libcrypt/tests/Makefile
==
--- head/lib/libcrypt/tests/MakefileSat Mar 11 00:04:59 2017
(r315034)
+++ head/lib/libcrypt/tests/MakefileSat Mar 11 00:07:04 2017
(r315035)
@@ -4,6 +4,7 @@ ATF_TESTS_C+= crypt_tests
 
 NETBSD_ATF_TESTS_C+= crypt_test
 
+WARNS?=6
 CFLAGS+= -I${.CURDIR:H}
 LIBADD=crypt
 
___
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: r315036 - head/lib/libmp/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:08:11 2017
New Revision: 315036
URL: https://svnweb.freebsd.org/changeset/base/315036

Log:
  Increase WARNS for libmp tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libmp/tests/Makefile

Modified: head/lib/libmp/tests/Makefile
==
--- head/lib/libmp/tests/Makefile   Sat Mar 11 00:07:04 2017
(r315035)
+++ head/lib/libmp/tests/Makefile   Sat Mar 11 00:08:11 2017
(r315036)
@@ -2,6 +2,7 @@
 
 TAP_TESTS_C+=  legacy_test
 
+WARNS?=3
 LIBADD+=   mp
 
 .include 
___
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: r315037 - head/lib/libpathconv/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:08:46 2017
New Revision: 315037
URL: https://svnweb.freebsd.org/changeset/base/315037

Log:
  Increase WARNS for libpathconv tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libpathconv/tests/Makefile

Modified: head/lib/libpathconv/tests/Makefile
==
--- head/lib/libpathconv/tests/Makefile Sat Mar 11 00:08:11 2017
(r315036)
+++ head/lib/libpathconv/tests/Makefile Sat Mar 11 00:08:46 2017
(r315037)
@@ -3,6 +3,7 @@
 TAP_TESTS_C+=  abs2rel
 TAP_TESTS_C+=  rel2abs
 
+WARNS?=6
 #LIBADD+=  pathconv
 #LDADD+= -L .. -lpathconv
 LDADD+= ../libpathconv.a
___
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: r315038 - head/lib/libproc/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:09:30 2017
New Revision: 315038
URL: https://svnweb.freebsd.org/changeset/base/315038

Log:
  Increase WARNS for libproc tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libproc/tests/Makefile

Modified: head/lib/libproc/tests/Makefile
==
--- head/lib/libproc/tests/Makefile Sat Mar 11 00:08:46 2017
(r315037)
+++ head/lib/libproc/tests/Makefile Sat Mar 11 00:09:30 2017
(r315038)
@@ -6,6 +6,7 @@ PROGS=  target_prog
 SRCS_target_prog=  target_prog.c
 BINDIR_target_prog=${TESTSDIR}
 
+WARNS?=6
 LIBADD=elf proc rtld_db util
 
 # Ensure that symbols aren't stripped from the test program, as they're needed
___
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: r315039 - head/lib/libutil/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:09:54 2017
New Revision: 315039
URL: https://svnweb.freebsd.org/changeset/base/315039

Log:
  Increase WARNS for libutil tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/lib/libutil/tests/Makefile

Modified: head/lib/libutil/tests/Makefile
==
--- head/lib/libutil/tests/Makefile Sat Mar 11 00:09:30 2017
(r315038)
+++ head/lib/libutil/tests/Makefile Sat Mar 11 00:09:54 2017
(r315039)
@@ -9,6 +9,7 @@ TAP_TESTS_C+=   pidfile_test
 TAP_TESTS_C+=  trimdomain_test
 TAP_TESTS_C+=  trimdomain-nodomain_test
 
+WARNS?=2
 LIBADD+=   util
 
 .include 
___
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: r315040 - in head/libexec/rtld-elf/tests: . libpythagoras target

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:10:40 2017
New Revision: 315040
URL: https://svnweb.freebsd.org/changeset/base/315040

Log:
  Increase WARNS for rtld-elf tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/libexec/rtld-elf/tests/Makefile
  head/libexec/rtld-elf/tests/libpythagoras/Makefile
  head/libexec/rtld-elf/tests/target/Makefile

Modified: head/libexec/rtld-elf/tests/Makefile
==
--- head/libexec/rtld-elf/tests/MakefileSat Mar 11 00:09:54 2017
(r315039)
+++ head/libexec/rtld-elf/tests/MakefileSat Mar 11 00:10:40 2017
(r315040)
@@ -4,5 +4,6 @@ SUBDIR+=libpythagoras target
 
 SUBDIR_DEPEND_target=  libpythagoras
 ATF_TESTS_C=   ld_library_pathfds
+WARNS?=3
 
 .include 

Modified: head/libexec/rtld-elf/tests/libpythagoras/Makefile
==
--- head/libexec/rtld-elf/tests/libpythagoras/Makefile  Sat Mar 11 00:09:54 
2017(r315039)
+++ head/libexec/rtld-elf/tests/libpythagoras/Makefile  Sat Mar 11 00:10:40 
2017(r315040)
@@ -10,6 +10,7 @@ SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf
 
 SRCS=  pythagoras.c
 
+WARNS?=6
 LIBADD=m
 
 .include 

Modified: head/libexec/rtld-elf/tests/target/Makefile
==
--- head/libexec/rtld-elf/tests/target/Makefile Sat Mar 11 00:09:54 2017
(r315039)
+++ head/libexec/rtld-elf/tests/target/Makefile Sat Mar 11 00:10:40 2017
(r315040)
@@ -5,6 +5,7 @@
 PROG=  target
 BINDIR=${TESTSBASE}/libexec/rtld-elf
 
+WARNS?=3
 CFLAGS+=   -I${.CURDIR}/../libpythagoras
 
 LDFLAGS+=  -L${.OBJDIR}/../libpythagoras
___
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: r315041 - head/usr.sbin/pw/tests

2017-03-10 Thread Alan Somers
Author: asomers
Date: Sat Mar 11 00:11:20 2017
New Revision: 315041
URL: https://svnweb.freebsd.org/changeset/base/315041

Log:
  Increase WARNS for pw tests
  
  ATF tests have a default WARNS of 0, unlike other usermode programs.
  
  Reviewed by:  ngie, julian
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation
  Differential Revision:https://reviews.freebsd.org/D9933

Modified:
  head/usr.sbin/pw/tests/Makefile

Modified: head/usr.sbin/pw/tests/Makefile
==
--- head/usr.sbin/pw/tests/Makefile Sat Mar 11 00:10:40 2017
(r315040)
+++ head/usr.sbin/pw/tests/Makefile Sat Mar 11 00:11:20 2017
(r315041)
@@ -5,6 +5,7 @@ PACKAGE=tests
 BINDIR=${TESTSDIR}
 
 PROGS+=crypt
+WARNS?=6
 LIBADD+=   crypt
 
 ATF_TESTS_SH=  pw_etcdir \
___
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: r314989 - head/usr.bin/vmstat

2017-03-10 Thread Bruce Evans

On Fri, 10 Mar 2017, Ngie Cooper wrote:


On Mar 10, 2017, at 03:59, Pedro Giffuni  wrote:


On 3/10/2017 2:45 AM, Bruce Evans wrote:

On Fri, 10 Mar 2017, Marcelo Araujo wrote:

...
Log:
Use nitems() from sys/param.h and also remove the cast.

Reviewed by:markj
MFC after:3 weeks.
Differential Revision:https://reviews.freebsd.org/D9937
...
Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cFri Mar 10 04:30:31 2017 (r314988)
+++ head/usr.bin/vmstat/vmstat.cFri Mar 10 04:49:40 2017 (r314989)
@@ -288,17 +288,13 @@ retry_nlist:
   namelist[X_SUM].n_name = "_cnt";
   goto retry_nlist;
   }
-for (c = 0;
- c < (int)(sizeof(namelist)/sizeof(namelist[0]));
- c++)
+for (c = 0; c < nitems(namelist); c++)
   if (namelist[c].n_type == 0)
   bufsize += strlen(namelist[c].n_name) + 1;


This undoes fixes to compile at WARNS=2 in r87690 and now breaks at WARNS=3.
vmstat is still compiled at WARNS=1.

nitems suffers from the same unsigned poisoning as the sizeof() expression
(since it reduces to the same expression.  Casting to int in the expression
to fix the warning would break exotic cases.  Of course, nitems is
undocumented so no one knows when it is supposed to work).

vmstat compiles with no errors at WARNS=2.  At WARNS=3, it used to compile
with 9 excessive warnings (about the good style of omitting redundant
initializers).  Now it compiles with 10 excessive warnings.  1 more about
comparison between signed unsigned.  This warning is a compiler bug.  Both
gcc-4.2.1 and clang-3.9.0 have it.  It is enabled by -W, which is put in
CFLAGS at WARNS >= 3, or by -Wsign-compare.

These compilers even complain about:

   int c;

   for (c = 0; c < 1U; c++)
   foo();

where it is extremely clear that c never gets converted to a wrong value
when it is promoted to unsigned for the comparison.  Compilers should
only warn about sign mismatches if they can't figure out the ranges or
if they can figure out the ranges but dangerous promotiions occur.
Compilers do excessive unrolling and other optimizations of loops like
the above, and they must figure out the ranges for this.



I haven't looked at the code but it would seem like you can unsign c and avoid 
the cast.


That would be much worse than the cast.  The cast is at least in the
right place -- it unpoisons nitimems.  "Unsigning" c would poison C.


Yeah. This might introduce a domino effect though of changes.


Domino effect = fast poisoning.  The dominos collapse immediately, but
poisoning takes a long time to spread.  In K&R-1 size_t didn't even
exist and the type of sizeof() was unspecified.  size_t was born with
unsign poisoning a little later.  That is almost 40 years ago, but its
poisoning hasn't spread to many loop variables yet.  Full poisoning would
spread it to the closure of all uses of the loop variables, or better
stopped at the source of the poisoning.  In the above, the variable is
not used outside of the loop, so the closure is small and easy to see.

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: r314989 - head/usr.bin/vmstat

2017-03-10 Thread Marcelo Araujo
So, in my understanding, bring that cast back might mitigate a bit and make
the situation less worst. Am I right?

Br,

On Mar 11, 2017 10:29 AM, "Bruce Evans"  wrote:

> On Fri, 10 Mar 2017, Ngie Cooper wrote:
>
> On Mar 10, 2017, at 03:59, Pedro Giffuni  wrote:
>>>
>>> On 3/10/2017 2:45 AM, Bruce Evans wrote:

> On Fri, 10 Mar 2017, Marcelo Araujo wrote:
>
> ...
> Log:
> Use nitems() from sys/param.h and also remove the cast.
>
> Reviewed by:markj
> MFC after:3 weeks.
> Differential Revision:https://reviews.freebsd.org/D9937
> ...
> Modified: head/usr.bin/vmstat/vmstat.c
> 
> ==
> --- head/usr.bin/vmstat/vmstat.cFri Mar 10 04:30:31 2017 (r314988)
> +++ head/usr.bin/vmstat/vmstat.cFri Mar 10 04:49:40 2017 (r314989)
> @@ -288,17 +288,13 @@ retry_nlist:
>namelist[X_SUM].n_name = "_cnt";
>goto retry_nlist;
>}
> -for (c = 0;
> - c < (int)(sizeof(namelist)/sizeof(namelist[0]));
> - c++)
> +for (c = 0; c < nitems(namelist); c++)
>if (namelist[c].n_type == 0)
>bufsize += strlen(namelist[c].n_name) + 1;
>

 This undoes fixes to compile at WARNS=2 in r87690 and now breaks at
 WARNS=3.
 vmstat is still compiled at WARNS=1.

 nitems suffers from the same unsigned poisoning as the sizeof()
 expression
 (since it reduces to the same expression.  Casting to int in the
 expression
 to fix the warning would break exotic cases.  Of course, nitems is
 undocumented so no one knows when it is supposed to work).

 vmstat compiles with no errors at WARNS=2.  At WARNS=3, it used to
 compile
 with 9 excessive warnings (about the good style of omitting redundant
 initializers).  Now it compiles with 10 excessive warnings.  1 more
 about
 comparison between signed unsigned.  This warning is a compiler bug.
 Both
 gcc-4.2.1 and clang-3.9.0 have it.  It is enabled by -W, which is put in
 CFLAGS at WARNS >= 3, or by -Wsign-compare.

 These compilers even complain about:

int c;

for (c = 0; c < 1U; c++)
foo();

 where it is extremely clear that c never gets converted to a wrong value
 when it is promoted to unsigned for the comparison.  Compilers should
 only warn about sign mismatches if they can't figure out the ranges or
 if they can figure out the ranges but dangerous promotiions occur.
 Compilers do excessive unrolling and other optimizations of loops like
 the above, and they must figure out the ranges for this.


>>> I haven't looked at the code but it would seem like you can unsign c and
>>> avoid the cast.
>>>
>>
> That would be much worse than the cast.  The cast is at least in the
> right place -- it unpoisons nitimems.  "Unsigning" c would poison C.
>
> Yeah. This might introduce a domino effect though of changes.
>>
>
> Domino effect = fast poisoning.  The dominos collapse immediately, but
> poisoning takes a long time to spread.  In K&R-1 size_t didn't even
> exist and the type of sizeof() was unspecified.  size_t was born with
> unsign poisoning a little later.  That is almost 40 years ago, but its
> poisoning hasn't spread to many loop variables yet.  Full poisoning would
> spread it to the closure of all uses of the loop variables, or better
> stopped at the source of the poisoning.  In the above, the variable is
> not used outside of the loop, so the closure is small and easy to see.
>
> 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"


svn commit: r315045 - in head/sys: dev/drm modules/drm modules/drm/i915 modules/drm/radeon

2017-03-10 Thread Emmanuel Vadot
Author: manu
Date: Sat Mar 11 03:01:18 2017
New Revision: 315045
URL: https://svnweb.freebsd.org/changeset/base/315045

Log:
  drm(old): Remove i915 and radeon drivers
  
  They cannot be used anymore with the userland bits we provide.
  Furthermore, their KMS versions support the same hardware.
  
  Submitted by: dumbbell
  Reviewed by:  emaste, manu
  Sponsored by: AsiaBSDCon
  Differential Revision:https://reviews.freebsd.org/D5614

Deleted:
  head/sys/dev/drm/i915_dma.c
  head/sys/dev/drm/i915_drm.h
  head/sys/dev/drm/i915_drv.c
  head/sys/dev/drm/i915_drv.h
  head/sys/dev/drm/i915_irq.c
  head/sys/dev/drm/i915_mem.c
  head/sys/dev/drm/i915_reg.h
  head/sys/dev/drm/i915_suspend.c
  head/sys/dev/drm/r300_cmdbuf.c
  head/sys/dev/drm/r300_reg.h
  head/sys/dev/drm/r600_blit.c
  head/sys/dev/drm/r600_cp.c
  head/sys/dev/drm/r600_microcode.h
  head/sys/dev/drm/radeon_cp.c
  head/sys/dev/drm/radeon_cs.c
  head/sys/dev/drm/radeon_drm.h
  head/sys/dev/drm/radeon_drv.c
  head/sys/dev/drm/radeon_drv.h
  head/sys/dev/drm/radeon_irq.c
  head/sys/dev/drm/radeon_mem.c
  head/sys/dev/drm/radeon_microcode.h
  head/sys/dev/drm/radeon_state.c
  head/sys/modules/drm/i915/
  head/sys/modules/drm/radeon/
Modified:
  head/sys/dev/drm/drm_pciids.h
  head/sys/modules/drm/Makefile

Modified: head/sys/dev/drm/drm_pciids.h
==
--- head/sys/dev/drm/drm_pciids.h   Sat Mar 11 02:51:29 2017
(r315044)
+++ head/sys/dev/drm/drm_pciids.h   Sat Mar 11 03:01:18 2017
(r315045)
@@ -5,381 +5,6 @@
This file is auto-generated from the drm_pciids.txt in the DRM CVS
Please contact dri-de...@lists.sf.net to add new cards to this list
 */
-#define radeon_PCI_IDS \
-   {0x1002, 0x3150, CHIP_RV380|RADEON_IS_MOBILITY, "ATI Radeon Mobility 
X600 M24"}, \
-   {0x1002, 0x3152, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI 
Radeon Mobility X300 M24"}, \
-   {0x1002, 0x3154, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI 
FireGL M24 GL"}, \
-   {0x1002, 0x3E50, CHIP_RV380|RADEON_NEW_MEMMAP, "ATI Radeon RV380 
X600"}, \
-   {0x1002, 0x3E54, CHIP_RV380|RADEON_NEW_MEMMAP, "ATI FireGL V3200 
RV380"}, \
-   {0x1002, 0x4136, CHIP_RS100|RADEON_IS_IGP, "ATI Radeon RS100 IGP 320"}, 
\
-   {0x1002, 0x4137, CHIP_RS200|RADEON_IS_IGP, "ATI Radeon RS200 IGP 340"}, 
\
-   {0x1002, 0x4144, CHIP_R300, "ATI Radeon AD 9500"}, \
-   {0x1002, 0x4145, CHIP_R300, "ATI Radeon AE 9700 Pro"}, \
-   {0x1002, 0x4146, CHIP_R300, "ATI Radeon AF R300 9600TX"}, \
-   {0x1002, 0x4147, CHIP_R300, "ATI FireGL AG Z1"}, \
-   {0x1002, 0x4148, CHIP_R350, "ATI Radeon AH 9800 SE"}, \
-   {0x1002, 0x4149, CHIP_R350, "ATI Radeon AI 9800"}, \
-   {0x1002, 0x414A, CHIP_R350, "ATI Radeon AJ 9800"}, \
-   {0x1002, 0x414B, CHIP_R350, "ATI FireGL AK X2"}, \
-   {0x1002, 0x4150, CHIP_RV350, "ATI Radeon AP 9600"}, \
-   {0x1002, 0x4151, CHIP_RV350, "ATI Radeon AQ 9600 SE"}, \
-   {0x1002, 0x4152, CHIP_RV350, "ATI Radeon AR 9600 XT"}, \
-   {0x1002, 0x4153, CHIP_RV350, "ATI Radeon AS 9550"}, \
-   {0x1002, 0x4154, CHIP_RV350, "ATI FireGL AT T2"}, \
-   {0x1002, 0x4155, CHIP_RV350, "ATI Radeon 9650"}, \
-   {0x1002, 0x4156, CHIP_RV350, "ATI FireGL AV RV360 T2"}, \
-   {0x1002, 0x4237, CHIP_RS200|RADEON_IS_IGP, "ATI Radeon RS250 IGP"}, \
-   {0x1002, 0x4242, CHIP_R200, "ATI Radeon BB R200 AIW 8500DV"}, \
-   {0x1002, 0x4243, CHIP_R200, "ATI Radeon BC R200"}, \
-   {0x1002, 0x4336, CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY, "ATI 
Radeon RS100 Mobility U1"}, \
-   {0x1002, 0x4337, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY, "ATI 
Radeon RS200 Mobility IGP 340M"}, \
-   {0x1002, 0x4437, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY, "ATI 
Radeon RS250 Mobility IGP"}, \
-   {0x1002, 0x4966, CHIP_RV250, "ATI Radeon If RV250 9000"}, \
-   {0x1002, 0x4967, CHIP_RV250, "ATI Radeon Ig RV250 9000"}, \
-   {0x1002, 0x4A48, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JH R420 
X800"}, \
-   {0x1002, 0x4A49, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JI R420 X800 
Pro"}, \
-   {0x1002, 0x4A4A, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JJ R420 X800 
SE"}, \
-   {0x1002, 0x4A4B, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JK R420 X800 
XT"}, \
-   {0x1002, 0x4A4C, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JL R420 
X800"}, \
-   {0x1002, 0x4A4D, CHIP_R420|RADEON_NEW_MEMMAP, "ATI FireGL JM X3-256"}, \
-   {0x1002, 0x4A4E, CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI 
Radeon JN R420 Mobility M18"}, \
-   {0x1002, 0x4A4F, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JO R420 X800 
SE"}, \
-   {0x1002, 0x4A50, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JP R420 X800 
XT PE"}, \
-   {0x1002, 0x4A54, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon JT R420 AIW 
X800 VE"}, \
-   {0x1002, 0x4B49, CHIP_R420|RADEON_NEW_MEMMAP, "ATI Radeon R481 X850 
XT"}, \
-

svn commit: r315046 - head/usr.sbin/boot0cfg

2017-03-10 Thread Marcelo Araujo
Author: araujo
Date: Sat Mar 11 04:00:27 2017
New Revision: 315046
URL: https://svnweb.freebsd.org/changeset/base/315046

Log:
  Use nitems() from sys/param.h
  
  Reviewed by:  jhb
  MFC after:3 weeks.
  Differential Revision:https://reviews.freebsd.org/D9941

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

Modified: head/usr.sbin/boot0cfg/boot0cfg.c
==
--- head/usr.sbin/boot0cfg/boot0cfg.c   Sat Mar 11 03:01:18 2017
(r315045)
+++ head/usr.sbin/boot0cfg/boot0cfg.c   Sat Mar 11 04:00:27 2017
(r315046)
@@ -88,7 +88,7 @@ static const struct {
 {"update", 1},
 {"setdrv", 0}
 };
-static const int nopt = sizeof(opttbl) / sizeof(opttbl[0]);
+static const int nopt = nitems(opttbl);
 
 static const char fmt0[] = "#   flag start chs   type"
 "   end chs   offset size\n";
___
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: r315047 - head/usr.sbin/ctld

2017-03-10 Thread Marcelo Araujo
Author: araujo
Date: Sat Mar 11 04:01:35 2017
New Revision: 315047
URL: https://svnweb.freebsd.org/changeset/base/315047

Log:
  Use nitems() from sys/param.h.
  
  Reviewed by:  np
  MFC after:3 weeks.
  Differential Revision:https://reviews.freebsd.org/D9945

Modified:
  head/usr.sbin/ctld/kernel.c

Modified: head/usr.sbin/ctld/kernel.c
==
--- head/usr.sbin/ctld/kernel.c Sat Mar 11 04:00:27 2017(r315046)
+++ head/usr.sbin/ctld/kernel.c Sat Mar 11 04:01:35 2017(r315047)
@@ -1285,8 +1285,8 @@ kernel_capsicate(void)
if (error != 0 && errno != ENOSYS)
log_err(1, "cap_rights_limit");
 
-   error = cap_ioctls_limit(ctl_fd, cmds,
-   sizeof(cmds) / sizeof(cmds[0]));
+   error = cap_ioctls_limit(ctl_fd, cmds, nitems(cmds));
+
if (error != 0 && errno != ENOSYS)
log_err(1, "cap_ioctls_limit");
 
___
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: r315048 - head/usr.sbin/iscsid

2017-03-10 Thread Marcelo Araujo
Author: araujo
Date: Sat Mar 11 04:03:13 2017
New Revision: 315048
URL: https://svnweb.freebsd.org/changeset/base/315048

Log:
  Use nitems() from sys/param.h.
  
  MFC after:3 weeks.

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

Modified: head/usr.sbin/iscsid/iscsid.c
==
--- head/usr.sbin/iscsid/iscsid.c   Sat Mar 11 04:01:35 2017
(r315047)
+++ head/usr.sbin/iscsid/iscsid.c   Sat Mar 11 04:03:13 2017
(r315048)
@@ -362,8 +362,8 @@ capsicate(struct connection *conn)
if (error != 0 && errno != ENOSYS)
log_err(1, "cap_rights_limit");
 
-   error = cap_ioctls_limit(conn->conn_iscsi_fd, cmds,
-   sizeof(cmds) / sizeof(cmds[0]));
+   error = cap_ioctls_limit(conn->conn_iscsi_fd, cmds, nitems(cmds));
+
if (error != 0 && errno != ENOSYS)
log_err(1, "cap_ioctls_limit");
 
___
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: r315049 - head/usr.bin/vmstat

2017-03-10 Thread Marcelo Araujo
Author: araujo
Date: Sat Mar 11 04:36:15 2017
New Revision: 315049
URL: https://svnweb.freebsd.org/changeset/base/315049

Log:
  Bring back the cast removed in my previous commit to allow us build vmstat
  with WARNS 2. This cast was first introduced at r87690.
  
  Reported by:  bde, pfg and ngie
  MFC after:3 weeks.

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

Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cSat Mar 11 04:03:13 2017
(r315048)
+++ head/usr.bin/vmstat/vmstat.cSat Mar 11 04:36:15 2017
(r315049)
@@ -288,13 +288,13 @@ retry_nlist:
namelist[X_SUM].n_name = "_cnt";
goto retry_nlist;
}
-   for (c = 0; c < nitems(namelist); c++)
+   for (c = 0; c < (int)(nitems(namelist)); c++)
if (namelist[c].n_type == 0)
bufsize += strlen(namelist[c].n_name) + 
1;
bufsize += len + 1;
buf = bp = alloca(bufsize);
 
-   for (c = 0; c < nitems(namelist); c++)
+   for (c = 0; c < (int)(nitems(namelist)); c++)
if (namelist[c].n_type == 0) {
xo_error(" %s",
namelist[c].n_name);
___
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: r315050 - head/sys/netinet

2017-03-10 Thread Andrey V. Elsukov
Author: ae
Date: Sat Mar 11 04:57:52 2017
New Revision: 315050
URL: https://svnweb.freebsd.org/changeset/base/315050

Log:
  Fix the L2 address printed in the "arp: %s moved from %*D" message.
  
  In the r292978 struct llentry was changed and the ll_addr field become
  the pointer.
  
  PR:   217667
  MFC after:1 week

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Sat Mar 11 04:36:15 2017(r315049)
+++ head/sys/netinet/if_ether.c Sat Mar 11 04:57:52 2017(r315050)
@@ -1203,7 +1203,7 @@ arp_check_update_lle(struct arphdr *ah, 
"to %*D on %s\n",
inet_ntoa_r(isaddr, addrbuf),
ifp->if_addrlen,
-   (u_char *)&la->ll_addr, ":",
+   (u_char *)la->ll_addr, ":",
ifp->if_addrlen, (u_char *)ar_sha(ah), ":",
ifp->if_xname);
}
___
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: r314989 - head/usr.bin/vmstat

2017-03-10 Thread Pedro Giffuni



On 3/10/2017 8:29 PM, Bruce Evans wrote:

On Fri, 10 Mar 2017, Ngie Cooper wrote:


On Mar 10, 2017, at 03:59, Pedro Giffuni  wrote:


On 3/10/2017 2:45 AM, Bruce Evans wrote:

On Fri, 10 Mar 2017, Marcelo Araujo wrote:

...
Log:
Use nitems() from sys/param.h and also remove the cast.

Reviewed by:markj
MFC after:3 weeks.
Differential Revision: https://reviews.freebsd.org/D9937
...
Modified: head/usr.bin/vmstat/vmstat.c
== 

--- head/usr.bin/vmstat/vmstat.cFri Mar 10 04:30:31 2017 
(r314988)
+++ head/usr.bin/vmstat/vmstat.cFri Mar 10 04:49:40 2017 
(r314989)

@@ -288,17 +288,13 @@ retry_nlist:
   namelist[X_SUM].n_name = "_cnt";
   goto retry_nlist;
   }
-for (c = 0;
- c < (int)(sizeof(namelist)/sizeof(namelist[0]));
- c++)
+for (c = 0; c < nitems(namelist); c++)
   if (namelist[c].n_type == 0)
   bufsize += strlen(namelist[c].n_name) + 1;


This undoes fixes to compile at WARNS=2 in r87690 and now breaks at 
WARNS=3.

vmstat is still compiled at WARNS=1.

nitems suffers from the same unsigned poisoning as the sizeof() 
expression
(since it reduces to the same expression.  Casting to int in the 
expression

to fix the warning would break exotic cases.  Of course, nitems is
undocumented so no one knows when it is supposed to work).

vmstat compiles with no errors at WARNS=2.  At WARNS=3, it used to 
compile

with 9 excessive warnings (about the good style of omitting redundant
initializers).  Now it compiles with 10 excessive warnings. 1 more 
about
comparison between signed unsigned.  This warning is a compiler 
bug.  Both
gcc-4.2.1 and clang-3.9.0 have it.  It is enabled by -W, which is 
put in

CFLAGS at WARNS >= 3, or by -Wsign-compare.

These compilers even complain about:

   int c;

   for (c = 0; c < 1U; c++)
   foo();

where it is extremely clear that c never gets converted to a wrong 
value

when it is promoted to unsigned for the comparison. Compilers should
only warn about sign mismatches if they can't figure out the ranges or
if they can figure out the ranges but dangerous promotiions occur.
Compilers do excessive unrolling and other optimizations of loops like
the above, and they must figure out the ranges for this.



I haven't looked at the code but it would seem like you can unsign c 
and avoid the cast.


That would be much worse than the cast.  The cast is at least in the
right place -- it unpoisons nitimems.  "Unsigning" c would poison C.


Yeah. This might introduce a domino effect though of changes.




As I said I hadn't looked at the code; the "c" is holding the return 
value of getopt() and later kvm_nlist() before getting reused as a loop 
index so it must be an int.


I would think it is such reuse of the same variable which is poisonous, 
although it does involve some efficiency.


Pedro.



Domino effect = fast poisoning.  The dominos collapse immediately, but
poisoning takes a long time to spread.  In K&R-1 size_t didn't even
exist and the type of sizeof() was unspecified.  size_t was born with
unsign poisoning a little later.  That is almost 40 years ago, but its
poisoning hasn't spread to many loop variables yet.  Full poisoning would
spread it to the closure of all uses of the loop variables, or better
stopped at the source of the poisoning.  In the above, the variable is
not used outside of the loop, so the closure is small and easy to see.

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"


svn commit: r315051 - in head: . gnu/usr.bin gnu/usr.bin/diff usr.bin usr.bin/diff usr.bin/diff/tests

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 05:01:29 2017
New Revision: 315051
URL: https://svnweb.freebsd.org/changeset/base/315051

Log:
  Import diff from OpenBSD and remove GNU diff
  
  Some of the modifications from the previous summer of code has been integrated
  Modification for compatibility with GNU diff output has been added
  
  Main difference with OpenBSD:
  Implement multiple GNU diff options:
  * --ignore-file-name-case
  * --no-ignore-file-name-case
  * --normal
  * --tabsize
  * --strip-trailing-cr
  Make diff -p compatible with GNU diff
  Implement diff -l
  Make diff -r compatible with GNU diff
  
  Capsicumize diffing 2 regular files
  Add a simple test suite
  
  Approved by:  AsiaBSDcon devsummit
  Obtained from:OpenBSD, GSoC
  Relnotes: yes

Added:
  head/usr.bin/diff/
  head/usr.bin/diff/Makefile   (contents, props changed)
  head/usr.bin/diff/TODO   (contents, props changed)
  head/usr.bin/diff/diff.1   (contents, props changed)
  head/usr.bin/diff/diff.c   (contents, props changed)
  head/usr.bin/diff/diff.h   (contents, props changed)
  head/usr.bin/diff/diffdir.c   (contents, props changed)
  head/usr.bin/diff/diffreg.c   (contents, props changed)
  head/usr.bin/diff/tests/
  head/usr.bin/diff/tests/Makefile   (contents, props changed)
  head/usr.bin/diff/tests/diff.sh   (contents, props changed)
  head/usr.bin/diff/tests/input1.in   (contents, props changed)
  head/usr.bin/diff/tests/input2.in   (contents, props changed)
  head/usr.bin/diff/tests/input_c1.in   (contents, props changed)
  head/usr.bin/diff/tests/input_c2.in   (contents, props changed)
  head/usr.bin/diff/tests/simple.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_b.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_e.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_i.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_n.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_p.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_u.out   (contents, props changed)
  head/usr.bin/diff/tests/simple_w.out   (contents, props changed)
  head/usr.bin/diff/tests/unified_.out   (contents, props changed)
  head/usr.bin/diff/tests/unified_c.out   (contents, props changed)
  head/usr.bin/diff/tests/unified_p.out   (contents, props changed)
  head/usr.bin/diff/xmalloc.c   (contents, props changed)
  head/usr.bin/diff/xmalloc.h   (contents, props changed)
Deleted:
  head/gnu/usr.bin/diff/
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/gnu/usr.bin/Makefile
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Mar 11 04:57:52 2017(r315050)
+++ head/ObsoleteFiles.inc  Sat Mar 11 05:01:29 2017(r315051)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20170311: remove GNU diff
+OLD_FILES+=usr/share/man/man7/diff.7.gz
 # 20170308: rename some tests
 OLD_FILES+=usr/tests/bin/pwait/pwait
 OLD_FILES+=usr/tests/usr.bin/timeout/timeout

Modified: head/UPDATING
==
--- head/UPDATING   Sat Mar 11 04:57:52 2017(r315050)
+++ head/UPDATING   Sat Mar 11 05:01:29 2017(r315051)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 ** SPECIAL WARNING: **
 
+20170311:
+   GNU diff has been replaced by a BSD licensed diff. Some features of GNU
+   diff has not been implemented, if those are needed a newer version of
+   GNU diff is available via the diffutils package under the gdiff name.
+
 20170302:
Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 4.0.0.
Please see the 20141231 entry below for information about prerequisites

Modified: head/gnu/usr.bin/Makefile
==
--- head/gnu/usr.bin/Makefile   Sat Mar 11 04:57:52 2017(r315050)
+++ head/gnu/usr.bin/Makefile   Sat Mar 11 05:01:29 2017(r315051)
@@ -17,7 +17,7 @@ SUBDIR.${MK_GDB}+=gdb
 .endif
 
 SUBDIR.${MK_GCC}+= cc
-SUBDIR.${MK_GNU_DIFF}+=diff diff3
+SUBDIR.${MK_GNU_DIFF}+=diff3
 SUBDIR.${MK_GNU_GREP}+=grep
 SUBDIR.${MK_GPL_DTC}+= dtc
 SUBDIR.${MK_TESTS}+=   tests

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Sat Mar 11 04:57:52 2017(r315050)
+++ head/usr.bin/Makefile   Sat Mar 11 05:01:29 2017(r315051)
@@ -34,6 +34,7 @@ SUBDIR=   alias \
csplit \
ctlstat \
cut \
+   diff \
dirname \
du \
elf2aout \

Added: head/usr.bin/diff/Makefile
==
--- /dev/null   00:00:00 1970   (empty, 

svn commit: r315052 - head

2017-03-10 Thread Emmanuel Vadot
Author: manu
Date: Sat Mar 11 05:12:39 2017
New Revision: 315052
URL: https://svnweb.freebsd.org/changeset/base/315052

Log:
  Document the removal of radeon and i915 old drm driver done in r315045.
  
  Reported by:  linimon

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sat Mar 11 05:01:29 2017(r315051)
+++ head/UPDATING   Sat Mar 11 05:12:39 2017(r315052)
@@ -52,6 +52,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 ** SPECIAL WARNING: **
 
 20170311:
+   The old drm (sys/dev/drm/) drivers for i915 and radeon have been
+   removed as the userland we provide cannot use them. The KMS version
+   (sys/dev/drm2) support the same hardware.
+
+20170311:
GNU diff has been replaced by a BSD licensed diff. Some features of GNU
diff has not been implemented, if those are needed a newer version of
GNU diff is available via the diffutils package under the gdiff name.
___
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: r315053 - head/usr.bin/man

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 05:56:50 2017
New Revision: 315053
URL: https://svnweb.freebsd.org/changeset/base/315053

Log:
  Add share/man if it exists to the MANPATH
  
  localbase is not consistent with base for manpages:
  /usr/local/man vs /usr/share/man adding share/man allows to fix that
  inconsistency and would permit to remove tons of patches/modifications in the
  ports tree

Modified:
  head/usr.bin/man/man.sh

Modified: head/usr.bin/man/man.sh
==
--- head/usr.bin/man/man.sh Sat Mar 11 05:12:39 2017(r315052)
+++ head/usr.bin/man/man.sh Sat Mar 11 05:56:50 2017(r315053)
@@ -771,6 +771,8 @@ search_path() {
case "$path" in
*/bin)  p="${path%/bin}/man"
add_to_manpath "$p"
+   p="${path%/bin}/share/man"
+   add_to_manpath "$p"
;;
*)  ;;
esac
___
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: r315054 - head/usr.bin/man

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 06:24:49 2017
New Revision: 315054
URL: https://svnweb.freebsd.org/changeset/base/315054

Log:
  Extend functionality MANPATH in man(1) to followup with apropos(1) from
  mandoc.
  
  If MANPATH begins with a colon, it is appended to the default list; if it ends
  with a colon, it is prepended to the default list; or if it contains two
  adjacent colons, the standard search path is inserted between the colons.  If
  none of these conditions are met, it overrides the standard search path.
  
  Import the MANPATH description from mandoc into the man(1) man page
  
  Reported by:  kargl
  MFC after:1 week

Modified:
  head/usr.bin/man/man.1
  head/usr.bin/man/man.sh

Modified: head/usr.bin/man/man.1
==
--- head/usr.bin/man/man.1  Sat Mar 11 05:56:50 2017(r315053)
+++ head/usr.bin/man/man.1  Sat Mar 11 06:24:49 2017(r315054)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 28, 2017
+.Dd March 11, 2017
 .Dt MAN 1
 .Os
 .Sh NAME
@@ -295,13 +295,22 @@ Corresponds to the
 .Fl m
 option.
 .It Ev MANPATH
-Used to find the location of the manual files.
-See
-.Xr manpath 1
-for additional information.
-Corresponds to the
-.Fl M
-option.
+The standard search path used by
+.Xr man 1
+may be changed by specifying a path in the
+.Ev MANPATH
+environment variable.
+Invalid paths, or paths without manual databases, are ignored.
+Overridden by
+.Fl M .
+If
+.Ev MANPATH
+begins with a colon, it is appended to the default list;
+if it ends with a colon, it is prepended to the default list;
+or if it contains two adjacent colons,
+the standard search path is inserted between the colons.
+If none of these conditions are met, it overrides the
+standard search path.
 .It Ev MANROFFSEQ
 Used to determine the preprocessors for the manual source before running
 .Xr nroff 1

Modified: head/usr.bin/man/man.sh
==
--- head/usr.bin/man/man.sh Sat Mar 11 05:56:50 2017(r315053)
+++ head/usr.bin/man/man.sh Sat Mar 11 06:24:49 2017(r315054)
@@ -68,7 +68,23 @@ build_manpath() {
 
# If the user has set a manpath, who are we to argue.
if [ -n "$MANPATH" ]; then
-   return
+   case "$MANPATH" in
+   *:) PREPEND_MANPATH=${MANPATH} ;;
+   :*) APPEND_MANPATH=${MANPATH} ;;
+   *::*)
+   PREPEND_MANPATH=${MANPATH%%::*}
+   APPEND_MANPATH=${MANPATH#*::}
+   ;;
+   *) return ;;
+   esac
+   fi
+
+   if [ -n "$PREPEND_MANPATH" ]; then
+   IFS=:
+   for path in $PREPEND_MANPATH; do
+   add_to_manpath "$path"
+   done
+   unset IFS
fi
 
search_path
@@ -82,6 +98,13 @@ build_manpath() {
 
parse_configs
 
+   if [ -n "$APPEND_MANPATH" ]; then
+   IFS=:
+   for path in $APPEND_MANPATH; do
+   add_to_manpath "$path"
+   done
+   unset IFS
+   fi
# Trim leading colon
MANPATH=${manpath#:}
 
___
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: r315055 - head/etc/mtree

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 06:27:06 2017
New Revision: 315055
URL: https://svnweb.freebsd.org/changeset/base/315055

Log:
  Add the diff to the tests mtree
  
  Reported by:  lwhsu

Modified:
  head/etc/mtree/BSD.tests.dist

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Sat Mar 11 06:24:49 2017
(r315054)
+++ head/etc/mtree/BSD.tests.dist   Sat Mar 11 06:27:06 2017
(r315055)
@@ -612,6 +612,8 @@
 ..
 cut
 ..
+diff
+..
 dirname
 ..
 file2c
___
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: r315056 - head/usr.bin/man

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 06:31:16 2017
New Revision: 315056
URL: https://svnweb.freebsd.org/changeset/base/315056

Log:
  Remove the warning when MANPATH is set in the environment
  
  The MANPATH environment variable behaviour is documented properly in the 
manpage
  and it now has extended to new feature that allows to make MANPATH env 
variable
  extending the default search path rather than overwriting it making the 
warning
  painful
  
  Reported by:  kargl
  MFC after:1 week

Modified:
  head/usr.bin/man/man.sh

Modified: head/usr.bin/man/man.sh
==
--- head/usr.bin/man/man.sh Sat Mar 11 06:27:06 2017(r315055)
+++ head/usr.bin/man/man.sh Sat Mar 11 06:31:16 2017(r315056)
@@ -261,10 +261,6 @@ manpath_usage() {
 # Usage: manpath_warnings
 # Display some warnings to stderr.
 manpath_warnings() {
-   if [ -z "$Lflag" -a -n "$MANPATH" ]; then
-   echo "(Warning: MANPATH environment variable set)" >&2
-   fi
-
if [ -n "$Lflag" -a -n "$MANLOCALES" ]; then
echo "(Warning: MANLOCALES environment variable set)" >&2
fi
___
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: r315057 - in head: . tools/build/mk tools/build/options usr.bin usr.bin/makewhatis usr.bin/man usr.bin/mandoc

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 06:51:21 2017
New Revision: 315057
URL: https://svnweb.freebsd.org/changeset/base/315057

Log:
  Remove the WITHOUT_MANDOCDB option
  
  mandoc database is activated since FreeBSD 11.0, let's remove the previous
  database format for FreeBSD 12.0

Deleted:
  head/tools/build/options/WITHOUT_MANDOCDB
  head/usr.bin/makewhatis/
  head/usr.bin/man/apropos.1
Modified:
  head/Makefile.inc1
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.bin/Makefile
  head/usr.bin/man/Makefile
  head/usr.bin/mandoc/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Mar 11 06:31:16 2017(r315056)
+++ head/Makefile.inc1  Sat Mar 11 06:51:21 2017(r315057)
@@ -1696,11 +1696,9 @@ _kerberos5_bootstrap_tools= \
 .endif
 
 # r283777 makewhatis(1) replaced with mandoc version which builds a database.
-.if ${MK_MANDOCDB} != "no"
 _libopenbsd?=  lib/libopenbsd
 _makewhatis=   usr.bin/mandoc
 ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
-.endif
 
 bootstrap-tools: .PHONY
 

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Mar 11 06:31:16 
2017(r315056)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Mar 11 06:51:21 
2017(r315057)
@@ -6671,10 +6671,6 @@ OLD_FILES+=usr/share/man/whatis
 OLD_FILES+=usr/share/openssl/man/whatis
 .endif
 
-.if ${MK_MANDOCDB} != no
-OLD_FILES+=usr/share/man/man1/makewhatis.1.gz
-.endif
-
 .if ${MK_NDIS} == no
 OLD_FILES+=usr/sbin/ndiscvt
 OLD_FILES+=usr/sbin/ndisgen

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Sat Mar 11 06:31:16 2017(r315056)
+++ head/usr.bin/Makefile   Sat Mar 11 06:51:21 2017(r315057)
@@ -237,9 +237,6 @@ SUBDIR.${MK_MAIL}+= mail
 SUBDIR.${MK_MAIL}+=msgs
 SUBDIR.${MK_MAKE}+=bmake
 SUBDIR.${MK_MAN_UTILS}+=   catman
-.if ${MK_MANDOCDB} == "no" # AND
-SUBDIR.${MK_MAN_UTILS}+=   makewhatis
-.endif
 SUBDIR.${MK_MAN_UTILS}+=   man
 SUBDIR.${MK_NETCAT}+=  nc
 SUBDIR.${MK_NIS}+= ypcat

Modified: head/usr.bin/man/Makefile
==
--- head/usr.bin/man/Makefile   Sat Mar 11 06:31:16 2017(r315056)
+++ head/usr.bin/man/Makefile   Sat Mar 11 06:51:21 2017(r315057)
@@ -1,17 +1,8 @@
 # $FreeBSD$
 
-.include 
-
 SCRIPTS= man.sh
 LINKS= ${BINDIR}/man ${BINDIR}/manpath
 
 MAN=   man.1 manpath.1 man.conf.5
 
-.if ${MK_MANDOCDB} == no
-LINKS+=${BINDIR}/man ${BINDIR}/apropos \
-   ${BINDIR}/man ${BINDIR}/whatis
-MAN+=  apropos.1
-MLINKS=apropos.1 whatis.1
-.endif
-
 .include 

Modified: head/usr.bin/mandoc/Makefile
==
--- head/usr.bin/mandoc/MakefileSat Mar 11 06:31:16 2017
(r315056)
+++ head/usr.bin/mandoc/MakefileSat Mar 11 06:51:21 2017
(r315057)
@@ -8,7 +8,7 @@ MDOCMLDIR=  ${.CURDIR}/../../contrib/mdoc
 PROG=  mandoc
 MAN=   mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 # roff.7
 MLINKS=mandoc.1 mdocml.1
-.if ${MK_MANDOCDB} != no && ${MK_MAN_UTILS} != no
+.if ${MK_MAN_UTILS} != no
 MAN+=  apropos.1 makewhatis.8
 MLINKS+=   apropos.1 whatis.1
 LINKS= ${BINDIR}/mandoc ${BINDIR}/whatis \
___
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: r315058 - head/share/man/man5

2017-03-10 Thread Baptiste Daroussin
Author: bapt
Date: Sat Mar 11 06:58:28 2017
New Revision: 315058
URL: https://svnweb.freebsd.org/changeset/base/315058

Log:
  Regenerate after r315057

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sat Mar 11 06:51:21 2017
(r315057)
+++ head/share/man/man5/src.conf.5  Sat Mar 11 06:58:28 2017
(r315058)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 313173 2017-02-03 20:17:54Z 
wblock
 .\" $FreeBSD$
-.Dd March 3, 2017
+.Dd March 11, 2017
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1169,16 +1169,6 @@ is set explicitly)
 .\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 266752 
2014-05-27 15:52:27Z gjb
 Set to not to install compressed man pages.
 Only the uncompressed versions will be installed.
-.It Va WITHOUT_MANDOCDB
-.\" from FreeBSD: head/tools/build/options/WITHOUT_MANDOCDB 306966 2016-10-10 
15:40:08Z emaste
-Use the version of
-.Xr makewhatis 1
-introduced in
-.Fx 2.1 ,
-instead of the
-.Xr makewhatis 8
-database and utilities from
-.Xr mandoc 1 .
 .It Va WITHOUT_MAN_UTILS
 .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 
00:07:21Z jkim
 Set to not build utilities for manual pages,
___
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: r315059 - in head/sys: arm/arm arm/at91 arm/include conf

2017-03-10 Thread Michal Meloun
Author: mmel
Date: Sat Mar 11 07:07:41 2017
New Revision: 315059
URL: https://svnweb.freebsd.org/changeset/base/315059

Log:
  Split overbloated machep.c to multiple files and do basic cleanup
  of these fragments.

Added:
  head/sys/arm/arm/machdep_boot.c
 - copied, changed from r315058, head/sys/arm/arm/machdep.c
  head/sys/arm/arm/machdep_kdb.c
 - copied, changed from r315058, head/sys/arm/arm/machdep.c
  head/sys/arm/arm/machdep_ptrace.c
 - copied, changed from r315058, head/sys/arm/arm/machdep.c
Modified:
  head/sys/arm/arm/machdep.c
  head/sys/arm/at91/at91_machdep.c
  head/sys/arm/include/machdep.h
  head/sys/conf/files.arm

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Sat Mar 11 06:58:28 2017(r315058)
+++ head/sys/arm/arm/machdep.c  Sat Mar 11 07:07:41 2017(r315059)
@@ -53,129 +53,43 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#if defined(LINUX_BOOT_ABI)
-#include 
-#endif
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 #ifdef FDT
-#include 
 #include 
-#include 
+#include 
 #endif
 
-#ifdef DDB
-#include 
-
-#if __ARM_ARCH >= 6
-
-DB_SHOW_COMMAND(cp15, db_show_cp15)
-{
-   u_int reg;
-
-   reg = cp15_midr_get();
-   db_printf("Cpu ID: 0x%08x\n", reg);
-   reg = cp15_ctr_get();
-   db_printf("Current Cache Lvl ID: 0x%08x\n",reg);
-
-   reg = cp15_sctlr_get();
-   db_printf("Ctrl: 0x%08x\n",reg);
-   reg = cp15_actlr_get();
-   db_printf("Aux Ctrl: 0x%08x\n",reg);
-
-   reg = cp15_id_pfr0_get();
-   db_printf("Processor Feat 0: 0x%08x\n", reg);
-   reg = cp15_id_pfr1_get();
-   db_printf("Processor Feat 1: 0x%08x\n", reg);
-   reg = cp15_id_dfr0_get();
-   db_printf("Debug Feat 0: 0x%08x\n", reg);
-   reg = cp15_id_afr0_get();
-   db_printf("Auxiliary Feat 0: 0x%08x\n", reg);
-   reg = cp15_id_mmfr0_get();
-   db_printf("Memory Model Feat 0: 0x%08x\n", reg);
-   reg = cp15_id_mmfr1_get();
-   db_printf("Memory Model Feat 1: 0x%08x\n", reg);
-   reg = cp15_id_mmfr2_get();
-   db_printf("Memory Model Feat 2: 0x%08x\n", reg);
-   reg = cp15_id_mmfr3_get();
-   db_printf("Memory Model Feat 3: 0x%08x\n", reg);
-   reg = cp15_ttbr_get();
-   db_printf("TTB0: 0x%08x\n", reg);
-}
-
-DB_SHOW_COMMAND(vtop, db_show_vtop)
-{
-   u_int reg;
-
-   if (have_addr) {
-   cp15_ats1cpr_set(addr);
-   reg = cp15_par_get();
-   db_printf("Physical address reg: 0x%08x\n",reg);
-   } else
-   db_printf("show vtop \n");
-}
-#endif /* __ARM_ARCH >= 6 */
-#endif /* DDB */
-
 #ifdef DEBUG
 #definedebugf(fmt, args...) printf(fmt, ##args)
 #else
@@ -204,10 +118,7 @@ int _min_bzero_size = 0;
 extern int *end;
 
 #ifdef FDT
-static char *loader_envp;
-
 vm_paddr_t pmap_pa;
-
 #if __ARM_ARCH >= 6
 vm_offset_t systempage;
 vm_offset_t irqstack;
@@ -220,64 +131,21 @@ vm_offset_t abtstack;
  * stacks etc.), uprounded to be divisible by 4.
  */
 #define KERNEL_PT_MAX  78
-
 static struct pv_addr kernel_pt_table[KERNEL_PT_MAX];
-
 struct pv_addr systempage;
 static struct pv_addr msgbufpv;
 struct pv_addr irqstack;
 struct pv_addr undstack;
 struct pv_addr abtstack;
 static struct pv_addr kernelstack;
-#endif
-#endif
-
-#if defined(LINUX_BOOT_ABI)
-#define LBABI_MAX_BANKS10
+#endif /* __ARM_ARCH >= 6 */
+#endif /* FDT */
 
-#define CMDLINE_GUARD "FreeBSD:"
-uint32_t board_id;
-struct arm_lbabi_tag *atag_list;
-char linux_command_line[LBABI_MAX_COMMAND_LINE + 1];
-char atags[LBABI_MAX_COMMAND_LINE * 2];
-uint32_t memstart[LBABI_MAX_BANKS];
-uint32_t memsize[LBABI_MAX_BANKS];
-uint32_t membanks;
-#endif
 #ifdef MULTIDELAY
 static delay_func *delay_impl;
 static void *delay_arg;
 #endif
 
-static uint32_t board_revision;
-/* hex representation of uint64_t */
-static char board_serial[32];
-
-SYSCTL_NODE(_hw, OID_AUTO, board, CTLFLAG_RD, 0, "Board attributes");
-SYSCTL_UINT(_hw_board, OID_AUTO, revision, CTLFLAG_RD,
-&board_revision, 0, "Board revision");
-SYSCTL_STRING(_hw_board, OID_AUTO, serial, CTLFLAG_RD,
-board_serial, 0, "Board serial");
-
-int vfp_exists;
-SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
-&vfp_exists, 0, "Floating point support enabled");
-
-void
-board_set_serial(uint64_t serial)
-{
-
-