svn commit: r363478 - head/usr.sbin/rwhod

2020-07-24 Thread Juli Mallett
Author: jmallett
Date: Fri Jul 24 16:58:13 2020
New Revision: 363478
URL: https://svnweb.freebsd.org/changeset/base/363478

Log:
  Remove reference to nlist(3) missed in SCCS revision 5.26 by mckusick
  when converting rwhod(8) to using kern.boottime ather than extracting
  the boot time from kernel memory directly.
  
  Reviewed by:  imp

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

Modified: head/usr.sbin/rwhod/rwhod.8
==
--- head/usr.sbin/rwhod/rwhod.8 Fri Jul 24 16:44:35 2020(r363477)
+++ head/usr.sbin/rwhod/rwhod.8 Fri Jul 24 16:58:13 2020(r363478)
@@ -215,15 +215,6 @@ format described above.
 .Pp
 Status messages are generated approximately once every
 3 minutes.
-The
-.Nm
-utility performs an
-.Xr nlist 3
-on
-.Pa /boot/kernel/kernel
-every 30 minutes to guard against
-the possibility that this file is not the system
-image currently operating.
 .Sh SEE ALSO
 .Xr ruptime 1 ,
 .Xr rwho 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362236 - head/usr.sbin/mpsutil

2020-06-16 Thread Juli Mallett
Author: jmallett
Date: Tue Jun 16 19:21:28 2020
New Revision: 362236
URL: https://svnweb.freebsd.org/changeset/base/362236

Log:
  Improve unit parsing of mpsutil.
  
  Previously, it used atoi(3) to parse the unit parameter, which would silently
  yield a unit of 0 in the presence of an invalid unit number.  As most users of
  mpsutil(8) are likely to have at least a unit 0, this is could have confusing
  results.
  
  This behaviour was particularly unintuitive if one incorrectly passed an
  adapter device name, or a device path, instead of a unit number.  In addition
  to using strtoumax(3) instead of atoi(3) to parse unit numbers, support
  stripping a device name (e.g. mps1) or path (e.g. /dev/mps2) to just its unit
  number.
  
  Reviewed by:  scottl (earlier version)

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

Modified: head/usr.sbin/mpsutil/mpsutil.c
==
--- head/usr.sbin/mpsutil/mpsutil.c Tue Jun 16 18:39:56 2020
(r362235)
+++ head/usr.sbin/mpsutil/mpsutil.c Tue Jun 16 19:21:28 2020
(r362236)
@@ -37,6 +37,8 @@ __RCSID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -91,6 +93,8 @@ int
 main(int ac, char **av)
 {
struct mpsutil_command **cmd;
+   uintmax_t unit;
+   char *end;
int ch;
 
is_mps = !strcmp(getprogname(), "mpsutil");
@@ -98,7 +102,17 @@ main(int ac, char **av)
while ((ch = getopt(ac, av, "u:h?")) != -1) {
switch (ch) {
case 'u':
-   mps_unit = atoi(optarg);
+   if (strncmp(optarg, _PATH_DEV, strlen(_PATH_DEV)) == 0) 
{
+   optarg += strlen(_PATH_DEV);
+   if (strncmp(optarg, is_mps ? "mps" : "mpr", 3) 
!= 0)
+   errx(1, "Invalid device: %s", optarg);
+   }
+   if (strncmp(optarg, is_mps ? "mps" : "mpr", 3) == 0)
+   optarg += 3;
+   unit = strtoumax(optarg, , 10);
+   if (*end != '\0' || unit == UINTMAX_MAX || unit > 
INT_MAX)
+   errx(1, "Invalid unit: %s", optarg);
+   mps_unit = unit;
break;
case 'h':
case '?':
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r345222 - head/sys/mips/sibyte

2019-03-16 Thread Juli Mallett
Author: jmallett
Date: Sat Mar 16 06:12:28 2019
New Revision: 345222
URL: https://svnweb.freebsd.org/changeset/base/345222

Log:
  Remove empty directory left by r342255.

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


svn commit: r345221 - in head/sys/mips: include mips

2019-03-16 Thread Juli Mallett
Author: jmallett
Date: Sat Mar 16 06:09:45 2019
New Revision: 345221
URL: https://svnweb.freebsd.org/changeset/base/345221

Log:
  Remove obsolete wrappers for 64-bit loads/stores which were only used by the
  removed (r342255) SiByte port.
  
  Reviewed by:  imp

Modified:
  head/sys/mips/include/cpufunc.h
  head/sys/mips/mips/support.S

Modified: head/sys/mips/include/cpufunc.h
==
--- head/sys/mips/include/cpufunc.h Sat Mar 16 04:24:02 2019
(r345220)
+++ head/sys/mips/include/cpufunc.h Sat Mar 16 06:09:45 2019
(r345221)
@@ -371,27 +371,19 @@ get_intr_mask(void)
return (mips_rd_status() & MIPS_SR_INT_MASK);
 }
 
-#if defined(__GNUC__) && !defined(__mips_o32)
-#definemips3_ld(a) (*(const volatile uint64_t *)(a))
-#definemips3_sd(a, v)  (*(volatile uint64_t *)(a) = (v))
-#else
-uint64_t mips3_ld(volatile uint64_t *va);
-void mips3_sd(volatile uint64_t *, uint64_t);
-#endif /* __GNUC__ */
-
 #endif /* _KERNEL */
 
 #definereadb(va)   (*(volatile uint8_t *) (va))
 #definereadw(va)   (*(volatile uint16_t *) (va))
 #definereadl(va)   (*(volatile uint32_t *) (va))
-#if defined(__GNUC__) && !defined(__mips_o32)
+#if !defined(__mips_o32)
 #definereadq(a)(*(volatile uint64_t *)(a))
 #endif
  
 #definewriteb(va, d)   (*(volatile uint8_t *) (va) = (d))
 #definewritew(va, d)   (*(volatile uint16_t *) (va) = (d))
 #definewritel(va, d)   (*(volatile uint32_t *) (va) = (d))
-#if defined(__GNUC__) && !defined(__mips_o32)
+#if !defined(__mips_o32)
 #definewriteq(va, d)   (*(volatile uint64_t *) (va) = (d))
 #endif
 

Modified: head/sys/mips/mips/support.S
==
--- head/sys/mips/mips/support.SSat Mar 16 04:24:02 2019
(r345220)
+++ head/sys/mips/mips/support.SSat Mar 16 06:09:45 2019
(r345221)
@@ -865,78 +865,3 @@ LEAF(longjmp)
jr  ra
li  v0, 1   # longjmp return
 END(longjmp)
-
-LEAF(mips3_ld)
-   .set push
-   .set noreorder
-   .set mips64
-#if defined(__mips_o32)
-   mfc0t0, MIPS_COP_0_STATUS   # turn off interrupts
-   and t1, t0, ~(MIPS_SR_INT_IE)
-   mtc0t1, MIPS_COP_0_STATUS
-   COP0_SYNC
-   nop
-   nop
-   nop
-
-   ld  v0, 0(a0)
-#if _BYTE_ORDER == _BIG_ENDIAN
-   dsllv1, v0, 32
-   dsrav1, v1, 32  # low word in v1
-   dsrav0, v0, 32  # high word in v0
-#else
-   dsrav1, v0, 32  # high word in v1
-   dsllv0, v0, 32
-   dsrav0, v0, 32  # low word in v0
-#endif
-
-   mtc0t0, MIPS_COP_0_STATUS   # restore intr status.
-   COP0_SYNC
-   nop
-#else /* !__mips_o32 */
-   ld  v0, 0(a0)
-#endif /* !__mips_o32 */
-
-   jr  ra
-   nop
-   .set pop
-END(mips3_ld)
-
-LEAF(mips3_sd)
-   .set push
-   .set mips64
-   .set noreorder
-#if defined(__mips_o32)
-   mfc0t0, MIPS_COP_0_STATUS   # turn off interrupts
-   and t1, t0, ~(MIPS_SR_INT_IE)
-   mtc0t1, MIPS_COP_0_STATUS
-   COP0_SYNC
-   nop
-   nop
-   nop
-
-   # NOTE: a1 is padding!
-
-#if _BYTE_ORDER == _BIG_ENDIAN
-   dslla2, a2, 32  # high word in a2
-   dslla3, a3, 32  # low word in a3
-   dsrla3, a3, 32
-#else
-   dslla2, a2, 32  # low word in a2
-   dsrla2, a2, 32
-   dslla3, a3, 32  # high word in a3
-#endif
-   or  a1, a2, a3
-   sd  a1, 0(a0)
-
-   mtc0t0, MIPS_COP_0_STATUS   # restore intr status.
-   COP0_SYNC
-   nop
-#else /* !__mips_o32 */
-   sd  a1, 0(a0)
-#endif /* !__mips_o32 */
-
-   jr  ra
-   nop
-   .set pop
-END(mips3_sd)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r344129 - head

2019-02-14 Thread Juli Mallett
On Thu, 14 Feb 2019 at 12:42, Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > On Thu, Feb 14, 2019 at 12:00:22PM -0700, Warner Losh wrote:
> > > On Thu, Feb 14, 2019 at 11:29 AM Rodney W. Grimes <
> > > > >   Differential Review: https://reviews.freebsd.org/D19193
> > > >
> > > > You sited a differential, but not give any attribution
> > > > to the external source :-(
> > > >
> > >
> > > The differential review has that information.
> >
> > External contributors should be recognized by having their names appear
> > in the commit logs.
>
> We even bother to put a special line in the commit template
> for this.  Further it has been standard operating procedure
> for at least as long as I have been back that submitters
> are infact recognized in commit messages.
>

Yeah, Phabricator must not become a second source of truth for who actually
did the work, which we had at least one case of recently.  That's no good.
In this case, the difference between a patch and a bug report is
indistinguishable ("word X is misspelt at offset Y in file Z" is probably
not really Phabricator fodder at the scale of a single instance), but it
should plainly either be a Reported byline if not a Submitted one in the
commit message itself.

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


Re: svn commit: r335270 - head/lib/liby

2018-06-17 Thread Juli Mallett
On 17 June 2018 at 08:07, Rodney W. Grimes 
wrote:

> > > > > > > >> Author: eadler
> > > > > > > >> Date: Sat Jun 16 23:50:34 2018
> > > > > > > >> New Revision: 335270
> > > > > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270
> > > > > > > >>
> > > > > > > >> Log:
> > > > > > > >>   liby: build with WARNS=6
> > > > > > > >>
> > > > > > > >>   Tested with amd64, arm64, i386, mips
> > > > > > > >>
> > > > > > > >> Added:
> > > > > > > >>   head/lib/liby/yyerror.h   (contents, props changed)
> >
> > Just says added, not copied from some file, so VCS here does
> > nothing for saying where this file came from.
> >
> > > > > > > >> Modified:
> > > > > > > >>   head/lib/liby/Makefile
> > > > > > > >>   head/lib/liby/main.c
> > > > > > > >>   head/lib/liby/yyerror.c
> > > > > > > >>
> > > > > > > >> Modified: head/lib/liby/Makefile
> > > > > > > >> ==
> ==
> > > > > > ==
> > > > > > > >> --- head/lib/liby/MakefileSat Jun 16 23:49:22 2018
> > > > > > (r335269)
> > > > > > > >> +++ head/lib/liby/MakefileSat Jun 16 23:50:34 2018
> > > > > > (r335270)
> > > > > > > >> @@ -5,6 +5,4 @@ LIB=  y
> > > > > > > >>  SRCS=main.c yyerror.c
> > > > > > > >>  NO_PIC=
> > > > > > > >>
> > > > > > > >> -WARNS?=  1
> > > > > > > >> -
> > > > > > > >>  .include 
> > > > > > > >>
> > > > > > > >> Modified: head/lib/liby/main.c
> > > > > > > >> ==
> ==
> > > > > > ==
> > > > > > > >> --- head/lib/liby/main.c  Sat Jun 16 23:49:22 2018
> > > > > > (r335269)
> > > > > > > >> +++ head/lib/liby/main.c  Sat Jun 16 23:50:34 2018
> > > > > > (r335270)
> > > > > > > >> @@ -32,16 +32,17 @@
> > > > > > > >>  #include 
> > > > > > > >>  __FBSDID("$FreeBSD$");
> > > > > > > >>
> > > > > > > >> -#ifndef lint
> > > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint)
> > > > > > > >>  static char sccsid[] = "@(#)main.c   8.1 (Berkeley)
> 6/4/93";
> > > > > > > >> -#endif /* not lint */
> > > > > > > >> +#endif /* LIBC_SCCS and not lint */
> > > > > > > >>
> > > > > > > >>  #include 
> > > > > > > >>
> > > > > > > >> -int yyparse(void);
> > > > > > > >> +#include "yyerror.h"
> > > > > > > >>
> > > > > > > >>  int
> > > > > > > >>  main(void)
> > > > > > > >>  {
> > > > > > > >> +
> > > > > > > >>   exit(yyparse());
> > > > > > > >>  }
> > > > > > > >>
> > > > > > > >> Modified: head/lib/liby/yyerror.c
> > > > > > > >> ==
> ==
> > > > > > ==
> > > > > > > >> --- head/lib/liby/yyerror.c   Sat Jun 16 23:49:22 2018
> > > > > > (r335269)
> > > > > > > >> +++ head/lib/liby/yyerror.c   Sat Jun 16 23:50:34 2018
> > > > > > (r335270)
> > > > > > > >> @@ -32,16 +32,18 @@
> > > > > > > >>  #include 
> > > > > > > >>  __FBSDID("$FreeBSD$");
> > > > > > > >>
> > > > > > > >> -#ifndef lint
> > > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint)
> > > > > > > >>  static char sccsid[] = "@(#)yyerror.c8.1 (Berkeley)
> > > > 6/4/93";
> > > > > > > >> -#endif /* not lint */
> > > > > > > >> +#endif /* LIBC_SCCS and not lint */
> > > > > > > >>
> > > > > > > >>  #include 
> > > > > > > >>
> > > > > > > >> +#include "yyerror.h"
> > > > > > > >> +
> > > > > > > >>  int
> > > > > > > >> -yyerror(msg)
> > > > > > > >> -char *msg;
> > > > > > > >> +yyerror(const char *msg)
> > > > > > > >>  {
> > > > > > > >> - (void)fprintf(stderr, "%s\n", msg);
> > > > > > > >> +
> > > > > > > >> + fprintf(stderr, "%s\n", msg);
> > > > > > > >>   return(0);
> > > > > > > >>  }
> > > > > > > >>
> > > > > > > >> Added: head/lib/liby/yyerror.h
> > > > > > > >> ==
> ==
> > > > > > ==
> > > > > > > >> --- /dev/null 00:00:00 1970   (empty, because file is newly
> added)
> > > > > > > >> +++ head/lib/liby/yyerror.h   Sat Jun 16 23:50:34 2018
> > > > > > (r335270)
> > > > > > > >> @@ -0,0 +1,36 @@
> > > > > > > >
> > > > > > > > Where did this file come from
> > > > > > >
> > > > > > > I added a header file instead of keeping the prototypes in the
> .c
> > > > > > > files. Is something wrong with that?
> > > > > >
> > > > > > If you extracted part of a c file and placed it in a .h file, you
> > > > > > should add a
> > > > > >  * from:pathname
> > > > > > comment to this yyerror.h
> > > > > >
> > > > >
> > > > > Rod,
> > > > >
> > > > > It's two prototypes.  For functions that are extern.  Including
> the UCB
> > > > > copyright isn't even necessary, but seems reasonable.
> > > >
> > > > Actually including a 1990/1993 UCB copyright is -exactly- why
> > > > the from: line should be there.  If he had assigned his own
> > > > copyright to this I wouldn't of batted an eye, but he didn't,
> > > > which means he copied it from someplace.  I would like to have
> > > > that someplace clearly documented as has always historically
> > > > been 

Re: svn commit: r335270 - head/lib/liby

2018-06-16 Thread Juli Mallett
On 16 June 2018 at 20:06, Rodney W. Grimes 
wrote:

> > On 16 June 2018 at 19:43, Rodney W. Grimes  net>
> > wrote:
> >
> > > > On 16 June 2018 at 18:10, Rodney W. Grimes
> > > >  wrote:
> > > > > [ Charset UTF-8 unsupported, converting... ]
> > > > >> Author: eadler
> > > > >> Date: Sat Jun 16 23:50:34 2018
> > > > >> New Revision: 335270
> > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270
> > > > >>
> > > > >> Log:
> > > > >>   liby: build with WARNS=6
> > > > >>
> > > > >>   Tested with amd64, arm64, i386, mips
> > > > >>
> > > > >> Added:
> > > > >>   head/lib/liby/yyerror.h   (contents, props changed)
> > > > >> Modified:
> > > > >>   head/lib/liby/Makefile
> > > > >>   head/lib/liby/main.c
> > > > >>   head/lib/liby/yyerror.c
> > > > >>
> > > > >> Modified: head/lib/liby/Makefile
> > > > >> 
> > > ==
> > > > >> --- head/lib/liby/MakefileSat Jun 16 23:49:22 2018
> > > (r335269)
> > > > >> +++ head/lib/liby/MakefileSat Jun 16 23:50:34 2018
> > > (r335270)
> > > > >> @@ -5,6 +5,4 @@ LIB=  y
> > > > >>  SRCS=main.c yyerror.c
> > > > >>  NO_PIC=
> > > > >>
> > > > >> -WARNS?=  1
> > > > >> -
> > > > >>  .include 
> > > > >>
> > > > >> Modified: head/lib/liby/main.c
> > > > >> 
> > > ==
> > > > >> --- head/lib/liby/main.c  Sat Jun 16 23:49:22 2018
> > > (r335269)
> > > > >> +++ head/lib/liby/main.c  Sat Jun 16 23:50:34 2018
> > > (r335270)
> > > > >> @@ -32,16 +32,17 @@
> > > > >>  #include 
> > > > >>  __FBSDID("$FreeBSD$");
> > > > >>
> > > > >> -#ifndef lint
> > > > >> +#if defined(LIBC_SCCS) && !defined(lint)
> > > > >>  static char sccsid[] = "@(#)main.c   8.1 (Berkeley) 6/4/93";
> > > > >> -#endif /* not lint */
> > > > >> +#endif /* LIBC_SCCS and not lint */
> > > > >>
> > > > >>  #include 
> > > > >>
> > > > >> -int yyparse(void);
> > > > >> +#include "yyerror.h"
> > > > >>
> > > > >>  int
> > > > >>  main(void)
> > > > >>  {
> > > > >> +
> > > > >>   exit(yyparse());
> > > > >>  }
> > > > >>
> > > > >> Modified: head/lib/liby/yyerror.c
> > > > >> 
> > > ==
> > > > >> --- head/lib/liby/yyerror.c   Sat Jun 16 23:49:22 2018
> > > (r335269)
> > > > >> +++ head/lib/liby/yyerror.c   Sat Jun 16 23:50:34 2018
> > > (r335270)
> > > > >> @@ -32,16 +32,18 @@
> > > > >>  #include 
> > > > >>  __FBSDID("$FreeBSD$");
> > > > >>
> > > > >> -#ifndef lint
> > > > >> +#if defined(LIBC_SCCS) && !defined(lint)
> > > > >>  static char sccsid[] = "@(#)yyerror.c8.1 (Berkeley)
> 6/4/93";
> > > > >> -#endif /* not lint */
> > > > >> +#endif /* LIBC_SCCS and not lint */
> > > > >>
> > > > >>  #include 
> > > > >>
> > > > >> +#include "yyerror.h"
> > > > >> +
> > > > >>  int
> > > > >> -yyerror(msg)
> > > > >> -char *msg;
> > > > >> +yyerror(const char *msg)
> > > > >>  {
> > > > >> - (void)fprintf(stderr, "%s\n", msg);
> > > > >> +
> > > > >> + fprintf(stderr, "%s\n", msg);
> > > > >>   return(0);
> > > > >>  }
> > > > >>
> > > > >> Added: head/lib/liby/yyerror.h
> > > > >> 
> > > ==
> > > > >> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> > > > >> +++ head/lib/liby/yyerror.h   Sat Jun 16 23:50:34 2018
> > > (r335270)
> > > > >> @@ -0,0 +1,36 @@
> > > > >
> > > > > Where did this file come from
> > > >
> > > > I added a header file instead of keeping the prototypes in the .c
> > > > files. Is something wrong with that?
> > >
> > > If you extracted part of a c file and placed it in a .h file, you
> > > should add a
> > >  * from:pathname
> > > comment to this yyerror.h
> > >
> >
> > Rod,
> >
> > It's two prototypes.  For functions that are extern.  Including the UCB
> > copyright isn't even necessary, but seems reasonable.
>
> Actually including a 1990/1993 UCB copyright is -exactly- why
> the from: line should be there.  If he had assigned his own
> copyright to this I wouldn't of batted an eye, but he didn't,
> which means he copied it from someplace.  I would like to have
> that someplace clearly documented as has always historically
> been done when copying parts of or whole files around the
> BSD source tree.
>
> His commit message also lacked any details about this move
> of code, it just said, build with WARNS=6.
>
> >
> > No, people do not need to add "from:" notes when adding a header to
> provide
> > prototypes for extern functions.
>
> They do if they infact copied a portion of another file...


I don't think this has been a FreeBSD norm since at least the late '90s for
both trivial and nontrivial refactoring.  We have good version control.

If this is the expectation, I'd love it if you could find somewhere it's
written down, or if it's not, start an FCP to get it written down.  It
seems important for this to be 

Re: svn commit: r335270 - head/lib/liby

2018-06-16 Thread Juli Mallett
On 16 June 2018 at 19:43, Rodney W. Grimes 
wrote:

> > On 16 June 2018 at 18:10, Rodney W. Grimes
> >  wrote:
> > > [ Charset UTF-8 unsupported, converting... ]
> > >> Author: eadler
> > >> Date: Sat Jun 16 23:50:34 2018
> > >> New Revision: 335270
> > >> URL: https://svnweb.freebsd.org/changeset/base/335270
> > >>
> > >> Log:
> > >>   liby: build with WARNS=6
> > >>
> > >>   Tested with amd64, arm64, i386, mips
> > >>
> > >> Added:
> > >>   head/lib/liby/yyerror.h   (contents, props changed)
> > >> Modified:
> > >>   head/lib/liby/Makefile
> > >>   head/lib/liby/main.c
> > >>   head/lib/liby/yyerror.c
> > >>
> > >> Modified: head/lib/liby/Makefile
> > >> 
> ==
> > >> --- head/lib/liby/MakefileSat Jun 16 23:49:22 2018
> (r335269)
> > >> +++ head/lib/liby/MakefileSat Jun 16 23:50:34 2018
> (r335270)
> > >> @@ -5,6 +5,4 @@ LIB=  y
> > >>  SRCS=main.c yyerror.c
> > >>  NO_PIC=
> > >>
> > >> -WARNS?=  1
> > >> -
> > >>  .include 
> > >>
> > >> Modified: head/lib/liby/main.c
> > >> 
> ==
> > >> --- head/lib/liby/main.c  Sat Jun 16 23:49:22 2018
> (r335269)
> > >> +++ head/lib/liby/main.c  Sat Jun 16 23:50:34 2018
> (r335270)
> > >> @@ -32,16 +32,17 @@
> > >>  #include 
> > >>  __FBSDID("$FreeBSD$");
> > >>
> > >> -#ifndef lint
> > >> +#if defined(LIBC_SCCS) && !defined(lint)
> > >>  static char sccsid[] = "@(#)main.c   8.1 (Berkeley) 6/4/93";
> > >> -#endif /* not lint */
> > >> +#endif /* LIBC_SCCS and not lint */
> > >>
> > >>  #include 
> > >>
> > >> -int yyparse(void);
> > >> +#include "yyerror.h"
> > >>
> > >>  int
> > >>  main(void)
> > >>  {
> > >> +
> > >>   exit(yyparse());
> > >>  }
> > >>
> > >> Modified: head/lib/liby/yyerror.c
> > >> 
> ==
> > >> --- head/lib/liby/yyerror.c   Sat Jun 16 23:49:22 2018
> (r335269)
> > >> +++ head/lib/liby/yyerror.c   Sat Jun 16 23:50:34 2018
> (r335270)
> > >> @@ -32,16 +32,18 @@
> > >>  #include 
> > >>  __FBSDID("$FreeBSD$");
> > >>
> > >> -#ifndef lint
> > >> +#if defined(LIBC_SCCS) && !defined(lint)
> > >>  static char sccsid[] = "@(#)yyerror.c8.1 (Berkeley) 6/4/93";
> > >> -#endif /* not lint */
> > >> +#endif /* LIBC_SCCS and not lint */
> > >>
> > >>  #include 
> > >>
> > >> +#include "yyerror.h"
> > >> +
> > >>  int
> > >> -yyerror(msg)
> > >> -char *msg;
> > >> +yyerror(const char *msg)
> > >>  {
> > >> - (void)fprintf(stderr, "%s\n", msg);
> > >> +
> > >> + fprintf(stderr, "%s\n", msg);
> > >>   return(0);
> > >>  }
> > >>
> > >> Added: head/lib/liby/yyerror.h
> > >> 
> ==
> > >> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> > >> +++ head/lib/liby/yyerror.h   Sat Jun 16 23:50:34 2018
> (r335270)
> > >> @@ -0,0 +1,36 @@
> > >
> > > Where did this file come from
> >
> > I added a header file instead of keeping the prototypes in the .c
> > files. Is something wrong with that?
>
> If you extracted part of a c file and placed it in a .h file, you
> should add a
>  * from:pathname
> comment to this yyerror.h
>

Rod,

It's two prototypes.  For functions that are extern.  Including the UCB
copyright isn't even necessary, but seems reasonable.

No, people do not need to add "from:" notes when adding a header to provide
prototypes for extern functions.

Juli.


> What flagged me was we shouldnt just have spontanious files arriving
> from 1990/1993 UCB.
>
> Thanks,
> Rod
>
> @@ -0,0 +1,36 @@
> +/*-
> + * SPDX-License-Identifier: BSD-3-Clause
> + *
> + * Copyright (c) 1990, 1993
> + * The Regents of the University of California.  All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
>
> --
> Rod Grimes
> rgri...@freebsd.org
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335091 - head/sbin/nvmecontrol

2018-06-13 Thread Juli Mallett
On 13 June 2018 at 22:35, Rodney W. Grimes 
wrote:

> > On 13 June 2018 at 20:28, Rodney W. Grimes  net>
> > wrote:
> >
> > > > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes <
> ...
> > > > > > @@ -1,7 +1,8 @@
> > > > > >  /*-
> > > > > > - * Copyright (c) 2017 Netflix, Inc
> > > > > > - * All rights reserved.
> > > > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> > > > > >   *
> > > > > > + * Copyright (C) 2018 Netflix
> > > > >
> > > > > You moved a copyright forward, that is not proper to do.
> > > > >
> > > >
> > > > Thought it was. I honestly don't care where (nor does my employer),
> so if
> > > > you want to tweak it to be more conforming, be my guest.
> > >
> > > You can add a new date to the end of a list, but you should always
> > > retain the oldest date, and many opinions are that all dates should
> > > be retained unless they are continuous.
> > >
> >
> > Do you have a citation for this, Rod?  I ask because my impression was
> that
> > although it has often been done, and at one point may legitimately have
> > been required, it is not any longer so.  I'd love to have a concrete
> source
> > on this, though.
>
> One place to start is circ15:
> https://www.copyright.gov/circs/circ15a.pdf
>
> Fundemental principle of copyright protections duration are from -first-
> date of publication, that is covered in USC 17.  If you miss represent
> that date in your copyright your copyright can be held invalid.
> The real smoking gun is:
> 17 USC 401 b (2):
> the year of first publication of the work; in the
> case of compilations or derivative works incorporating
> previously published material, the year date of first
> publication of the compilation or derivative work is
> sufficient. The year date may be omitted where a pictorial,
> graphic, or sculptural work, with accompanying text matter,
> if any, is reproduced in or on greeting cards, postcards,
> stationery, jewelry, dolls, toys, or any useful articles; and
>
> The interpretation of compilation or derivative does open a grey
> area here in software, and I can see how one might consider a
> patch to create a derived work.
>

Per your quote:
"the year of first publication of the work; in the
case of compilations or derivative works incorporating
previously published material, the year date of first
publication of the compilation or derivative work is
sufficient."

It seems to plainly suggest listing one year, not several years, and
certainly not by some convoluted scheme.

We're not lawyers.  I'm not sure this is a useful discussion.  I'd love a
citation for the multiple-years scheme you describe, which does not seem to
be in USC 17.


There is case law that putting a date later than first publication
> appears as an attempt to move the duration of your protection
> to be longer than it really should be.
>
> https://www.copyright.gov/comp3/chap2200/ch2200-notice.pdf
> At 2202.2(A) Advantages to Using Notice on Post-Berne Works
> "It identifies the year of first publication,
> which may be used to determine the term of copyright
> protection in the case of an anonymous work,
> a pseudonymous work, or a work made for hire."
>
> Much of our work, and in this case of Netflix and these
> files, they are defanitly works made for hire, so this
> applies and identifying first date of publication is
> important.
>
> There is also:
> At 2203.1 Works First Published Between January 1, 1978 and February 28,
> 1989
> This Applies to some of our code, as it has First publications
> in these date ranges, boils down to even though Berne says you dont
> have to have a notice, if you first published the work in this time
> frame you had to have a notice then, and you still have to have a
> notice now.
>
> Yes, Disney and others have done fun stuff with copyrights on *movies*,
> but that has other complications doing with re-mixes and all sorts of other
> things that make it possible for them to claim it is a new creative
> work, not just a revision of an old work.
>
> I could re research the case law if you really want more.
>
>
> > > It would be much simpler for you to commit:
> > > - * Copyright (C) 2018 Netflix
> > > + * Copyright (C) 2017-2018 Netflix
> > >
> > > Than for me to get approval: bde, phk.
> > >
> > > Thanks.
> > > Rod
> > >
> > > >
> > > > > Not sure about dropping the , Inc either.
> > > >
> > > >
> > > > Doesn't matter. Different Netflix committers do different things and
> I
> > > was
> > > > trying to move towards uniformity.
> > >
> > > Ok
> > >
> > > > Warner
> > >
> > > --
> > > Rod Grimes
> > > rgri...@freebsd.org
> > >
> > >
>
> --
> Rod Grimes
> rgri...@freebsd.org
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r335091 - head/sbin/nvmecontrol

2018-06-13 Thread Juli Mallett
On 13 June 2018 at 20:28, Rodney W. Grimes 
wrote:

> > On Wed, Jun 13, 2018 at 9:03 PM, Rodney W. Grimes <
> > free...@pdx.rh.cn85.dnsmgr.net> wrote:
> >
> > > > Author: imp
> > > > Date: Wed Jun 13 22:00:02 2018
> > > > New Revision: 335091
> > > > URL: https://svnweb.freebsd.org/changeset/base/335091
> > > >
> > > > Log:
> > > >   Make it possible to use print_controller from another program
> > > >
> > > >   Rename print_controller to nvme_print_controller. Put it in its
> > > >   own file for easy inclusion. Move util.c to be nc_util.c to not
> > > >   conflict with camcontrol. add nvecontrol_ext.h to define shared
> > > >   interfaces.
> > > >
> > > >   Sponsored by: Netflix
> > > >   Differential Revision: https://reviews.freebsd.org/D15371
> > > >
> > > > Added:
> > > >   head/sbin/nvmecontrol/identify_ext.c
> > > >  - copied, changed from r335089, head/sbin/nvmecontrol/
> identify.c
> > > >   head/sbin/nvmecontrol/nc_util.c
> > > >  - copied, changed from r335089, head/sbin/nvmecontrol/util.c
> > > >   head/sbin/nvmecontrol/nvmecontrol_ext.h   (contents, props
> changed)
> > > >  - copied, changed from r335089, head/sbin/nvmecontrol/util.c
> > > ...
> > >
> > > >
> > > > Copied and modified: head/sbin/nvmecontrol/nvmecontrol_ext.h (from
> > > r335089, head/sbin/nvmecontrol/util.c)
> > > > 
> > > ==
> > > > --- head/sbin/nvmecontrol/util.c  Wed Jun 13 21:10:23 2018
> > > (r335089, copy source)
> > > > +++ head/sbin/nvmecontrol/nvmecontrol_ext.h   Wed Jun 13 22:00:02
> 2018
> > >   (r335091)
> > > > @@ -1,7 +1,8 @@
> > > >  /*-
> > > > - * Copyright (c) 2017 Netflix, Inc
> > > > - * All rights reserved.
> > > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
> > > >   *
> > > > + * Copyright (C) 2018 Netflix
> > >
> > > You moved a copyright forward, that is not proper to do.
> > >
> >
> > Thought it was. I honestly don't care where (nor does my employer), so if
> > you want to tweak it to be more conforming, be my guest.
>
> You can add a new date to the end of a list, but you should always
> retain the oldest date, and many opinions are that all dates should
> be retained unless they are continuous.
>

Do you have a citation for this, Rod?  I ask because my impression was that
although it has often been done, and at one point may legitimately have
been required, it is not any longer so.  I'd love to have a concrete source
on this, though.


> It would be much simpler for you to commit:
> - * Copyright (C) 2018 Netflix
> + * Copyright (C) 2017-2018 Netflix
>
> Than for me to get approval: bde, phk.
>
> Thanks.
> Rod
>
> >
> > > Not sure about dropping the , Inc either.
> >
> >
> > Doesn't matter. Different Netflix committers do different things and I
> was
> > trying to move towards uniformity.
>
> Ok
>
> > Warner
>
> --
> Rod Grimes
> rgri...@freebsd.org
>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r333266 - head/sys/amd64/amd64

2018-05-04 Thread Juli Mallett
On 4 May 2018 at 16:12, Mateusz Guzik  wrote:

> On Sat, May 5, 2018 at 12:58 AM, Steven Hartland <
> steven.hartl...@multiplay.co.uk> wrote:
>
>> Can we get the why in commit messages please?
>>
>> This sort of message doesnt provide anything more that can be obtained
>> from reading the diff, which just leaves us wondering why?
>>
>> I’m sure there is a good reason, but without confirmation we’re just left
>> guessing. The knock on to this is if some assumption that caused the why
>> changes, anyone looking at this will not be able to make an informed
>> descision that that was the case.
>>
>>
> bcopy is an equivalent of memmove, i.e. it accepts overlapping buffers.
> But if we know for a fact they don't overlap (like here), doing this over
> memcpy (which does not accept such buffers) only puts avoidable
> constraints on the optimizer.
>
> This is a rather pedestrian change which can be made in many places,
> I don't see the point of repeating the explanation in each one. Although
> I guess it would make sense to point at a specific commit which explains
> things.
>

I feel like the second paragraph in particular suggests a methodical
project (maybe in a branch?) to convert or mark all instances as
not-to-be-converted based on their context and practical concerns (like
performance) might be better than doing a bunch of one-off commits, with
batched commits to -CURRENT from time-to-time.  Then it's easy to say
"Phase IV of bcopy analysis in kernel: convert to memcpy for all
non-overlapping small copies" with a whole bunch of changes lumped together.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r311233 - head/contrib/netbsd-tests/fs/tmpfs

2017-01-04 Thread Juli Mallett
On Wed, Jan 4, 2017 at 3:36 PM, Jilles Tjoelker  wrote:
> On Wed, Jan 04, 2017 at 02:46:36AM +, Ngie Cooper wrote:
>>   - Initialize .sun_len before passing it to strlcpy and bind.
> It would be better to avoid naming the non-portable sun_len field if it
> is just to make Coverity happy. I suggest initializing the structure
> with designated initializers or memset().
>
> Apart from that, the value for sun_len is wrong; it should be the length
> of the whole structure and not just the sun_path part. Fortunately, the
> field is ignored by bind(), which uses the addrlen parameter instead.

This is incorrect, too.  It's the length of the sockaddr_un header
plus the actual length of the pathname, not the available size of the
path field.  It's kind of awful that it's inconsistent with the other
sockaddr types, but that's the fun of sockaddr_un, to accommodate the
fact that the path name is naturally a variable-length field.  In
fact, the calculation here seems to be wrong, also; we have the
SUN_LEN macro in  for a reason, and it's what the unix(4)
manpage suggests.  Of course, sun_len is sort of needlessly obscure
and in general it's best for us to fix anything which requires the
_len fields to be accurate, and to just ignore them :(
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r310138 - head/lib/libc/stdio

2016-12-20 Thread Juli Mallett
On Tue, Dec 20, 2016 at 6:04 PM, Conrad Meyer  wrote:
> Hi Adrian,
>
> On Tue, Dec 20, 2016 at 5:56 PM, Adrian Chadd  wrote:
>> Here's my reason for removal.
>>
>> Plenty of us are looking to be able to build bits of the BSD source
>> tree as part of other non FreeBSD systems, especially if they're
>> involved in bootstrapping.
>
> Understood, however:
>
>> That means that it needs to be compilable
>> by a non-FreeBSD-modified compiler. Ideally this means we'd stick to
>> mostly POSIX options source code that we can compile with unmodified
>> compilers, and we push non-standard stuff into otherly-named
>> functions.
>
> Yeah, this isn't actually a problem.  printf("%b", foo) compiles fine
> with non-modified compilers.

I want FreeBSD tools to avoid non-standard extensions to standard APIs
where possible.  Non-standard APIs are fine, because they're easy to
provide one's own implementations along with portable software, but
building in quirky behaviour to core POSIX/C/whatever interfaces
invites pain.  In this case, the cost-benefit ratio is all out of
whack.  Now, %b is unusual enough that I don't have to worry that,
say, a bootstrap tool will use it, but it's also unusual enough that
the benefit here is elusive.

I would love to see this reverted and snprintb instead.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304070 - svnadmin/conf

2016-08-13 Thread Juli Mallett
On Sat, Aug 13, 2016 at 9:47 PM, Glen Barber  wrote:
> Quoting the original request to remove this, which I tend to agree:
>
> -- begin quoted text ---
>  The svn commit mail script uses some form of 'diff -p' (or 'svn diff
>  -x-p') to include function names at the top of each hunk.  The problem
>  is that diff gets it wrong more often than not, especially (but not
>  only) when functions are added or renamed, or outside a funciton, or in
>  headers, or in code that makes heavy use of macros, or in files that
>  aren't C-like source code: shell scripts, man pages, Makefiles...  All
>  it really does is clutter up the patch and mislead the reader.
> --- end quoted text 

:(

I'm deeply skeptical that the described conditions add up to "more
often than not," and that tangible harm is done in those cases,
outweighing benefit added in the other, ostensibly rarer, case
(changes in ordinary C source files, which are actually fairly
abundant in FreeBSD.)

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


Re: svn commit: r300154 - head/sys/net

2016-05-18 Thread Juli Mallett
On Wed, May 18, 2016 at 9:41 AM, Justin Hibbits  wrote:
> #if (defined(__powerpc__) && !defined(__powerpc64__)) ||
> (defined(__mips__) && !defined(__mips64__))
>
> should work.

Depending on what the point of this is on MIPS, it is probably also
inadequate.  I believe you want a MIPS ABI check, as we can support
64-bit atomics with n32 and n64 ABIs, so !defined(__mips_n32) &&
!defined(__mips_n64).
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core

2016-04-21 Thread Juli Mallett
On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky  wrote:
> On 04/21/16 19:12, Ngie Cooper wrote:
>>
>> Please put the "deadcode" back. It will crash now if it's given an
>> invalid address family (or none are configured in the kernel) when it
>> tries to do the memcpy below.
>
>
> If you look a few lines up in the file, not the patch, you'll see that there
> already is a switch case which catches this.
>
> OK?

Then there should be an assertion or something else of that sort (I
forget if we have a __builtin_unreachable()-alike macro in the kernel;
the lint(1)y NOTREACHED isn't as nice as actual code) so that it is
apparent to a human that this case cannot be reached.  The presence of
a do-nothing default case is not typically indicative of unreachable
code.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r298274 - head/sys/dev/spibus

2016-04-19 Thread Juli Mallett
Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody seemed
interested.  I know of one proprietary branch of FreeBSD using it.
You might poke him if you want to know how he dealt with this, and if
you want to commit his driver.

On Tue, Apr 19, 2016 at 10:12 AM, Ruslan Bukin
 wrote:
> Why I added or why I reverted ?
> So once I started to work on generic MMC over SPI driver it was looking like
> MMC/SD device in harware requires to keep CS asserted during multiple 
> transfers,
> but once I completed it is become clear hardware don't require that.
>
> Ruslan
>
> On Tue, Apr 19, 2016 at 09:40:23AM -0700, Adrian Chadd wrote:
>> Hm, why'd you do this? did you get it reviewed first?
>>
>> I'm about to write a kernel bitbang SPI driver that supports arbitrary
>> GPIOs, and I was thinking of fleshing this out somewhat.
>>
>>
>>
>> -adrian
>>
>>
>> On 19 April 2016 at 08:39, Ruslan Bukin  wrote:
>> > Author: br
>> > Date: Tue Apr 19 15:39:46 2016
>> > New Revision: 298274
>> > URL: https://svnweb.freebsd.org/changeset/base/298274
>> >
>> > Log:
>> >   Revert r298268 (Add optional chip_select/deselect methods).
>> >   None of supported hardware do require that.
>> >
>> > Modified:
>> >   head/sys/dev/spibus/spibus.c
>> >   head/sys/dev/spibus/spibus_if.m
>> >
>> > Modified: head/sys/dev/spibus/spibus.c
>> > ==
>> > --- head/sys/dev/spibus/spibus.cTue Apr 19 15:36:18 2016
>> > (r298273)
>> > +++ head/sys/dev/spibus/spibus.cTue Apr 19 15:39:46 2016
>> > (r298274)
>> > @@ -185,24 +185,9 @@ spibus_hinted_child(device_t bus, const
>> >  static int
>> >  spibus_transfer_impl(device_t dev, device_t child, struct spi_command 
>> > *cmd)
>> >  {
>> > -
>> > return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd));
>> >  }
>> >
>> > -static int
>> > -spibus_chip_select_impl(device_t dev, device_t child)
>> > -{
>> > -
>> > -   return (SPIBUS_CHIP_SELECT(device_get_parent(dev), child));
>> > -}
>> > -
>> > -static int
>> > -spibus_chip_deselect_impl(device_t dev, device_t child)
>> > -{
>> > -
>> > -   return (SPIBUS_CHIP_DESELECT(device_get_parent(dev), child));
>> > -}
>> > -
>> >  static device_method_t spibus_methods[] = {
>> > /* Device interface */
>> > DEVMETHOD(device_probe, spibus_probe),
>> > @@ -223,8 +208,6 @@ static device_method_t spibus_methods[]
>> >
>> > /* spibus interface */
>> > DEVMETHOD(spibus_transfer,  spibus_transfer_impl),
>> > -   DEVMETHOD(spibus_chip_select,   spibus_chip_select_impl),
>> > -   DEVMETHOD(spibus_chip_deselect, spibus_chip_deselect_impl),
>> >
>> > DEVMETHOD_END
>> >  };
>> >
>> > Modified: head/sys/dev/spibus/spibus_if.m
>> > ==
>> > --- head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:36:18 2016
>> > (r298273)
>> > +++ head/sys/dev/spibus/spibus_if.m Tue Apr 19 15:39:46 2016
>> > (r298274)
>> > @@ -39,19 +39,3 @@ METHOD int transfer {
>> > device_t child;
>> > struct spi_command *cmd;
>> >  };
>> > -
>> > -#
>> > -# Assert chip select
>> > -#
>> > -METHOD int chip_select {
>> > -   device_t dev;
>> > -   device_t child;
>> > -};
>> > -
>> > -#
>> > -# Deassert chip select
>> > -#
>> > -METHOD int chip_deselect {
>> > -   device_t dev;
>> > -   device_t child;
>> > -};
>> >
>>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r294047 - head/sys/boot/userboot/test

2016-01-14 Thread Juli Mallett
Author: jmallett
Date: Thu Jan 14 22:07:35 2016
New Revision: 294047
URL: https://svnweb.freebsd.org/changeset/base/294047

Log:
  Make it possible to specify the path to userboot.so with the -b flag.
  
  Reviewed by:  neel

Modified:
  head/sys/boot/userboot/test/test.c

Modified: head/sys/boot/userboot/test/test.c
==
--- head/sys/boot/userboot/test/test.c  Thu Jan 14 22:02:21 2016
(r294046)
+++ head/sys/boot/userboot/test/test.c  Thu Jan 14 22:07:35 2016
(r294047)
@@ -414,7 +414,7 @@ void
 usage()
 {
 
-   printf("usage: [-d ] [-h \n");
+   printf("usage: [-b ] [-d ] [-h 
\n");
exit(1);
 }
 
@@ -425,9 +425,14 @@ main(int argc, char** argv)
void (*func)(struct loader_callbacks *, void *, int, int);
int opt;
char *disk_image = NULL;
+   const char *userboot_obj = "/boot/userboot.so";
 
-   while ((opt = getopt(argc, argv, "d:h:")) != -1) {
+   while ((opt = getopt(argc, argv, "b:d:h:")) != -1) {
switch (opt) {
+   case 'b':
+   userboot_obj = optarg;
+   break;
+
case 'd':
disk_image = optarg;
break;
@@ -441,8 +446,7 @@ main(int argc, char** argv)
}
}
 
-   h = dlopen("/boot/userboot.so",
-RTLD_LOCAL);
+   h = dlopen(userboot_obj, RTLD_LOCAL);
if (!h) {
printf("%s\n", dlerror());
return (1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r290276 - head/sys/net

2015-11-02 Thread Juli Mallett
On Mon, Nov 2, 2015 at 1:21 PM, Randall Stewart  wrote:

> Author: rrs
> Date: Mon Nov  2 21:21:00 2015
> New Revision: 290276
> URL: https://svnweb.freebsd.org/changeset/base/290276
>
> Log:
>   Fix three flowtable bugs, a) one lookup issue, b) a two cleaner issue.
>

This commit message is not helpful, but the review is; it seems like the
summary there might have been better for the commit message than naming the
number of bugs.  Should we assume the three hunks each fix a bug, or what?
What if there were four hunks, or two?  That kind of ambiguity and
obscurity is especially confusing as time passes.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287391 - svnadmin/conf

2015-09-01 Thread Juli Mallett
Author: jmallett
Date: Wed Sep  2 02:50:41 2015
New Revision: 287391
URL: https://svnweb.freebsd.org/changeset/base/287391

Log:
  Release Patrick Kelsey (pkelsey@) from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Sep  1 22:39:09 2015(r287390)
+++ svnadmin/conf/mentors   Wed Sep  2 02:50:41 2015(r287391)
@@ -30,7 +30,6 @@ mahrens   mckusick
 miwi   rwatson
 monthadar  adrian
 peterj jhb Co-mentor: grog
-pkelseyjmallett
 slmken Co-mentor: scottl, ambrisko
 snbdwmalone
 torek  rpaulo
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r277517 - head

2015-01-21 Thread Juli Mallett
On Wed, Jan 21, 2015 at 1:49 PM, Ed Maste ema...@freebsd.org wrote:
 Author: emaste
 Date: Wed Jan 21 21:49:03 2015
 New Revision: 277517
 URL: https://svnweb.freebsd.org/changeset/base/277517

 Log:
   Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL

   ELF Tool Chain tools need libelf and libdwarf.

Thanks very much!
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r268491 - head/usr.bin/users

2014-07-10 Thread Juli Mallett
On Thu, Jul 10, 2014 at 9:11 AM, Ed Schouten e...@80386.nl wrote:

 On 10 July 2014 18:05, Pietro Cerutti g...@freebsd.org wrote:
  I reply to this one, since I'm not on src-all.
 
  - for consistency, I'd s|std::set|set|
  - return (0) is not needed in c++

 Good catch. Fixed!


If we're going to have more C++ in base we may want to pause and think
about style(9) for C++ briefly.  I'm not sure implicit return is something
that fits the rest of the FreeBSD style, for instance.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net

2014-06-02 Thread Juli Mallett
Marcel,

On Mon, Jun 2, 2014 at 10:54 AM, Marcel Moolenaar mar...@freebsd.org
wrote:

 Author: marcel
 Date: Mon Jun  2 17:54:39 2014
 New Revision: 266974
 URL: http://svnweb.freebsd.org/changeset/base/266974

 Log:
   Introduce a procedural interface to the ifnet structure.  The new
   interface allows the ifnet structure to be defined as an opaque
   type in NIC drivers.  This then allows the ifnet structure to be
   changed without a need to change or recompile NIC drivers.

   Put differently, NIC drivers can be written and compiled once and
   be used with different network stack implementations, provided of
   course that those network stack implementations have an API and
   ABI compatible interface.

   This commit introduces the 'if_t' type to replace 'struct ifnet *'
   as the type of a network interface. The 'if_t' type is defined as
   'void *' to enable the compiler to perform type conversion to
   'struct ifnet *' and vice versa where needed and without warnings.
   The functions that implement the API are the only functions that
   need to have an explicit cast.
 [...]
   Submitted by: Anuranjan Shukla anshu...@juniper.net
   Reviewed by:  glebius@
   Obtained from:Juniper Networks, Inc.


Could you say a little bit about why so few reviewers?  Also, why if_t
rather than an opaque struct ifnet to minimize churn, and also not
conflict with other if_t types one might be using in third-party kernel
modules.  It's a pretty general name, and that seems problematic.  In
general am enthused about this happening, just minor implementation
concerns.

Thanks,
Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r266867 - svnadmin/conf

2014-05-29 Thread Juli Mallett
Author: jmallett
Date: Fri May 30 04:44:07 2014
New Revision: 266867
URL: http://svnweb.freebsd.org/changeset/base/266867

Log:
  Welcome Patrick Kelsey (pkelsey@) to the order of src committers.  He
  will be contributing drivers and enhancements for various ARM and MIPS
  systems, and hopefully will merge some of the new network stack features
  from his libuinet project, which was the subject of a talk given by
  him at BSDCan 2014.  I will be his mentor.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessFri May 30 02:16:28 2014(r266866)
+++ svnadmin/conf/accessFri May 30 04:44:07 2014(r266867)
@@ -171,6 +171,7 @@ philip
 phk
 pho
 pjd
+pkelsey
 pluknet
 ps
 qingli

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Fri May 30 02:16:28 2014(r266866)
+++ svnadmin/conf/mentors   Fri May 30 04:44:07 2014(r266867)
@@ -28,6 +28,7 @@ miwi  rwatson
 monthadar  adrian
 odeds  jhb Co-mentor: alfred
 peterj jhb Co-mentor: grog
+pkelseyjmallett
 royger gibbs
 slmken Co-mentor: scottl, ambrisko
 snbdwmalone
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r259161 - head/sys/mips/cavium/octe

2013-12-10 Thread Juli Mallett
Author: jmallett
Date: Tue Dec 10 09:38:18 2013
New Revision: 259161
URL: http://svnweb.freebsd.org/changeset/base/259161

Log:
  Add missing includes.

Modified:
  head/sys/mips/cavium/octe/cavium-ethernet.h
  head/sys/mips/cavium/octe/ethernet-mv88e61xx.c

Modified: head/sys/mips/cavium/octe/cavium-ethernet.h
==
--- head/sys/mips/cavium/octe/cavium-ethernet.h Tue Dec 10 09:14:11 2013
(r259160)
+++ head/sys/mips/cavium/octe/cavium-ethernet.h Tue Dec 10 09:38:18 2013
(r259161)
@@ -38,7 +38,9 @@ AND WITH ALL FAULTS AND CAVIUM  NETWORKS
 #ifndef CAVIUM_ETHERNET_H
 #define CAVIUM_ETHERNET_H
 
+#include sys/taskqueue.h
 #include net/if_media.h
+#include net/ifq.h
 
 /**
  * This is the definition of the Ethernet driver's private

Modified: head/sys/mips/cavium/octe/ethernet-mv88e61xx.c
==
--- head/sys/mips/cavium/octe/ethernet-mv88e61xx.c  Tue Dec 10 09:14:11 
2013(r259160)
+++ head/sys/mips/cavium/octe/ethernet-mv88e61xx.c  Tue Dec 10 09:38:18 
2013(r259161)
@@ -45,6 +45,7 @@ __FBSDID($FreeBSD$);
 
 #include net/ethernet.h
 #include net/if.h
+#include net/if_var.h
 
 #include wrapper-cvmx-includes.h
 #include ethernet-headers.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r258686 - head/sbin/fdisk

2013-11-27 Thread Juli Mallett
Author: jmallett
Date: Wed Nov 27 17:59:13 2013
New Revision: 258686
URL: http://svnweb.freebsd.org/changeset/base/258686

Log:
  Fix fdisk(8) to create 2TB partitions on disks larger than 2TB, rather than
  only being able to create 1TB partitions:
  o) Use an unsigned 32-bit quantity to store the number of disk sectors.
  o) Detect overflow of said 32-bit quantity and clamp to 2^32.
  o) Rather than returning the disk sector count from get_params, return 0 on
 success, since its return value is only ever compared to -1 to detect
 failure.  This would cause returning 2^32 sectors to be interpreted as an
 error.
  
  Reviewed by:  bde (good for a quick fix)

Modified:
  head/sbin/fdisk/fdisk.c

Modified: head/sbin/fdisk/fdisk.c
==
--- head/sbin/fdisk/fdisk.c Wed Nov 27 16:08:33 2013(r258685)
+++ head/sbin/fdisk/fdisk.c Wed Nov 27 17:59:13 2013(r258686)
@@ -75,7 +75,8 @@ static int secsize = 0;   /* the sensed s
 
 static char *disk;
 
-static int cyls, sectors, heads, cylsecs, disksecs;
+static int cyls, sectors, heads, cylsecs;
+static u_int32_t disksecs;
 
 struct mboot {
unsigned char *bootinst;  /* boot code */
@@ -873,10 +874,13 @@ get_params()
o = g_mediasize(fd);
if (o  0)
return (-1);
-   disksecs = o / u;
+   if (o / u = NO_DISK_SECTORS)
+   disksecs = o / u;
+   else
+   disksecs = NO_DISK_SECTORS;
cyls = dos_cyls = o / (u * dos_heads * dos_sectors);
 
-   return (disksecs);
+   return (0);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r258695 - head/usr.sbin/makefs

2013-11-27 Thread Juli Mallett
Author: jmallett
Date: Wed Nov 27 21:55:43 2013
New Revision: 258695
URL: http://svnweb.freebsd.org/changeset/base/258695

Log:
  Provide a helpful diagnostic when the minimum size rounded to the block size
  would exceed the maximum size.  This can be a difficult problem to diagnose
  if one is, for instance, using -s with a fixed size in a script and the bsize
  calculated for a filesystem image changes, necessitating a re-rounding of the
  image size or a hand-setting of the bsize.  Previously one would get a
  cryptic message about how the size exceeded the maximum size, which normally
  only happens if the contents of the image are larger than specified.

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Wed Nov 27 21:51:34 2013(r258694)
+++ head/usr.sbin/makefs/ffs.c  Wed Nov 27 21:55:43 2013(r258695)
@@ -361,6 +361,13 @@ ffs_validate(const char *dir, fsnode *ro
if (ffs_opts-avgfpdir == -1)
ffs_opts-avgfpdir = AFPDIR;
 
+   if (roundup(fsopts-minsize, ffs_opts-bsize)  fsopts-maxsize)
+   errx(1, `%s' minsize of %lld rounded up to ffs bsize of %d 
+   exceeds maxsize %lld.  Lower bsize, or round the minimum 
+   and maximum sizes to bsize., dir,
+   (long long)fsopts-minsize, ffs_opts-bsize,
+   (long long)fsopts-maxsize);
+
/* calculate size of tree */
ffs_size_dir(root, fsopts);
fsopts-inodes += ROOTINO;  /* include first two inodes */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r258686 - head/sbin/fdisk

2013-11-27 Thread Juli Mallett
On Wed, Nov 27, 2013 at 11:00 PM, Gleb Smirnoff gleb...@freebsd.org wrote:

   Juli,

 On Wed, Nov 27, 2013 at 05:59:14PM +, Juli Mallett wrote:
 J Author: jmallett
 J Date: Wed Nov 27 17:59:13 2013
 J New Revision: 258686
 J URL: http://svnweb.freebsd.org/changeset/base/258686
 J
 J Log:
 J   Fix fdisk(8) to create 2TB partitions on disks larger than 2TB,
 rather than
 J   only being able to create 1TB partitions:
 J   o) Use an unsigned 32-bit quantity to store the number of disk
 sectors.
 J   o) Detect overflow of said 32-bit quantity and clamp to 2^32.
 J   o) Rather than returning the disk sector count from get_params,
 return 0 on
 J  success, since its return value is only ever compared to -1 to
 detect
 J  failure.  This would cause returning 2^32 sectors to be
 interpreted as an
 J  error.
 J
 J   Reviewed by:   bde (good for a quick fix)

 What is the reason to use fdisk today, instead of gpart?


Habit?  Hysterical reasons?  Ease-of-use?  (The fact that I find fdisk(8)
easier to use than gpart(8) is probably a bug in me and not in gpart(8),
but it always takes me too many steps to get things done with gpart(8),
including some manpage reading.)  Being fairly self-contained so that one
can use it in automated systems without worrying about which geom(4)
modules are in the host system's kernel is probably the most-reasonable
version.

If it's so deprecated that leaving bugs in it is desirable, please remove
it from the tree entirely :)

Thanks,
Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254419 - head/contrib/bmake

2013-08-16 Thread Juli Mallett
On Fri, Aug 16, 2013 at 11:47 AM, Simon J. Gerraty s...@freebsd.org wrote:

 Author: sjg
 Date: Fri Aug 16 18:47:18 2013
 New Revision: 254419
 URL: http://svnweb.freebsd.org/changeset/base/254419

 Log:
   Add .MAKE.ALWAYS_PASS_JOB_QUEUE knob (default yes)
   for backwards compatability.


Thanks very much.  Do you have some sense of when/if this might switch to a
default of no?  If so, it seems like it might be good to note that
dependence on that behaviour is deprecated and will be removed in
11.0-RELEASE or whenever you think appropriate.

Thanks again,
Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254286 - head/sys/fs/ext2fs

2013-08-14 Thread Juli Mallett
On Wed, Aug 14, 2013 at 12:11 AM, Dimitry Andric d...@freebsd.org wrote:

 This still fails on arches where int64_t is aliased to long long
 (basically, the 32-bit arches).  Since using PRId64 is apparently
 frowned upon, the easiest solution is to cast the 'start' and 'last'
 variables to long long, and print them using %lld.


That can't be the easiest solution, it's not even that easy :)  It seems
like intmax_t or uintmax_t as appropriate and cast to %jd or %ju
respectively would be better.

Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc

2013-07-26 Thread Juli Mallett
On Fri, Jul 26, 2013 at 2:26 PM, Andrey Zonov z...@freebsd.org wrote:

 On 7/26/13 8:09 AM, Jilles Tjoelker wrote:
  On Fri, Jul 26, 2013 at 02:00:07AM +, Andrey Zonov wrote:
  Author: zont
  Date: Fri Jul 26 02:00:06 2013
  New Revision: 253662
  URL: http://svnweb.freebsd.org/changeset/base/253662
 
  Log:
Remove define and documentation for vm_pageout_algorithm missed in
 r253587
 
  Modified:
head/lib/libc/gen/sysctl.3
head/sys/vm/vm_param.h
head/tools/tools/sysdoc/tunables.mdoc
 
  Modified: head/sys/vm/vm_param.h
 
 ==
  --- head/sys/vm/vm_param.h   Fri Jul 26 00:28:19 2013(r253661)
  +++ head/sys/vm/vm_param.h   Fri Jul 26 02:00:06 2013(r253662)
  @@ -82,9 +82,8 @@
   #define VM_V_CACHE_MIN  7   /* cnt.v_cache_min */
   #define VM_V_CACHE_MAX  8   /* cnt.v_cache_max */
   #define VM_V_PAGEOUT_FREE_MIN   9   /* cnt.v_pageout_free_min
 */
  -#define VM_PAGEOUT_ALGORITHM10  /* pageout algorithm */
  -#define VM_SWAPPING_ENABLED 11  /* swapping enabled */
  -#define VM_MAXID12  /* number of valid vm ids
 */
  +#define VM_SWAPPING_ENABLED 10  /* swapping enabled */
  +#define VM_MAXID11  /* number of valid vm ids
 */
 
  As noted in mail from Bruce Evans, please preserve the ABI of
  VM_SWAPPING_ENABLED here.
 

 I don't think it's a big problem.  Internally we don't use it.  Good
 code uses sysctlbyname() instead of sysctl().  It doesn't seem to me
 this is very popular sysctl.  It's also CURRENT without MFC.


That doesn't seem like a great argument.

Why should we break the ABI for bad code that used that sysctl and all
following?  It seems pretty trivial to preserve, and no-cost.  Also, the
fact that it's in current misses the point completely: it breaks ABI with
older binaries, namely older binaries running on -CURRENT.  And not just
for that field.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r252913 - head/sys/arm/ti/am335x

2013-07-06 Thread Juli Mallett
Thanks for this and the other commits, Oleksandr!  Much appreciated.
Looking forward to giving it a spin on my BeagleBones Black!

On Sat, Jul 6, 2013 at 9:22 PM, Oleksandr Tymoshenko go...@freebsd.org wrote:
 Author: gonzo
 Date: Sun Jul  7 04:22:08 2013
 New Revision: 252913
 URL: http://svnweb.freebsd.org/changeset/base/252913

 Log:
   - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors 
 Graphic
  USB OTG core.

 Added:
   head/sys/arm/ti/am335x/am335x_usbss.c   (contents, props changed)
 Modified:
   head/sys/arm/ti/am335x/files.am335x

 Added: head/sys/arm/ti/am335x/am335x_usbss.c
 ==
 --- /dev/null   00:00:00 1970   (empty, because file is newly added)
 +++ head/sys/arm/ti/am335x/am335x_usbss.c   Sun Jul  7 04:22:08 2013  
   (r252913)
 @@ -0,0 +1,481 @@
 +/*-
 + * Copyright (c) 2013 Oleksandr Tymoshenko go...@freebsd.org
 + *
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions
 + * are met:
 + * 1. Redistributions of source code must retain the above copyright
 + *notice, this list of conditions and the following disclaimer.
 + * 2. Redistributions in binary form must reproduce the above copyright
 + *notice, this list of conditions and the following disclaimer in the
 + *documentation and/or other materials provided with the distribution.
 + *
 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 + * SUCH DAMAGE.
 + */
 +
 +#include sys/cdefs.h
 +__FBSDID($FreeBSD$);
 +
 +#include sys/stdint.h
 +#include sys/stddef.h
 +#include sys/param.h
 +#include sys/queue.h
 +#include sys/types.h
 +#include sys/systm.h
 +#include sys/kernel.h
 +#include sys/bus.h
 +#include sys/module.h
 +#include sys/lock.h
 +#include sys/mutex.h
 +#include sys/condvar.h
 +#include sys/sysctl.h
 +#include sys/sx.h
 +#include sys/unistd.h
 +#include sys/callout.h
 +#include sys/malloc.h
 +#include sys/priv.h
 +
 +#include dev/fdt/fdt_common.h
 +#include dev/ofw/openfirm.h
 +#include dev/ofw/ofw_bus.h
 +#include dev/ofw/ofw_bus_subr.h
 +
 +#include dev/usb/usb.h
 +#include dev/usb/usbdi.h
 +
 +#include dev/usb/usb_core.h
 +#include dev/usb/usb_busdma.h
 +#include dev/usb/usb_process.h
 +#include dev/usb/usb_util.h
 +
 +#defineUSB_DEBUG_VAR usbssdebug
 +
 +#include dev/usb/usb_controller.h
 +#include dev/usb/usb_bus.h
 +#include dev/usb/controller/musb_otg.h
 +#include dev/usb/usb_debug.h
 +
 +#include sys/rman.h
 +
 +#include arm/ti/ti_prcm.h
 +#include arm/ti/ti_scm.h
 +#include arm/ti/am335x/am335x_scm.h
 +
 +#defineAM335X_USB_PORTS2
 +
 +#defineUSBSS_REVREG0x00
 +#defineUSBSS_SYSCONFIG 0x10
 +#defineUSBSS_SYSCONFIG_SRESET  1
 +
 +#define USBCTRL_REV0x00
 +#define USBCTRL_CTRL   0x14
 +#define USBCTRL_STAT   0x18
 +#define USBCTRL_IRQ_STAT0  0x30
 +#defineIRQ_STAT0_RXSHIFT   16
 +#defineIRQ_STAT0_TXSHIFT   0
 +#define USBCTRL_IRQ_STAT1  0x34
 +#defineIRQ_STAT1_DRVVBUS   (1  8)
 +#define USBCTRL_INTEN_SET0 0x38
 +#define USBCTRL_INTEN_SET1 0x3C
 +#defineUSBCTRL_INTEN_USB_ALL   0x1ff
 +#defineUSBCTRL_INTEN_USB_SOF   (1  3)
 +#define USBCTRL_INTEN_CLR0 0x40
 +#define USBCTRL_INTEN_CLR1 0x44
 +#define USBCTRL_UTMI   0xE0
 +#defineUSBCTRL_UTMI_FSDATAEXT  (1  1)
 +#define USBCTRL_MODE   0xE8
 +#defineUSBCTRL_MODE_IDDIG  (1  8)
 +#defineUSBCTRL_MODE_IDDIGMUX   (1  7)
 +
 +/* USBSS resource + 2 MUSB ports */
 +
 +#define RES_USBSS  0
 +#define RES_USBCTRL(i) (3*i+1)
 +#define RES_USBPHY(i)  (3*i+2)
 +#define RES_USBCORE(i) (3*i+3)
 +
 +#defineUSB_WRITE4(sc, idx, reg, val)   do {\
 +   bus_write_4((sc)-sc_mem_res[idx], (reg), (val));   \
 +} while (0)
 +
 +#defineUSB_READ4(sc, idx, reg) bus_read_4((sc)-sc_mem_res[idx], 
 (reg))
 +
 +#defineUSBSS_WRITE4(sc, reg, val)  \
 +USB_WRITE4((sc), RES_USBSS, (reg), (val))
 +#defineUSBSS_READ4(sc, reg)\
 +

Re: svn commit: r250940 - head/sys/mips/mips

2013-05-23 Thread Juli Mallett
Thanks very much, Marcel, and everyone involved at Juniper!

On Thu, May 23, 2013 at 12:47 PM, Marcel Moolenaar mar...@freebsd.org wrote:
 Author: marcel
 Date: Thu May 23 19:47:37 2013
 New Revision: 250940
 URL: http://svnweb.freebsd.org/changeset/base/250940

 Log:
   Change the copyright notice to a standard BSD 2-clause license and assign
   ownership to the FreeBSD foundation for the years this file has been in
   the FreeBSD repository.

   This file was originally created by Juniper as part of upgrading to FreeBSD
   4.10 (which had no MIPS support) and held functions found on other machines
   It grew actual functionality over time. The functionaliy was copied from
   other architectures and ported to MIPS on a as-needed basis.

   Approved by:  Mark Baushke (Juniper IP)
   Approved by:  Megan Sugiyama (Juniper legal)
   Pointed out by:   jmallett@
   Requested by: core (jhb@)

 Modified:
   head/sys/mips/mips/db_trace.c

 Modified: head/sys/mips/mips/db_trace.c
 ==
 --- head/sys/mips/mips/db_trace.c   Thu May 23 19:47:35 2013
 (r250939)
 +++ head/sys/mips/mips/db_trace.c   Thu May 23 19:47:37 2013
 (r250940)
 @@ -1,7 +1,29 @@
  /*-
 + * Copyright (c) 2008-2013 The FreeBSD Foundation
   * Copyright (c) 2004-2005, Juniper Networks, Inc.
   * All rights reserved.
   *
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions
 + * are met:
 + * 1. Redistributions of source code must retain the above copyright
 + *notice, this list of conditions and the following disclaimer.
 + * 2. Redistributions in binary form must reproduce the above copyright
 + *notice, this list of conditions and the following disclaimer in the
 + *documentation and/or other materials provided with the distribution.
 + *
 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 + * SUCH DAMAGE.
 + *
   * JNPR: db_trace.c,v 1.8 2007/08/09 11:23:32 katta
   */

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250431 - head/usr.bin/xargs

2013-05-10 Thread Juli Mallett
Eitan,

Are other changes coming to xargs for which these style changes make
sense?  If not, I'd say that style changes which only adjust vertical
whitespace, especially those which mostly add vertical whitespace at
the start of functions with no local variables (which is one of the
most archaic and unusual things style(9) requires), are probably the
most gratuitous and silly style changes to make.  That doesn't even
rise to being a style change, it's just a whitespace change.  And I
really do believe that vertical whitespace changes are much, much
sillier than horizontal whitespace changes.

Curious what the motivation was here; was xargs the only utility in
usr.bin which didn't conform to style(9) in this regard?  (No.)  Was
this part of a tree-wide sweep to finally bring conformity to these
rules?  (I hope not.)  What's the point?*

Juli.

*: Not that I've never made changes equally-gratuitous; I certainly
have, and so would more strongly discourage people from making them
given the regret and embarrassment I feel about having done so with
the aid of years of hindsight, and a greater awareness of how easy it
is to make minor functional improvements, or at least do refactoring
with some purpose in mind, if one just wants to leave one's
thumbprint.  (Watch for standalone commits from people who used to be
very active developers who have recently hit the threshold for getting
commit bit reaper E-Mails.  They're fairly instructive in the art of
making occasional insignificant changes for the sake of making
changes.)

On Thu, May 9, 2013 at 8:49 PM, Eitan Adler ead...@freebsd.org wrote:
 Author: eadler
 Date: Fri May 10 03:49:05 2013
 New Revision: 250431
 URL: http://svnweb.freebsd.org/changeset/base/250431

 Log:
   Style(9) changes fo xargs.c

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

 Modified: head/usr.bin/xargs/xargs.c
 ==
 --- head/usr.bin/xargs/xargs.c  Fri May 10 03:42:48 2013(r250430)
 +++ head/usr.bin/xargs/xargs.c  Fri May 10 03:49:05 2013(r250431)
 @@ -670,12 +670,14 @@ pids_init(void)
  static int
  pids_empty(void)
  {
 +
 return (curprocs == 0);
  }

  static int
  pids_full(void)
  {
 +
 return (curprocs = maxprocs);
  }

 @@ -709,7 +711,6 @@ findfreeslot(void)

 if ((slot = findslot(NOPID))  0)
 errx(1, internal error: no free pid slot);
 -
 return (slot);
  }

 @@ -721,13 +722,13 @@ findslot(pid_t pid)
 for (slot = 0; slot  maxprocs; slot++)
 if (childpids[slot] == pid)
 return (slot);
 -
 return (-1);
  }

  static void
  clearslot(int slot)
  {
 +
 childpids[slot] = NOPID;
  }

 @@ -762,6 +763,7 @@ prompt(void)
  static void
  usage(void)
  {
 +
 fprintf(stderr,
  usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S 
 replsize]]\n
   [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\n
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250426 - head/sys/contrib/octeon-sdk

2013-05-09 Thread Juli Mallett
On Thu, May 9, 2013 at 7:57 PM, Warner Losh i...@freebsd.org wrote:
 Log:
   Both my EBH5200 and GE WANIC 6354 have a RTC as well. It looks from
   the Linux tree that they always include this chip in their FDT, so
   make support for the ds1337 opt-out rather than opt-in. Now my boards
   boot with the correct time.

What boards did you test on without RTCs to verify that it doesn't
cause hangs?  The fact that there are two boards not enumerated which
did have an RTC doesn't say anything about the boards that truly
don't.  Likewise, Linux's FDT is not authoritative for all boards.
I'd feel better knowing this at least won't have a negative effect on
boards without an RTC.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250134 - head/sys/mips/include

2013-04-30 Thread Juli Mallett
Warner,

May I ask why you're bringing in the 4.4BSD version and not the NetBSD
version, which already contained the appropriate ABI gunk?  Do we
really need to duplicate their work improving the file since 4.4BSD?

Thanks,
Juli.

On Tue, Apr 30, 2013 at 10:46 PM, Warner Losh i...@freebsd.org wrote:
 Author: imp
 Date: Wed May  1 05:46:54 2013
 New Revision: 250134
 URL: http://svnweb.freebsd.org/changeset/base/250134

 Log:
   Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h,
   expand the %sccs.include.redist.c% directive with the standard
   3-clause license, and add $FreeBSD$ to keep the commit script happy.

   # This may break some mips stuff, which will be fixed in the next commit.

 Modified:
   head/sys/mips/include/regdef.h

 Modified: head/sys/mips/include/regdef.h
 ==
 --- head/sys/mips/include/regdef.h  Wed May  1 05:14:59 2013
 (r250133)
 +++ head/sys/mips/include/regdef.h  Wed May  1 05:46:54 2013
 (r250134)
 @@ -1,86 +1,67 @@
 -/*-
 - * Copyright (c) 2001, Juniper Networks, Inc.
 - * All rights reserved.
 - * Truman Joe, February 2001.
 +/*
 + * Copyright (c) 1992, 1993
 + *  The Regents of the University of California.  All rights reserved.
   *
 - * regdef.h -- MIPS register definitions.
 + * This code is derived from software contributed to Berkeley by
 + * Ralph Campbell. This file is derived from the MIPS RISC
 + * Architecture book by Gerry Kane.
   *
 - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta
 - * $FreeBSD$
 - */
 -
 -#ifndef _MACHINE_REGDEF_H_
 -#define_MACHINE_REGDEF_H_
 -
 -#include machine/cdefs.h /* For API selection */
 -
 -#if defined(__ASSEMBLER__)
 -/* General purpose CPU register names */
 -#definezero$0  /* wired zero */
 -#defineAT  $at /* assembler temp */
 -#definev0  $2  /* return value */
 -#definev1  $3
 -#definea0  $4  /* argument registers */
 -#definea1  $5
 -#definea2  $6
 -#definea3  $7
 -#if defined(__mips_n32) || defined(__mips_n64)
 -#definea4  $8
 -#definea5  $9
 -#definea6  $10
 -#definea7  $11
 -#definet0  $12 /* Temp regs, not saved accross subroutine 
 calls */
 -#definet1  $13
 -#definet2  $14
 -#definet3  $15
 -#else
 -#definet0  $8  /* caller saved */
 -#definet1  $9
 -#definet2  $10
 -#definet3  $11
 -#definet4  $12 /* caller saved - 32 bit env arg reg 64 bit */
 -#definet5  $13
 -#definet6  $14
 -#definet7  $15
 -#endif
 -#defines0  $16 /* callee saved */
 -#defines1  $17
 -#defines2  $18
 -#defines3  $19
 -#defines4  $20
 -#defines5  $21
 -#defines6  $22
 -#defines7  $23
 -#definet8  $24 /* code generator */
 -#definet9  $25
 -#definek0  $26 /* kernel temporary */
 -#definek1  $27
 -#definegp  $28 /* global pointer */
 -#definesp  $29 /* stack pointer */
 -#definefp  $30 /* frame pointer */
 -#defines8  $30 /* callee saved */
 -#definera  $31 /* return address */
 -
 -/*
 - * These are temp registers whose names can be used in either the old
 - * or new ABI, although they map to different physical registers.  In
 - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7.
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions
 + * are met:
 + * 1. Redistributions of source code must retain the above copyright
 + *notice, this list of conditions and the following disclaimer.
 + * 2. Redistributions in binary form must reproduce the above copyright
 + *notice, this list of conditions and the following disclaimer in the
 + *documentation and/or other materials provided with the distribution.
 + * 4. Neither the name of the University nor the names of its contributors
 + *may be used to endorse or promote products derived from this software
 + *without specific prior written permission.
   *
 - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3
 - * should be used only when we need more than t0-t3.
 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 + * DAMAGES (INCLUDING, BUT NOT 

Re: svn commit: r249790 - in head/sys/mips: include mips

2013-04-23 Thread Juli Mallett
On Tue, Apr 23, 2013 at 2:38 AM, Warner Losh i...@freebsd.org wrote:
 Modified: head/sys/mips/include/frame.h
 ==
 --- head/sys/mips/include/frame.h   Tue Apr 23 06:37:50 2013
 (r249789)
 +++ head/sys/mips/include/frame.h   Tue Apr 23 09:38:18 2013
 (r249790)
 @@ -37,6 +37,8 @@
  #ifndef _MACHINE_FRAME_H_
  #define_MACHINE_FRAME_H_

 +/* Note: This must also match regnum.h and regdef.h */
 +
  struct trapframe {
 register_t  zero;
 register_t  ast;
 @@ -46,6 +48,16 @@ struct trapframe {
 register_t  a1;
 register_t  a2;
 register_t  a3;
 +#if defined(__mips_n32) || defined(__mips_n64)
 +   register_t  a4;
 +   register_t  a5;
 +   register_t  a6;
 +   register_t  a7;
 +   register_t  t0;
 +   register_t  t1;
 +   register_t  t2;
 +   register_t  t3;
 +#else
 register_t  t0;
 register_t  t1;
 register_t  t2;
 @@ -54,6 +66,7 @@ struct trapframe {
 register_t  t5;
 register_t  t6;
 register_t  t7;
 +#endif
 register_t  s0;
 register_t  s1;
 register_t  s2;

 Modified: head/sys/mips/mips/trap.c
 ==
 --- head/sys/mips/mips/trap.c   Tue Apr 23 06:37:50 2013(r249789)
 +++ head/sys/mips/mips/trap.c   Tue Apr 23 09:38:18 2013(r249790)
 @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td
 /*
  * Non-o32 ABIs support more arguments in registers.
  */
 -   sa-args[3] = locr0-t4;
 -   sa-args[4] = locr0-t5;
 -   sa-args[5] = locr0-t6;
 -   sa-args[6] = locr0-t7;
 +   sa-args[3] = locr0-t0;
 +   sa-args[4] = locr0-t1;
 +   sa-args[5] = locr0-t2;
 +   sa-args[6] = locr0-t3;
 nsaved += 4;
  #ifdef COMPAT_FREEBSD32
 }
 @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td
 /*
  * Non-o32 ABIs support more arguments in registers.
  */
 -   sa-args[4] = locr0-t4;
 -   sa-args[5] = locr0-t5;
 -   sa-args[6] = locr0-t6;
 -   sa-args[7] = locr0-t7;
 +   sa-args[4] = locr0-t0;
 +   sa-args[5] = locr0-t1;
 +   sa-args[6] = locr0-t2;
 +   sa-args[7] = locr0-t3;
 nsaved += 4;
  #ifdef COMPAT_FREEBSD32
 }

These should use a4, a5, a6, a7 now, not t0, t1, t2, t3.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r249790 - in head/sys/mips: include mips

2013-04-23 Thread Juli Mallett
Also: the comment says that the trapframe layout must match regnum.h —
I don't think that's really true.  Why can't we just store things in
the trapframe in whatever order we want?  Why do they need to match
the register numbers.

More worrying, however, is that looking at regnum.h brought to my
attention the fact that Juniper filed the original license off of the
file, and placed a copyright without a license.  The same file seems
to have been published by SGI under a proprietary/unpublished
copyright and under the GPL for Linux, but it's not clear to me that
there's a public domain copy that it would have been acceptable for
Juniper to assert sole copyright over.  It's also definitely
unacceptable that Juniper didn't provide a license for that file.

I don't see why we shouldn't just replace regnum.h with the NetBSD
version, and merge that to all active branches.  Since you're trying
to update these headers, Warner, it would be great if you could do
that.

I wish the project had never accepted any code for the MIPS port from
Juniper, given their penchant (like OpenBSD's MIPS port — what is it
about MIPS ports?) for filing licenses off and placing on their own
(or in Juniper's case, none at all.)  That's just not acceptable for
an open-source project.

Juli.

On Tue, Apr 23, 2013 at 2:38 AM, Warner Losh i...@freebsd.org wrote:
 Author: imp
 Date: Tue Apr 23 09:38:18 2013
 New Revision: 249790
 URL: http://svnweb.freebsd.org/changeset/base/249790

 Log:
   Update trapframe to be consistent with the changes made to regnum.h. This
   should fix the booting problems people have been seeing.

 Modified:
   head/sys/mips/include/frame.h
   head/sys/mips/include/regnum.h
   head/sys/mips/mips/db_interface.c
   head/sys/mips/mips/trap.c
   head/sys/mips/mips/vm_machdep.c

 Modified: head/sys/mips/include/frame.h
 ==
 --- head/sys/mips/include/frame.h   Tue Apr 23 06:37:50 2013
 (r249789)
 +++ head/sys/mips/include/frame.h   Tue Apr 23 09:38:18 2013
 (r249790)
 @@ -37,6 +37,8 @@
  #ifndef _MACHINE_FRAME_H_
  #define_MACHINE_FRAME_H_

 +/* Note: This must also match regnum.h and regdef.h */
 +
  struct trapframe {
 register_t  zero;
 register_t  ast;
 @@ -46,6 +48,16 @@ struct trapframe {
 register_t  a1;
 register_t  a2;
 register_t  a3;
 +#if defined(__mips_n32) || defined(__mips_n64)
 +   register_t  a4;
 +   register_t  a5;
 +   register_t  a6;
 +   register_t  a7;
 +   register_t  t0;
 +   register_t  t1;
 +   register_t  t2;
 +   register_t  t3;
 +#else
 register_t  t0;
 register_t  t1;
 register_t  t2;
 @@ -54,6 +66,7 @@ struct trapframe {
 register_t  t5;
 register_t  t6;
 register_t  t7;
 +#endif
 register_t  s0;
 register_t  s1;
 register_t  s2;

 Modified: head/sys/mips/include/regnum.h
 ==
 --- head/sys/mips/include/regnum.h  Tue Apr 23 06:37:50 2013
 (r249789)
 +++ head/sys/mips/include/regnum.h  Tue Apr 23 09:38:18 2013
 (r249790)
 @@ -87,10 +87,10 @@
  #defineT1  9
  #defineT2  10
  #defineT3  11
 -#defineTA0 12
 -#defineTA1 13
 -#defineTA2 14
 -#defineTA3 15
 +#defineT4  12
 +#defineT5  13
 +#defineT6  14
 +#defineT7  15
  #endif
  #defineS0  16
  #defineS1  17

 Modified: head/sys/mips/mips/db_interface.c
 ==
 --- head/sys/mips/mips/db_interface.c   Tue Apr 23 06:37:50 2013
 (r249789)
 +++ head/sys/mips/mips/db_interface.c   Tue Apr 23 09:38:18 2013
 (r249790)
 @@ -77,6 +77,16 @@ struct db_variable db_regs[] = {
 { a1,  DB_OFFSET(a1), db_frame },
 { a2,  DB_OFFSET(a2), db_frame },
 { a3,  DB_OFFSET(a3), db_frame },
 +#if defined(__mips_n32) || defined(__mips_n64)
 +   { a4,  DB_OFFSET(a4), db_frame },
 +   { a5,  DB_OFFSET(a5), db_frame },
 +   { a6,  DB_OFFSET(a6), db_frame },
 +   { a7,  DB_OFFSET(a7), db_frame },
 +   { t0,  DB_OFFSET(t0), db_frame },
 +   { t1,  DB_OFFSET(t1), db_frame },
 +   { t2,  DB_OFFSET(t2), db_frame },
 +   { t3,  DB_OFFSET(t3), db_frame },
 +#else
 { t0,  DB_OFFSET(t0), db_frame },
 { t1,  DB_OFFSET(t1), db_frame },
 { t2,  DB_OFFSET(t2), db_frame },
 @@ -85,6 +95,7 @@ struct db_variable db_regs[] = {
 { t5,  DB_OFFSET(t5), db_frame },
 { t6,  DB_OFFSET(t6), db_frame },

Re: svn commit: r249484 - head/lib

2013-04-17 Thread Juli Mallett
On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle kient...@freebsd.org wrote:

 On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote:

 On 2013-04-14 21:13, Tim Kientzle wrote:
 Author: kientzle
 Date: Sun Apr 14 19:13:51 2013
 New Revision: 249484
 URL: http://svnweb.freebsd.org/changeset/base/249484

 Log:
  Install a symlink
/usr/lib/include == /usr/include

  This fixes -print-file-name=include in clang (and is
  arguably a better way to fix the same issue in GCC than
  the change I made in r231336).

  MFC after:  1 week

 Modified:
  head/lib/Makefile

 Modified: head/lib/Makefile
 ==
 --- head/lib/MakefileSun Apr 14 18:36:30 2013(r249483)
 +++ head/lib/MakefileSun Apr 14 19:13:51 2013(r249484)
 @@ -252,4 +252,7 @@ _libusbhid=  libusbhid
 _libusb= libusb
 .endif

 +afterinstall:
 +ln -fs ../include ${DESTDIR}/usr/lib/include
 +
 .include bsd.subdir.mk

 This breaks with -DNO_CLEAN defined, because then
 ${DESTDIR}/usr/lib/include/include is created.

 That's a good point.  Would this work better?

 afterinstall:
  if [ ! -e $(DESTDIR)/usr/lib/include ]; then
 ln -fs ../include $(DESTDIR)/usr/lib/include
  fi

 I'm not that fond of this patch by the way, but I don't fully
 understand the problem it's trying to solve so I won't object.
 It just looks too much like a hack to me

 It's a subtle issue and I'm not surprised that it raised some
 eyebrows.  I spent a long time looking for a better solution.

 In short, both GCC and Clang make some assumptions
 about the layout of headers used for freestanding compiles.
 (My earlier commit said these assumptions were undocumented,
 but that's not quite true, they're just rather obscure.)

If you're doing a freestanding compile...shouldn't you also be
specifying both include and library paths explicitly?  I just feel
more confused by this explanation.  Why not just specify
-I/usr/include?  (Or even better, if you're doing a freestanding
compile, but want the default include paths, get the compiler to dump
the default include paths and process that.)  /usr/lib/include is just
badly and plainly wrong unless it's absolutely, absolutely necessary.

 This symlink is the simplest way I've found to reconcile those
 assumptions with the FreeBSD directory layout.  I'm happy to
 consider alternatives.

 Tim

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r249484 - head/lib

2013-04-17 Thread Juli Mallett
On Tue, Apr 16, 2013 at 11:26 PM, Tim Kientzle kient...@freebsd.org wrote:

 On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote:
 If you're doing a freestanding compile...shouldn't you also be
 specifying both include and library paths explicitly?

 Yes, of course.  But the correct directories to use vary somewhat
 across platforms, so we would like to have some reasonably
 portable way to find the right directory to use for building on
 a particular system.

 Both gcc and clang support a -print-file-name=include option which
 is supposed to print out the directory containing headers used
 for freestanding compiles.  You can then take that path and
 use it as the explicit include directory path for freestanding builds.

Right...

  (Or even better, if you're doing a freestanding
 compile, but want the default include paths, get the compiler to dump
 the default include paths and process that.)

 That's precisely what this is for.  I've been working with U-Boot
 sources which compile on many systems and use
 -print-file-name=include to identify the directory containing
 the basic freestanding header files.

 The -print-file-name=include option works on Linux, works
 on MacOS, and --- with this one symlink --- can work on
 FreeBSD as well.  I've been using it to cross-build U-Boot
 using the FreeBSD xdev toolchain with both GCC and Clang.

I'm confused as to how it wasn't working, and am not convinced that it
shouldn't be fixed otherwise.  It seems like for clang the user ought
to get /usr/include/clang/{version}, except for the problem that we
don't put some headers there that some software might expect; so maybe
we should just install copies of things like stddef.h into the
compiler-specific directory as well?  I'm not sure I'm fully
understanding your needs, or what you're seeing in practice.
Certainly none of those systems have a /usr/lib/include AFAIK; this
seems like we're just not deploying our compilers configured in the
way that some software (perhaps rightly) expects.

And -print-file-name=include doesn't give you the full search path;
shouldn't it just give the compiler-specific include directory?  You
really want something like:

% clang -E -Xpreprocessor -v -x c /dev/null

For C, and -x c++ for C++.

What are the headers you are expecting to find?  stddef.h, stdbool.h,
stdarg.h?  I think I'd rather just see those installed in the
compiler-specific dirs, and if we're not spitting those out with our
stock-built compilers, we should fix that to match behaviour on other
systems.  Other systems' -print-file-name=include doesn't expose all
of /usr/include, as far as I can tell.  That seem excessive and wrong
for a freestanding build.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r249355 - head/lib/libkvm

2013-04-11 Thread Juli Mallett
On Thu, Apr 11, 2013 at 11:00 AM, Gleb Smirnoff gleb...@freebsd.org wrote:
   Bruce,

 On Thu, Apr 11, 2013 at 09:07:25PM +1000, Bruce Evans wrote:
 B Just routine avoidance of namespace pollution.  This is easy in such a
 B simple header.

 Sorry, with all respect, but I can't call including sys/types.h
 a namespace pollution.

 Ok, even you force me to name it that way, still I would prefer
 namespace pollution instead of handmade copy pasted typedefs.

But Gleb, making such changes unilaterally is a bit of a leap.  The
project has mostly accepted Bruce's wisdom about trying to minimize
and reduce namespace pollution.  Now, this isn't a standard header so
it's quite a bit less of a concern, but it's not no concern.  If you
think that we should reverse our trend on including
namespace-polluting headers in system headers, we should discuss that
on arch@, and it shouldn't be something that's done without any
discussion or consideration.

Should we expect further changes of this nature (and of the proposed
nature removing __size_t and __ssize_t use) if you make changes to
other headers as part of your work?  Are you going to add
sys/types.h to every header currently using sys/_types.h in a
single go, or will you be doing that a little at a time when making
functional changes?

Thanks,
Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r247860 - in head/sbin: mount_ext2fs mount_reiserfs mount_std

2013-03-05 Thread Juli Mallett
Thanks!

On Tue, Mar 5, 2013 at 3:53 PM, Jung-uk Kim j...@freebsd.org wrote:
 Author: jkim
 Date: Tue Mar  5 23:53:37 2013
 New Revision: 247860
 URL: http://svnweb.freebsd.org/changeset/base/247860

 Log:
   GC unused mount_* directories.  mount_reiserfs was disconnected from build
   with r158666.  mount_ext2fs and mount_std were disconnected with r164527.

 Deleted:
   head/sbin/mount_ext2fs/
   head/sbin/mount_reiserfs/
   head/sbin/mount_std/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r247035 - head/sys/dev/ixgbe

2013-02-20 Thread Juli Mallett
On Wed, Feb 20, 2013 at 10:57 AM, Dag-Erling Smørgrav d...@des.no wrote:
 Jack Vogel jfvo...@gmail.com writes:
 OK, this change must be backed out. This was not run past me, and this
 is a shared code file, that means its code that we license in both
 GPL, BSD, and closed source licensing, and thus we CANNOT accept
 changes without special handling. Further, I do not author this code,
 its done by another team internally, and I simply accept it as a
 component.

 I think you're confused.  I did not commit this to Intel's code
 repository.  I committed it to FreeBSD's code repository as a precursor
 to a slightly more extensive patch which I intend to commit once I've
 tested it more thoroughly.

Please don't.  Many others have accepted/respected Jack's
maintainership by letting him keep control of the in-tree driver as
much as is possible, particularly outside of ixgbe.c.  I would love to
have committed my code to handle 1G SFPs quite some time ago, but it
makes at least a little sense to me that Jack handles the merges and
testing and whatnot and doesn't need the additional work of
maintaining FreeBSD additions he can't test.  In general, the benefit
of having the Intel drivers updated regularly by someone who has done
extensive testing and who has the backing of Intel has outweighed the
cost of deferring to Intel and Jack about what can go into the
drivers.

If your changes are so compelling, I would have expected them to have
appeared at least on a major public mailing list, rather than
committed at a whim to a driver which has a clear and obvious
maintainer.  If we really do have a lot of wonderful changes that are
stalled by Jack's maintainership, provide a second driver in-tree and
maintain it, which has all the go-faster/better/stronger stripes.

It's not just Jack that unexpected changes to these critical drivers
make things harder for.  There's Luigi, Ryan Stone, John Baldwin,
myself and others, who maintain extensions to the Intel drivers
in-tree and/or privately.

Thanks,
Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org

Re: svn commit: r246204 - head/sys/arm/include

2013-02-01 Thread Juli Mallett
On Fri, Feb 1, 2013 at 1:01 PM, Andre Oppermann an...@freebsd.org wrote:
 On 01.02.2013 21:23, Adrian Chadd wrote:

 .. before you make that assumption, please re-visit some the ..
 lower-end integrated ethernet MACs in embedded chips.

 I don't know whether the Atheros stuff does (I think it does, but I
 don't know under what conditions it's possible.)

 Maybe have it by default not return jumbo mbufs, and if a driver wants
 jumbo mbufs it can explicitly ask for them.


 Jumbo frames do not see wide-spread use.  If they are used, then
 in data centre LAN environments and possibly also inter-datacenter.
 That is high performance environments.

 I seriously doubt that lower-end ethernet MACs you're referring to
 fit that bill.

These are silly generalizations, Andre.  I know of low-end systems in
jumbo frame environments.  I think Adrian's implication that Atheros
hardware can't handle doing scatter-gather into multiple buffers for
jumbo frames is probably an unlikely one, but if we have hardware that
requires jumbo mbufs, we should obviously keep supporting jumbo mbufs
to some extent.

Hypotheticals are somewhat irrelevant, but I find it surprising that
you're being so glib about breaking FreeBSD networking just because of
an idea you have about where jumbo frame use is appropriate and what
kinds of hardware should be connected to jumbo frame networks.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r245712 - head/sys/contrib/octeon-sdk

2013-01-20 Thread Juli Mallett
Author: jmallett
Date: Mon Jan 21 06:47:06 2013
New Revision: 245712
URL: http://svnweb.freebsd.org/changeset/base/245712

Log:
  Fix packet reception and other issues arising from incorrect ASX clock
  configuration on the physical ports of the Ubiquiti EdgeRouter Lite.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Jan 21 06:46:17 
2013(r245711)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Jan 21 06:47:06 
2013(r245712)
@@ -1394,6 +1394,21 @@ int __cvmx_helper_board_hardware_enable(
 }
 }
 }
+#if defined(OCTEON_VENDOR_UBIQUITI)
+else if (cvmx_sysinfo_get()-board_type == 
CVMX_BOARD_TYPE_CUST_UBIQUITI_E100)
+{
+   /* Configure ASX cloks for all ports on interface 0.  */
+   if (interface == 0)
+   {
+   int port;
+
+   for (port = 0; port  3; port++) {
+cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 16);
+cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(port, interface), 0);
+   }
+   }
+}
+#endif
 return 0;
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r244984 - in head/sys: conf contrib/octeon-sdk mips/conf

2013-01-02 Thread Juli Mallett
Author: jmallett
Date: Wed Jan  2 23:17:50 2013
New Revision: 244984
URL: http://svnweb.freebsd.org/changeset/base/244984

Log:
  Add basic support for the Ubiquiti EdgeRouter Lite.
  
  Note that USB does not currently work, and the flash is connected via USB, so
  local storage is not working.

Modified:
  head/sys/conf/options.mips
  head/sys/contrib/octeon-sdk/cvmx-app-init.h
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c
  head/sys/mips/conf/OCTEON1

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Wed Jan  2 22:26:46 2013(r244983)
+++ head/sys/conf/options.mips  Wed Jan  2 23:17:50 2013(r244984)
@@ -73,6 +73,7 @@ MAXMEMopt_global.h
 #
 OCTEON_MODEL   opt_cvmx.h
 OCTEON_VENDOR_LANNER   opt_cvmx.h
+OCTEON_VENDOR_UBIQUITI opt_cvmx.h
 OCTEON_VENDOR_RADISYS  opt_cvmx.h
 OCTEON_BOARD_CAPK_0100ND   opt_cvmx.h
 

Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h
==
--- head/sys/contrib/octeon-sdk/cvmx-app-init.h Wed Jan  2 22:26:46 2013
(r244983)
+++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Wed Jan  2 23:17:50 2013
(r244984)
@@ -299,6 +299,9 @@ enum cvmx_board_types_enum {
 CVMX_BOARD_TYPE_CUST_LANNER_MR320= 20002,
 CVMX_BOARD_TYPE_CUST_LANNER_MR321X=20007,
 #endif
+#if defined(OCTEON_VENDOR_UBIQUITI)
+CVMX_BOARD_TYPE_CUST_UBIQUITI_E100=20002,
+#endif
 #if defined(OCTEON_VENDOR_RADISYS)
 CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE=20002,
 #endif
@@ -426,6 +429,9 @@ static inline const char *cvmx_board_typ
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR320)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR321X)
 #endif
+#if defined(OCTEON_VENDOR_UBIQUITI)
+   ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E100)
+#endif
 #if defined(OCTEON_VENDOR_RADISYS)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE)
 #endif

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan  2 22:26:46 
2013(r244983)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan  2 23:17:50 
2013(r244984)
@@ -592,6 +592,12 @@ int cvmx_helper_board_get_mii_address(in
return -1;
}
 #endif
+#if defined(OCTEON_VENDOR_UBIQUITI)
+   case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100:
+   if (ipd_port  2)
+   return -1;
+   return (7 - ipd_port);
+#endif
 #if defined(OCTEON_VENDOR_RADISYS)
case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE:
/* No MII.  */

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Wed Jan  2 22:26:46 2013(r244983)
+++ head/sys/mips/conf/OCTEON1  Wed Jan  2 23:17:50 2013(r244984)
@@ -39,6 +39,7 @@ makeoptions   DEBUG=-g#Build kernel with
 # Board-specific support that cannot be auto-detected at runtime.
 #options   OCTEON_VENDOR_LANNER# Support for Lanner boards.
 #options   OCTEON_VENDOR_RADISYS   # Support for Radisys boards.
+#options   OCTEON_VENDOR_UBIQUITI  # Support for Ubiquiti boards.
 #options   OCTEON_BOARD_CAPK_0100ND# Support for CAPK-0100nd.
 
 # Compile for a specified Octeon model.  If not specified, support for
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r244985 - head/sys/contrib/octeon-sdk

2013-01-02 Thread Juli Mallett
Author: jmallett
Date: Wed Jan  2 23:29:54 2013
New Revision: 244985
URL: http://svnweb.freebsd.org/changeset/base/244985

Log:
  Use the right USB clock type on the EdgeRouter Lite.  This fixes USB.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan  2 23:17:50 
2013(r244984)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan  2 23:29:54 
2013(r244985)
@@ -1469,6 +1469,9 @@ cvmx_helper_board_usb_clock_types_t __cv
 case CVMX_BOARD_TYPE_CUST_LANNER_MR320:
 case CVMX_BOARD_TYPE_CUST_LANNER_MR321X:
 #endif
+#if defined(OCTEON_VENDOR_UBIQUITI)
+case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100:
+#endif
 #if defined(OCTEON_BOARD_CAPK_0100ND)
case CVMX_BOARD_TYPE_CN3010_EVB_HS5:
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r244865 - in head: . lib lib/libdisk share/mk

2012-12-30 Thread Juli Mallett
On Sun, Dec 30, 2012 at 6:54 PM, Adrian Chadd adr...@freebsd.org wrote:
 .. not that I mind old things being retired, but we really should
 announce things like this.

 Also - you disconnected libftpio too; is that intentional?

I would assume so, given that this only removed the static library
name, which nothing else could be using still, seeing as how the
library was disconnected and removed in r225952.

 Just because libdisk/libftpio isn't used by anything in the base -HEAD
 doesn't mean that:

 * it's not used by third party programs in ports;
 * it's not used by any external, non open source utilities that people
 have read.

 So I'd suggest creating a port for them both and begin the process of
 deprecating the kernel side interfaces that are unique to this API.

Pretty sure the addition of and widespread use of GEOM things
initiated the deprecation of the really lousy and properly-disliked
kernel interfaces involved.

 On 30 December 2012 08:28, Nathan Whitehorn nwhiteh...@freebsd.org wrote:
 Author: nwhitehorn
 Date: Sun Dec 30 16:28:06 2012
 New Revision: 244865
 URL: http://svnweb.freebsd.org/changeset/base/244865

 Log:
   With the old sade removed, libdisk is no longer used by anything in HEAD
   and uses a number of problematic pre-gpart interfaces. Since it has been
   entirely obsoleted by interfaces in geom, remove it.

 Deleted:
   head/lib/libdisk/
 Modified:
   head/ObsoleteFiles.inc
   head/lib/Makefile
   head/share/mk/bsd.libnames.mk

 Modified: head/ObsoleteFiles.inc
 ==
 --- head/ObsoleteFiles.inc  Sun Dec 30 15:38:06 2012(r244864)
 +++ head/ObsoleteFiles.inc  Sun Dec 30 16:28:06 2012(r244865)
 @@ -38,6 +38,9 @@
  #   xargs -n1 | sort | uniq -d;
  # done

 +# 20121230: libdisk removed
 +OLD_FILES+=usr/share/man/man3/libdisk.3.gz usr/include/libdisk.h
 +OLD_FILES+=usr/lib/libdisk.a usr/lib32/libdisk.a
  # 20121230: remove wrongly created directories for auditdistd
  OLD_DIRS+=var/dist
  OLD_DIRS+=var/remote

 Modified: head/lib/Makefile
 ==
 --- head/lib/Makefile   Sun Dec 30 15:38:06 2012(r244864)
 +++ head/lib/Makefile   Sun Dec 30 16:28:06 2012(r244865)
 @@ -69,7 +69,6 @@ SUBDIR=   ${SUBDIR_ORDERED} \
 libcompat \
 libdevinfo \
 libdevstat \
 -   libdisk \
 libdwarf \
 libedit \
 ${_libefi} \

 Modified: head/share/mk/bsd.libnames.mk
 ==
 --- head/share/mk/bsd.libnames.mk   Sun Dec 30 15:38:06 2012
 (r244864)
 +++ head/share/mk/bsd.libnames.mk   Sun Dec 30 16:28:06 2012
 (r244865)
 @@ -45,7 +45,6 @@ LIBCURSES?=   ${DESTDIR}${LIBDIR}/libcurse
  LIBDEVINFO?=   ${DESTDIR}${LIBDIR}/libdevinfo.a
  LIBDEVSTAT?=   ${DESTDIR}${LIBDIR}/libdevstat.a
  LIBDIALOG?=${DESTDIR}${LIBDIR}/libdialog.a
 -LIBDISK?=  ${DESTDIR}${LIBDIR}/libdisk.a
  LIBDNS?=   ${DESTDIR}${LIBDIR}/libdns.a
  LIBDTRACE?=${DESTDIR}${LIBDIR}/libdtrace.a
  LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a
 @@ -54,7 +53,6 @@ LIBELF?=  ${DESTDIR}${LIBDIR}/libelf.a
  LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a
  LIBFL?=don't use LIBFL, use LIBL
  LIBFORM?=  ${DESTDIR}${LIBDIR}/libform.a
 -LIBFTPIO?= ${DESTDIR}${LIBDIR}/libftpio.a
  LIBG2C?=   ${DESTDIR}${LIBDIR}/libg2c.a
  LIBGCC?=   ${DESTDIR}${LIBDIR}/libgcc.a
  LIBGCC_PIC?=   ${DESTDIR}${LIBDIR}/libgcc_pic.a
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r244765 - in head/sys: kern tools

2012-12-27 Thread Juli Mallett
Seems like uintmax_t and %ju might be better?  At least, truncating a
syscall arg to a pointer seems like it could be misleading (e.g. on
MIPS n32, even though it's an abomination.)

On Thu, Dec 27, 2012 at 10:52 PM, Oleksandr Tymoshenko
go...@freebsd.org wrote:
 Author: gonzo
 Date: Fri Dec 28 06:52:53 2012
 New Revision: 244765
 URL: http://svnweb.freebsd.org/changeset/base/244765

 Log:
   Fix build on ARM (and probably other platforms)

 Modified:
   head/sys/kern/subr_syscall.c
   head/sys/tools/vnode_if.awk

 Modified: head/sys/kern/subr_syscall.c
 ==
 --- head/sys/kern/subr_syscall.cFri Dec 28 05:48:44 2012
 (r244764)
 +++ head/sys/kern/subr_syscall.cFri Dec 28 06:52:53 2012
 (r244765)
 @@ -78,7 +78,7 @@ syscallenter(struct thread *td, struct s
 ktrsyscall(sa-code, sa-narg, sa-args);
  #endif
 KTR_START4(KTR_SYSC, syscall, syscallname(p, sa-code),
 -   td, pid:%d, td-td_proc-p_pid, arg0:%p, sa-args[0],
 +   (uintptr_t)td, pid:%d, td-td_proc-p_pid, arg0:%p, 
 sa-args[0],
 arg1:%p, sa-args[1], arg2:%p, sa-args[2]);

 if (error == 0) {
 @@ -152,7 +152,7 @@ syscallenter(struct thread *td, struct s
 }
   retval:
 KTR_STOP4(KTR_SYSC, syscall, syscallname(p, sa-code),
 -   td, pid:%d, td-td_proc-p_pid, error:%d, error,
 +   (uintptr_t)td, pid:%d, td-td_proc-p_pid, error:%d, error,
 retval0:%#lx, td-td_retval[0], retval1:%#lx,
 td-td_retval[1]);
 if (traced) {

 Modified: head/sys/tools/vnode_if.awk
 ==
 --- head/sys/tools/vnode_if.awk Fri Dec 28 05:48:44 2012(r244764)
 +++ head/sys/tools/vnode_if.awk Fri Dec 28 06:52:53 2012(r244765)
 @@ -270,7 +270,7 @@ while ((getline  srcfile)  0) {
 ctrargs = 4;
 else
 ctrargs = numargs;
 -   ctrstr = ctrargs (KTR_VOP, \VOP\, \ uname \, a,\n\t;
 +   ctrstr = ctrargs (KTR_VOP, \VOP\, \ uname \, (uintptr_t)a,\n\t 
;
 ctrstr = ctrstr \ args[0] :0x%jX\, (uintptr_t)a-a_ args[0];
 for (i = 1; i  ctrargs; ++i)
 ctrstr = ctrstr , \ args[i] :0x%jX\, a-a_ args[i];
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243587 - head/sys/contrib/octeon-sdk

2012-11-26 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 27 02:03:41 2012
New Revision: 243587
URL: http://svnweb.freebsd.org/changeset/base/243587

Log:
  Allow this file to build on FreeBSD.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-dma-engine.c

Modified: head/sys/contrib/octeon-sdk/cvmx-dma-engine.c
==
--- head/sys/contrib/octeon-sdk/cvmx-dma-engine.c   Tue Nov 27 01:59:51 
2012(r243586)
+++ head/sys/contrib/octeon-sdk/cvmx-dma-engine.c   Tue Nov 27 02:03:41 
2012(r243587)
@@ -65,8 +65,10 @@
 #include asm/octeon/cvmx-pexp-defs.h
 #include asm/octeon/cvmx-helper-cfg.h
 #else
+#if !defined(__FreeBSD__) || !defined(_KERNEL)
 #include executive-config.h
 #include cvmx-config.h
+#endif
 #include cvmx.h
 #include cvmx-cmd-queue.h
 #include cvmx-dma-engine.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243469 - in head/sys: conf contrib/octeon-sdk mips/cavium mips/conf

2012-11-23 Thread Juli Mallett
Author: jmallett
Date: Sat Nov 24 02:00:29 2012
New Revision: 243469
URL: http://svnweb.freebsd.org/changeset/base/243469

Log:
  o) Add support for specifying a model of Octeon to target at compile-time,
 reducing the number of runtime checks done by the SDK code.
  o) Group board/CPU information at early startup by subject matter, so that 
e.g.
 CPU information is adjacent to CPU information and board information is
 adjacent to board information.

Modified:
  head/sys/conf/options.mips
  head/sys/contrib/octeon-sdk/octeon-model.c
  head/sys/contrib/octeon-sdk/octeon-model.h
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/conf/OCTEON1

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Fri Nov 23 23:51:06 2012(r243468)
+++ head/sys/conf/options.mips  Sat Nov 24 02:00:29 2012(r243469)
@@ -71,6 +71,7 @@ MAXMEMopt_global.h
 #
 # Options that control the Cavium Simple Executive.
 #
+OCTEON_MODEL   opt_cvmx.h
 OCTEON_VENDOR_LANNER   opt_cvmx.h
 OCTEON_VENDOR_RADISYS  opt_cvmx.h
 OCTEON_BOARD_CAPK_0100ND   opt_cvmx.h

Modified: head/sys/contrib/octeon-sdk/octeon-model.c
==
--- head/sys/contrib/octeon-sdk/octeon-model.c  Fri Nov 23 23:51:06 2012
(r243468)
+++ head/sys/contrib/octeon-sdk/octeon-model.c  Sat Nov 24 02:00:29 2012
(r243469)
@@ -60,20 +60,24 @@
 #include cvmx-warn.h
 #endif
 
-#if defined(CVMX_BUILD_FOR_LINUX_USER) || defined(CVMX_BUILD_FOR_STANDALONE)
+#if defined(CVMX_BUILD_FOR_LINUX_USER) || defined(CVMX_BUILD_FOR_STANDALONE) 
|| defined(CVMX_BUILD_FOR_FREEBSD_KERNEL)
+#if !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL)
 #include octeon-app-init.h
+#endif
 #include cvmx-sysinfo.h
 
 /**
  * This function checks to see if the software is compatible with the
  * chip it is running on.  This is called in the application startup code
  * and does not need to be called directly by the application.
- * Does not return if software is incompatible.
+ * Does not return if software is incompatible, unless compiled for the
+ * FreeBSD kernel, in which case it returns -1.
  *
  * @param chip_id chip id that the software is being run on.
  *
  * @return 0: runtime checking or exact version match
  * 1: chip is newer revision than compiled for, but software will run 
properly.
+ *-1: software is incompatible
  */
 int octeon_model_version_check(uint32_t chip_id __attribute__ ((unused)))
 {
@@ -91,7 +95,11 @@ int octeon_model_version_check(uint32_t 
 Expecting ID=0x%08x, Chip is 0x%08x\n, 
(OCTEON_MODEL  0xff), (unsigned int)chip_id);
 if ((OCTEON_MODEL  0xff)  chip_id)
 printf(Refusing to run on older revision than program was 
compiled for.\n);
+#if !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL)
exit(-1);
+#else
+   return(-1);
+#endif
 }
 else
 {

Modified: head/sys/contrib/octeon-sdk/octeon-model.h
==
--- head/sys/contrib/octeon-sdk/octeon-model.h  Fri Nov 23 23:51:06 2012
(r243468)
+++ head/sys/contrib/octeon-sdk/octeon-model.h  Sat Nov 24 02:00:29 2012
(r243469)
@@ -317,7 +317,7 @@ extern C {
 )))
 
 #ifndef OCTEON_IS_MODEL
-#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || 
(defined(__linux__)  defined(__KERNEL__)) || 
defined(CVMX_BUILD_FOR_TOOLCHAIN) || (defined(__FreeBSD__)  defined(_KERNEL))
+#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || 
(defined(__linux__)  defined(__KERNEL__)) || 
defined(CVMX_BUILD_FOR_TOOLCHAIN) || (defined(__FreeBSD__)  defined(_KERNEL) 
 !defined(OCTEON_MODEL))
 
 /* NOTE: This for internal use only! */
 static inline int __octeon_is_model_runtime__(uint32_t model)
@@ -359,6 +359,7 @@ static inline int __octeon_is_model_runt
 #endif
 #endif
 
+int octeon_model_version_check(uint32_t chip_id);
 const char *octeon_model_get_string(uint32_t chip_id);
 const char *octeon_model_get_string_buffer(uint32_t chip_id, char * buffer);
 

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Fri Nov 23 23:51:06 2012
(r243468)
+++ head/sys/mips/cavium/octeon_machdep.c   Sat Nov 24 02:00:29 2012
(r243469)
@@ -276,6 +276,7 @@ platform_start(__register_t a0, __regist
 {
const struct octeon_feature_description *ofd;
uint64_t platform_counter_freq;
+   int rv;
 
mips_postboot_fixup();
 
@@ -293,19 +294,25 @@ platform_start(__register_t a0, __regist
cninit();
 
/*
-* Display information about the board/CPU.
+* Display information about the CPU.
 */
+#if 

svn commit: r243470 - in head/sys: contrib/octeon-sdk mips/cavium

2012-11-23 Thread Juli Mallett
Author: jmallett
Date: Sat Nov 24 02:12:24 2012
New Revision: 243470
URL: http://svnweb.freebsd.org/changeset/base/243470

Log:
  Use bootverbose to control debug printfs from the Cavium Simple Executive
  code.  Also remove an unnecessary CVMX_ENABLE_DEBUG_PRINTS conditional around
  what is already a cvmx_dprintf.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-spi.c
  head/sys/contrib/octeon-sdk/cvmx-utils.h
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c
==
--- head/sys/contrib/octeon-sdk/cvmx-spi.c  Sat Nov 24 02:00:29 2012
(r243469)
+++ head/sys/contrib/octeon-sdk/cvmx-spi.c  Sat Nov 24 02:12:24 2012
(r243470)
@@ -182,9 +182,7 @@ int cvmx_spi_restart_interface(int inter
 if (!(OCTEON_IS_MODEL(OCTEON_CN38XX) || OCTEON_IS_MODEL(OCTEON_CN58XX)))
 return res;
 
-#if CVMX_ENABLE_DEBUG_PRINTS
 cvmx_dprintf (SPI%d: Restart %s\n, interface, modes[mode]);
-#endif
 
 // Callback to perform SPI4 reset
 INVOKE_CB(cvmx_spi_callbacks.reset_cb, interface,mode);

Modified: head/sys/contrib/octeon-sdk/cvmx-utils.h
==
--- head/sys/contrib/octeon-sdk/cvmx-utils.hSat Nov 24 02:00:29 2012
(r243469)
+++ head/sys/contrib/octeon-sdk/cvmx-utils.hSat Nov 24 02:12:24 2012
(r243470)
@@ -76,6 +76,9 @@ extern C {
 #ifdef CVMX_BUILD_FOR_LINUX_KERNEL
 #define cvmx_dprintfprintk
 #define cvmx_dvprintf   vprintk
+#elif defined(CVMX_BUILD_FOR_FREEBSD_KERNEL)
+   void cvmx_dvprintf(const char *, va_list);
+   void cvmx_dprintf(const char *, ...) __attribute__ ((format(printf, 1, 
2)));
 #else
 #define cvmx_dprintfprintf
 #define cvmx_dvprintf   vprintf

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Sat Nov 24 02:00:29 2012
(r243469)
+++ head/sys/mips/cavium/octeon_machdep.c   Sat Nov 24 02:12:24 2012
(r243470)
@@ -446,6 +446,24 @@ SYSCTL_PROC(_machdep, OID_AUTO, led_disp
 NULL, 0, sysctl_machdep_led_display, A,
 String to display on LED display);
 
+void
+cvmx_dvprintf(const char *fmt, va_list ap)
+{
+   if (!bootverbose)
+   return;
+   vprintf(fmt, ap);
+}
+
+void
+cvmx_dprintf(const char *fmt, ...)
+{
+   va_list ap;
+
+   va_start(ap, fmt);
+   cvmx_dvprintf(fmt, ap);
+   va_end(ap);
+}
+
 /**
  * version of printf that works better in exception context.
  *
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243473 - head/sys/contrib/octeon-sdk

2012-11-23 Thread Juli Mallett
Author: jmallett
Date: Sat Nov 24 02:55:05 2012
New Revision: 243473
URL: http://svnweb.freebsd.org/changeset/base/243473

Log:
  o) Have the FreeBSD kernel option INVARIANTS trickle down into the Simple
 Executive code where similar invariant knobs exist.
  o) Make the Simple Executive's warning function print WARNING:  on the same
 line as the warning it is displaying, rather than on a separate line.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-pow.h
  head/sys/contrib/octeon-sdk/cvmx-warn.c
  head/sys/contrib/octeon-sdk/cvmx.h

Modified: head/sys/contrib/octeon-sdk/cvmx-pow.h
==
--- head/sys/contrib/octeon-sdk/cvmx-pow.h  Sat Nov 24 02:41:18 2012
(r243472)
+++ head/sys/contrib/octeon-sdk/cvmx-pow.h  Sat Nov 24 02:55:05 2012
(r243473)
@@ -80,9 +80,23 @@
 extern C {
 #endif
 
-/* Default to having all POW constancy checks turned on */
-#ifndef CVMX_ENABLE_POW_CHECKS
-#define CVMX_ENABLE_POW_CHECKS 1
+#if defined(__FreeBSD__)  defined(_KERNEL)
+/*
+ * For the FreeBSD kernel, have POW consistency checks depend on
+ * the setting of INVARIANTS.
+ */
+#ifndef CVMX_ENABLE_POW_CHECKS
+#ifdef INVARIANTS
+#define CVMX_ENABLE_POW_CHECKS 1
+#else
+#define CVMX_ENABLE_POW_CHECKS 0
+#endif
+#endif
+#else
+/* Default to having all POW constancy checks turned on */
+#ifndef CVMX_ENABLE_POW_CHECKS
+#define CVMX_ENABLE_POW_CHECKS 1
+#endif
 #endif
 
 /**

Modified: head/sys/contrib/octeon-sdk/cvmx-warn.c
==
--- head/sys/contrib/octeon-sdk/cvmx-warn.c Sat Nov 24 02:41:18 2012
(r243472)
+++ head/sys/contrib/octeon-sdk/cvmx-warn.c Sat Nov 24 02:55:05 2012
(r243473)
@@ -77,7 +77,11 @@ void cvmx_warn(const char *format, ...)
 printk(WARNING:);
 vprintk(format, args);
 #else
+#ifdef CVMX_BUILD_FOR_FREEBSD_KERNEL
+printf(WARNING: );
+#else
 printf(WARNING:\n);
+#endif
 vprintf(format, args);
 #endif
 va_end(args);

Modified: head/sys/contrib/octeon-sdk/cvmx.h
==
--- head/sys/contrib/octeon-sdk/cvmx.h  Sat Nov 24 02:41:18 2012
(r243472)
+++ head/sys/contrib/octeon-sdk/cvmx.h  Sat Nov 24 02:55:05 2012
(r243473)
@@ -53,13 +53,28 @@
 /* Control whether simple executive applications use 1-1 TLB mappings to 
access physical
 ** memory addresses.  This must be disabled to allow large programs that use 
more than
 ** the 0x1000 - 0x2000 virtual address range.
+**
+** The FreeBSD kernel ifdefs elsewhere should mean that this is never even 
checked,
+** and so does not need to be defined.
 */
+#if !defined(__FreeBSD__) || !defined(_KERNEL)
 #ifndef CVMX_USE_1_TO_1_TLB_MAPPINGS
 #define CVMX_USE_1_TO_1_TLB_MAPPINGS 1
 #endif
+#endif
 
-#ifndef CVMX_ENABLE_PARAMETER_CHECKING
-#define CVMX_ENABLE_PARAMETER_CHECKING 1
+#if defined(__FreeBSD__)  defined(_KERNEL)
+#ifndef CVMX_ENABLE_PARAMETER_CHECKING
+#ifdef INVARIANTS
+#define CVMX_ENABLE_PARAMETER_CHECKING 1
+#else
+#define CVMX_ENABLE_PARAMETER_CHECKING 0
+#endif
+#endif
+#else
+#ifndef CVMX_ENABLE_PARAMETER_CHECKING
+#define CVMX_ENABLE_PARAMETER_CHECKING 1
+#endif
 #endif
 
 #ifndef CVMX_ENABLE_DEBUG_PRINTS
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243422 - head/sys/dev/gxemul/cons

2012-11-22 Thread Juli Mallett
Author: jmallett
Date: Fri Nov 23 04:28:13 2012
New Revision: 243422
URL: http://svnweb.freebsd.org/changeset/base/243422

Log:
  Use MIPS_PHYS_TO_DIRECT_UNCACHED rather than a homegrown version which is not
  compatible with 32-bit kernels.

Modified:
  head/sys/dev/gxemul/cons/gxemul_cons.c

Modified: head/sys/dev/gxemul/cons/gxemul_cons.c
==
--- head/sys/dev/gxemul/cons/gxemul_cons.c  Fri Nov 23 03:34:12 2012
(r243421)
+++ head/sys/dev/gxemul/cons/gxemul_cons.c  Fri Nov 23 04:28:13 2012
(r243422)
@@ -42,6 +42,8 @@ __FBSDID($FreeBSD$);
 
 #include ddb/ddb.h
 
+#include machine/cpuregs.h
+
 #defineGC_LOCK_INIT()  mtx_init(gc_lock, gc_lock, NULL, 
MTX_SPIN)
 
 #defineGC_LOCK() do {  
\
@@ -97,8 +99,6 @@ static void   gxemul_cons_timeout(void *)
  * XXXRW: Should be using FreeBSD's bus routines here, but they are not
  * available until later in the boot.
  */
-#defineMIPS_XKPHYS_UNCACHED_BASE   0x9000
-
 typedefuint64_tpaddr_t;
 typedefuint64_tvaddr_t;
 
@@ -106,7 +106,7 @@ static inline vaddr_t
 mips_phys_to_uncached(paddr_t phys)
 {
 
-   return (phys | MIPS_XKPHYS_UNCACHED_BASE);
+   return (MIPS_PHYS_TO_DIRECT_UNCACHED(phys));
 }
 
 static inline uint8_t
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243263 - head/sys/mips/cavium/octe

2012-11-19 Thread Juli Mallett
Author: jmallett
Date: Mon Nov 19 08:29:53 2012
New Revision: 243263
URL: http://svnweb.freebsd.org/changeset/base/243263

Log:
  Remove redundant printf of SDK version which already appears earlier in boot.

Modified:
  head/sys/mips/cavium/octe/ethernet.c

Modified: head/sys/mips/cavium/octe/ethernet.c
==
--- head/sys/mips/cavium/octe/ethernet.cMon Nov 19 08:03:40 2012
(r243262)
+++ head/sys/mips/cavium/octe/ethernet.cMon Nov 19 08:29:53 2012
(r243263)
@@ -308,8 +308,6 @@ int cvm_oct_init_module(device_t bus)
int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE;
int qos;
 
-   printf(cavium-ethernet: %s\n, OCTEON_SDK_VERSION_STRING);
-
cvm_oct_rx_initialize();
cvm_oct_configure_common_hw(bus);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243264 - head/sys/mips/cavium/octe

2012-11-19 Thread Juli Mallett
Author: jmallett
Date: Mon Nov 19 08:30:29 2012
New Revision: 243264
URL: http://svnweb.freebsd.org/changeset/base/243264

Log:
  Prevent hang on ATCA-7220 when transmitting packets  60 bytes.

Modified:
  head/sys/mips/cavium/octe/ethernet-tx.c

Modified: head/sys/mips/cavium/octe/ethernet-tx.c
==
--- head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 19 08:29:53 2012
(r243263)
+++ head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 19 08:30:29 2012
(r243264)
@@ -116,6 +116,19 @@ int cvm_oct_xmit(struct mbuf *m, struct 
}
}
 
+#ifdef OCTEON_VENDOR_RADISYS
+   /*
+* The RSYS4GBE will hang if asked to transmit a packet less than 60 
bytes.
+*/
+   if (__predict_false(m-m_pkthdr.len  60) 
+   cvmx_sysinfo_get()-board_type == 
CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) {
+   static uint8_t pad[60];
+
+   if (!m_append(m, sizeof pad - m-m_pkthdr.len, pad))
+   printf(%s: unable to pad small packet., __func__);
+   }
+#endif
+
/*
 * If the packet is not fragmented.
 */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243265 - head/sys/contrib/octeon-sdk

2012-11-19 Thread Juli Mallett
Author: jmallett
Date: Mon Nov 19 08:35:58 2012
New Revision: 243265
URL: http://svnweb.freebsd.org/changeset/base/243265

Log:
  Return port numbers for ATCA-7220 SPI interfaces in a different place for
  consistency reasons, and to ensure that CRC addition is disabled on output.
  With this, transmit seems to be working properly on the ATCA-7220.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c
  head/sys/contrib/octeon-sdk/cvmx-helper-spi.c

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 19 08:30:29 
2012(r243264)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 19 08:35:58 
2012(r243265)
@@ -1313,14 +1313,6 @@ int __cvmx_helper_board_interface_probe(
return 12;
break;
 #endif
-#if defined(OCTEON_VENDOR_RADISYS)
-   case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE:
-   if (interface == 0)
-   return 13;
-   if (interface == 1)
-   return 8;
-   return 0;
-#endif
 }
 #ifdef CVMX_BUILD_FOR_UBOOT
 if (CVMX_HELPER_INTERFACE_MODE_SPI == 
cvmx_helper_interface_get_mode(interface)  getenv(disable_spi))

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c   Mon Nov 19 08:30:29 
2012(r243264)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c   Mon Nov 19 08:35:58 
2012(r243265)
@@ -104,6 +104,16 @@ int __cvmx_helper_spi_enumerate(int inte
 }
 #endif
 
+#if defined(OCTEON_VENDOR_RADISYS)
+if (cvmx_sysinfo_get()-board_type == 
CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) {
+   if (interface == 0)
+   return 13;
+   if (interface == 1)
+   return 8;
+   return 0;
+}
+#endif
+
if ((cvmx_sysinfo_get()-board_type != CVMX_BOARD_TYPE_SIM) 
cvmx_spi4000_is_present(interface))
return 10;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243253 - head/sys/mips/cavium

2012-11-18 Thread Juli Mallett
Author: jmallett
Date: Mon Nov 19 00:19:27 2012
New Revision: 243253
URL: http://svnweb.freebsd.org/changeset/base/243253

Log:
  o) Do boot descriptor parsing before console setup so that we can use a 
console
 other than UART 0 from the outset.
  o) Print board information from sysinfo after consoles have been initialized
 rather than doing it during boot descriptor parsing.
  o) Use cvmx_safe_printf and platform_reset rather than panic when doing very
 early boot descriptor parsing before the console is set up.
  o) Get rid of the global octeon_bootinfo.

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Sun Nov 18 23:15:22 2012
(r243252)
+++ head/sys/mips/cavium/octeon_machdep.c   Mon Nov 19 00:19:27 2012
(r243253)
@@ -88,14 +88,11 @@ __FBSDID($FreeBSD$);
 #define MAX_APP_DESC_ADDR 0xafff
 #endif
 
-#define OCTEON_CLOCK_DEFAULT (500 * 1000 * 1000)
-
 struct octeon_feature_description {
octeon_feature_t ofd_feature;
const char *ofd_string;
 };
 
-extern int *edata;
 extern int *end;
 extern char cpu_model[];
 extern char cpu_board[];
@@ -280,26 +277,51 @@ platform_start(__register_t a0, __regist
const struct octeon_feature_description *ofd;
uint64_t platform_counter_freq;
 
+   mips_postboot_fixup();
+
/*
-* XXX
-* octeon_boot_params_init() should be called before anything else,
-* certainly before any output; we may find out from the boot
-* descriptor's flags that we're supposed to use the PCI or UART1
-* consoles rather than UART0.  No point doing that reorganization
-* until we actually intercept UART_DEV_CONSOLE for the UART1 case
-* and somehow handle the PCI console, which we lack code for
-* entirely.
+* Initialize boot parameters so that we can determine things like
+* which console we shoud use, etc.
 */
-
-   mips_postboot_fixup();
+   octeon_boot_params_init(a3);
 
/* Initialize pcpu stuff */
mips_pcpu0_init();
-   mips_timer_early_init(OCTEON_CLOCK_DEFAULT);
+   mips_timer_early_init(cvmx_sysinfo_get()-cpu_clock_hz);
+
+   /* Initialize console.  */
cninit();
 
+   /*
+* Display information about the board/CPU.
+*/
+   printf(CPU clock: %uMHz  Core Mask: %#x\n,
+  cvmx_sysinfo_get()-cpu_clock_hz / 100,
+  cvmx_sysinfo_get()-core_mask);
+   printf(Board Type: %u  Revision: %u/%u\n,
+  cvmx_sysinfo_get()-board_type,
+  cvmx_sysinfo_get()-board_rev_major,
+  cvmx_sysinfo_get()-board_rev_minor);
+   printf(MAC address base: %6D (%u configured)\n,
+  cvmx_sysinfo_get()-mac_addr_base, :,
+  cvmx_sysinfo_get()-mac_addr_count);
+
+#if defined(OCTEON_BOARD_CAPK_0100ND)
+   strcpy(cpu_board, CAPK-0100ND);
+   if (cvmx_sysinfo_get()-board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) {
+   panic(Compiled for %s, but board type is %s., cpu_board,
+  
cvmx_board_type_to_string(cvmx_sysinfo_get()-board_type));
+   }
+#else
+   strcpy(cpu_board,
+  cvmx_board_type_to_string(cvmx_sysinfo_get()-board_type));
+#endif
+   printf(Board: %s\n, cpu_board);
+   strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id()));
+   printf(Model: %s\n, cpu_model);
+   printf(Serial number: %s\n, cvmx_sysinfo_get()-board_serial_number);
+
octeon_ciu_reset();
-   octeon_boot_params_init(a3);
/*
 * XXX
 * We can certainly parse command line arguments or U-Boot environment
@@ -514,26 +536,26 @@ typedef struct {
uint64_t cvmx_desc_vaddr;
 } octeon_boot_descriptor_t;
 
-cvmx_bootinfo_t *octeon_bootinfo;
-
-static octeon_boot_descriptor_t *app_desc_ptr;
-
-static void
-octeon_process_app_desc_ver_6(void)
+static cvmx_bootinfo_t *
+octeon_process_app_desc_ver_6(octeon_boot_descriptor_t *app_desc_ptr)
 {
+   cvmx_bootinfo_t *octeon_bootinfo;
+
/* XXX Why is 0xULL a bad value?  */
if (app_desc_ptr-cvmx_desc_vaddr == 0 ||
-   app_desc_ptr-cvmx_desc_vaddr == 0xul)
-   panic(Bad octeon_bootinfo %p, octeon_bootinfo);
+   app_desc_ptr-cvmx_desc_vaddr == 0xul) {
+   cvmx_safe_printf(Bad octeon_bootinfo %#jx\n,
+   (uintmax_t)app_desc_ptr-cvmx_desc_vaddr);
+   return (NULL);
+   }
 
-   octeon_bootinfo =
-   (cvmx_bootinfo_t *)(intptr_t)app_desc_ptr-cvmx_desc_vaddr;
-octeon_bootinfo =
-   (cvmx_bootinfo_t *) ((intptr_t)octeon_bootinfo | MIPS_KSEG0_START);
-if (octeon_bootinfo-major_version != 1)
-   panic(Incompatible CVMX descriptor from 

svn commit: r243255 - head/sys/mips/cavium

2012-11-18 Thread Juli Mallett
Author: jmallett
Date: Mon Nov 19 01:58:20 2012
New Revision: 243255
URL: http://svnweb.freebsd.org/changeset/base/243255

Log:
  Add basic support for the Radisys-specific PCI console mechanism found on the
  Radisys ATCA-7220.

Modified:
  head/sys/mips/cavium/octeon_pci_console.c

Modified: head/sys/mips/cavium/octeon_pci_console.c
==
--- head/sys/mips/cavium/octeon_pci_console.c   Mon Nov 19 01:15:32 2012
(r243254)
+++ head/sys/mips/cavium/octeon_pci_console.c   Mon Nov 19 01:58:20 2012
(r243255)
@@ -39,8 +39,22 @@ __FBSDID($FreeBSD$);
 
 #include contrib/octeon-sdk/cvmx.h
 #include contrib/octeon-sdk/cvmx-bootmem.h
+#include contrib/octeon-sdk/cvmx-interrupt.h
 #include contrib/octeon-sdk/octeon-pci-console.h
 
+#ifdef OCTEON_VENDOR_RADISYS
+#defineOPCIC_FLAG_RSYS (0x0001)
+
+#defineOPCIC_RSYS_FIFO_SIZE(0x2000)
+#endif
+
+struct opcic_softc {
+   unsigned sc_flags;
+   uint64_t sc_base_addr;
+};
+
+static struct opcic_softc opcic_instance;
+
 static cn_probe_t opcic_cnprobe;
 static cn_init_t opcic_cninit;
 static cn_term_t opcic_cnterm;
@@ -49,20 +63,46 @@ static cn_putc_t opcic_cnputc;
 static cn_grab_t opcic_cngrab;
 static cn_ungrab_t opcic_cnungrab;
 
+#ifdef OCTEON_VENDOR_RADISYS
+static int opcic_rsys_cngetc(struct opcic_softc *);
+static void opcic_rsys_cnputc(struct opcic_softc *, int);
+#endif
+
 CONSOLE_DRIVER(opcic);
 
 static void
 opcic_cnprobe(struct consdev *cp)
 {
const struct cvmx_bootmem_named_block_desc *pci_console_block;
+   struct opcic_softc *sc;
+
+   sc = opcic_instance;
+   sc-sc_flags = 0;
+   sc-sc_base_addr = 0;
 
cp-cn_pri = CN_DEAD;
 
-   pci_console_block = 
cvmx_bootmem_find_named_block(OCTEON_PCI_CONSOLE_BLOCK_NAME);
-   if (pci_console_block == NULL)
-   return;
+   switch (cvmx_sysinfo_get()-board_type) {
+#ifdef OCTEON_VENDOR_RADISYS
+   case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE:
+   pci_console_block =
+   cvmx_bootmem_find_named_block(rsys_gbl_memory);
+   if (pci_console_block != NULL) {
+   sc-sc_flags |= OPCIC_FLAG_RSYS;
+   sc-sc_base_addr = pci_console_block-base_addr;
+   break;
+   }
+#endif
+   default:
+   pci_console_block =
+   
cvmx_bootmem_find_named_block(OCTEON_PCI_CONSOLE_BLOCK_NAME);
+   if (pci_console_block == NULL)
+   return;
+   sc-sc_base_addr = pci_console_block-base_addr;
+   break;
+   }
 
-   cp-cn_arg = (void *)(uintptr_t)pci_console_block-base_addr;
+   cp-cn_arg = sc;
snprintf(cp-cn_name, sizeof cp-cn_name, opcic@%p, cp-cn_arg);
cp-cn_pri = (boothowto  RB_SERIAL) ? CN_REMOTE : CN_NORMAL;
 }
@@ -82,13 +122,19 @@ opcic_cnterm(struct consdev *cp)
 static int
 opcic_cngetc(struct consdev *cp)
 {
-   uint64_t console_desc_addr;
+   struct opcic_softc *sc;
char ch;
int rv;
 
-   console_desc_addr = (uintptr_t)cp-cn_arg;
+   sc = cp-cn_arg;
 
-   rv = octeon_pci_console_read(console_desc_addr, 0, ch, 1, 
OCT_PCI_CON_FLAG_NONBLOCK);
+#ifdef OCTEON_VENDOR_RADISYS
+   if ((sc-sc_flags  OPCIC_FLAG_RSYS) != 0)
+   return (opcic_rsys_cngetc(sc));
+#endif
+
+   rv = octeon_pci_console_read(sc-sc_base_addr, 0, ch, 1,
+   OCT_PCI_CON_FLAG_NONBLOCK);
if (rv != 1)
return (-1);
return (ch);
@@ -97,14 +143,21 @@ opcic_cngetc(struct consdev *cp)
 static void
 opcic_cnputc(struct consdev *cp, int c)
 {
-   uint64_t console_desc_addr;
+   struct opcic_softc *sc;
char ch;
int rv;
 
-   console_desc_addr = (uintptr_t)cp-cn_arg;
+   sc = cp-cn_arg;
ch = c;
 
-   rv = octeon_pci_console_write(console_desc_addr, 0, ch, 1, 0);
+#ifdef OCTEON_VENDOR_RADISYS
+   if ((sc-sc_flags  OPCIC_FLAG_RSYS) != 0) {
+   opcic_rsys_cnputc(sc, c);
+   return;
+   }
+#endif
+
+   rv = octeon_pci_console_write(sc-sc_base_addr, 0, ch, 1, 0);
if (rv == -1)
panic(%s: octeon_pci_console_write failed., __func__);
 }
@@ -120,3 +173,64 @@ opcic_cnungrab(struct consdev *cp)
 {
(void)cp;
 }
+
+#ifdef OCTEON_VENDOR_RADISYS
+static int
+opcic_rsys_cngetc(struct opcic_softc *sc)
+{
+   uint64_t gbl_base;
+   uint64_t console_base;
+   uint64_t console_rbuf;
+   uint64_t console_rcnt[2];
+   uint16_t rcnt[2];
+   uint16_t roff;
+   int c;
+
+   gbl_base = CVMX_ADD_IO_SEG(sc-sc_base_addr);
+   console_base = gbl_base + 0x10;
+
+   console_rbuf = console_base + 0x2018;
+   console_rcnt[0] = console_base + 0x08;
+   console_rcnt[1] = console_base + 0x0a;
+
+   /* Check if there is anything new in the FIFO.  */
+   rcnt[0] 

svn commit: r243260 - head/sys/contrib/octeon-sdk

2012-11-18 Thread Juli Mallett
Author: jmallett
Date: Mon Nov 19 05:24:33 2012
New Revision: 243260
URL: http://svnweb.freebsd.org/changeset/base/243260

Log:
  Fix packet receive on the ATCA-7220 by disabling FCS-related checks, since the
  FCS is stripped by the underlying hardware before it reaches the Octeon.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-helper-spi.c
  head/sys/contrib/octeon-sdk/cvmx-spi.c

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c   Mon Nov 19 04:10:23 
2012(r243259)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c   Mon Nov 19 05:24:33 
2012(r243260)
@@ -164,6 +164,13 @@ int __cvmx_helper_spi_enable(int interfa
 cvmx_pip_prt_cfgx_t port_config;
 port_config.u64 = cvmx_read_csr(CVMX_PIP_PRT_CFGX(ipd_port));
 port_config.s.crc_en = 1;
+#ifdef OCTEON_VENDOR_RADISYS
+   /*
+* Incoming packets on the RSYS4GBE have the FCS stripped.
+*/
+   if (cvmx_sysinfo_get()-board_type == 
CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE)
+   port_config.s.crc_en = 0;
+#endif
 cvmx_write_csr(CVMX_PIP_PRT_CFGX(ipd_port), port_config.u64);
 }
 

Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c
==
--- head/sys/contrib/octeon-sdk/cvmx-spi.c  Mon Nov 19 04:10:23 2012
(r243259)
+++ head/sys/contrib/octeon-sdk/cvmx-spi.c  Mon Nov 19 05:24:33 2012
(r243260)
@@ -652,6 +652,13 @@ int cvmx_spi_interface_up_cb(int interfa
 
 gmxx_rxx_frm_min.u64 = 0;
 gmxx_rxx_frm_min.s.len = 64;
+#ifdef OCTEON_VENDOR_RADISYS
+/*
+ * Incoming packets on the RSYS4GBE have the FCS stripped.
+ */
+if (cvmx_sysinfo_get()-board_type == 
CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE)
+   gmxx_rxx_frm_min.s.len -= 4;
+#endif
 cvmx_write_csr(CVMX_GMXX_RXX_FRM_MIN(0,interface), gmxx_rxx_frm_min.u64);
 gmxx_rxx_frm_max.u64 = 0;
 gmxx_rxx_frm_max.s.len = 64*1024 - 4;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r243203 - head/sys/mips/mips

2012-11-17 Thread Juli Mallett
Author: jmallett
Date: Sat Nov 17 23:53:12 2012
New Revision: 243203
URL: http://svnweb.freebsd.org/changeset/base/243203

Log:
  Remove one wholly-unused and buggy routine and some nearby alternative 
symbols.
  
  While here, also correct a comment that seems to imply that this file is
  NetBSD's all-singing, all-dancing locore.S, rather than our conservative set 
of
  assembly support routines.

Modified:
  head/sys/mips/mips/support.S

Modified: head/sys/mips/mips/support.S
==
--- head/sys/mips/mips/support.SSat Nov 17 23:52:38 2012
(r243202)
+++ head/sys/mips/mips/support.SSat Nov 17 23:53:12 2012
(r243203)
@@ -83,8 +83,7 @@
  */
 
 /*
- * Contains code that is the first executed at boot time plus
- * assembly language support routines.
+ * Contains assembly language support routines.
  */
 
 #include opt_ddb.h
@@ -289,7 +288,6 @@ END(copyerr)
 #ifdef __mips_n64
 LEAF(fuword64)
 ALEAF(fuword)
-ALEAF(fuiword)
PTR_LA  v0, fswberr
blt a0, zero, fswberr   # make sure address is in user space
nop
@@ -305,7 +303,6 @@ END(fuword64)
 LEAF(fuword32)
 #ifndef __mips_n64
 ALEAF(fuword)
-ALEAF(fuiword)
 #endif
PTR_LA  v0, fswberr
blt a0, zero, fswberr   # make sure address is in user space
@@ -319,7 +316,6 @@ ALEAF(fuiword)
 END(fuword32)
 
 LEAF(fusword)
-ALEAF(fuisword)
PTR_LA  v0, fswberr
blt a0, zero, fswberr   # make sure address is in user space
nop
@@ -332,7 +328,6 @@ ALEAF(fuisword)
 END(fusword)
 
 LEAF(fubyte)
-ALEAF(fuibyte)
PTR_LA  v0, fswberr
blt a0, zero, fswberr   # make sure address is in user space
nop
@@ -441,30 +436,10 @@ XLEAF(casuword)
 END(casuword64)
 #endif
 
-#if 0
-   /* unused in FreeBSD */
-/*
- * Have to flush instruction cache afterwards.
- */
-LEAF(suiword)
-   PTR_LA  v0, fswberr
-   blt a0, zero, fswberr   # make sure address is in user space
-   nop
-   GET_CPU_PCPU(v1)
-   PTR_L   v1, PC_CURPCB(v1)
-   PTR_S   v0, U_PCB_ONFAULT(v1)
-   sw  a1, 0(a0)   # store word
-   PTR_S   zero, U_PCB_ONFAULT(v1)
-   j   _C_LABEL(Mips_SyncICache)  # FlushICache sets v0 = 0. (Ugly)
-   li  a1, 4   # size of word
-END(suiword)
-#endif
-
 /*
  * Will have to flush the instruction cache if byte merging is done in 
hardware.
  */
 LEAF(susword)
-ALEAF(suisword)
PTR_LA  v0, fswberr
blt a0, zero, fswberr   # make sure address is in user space
nop
@@ -478,7 +453,6 @@ ALEAF(suisword)
 END(susword)
 
 LEAF(subyte)
-ALEAF(suibyte)
PTR_LA  v0, fswberr
blt a0, zero, fswberr   # make sure address is in user space
nop
@@ -1140,39 +1114,6 @@ LEAF(longjmp)
li  v0, 1   # longjmp return
 END(longjmp)
 
-LEAF(fusufault)
-   GET_CPU_PCPU(t0)
-   lw  t0, PC_CURTHREAD(t0)
-   lw  t0, TD_PCB(t0)
-   li  v0, -1
-   j   ra
-END(fusufault)
-
-/* Define a new md function 'casuptr'.  This atomically compares and sets
-   a pointer that is in user space. It will be used as the basic 
primitive
-   for a kernel supported user space lock implementation. */
-LEAF(casuptr)
-   PTR_LI  t0, VM_MAXUSER_ADDRESS /* verify address validity */
-   blt a0, t0, fusufault   /* trap faults */
-   nop
-
-   GET_CPU_PCPU(t1)
-   lw  t1, PC_CURTHREAD(t1)
-   lw  t1, TD_PCB(t1)
-
-   PTR_LA  t2, fusufault
-   PTR_S   t2, U_PCB_ONFAULT(t1)
-1:
-   ll  v0, 0(a0)   /* try to load the old value */
-   beq v0, a1, 2f  /* compare */
-   movet0, a2  /* setup value to write */
-   sc  t0, 0(a0)   /* write if address still locked */
-   beq t0, zero, 1b/* if it failed, spin */
-2:
-   PTR_S   zero, U_PCB_ONFAULT(t1) /* clean up */
-   j   ra
-END(casuptr)
-
 LEAF(mips3_ld)
.set push
.set noreorder
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r243179 - head/sys/mips/atheros

2012-11-16 Thread Juli Mallett
On Fri, Nov 16, 2012 at 8:10 PM, Adrian Chadd adr...@freebsd.org wrote:

 Author: adrian
 Date: Sat Nov 17 04:10:42 2012
 New Revision: 243179
 URL: http://svnweb.freebsd.org/changeset/base/243179

 Log:
   Make MIPS24k PMC optional on hwpmc_mips24k.


I think having it in files.mips should be sufficient?  Thanks so much for
doing this!


   Requested by: juli

 Modified:
   head/sys/mips/atheros/files.ar71xx

 Modified: head/sys/mips/atheros/files.ar71xx

 ==
 --- head/sys/mips/atheros/files.ar71xx  Sat Nov 17 04:09:28 2012
  (r243178)
 +++ head/sys/mips/atheros/files.ar71xx  Sat Nov 17 04:10:42 2012
  (r243179)
 @@ -23,4 +23,4 @@ mips/atheros/ar724x_chip.cstandard
  mips/atheros/ar91xx_chip.c standard
  mips/atheros/ar71xx_fixup.coptional ar71xx_ath_eeprom

 -dev/hwpmc/hwpmc_mips24k.c  optional hwpmc
 +dev/hwpmc/hwpmc_mips24k.c  optional hwpmc_mips24k

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242952 - head/sys/contrib/octeon-sdk

2012-11-12 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 13 07:33:45 2012
New Revision: 242952
URL: http://svnweb.freebsd.org/changeset/base/242952

Log:
  Fix build for FreeBSD kernel.

Modified:
  head/sys/contrib/octeon-sdk/octeon-pci-console.c

Modified: head/sys/contrib/octeon-sdk/octeon-pci-console.c
==
--- head/sys/contrib/octeon-sdk/octeon-pci-console.cTue Nov 13 06:28:57 
2012(r242951)
+++ head/sys/contrib/octeon-sdk/octeon-pci-console.cTue Nov 13 07:33:45 
2012(r242952)
@@ -75,7 +75,7 @@
 
 /* The following code is only used in standalone CVMX applications. It does
 not apply for kernel or Linux programming */
-#if defined(OCTEON_TARGET)  !defined(__linux__)
+#if defined(OCTEON_TARGET)  !defined(__linux__)  
!defined(CVMX_BUILD_FOR_LINUX_KERNEL)
 
 static int cvmx_pci_console_num = 0;
 static int per_core_pci_consoles = 0;
@@ -110,14 +110,14 @@ int  __cvmx_pci_console_write (int fd, c
 
 
 #if !defined(CONFIG_OCTEON_U_BOOT) || (defined(CONFIG_OCTEON_U_BOOT)  
(defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE)))
-int octeon_pci_console_buffer_free_bytes(uint32_t buffer_size, uint32_t 
wr_idx, uint32_t rd_idx)
+static int octeon_pci_console_buffer_free_bytes(uint32_t buffer_size, uint32_t 
wr_idx, uint32_t rd_idx)
 {
 if (rd_idx = buffer_size || wr_idx = buffer_size)
 return -1;
 
 return (((buffer_size -1) - (wr_idx - rd_idx))%buffer_size);
 }
-int octeon_pci_console_buffer_avail_bytes(uint32_t buffer_size, uint32_t 
wr_idx, uint32_t rd_idx)
+static int octeon_pci_console_buffer_avail_bytes(uint32_t buffer_size, 
uint32_t wr_idx, uint32_t rd_idx)
 {
 if (rd_idx = buffer_size || wr_idx = buffer_size)
 return -1;
@@ -287,7 +287,7 @@ int octeon_pci_console_host_read_avail(u
 
 /* This code is only available in a kernel or CVMX standalone. It can't be used
 from userspace */
-#if (!defined(CONFIG_OCTEON_U_BOOT)  (!defined(__linux__) || 
defined(__KERNEL__))) || (defined(CONFIG_OCTEON_U_BOOT)  
(defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE)))
+#if (!defined(CONFIG_OCTEON_U_BOOT)  (!defined(__linux__) || 
defined(__KERNEL__))) || (defined(CONFIG_OCTEON_U_BOOT)  
(defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE))) || 
defined(CVMX_BUILD_FOR_LINUX_KERNEL)
 
 static octeon_pci_console_t *octeon_pci_console_get_ptr(uint64_t 
console_desc_addr, unsigned int console_num)
 {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242953 - head/sys/mips/conf

2012-11-12 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 13 07:34:46 2012
New Revision: 242953
URL: http://svnweb.freebsd.org/changeset/base/242953

Log:
  Add some useful options to consider.

Modified:
  head/sys/mips/conf/OCTEON1

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Tue Nov 13 07:33:45 2012(r242952)
+++ head/sys/mips/conf/OCTEON1  Tue Nov 13 07:34:46 2012(r242953)
@@ -261,6 +261,9 @@ device  firmware# firmware assist modul
 # Note that 'bpf' is required for DHCP.
 device bpf # Berkeley packet filter
 
+# Hardware watchdog support.
+#deviceocteon_wdog # Octeon hardware watchdog
+
 # USB support
 optionsUSB_DEBUG   # enable debug msgs
 device octusb  # Cavium Octeon on-board USB interface (USB 2.0)
@@ -297,3 +300,14 @@ device rum # Ralink Technology 
RT2501U
 device uath# Atheros AR5523 wireless NICs
 device ural# Ralink Technology RT2500USB wireless NICs
 device zyd # ZyDAS zd1211/zd1211b wireless NICs
+
+# crypto subsystem
+device crypto  # core crypto support
+device cryptodev   # /dev/crypto for access to h/w
+device cryptocteon # Octeon coprocessor 2 crypto offload
+
+# GPIO support
+#devicegpio
+
+# PMC support
+#devicehwpmc
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242955 - head/sys/mips/cavium

2012-11-12 Thread Juli Mallett
Author: jmallett
Date: Tue Nov 13 07:39:49 2012
New Revision: 242955
URL: http://svnweb.freebsd.org/changeset/base/242955

Log:
  Add preliminary Octeon PCI console support.  Radisys-specific PCI console
  support may follow soon (it uses a proprietary memory layout, but operation
  looks pretty trivial.)

Added:
  head/sys/mips/cavium/octeon_pci_console.c   (contents, props changed)
Modified:
  head/sys/mips/cavium/files.octeon1

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Tue Nov 13 07:39:05 2012
(r242954)
+++ head/sys/mips/cavium/files.octeon1  Tue Nov 13 07:39:49 2012
(r242955)
@@ -45,6 +45,8 @@ mips/cavium/octe/octebus.coptional oc
 
 mips/cavium/octopci.c  optional pci
 mips/cavium/octopci_bus_space.coptional pci
+mips/cavium/octeon_pci_console.c   optional pci
+contrib/octeon-sdk/octeon-pci-console.coptional pci
 
 mips/cavium/usb/octusb.c   optional usb octusb
 mips/cavium/usb/octusb_octeon.coptional usb octusb

Added: head/sys/mips/cavium/octeon_pci_console.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/cavium/octeon_pci_console.c   Tue Nov 13 07:39:49 2012
(r242955)
@@ -0,0 +1,122 @@
+/*-
+ * Copyright (c) 2012 Juli Mallett jmall...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/bus.h
+#include sys/conf.h
+#include sys/cons.h
+#include sys/kernel.h
+#include sys/reboot.h
+
+#include contrib/octeon-sdk/cvmx.h
+#include contrib/octeon-sdk/cvmx-bootmem.h
+#include contrib/octeon-sdk/octeon-pci-console.h
+
+static cn_probe_t opcic_cnprobe;
+static cn_init_t opcic_cninit;
+static cn_term_t opcic_cnterm;
+static cn_getc_t opcic_cngetc;
+static cn_putc_t opcic_cnputc;
+static cn_grab_t opcic_cngrab;
+static cn_ungrab_t opcic_cnungrab;
+
+CONSOLE_DRIVER(opcic);
+
+static void
+opcic_cnprobe(struct consdev *cp)
+{
+   const struct cvmx_bootmem_named_block_desc *pci_console_block;
+
+   cp-cn_pri = CN_DEAD;
+
+   pci_console_block = 
cvmx_bootmem_find_named_block(OCTEON_PCI_CONSOLE_BLOCK_NAME);
+   if (pci_console_block == NULL)
+   return;
+
+   cp-cn_arg = (void *)(uintptr_t)pci_console_block-base_addr;
+   snprintf(cp-cn_name, sizeof cp-cn_name, opcic@%p, cp-cn_arg);
+   cp-cn_pri = (boothowto  RB_SERIAL) ? CN_REMOTE : CN_NORMAL;
+}
+
+static void
+opcic_cninit(struct consdev *cp)
+{
+   (void)cp;
+}
+
+static void
+opcic_cnterm(struct consdev *cp)
+{
+   (void)cp;
+}
+
+static int
+opcic_cngetc(struct consdev *cp)
+{
+   uint64_t console_desc_addr;
+   char ch;
+   int rv;
+
+   console_desc_addr = (uintptr_t)cp-cn_arg;
+
+   rv = octeon_pci_console_read(console_desc_addr, 0, ch, 1, 
OCT_PCI_CON_FLAG_NONBLOCK);
+   if (rv != 1)
+   return (-1);
+   return (ch);
+}
+
+static void
+opcic_cnputc(struct consdev *cp, int c)
+{
+   uint64_t console_desc_addr;
+   char ch;
+   int rv;
+
+   console_desc_addr = (uintptr_t)cp-cn_arg;
+   ch = c;
+
+   rv = octeon_pci_console_write(console_desc_addr, 0, ch, 1, 0);
+   if (rv == -1)
+   panic(%s: octeon_pci_console_write failed., __func__);
+}
+
+static void
+opcic_cngrab(struct consdev *cp)
+{
+   (void)cp;
+}
+
+static void

svn commit: r242454 - head/sys/mips/cavium

2012-11-01 Thread Juli Mallett
Author: jmallett
Date: Thu Nov  1 20:39:39 2012
New Revision: 242454
URL: http://svn.freebsd.org/changeset/base/242454

Log:
  Don't disable PCIe just because the host is not a PCI host; the latter flag
  only applies to non-PCIe systems.  If PCIe is in target mode, it will simply
  and gracefully fail to attach of its own accord.

Modified:
  head/sys/mips/cavium/octopci.c

Modified: head/sys/mips/cavium/octopci.c
==
--- head/sys/mips/cavium/octopci.c  Thu Nov  1 20:09:48 2012
(r242453)
+++ head/sys/mips/cavium/octopci.c  Thu Nov  1 20:39:39 2012
(r242454)
@@ -104,10 +104,6 @@ static uint64_toctopci_cs_addr(unsigned
 static void
 octopci_identify(driver_t *drv, device_t parent)
 {
-   /* Check whether we are a PCI host.  */
-   if ((cvmx_sysinfo_get()-bootloader_config_flags  
CVMX_BOOTINFO_CFG_FLAG_PCI_HOST) == 0)
-   return;
-
BUS_ADD_CHILD(parent, 0, pcib, 0);
if (octeon_has_feature(OCTEON_FEATURE_PCIE))
BUS_ADD_CHILD(parent, 0, pcib, 1);
@@ -121,6 +117,10 @@ octopci_probe(device_t dev)
return (0);
}
 
+   /* Check whether we are a PCI host.  */
+   if ((cvmx_sysinfo_get()-bootloader_config_flags  
CVMX_BOOTINFO_CFG_FLAG_PCI_HOST) == 0)
+   return (ENXIO);
+
if (device_get_unit(dev) != 0)
return (ENXIO);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242423 - head/sys/contrib/octeon-sdk

2012-10-31 Thread Juli Mallett
Author: jmallett
Date: Thu Nov  1 03:45:33 2012
New Revision: 242423
URL: http://svn.freebsd.org/changeset/base/242423

Log:
  Handle the management port on the EBT5600 and disable loopback.  The XAUI
  port connected to the Broadcom switch does not seem operable, but it's unclear
  if that's simply due to a lack of configuration information for the switch.
  The switch does not seem to present any identifying information via MDIO,
  and is a BCM56512.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Nov  1 00:09:01 
2012(r242422)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Nov  1 03:45:33 
2012(r242423)
@@ -451,6 +451,12 @@ int cvmx_helper_board_get_mii_address(in
 return ipd_port+1;
 else
 return -1;
+case CVMX_BOARD_TYPE_EBT5600:
+   /* Board has 1 management port */
+if (ipd_port == CVMX_HELPER_BOARD_MGMT_IPD_PORT)
+return 0;
+   /* Board has 1 XAUI port connected to a switch.  */
+   return -1;
 case CVMX_BOARD_TYPE_EBB5600:
 {
 static unsigned char qlm_switch_addr = 0;
@@ -990,6 +996,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo
 }
 /* Fall through to the generic code below */
 break;
+case CVMX_BOARD_TYPE_EBT5600:
 case CVMX_BOARD_TYPE_EBH5600:
 case CVMX_BOARD_TYPE_EBH5601:
 case CVMX_BOARD_TYPE_EBH5610:
@@ -1289,6 +1296,11 @@ int __cvmx_helper_board_interface_probe(
 return 0;
 #endif
break;
+case CVMX_BOARD_TYPE_EBT5600:
+   /* Disable loopback.  */
+   if (interface == 3)
+   return 0;
+   break;
 case CVMX_BOARD_TYPE_EBT5810:
 return 1;  /* Two ports on each SPI: 1 hooked to MAC, 1 loopback
** Loopback disabled by default. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242342 - in head/sys: contrib/octeon-sdk mips/cavium

2012-10-30 Thread Juli Mallett
Author: jmallett
Date: Tue Oct 30 06:07:30 2012
New Revision: 242342
URL: http://svn.freebsd.org/changeset/base/242342

Log:
  Speed feature tests and initialize helper configuration that some CPUs 
require.

Modified:
  head/sys/contrib/octeon-sdk/octeon-feature.c
  head/sys/contrib/octeon-sdk/octeon-feature.h
  head/sys/mips/cavium/files.octeon1
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/contrib/octeon-sdk/octeon-feature.c
==
--- head/sys/contrib/octeon-sdk/octeon-feature.cTue Oct 30 04:31:32 
2012(r242341)
+++ head/sys/contrib/octeon-sdk/octeon-feature.cTue Oct 30 06:07:30 
2012(r242342)
@@ -139,7 +139,7 @@ feature_check:
cvmx_dprintf(unknown error %d.\n, val);
break;
}
-#if !defined(CVMX_BUILD_FOR_LINUX_KERNEL)  !defined(__U_BOOT__)  
!defined(CVMX_BUILD_FOR_TOOLCHAIN)
+#if !defined(CVMX_BUILD_FOR_LINUX_KERNEL)  !defined(__U_BOOT__)  
!defined(CVMX_BUILD_FOR_TOOLCHAIN)  !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL)
exit (1);
 #endif
 }

Modified: head/sys/contrib/octeon-sdk/octeon-feature.h
==
--- head/sys/contrib/octeon-sdk/octeon-feature.hTue Oct 30 04:31:32 
2012(r242341)
+++ head/sys/contrib/octeon-sdk/octeon-feature.hTue Oct 30 06:07:30 
2012(r242342)
@@ -281,7 +281,7 @@ extern uint8_t octeon_feature_map[FEATUR
 #if defined(__U_BOOT__) || defined(CVMX_BUILD_FOR_LINUX_HOST) || 
defined(CVMX_BUILD_FOR_TOOLCHAIN)
 #define octeon_has_feature old_octeon_has_feature
 #else
-#if defined(USE_RUNTIME_MODEL_CHECKS)
+#if defined(USE_RUNTIME_MODEL_CHECKS) || (defined(__FreeBSD__)  
defined(_KERNEL))
 static inline int octeon_has_feature(octeon_feature_t feature)
 {
int byte, bit;

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Tue Oct 30 04:31:32 2012
(r242341)
+++ head/sys/mips/cavium/files.octeon1  Tue Oct 30 06:07:30 2012
(r242342)
@@ -61,6 +61,7 @@ contrib/octeon-sdk/cvmx-clock.c   standa
 contrib/octeon-sdk/cvmx-ebt3000.c  standard
 contrib/octeon-sdk/cvmx-fpa.c  standard
 contrib/octeon-sdk/cvmx-helper.c   standard
+contrib/octeon-sdk/cvmx-helper-cfg.c   standard
 contrib/octeon-sdk/cvmx-helper-board.c standard
 contrib/octeon-sdk/cvmx-helper-cfg.c   standard
 contrib/octeon-sdk/cvmx-helper-errata.cstandard
@@ -89,6 +90,7 @@ contrib/octeon-sdk/cvmx-sysinfo.c stand
 contrib/octeon-sdk/cvmx-thunder.c  standard
 contrib/octeon-sdk/cvmx-twsi.c standard
 contrib/octeon-sdk/cvmx-warn.c standard
+contrib/octeon-sdk/octeon-feature.cstandard
 contrib/octeon-sdk/octeon-model.c  standard
 
 # HWPMC 

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Tue Oct 30 04:31:32 2012
(r242341)
+++ head/sys/mips/cavium/octeon_machdep.c   Tue Oct 30 06:07:30 2012
(r242342)
@@ -76,6 +76,7 @@ __FBSDID($FreeBSD$);
 #include contrib/octeon-sdk/cvmx.h
 #include contrib/octeon-sdk/cvmx-bootmem.h
 #include contrib/octeon-sdk/cvmx-ebt3000.h
+#include contrib/octeon-sdk/cvmx-helper-cfg.h
 #include contrib/octeon-sdk/cvmx-interrupt.h
 #include contrib/octeon-sdk/cvmx-version.h
 
@@ -598,6 +599,10 @@ octeon_boot_params_init(register_t ptr)
panic(Your boot loader did not supply a memory descriptor.);
cvmx_bootmem_init(cvmx_sysinfo_get()-phy_mem_desc_addr);
 
+   octeon_feature_init();
+
+   __cvmx_helper_cfg_init();
+
 printf(Boot Descriptor Ver: %u - %u/%u,
app_desc_ptr-desc_version, octeon_bootinfo-major_version,
   octeon_bootinfo-minor_version);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242344 - head/sys/mips/cavium

2012-10-30 Thread Juli Mallett
Author: jmallett
Date: Tue Oct 30 06:19:46 2012
New Revision: 242344
URL: http://svn.freebsd.org/changeset/base/242344

Log:
  Remove stale declarations.

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Tue Oct 30 06:11:09 2012
(r242343)
+++ head/sys/mips/cavium/octeon_machdep.c   Tue Oct 30 06:19:46 2012
(r242344)
@@ -130,9 +130,6 @@ static const struct octeon_feature_descr
{ 0,NULL }
 };
 
-uint64_t ciu_get_en_reg_addr_new(int corenum, int intx, int enx, int ciu_ip);
-void ciu_dump_interrutps_enabled(int core_num, int intx, int enx, int ciu_ip);
-
 static uint64_t octeon_get_ticks(void);
 static unsigned octeon_get_timecount(struct timecounter *tc);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242345 - head/sys/mips/cavium

2012-10-30 Thread Juli Mallett
Author: jmallett
Date: Tue Oct 30 06:29:17 2012
New Revision: 242345
URL: http://svn.freebsd.org/changeset/base/242345

Log:
  Remove oct_read64 and oct_write64 and use their equivalents from the Simple
  Executive, which are used everywhere else in the Octeon port.  While here,
  remove other unused things from octeon_pcmap_regs.h.

Modified:
  head/sys/mips/cavium/octeon_pcmap_regs.h
  head/sys/mips/cavium/uart_cpu_octeonusart.c

Modified: head/sys/mips/cavium/octeon_pcmap_regs.h
==
--- head/sys/mips/cavium/octeon_pcmap_regs.hTue Oct 30 06:19:46 2012
(r242344)
+++ head/sys/mips/cavium/octeon_pcmap_regs.hTue Oct 30 06:29:17 2012
(r242345)
@@ -47,148 +47,14 @@
 #define __OCTEON_PCMAP_REGS_H__
 
 #ifndef LOCORE
-
-/*
- * Utility inlines  macros
- */
-
-#if defined(__mips_n64)
-#defineoct_write64(a, v)   (*(volatile uint64_t *)(a) = 
(uint64_t)(v))
-
-#defineOCT_READ(n, t)  
\
-static inline t oct_read ## n(uintptr_t a) \
-{  \
-   volatile t *p = (volatile t *)a;\
-   return (*p);\
-}
-
-OCT_READ(64, uint64_t);
-
-#elif defined(__mips_n32) || defined(__mips_o32)
-#if defined(__mips_n32)
-static inline void oct_write64 (uint64_t csr_addr, uint64_t val64)
-{
-__asm __volatile (
-   .set push\n
-.set mips64\n
-sd %0, 0(%1)\n
-.set pop\n
-:
-   : r(val64), r(csr_addr));
-}
-
-#defineOCT_READ(n, t, insn)
\
-static inline t oct_read ## n(uint64_t a)  \
-{  \
-uint64_t tmp;  \
-   \
-__asm __volatile ( \
-   .set push\n   \
-.set mips64\n
\
-insn \t%0, 0(%1)\n   \
-.set pop\n   \
-: =r(tmp)\
-: r(a)); \
-return ((t)tmp);   \
-}
-
-OCT_READ(64, uint64_t, ld);
-#else
-
-/*
- * XXX
- * Add o32 variants that load the address into a register and the result out
- * of a register properly, and simply disable interrupts before and after and
- * hope that we don't need to refill or modify the TLB to access the address.
- * I'd be a lot happier if csr_addr were a physical address and we mapped it
- * into XKPHYS here so that we could guarantee that interrupts were the only
- * kind of exception we needed to worry about.
- *
- * Also, some of this inline assembly is needlessly verbose.  Oh, well.
- */
-static inline void oct_write64 (uint64_t csr_addr, uint64_t val64)
-{
-   uint32_t csr_addrh = csr_addr  32;
-   uint32_t csr_addrl = csr_addr;
-   uint32_t valh = val64  32;
-   uint32_t vall = val64;
-   uint32_t tmp1;
-   uint32_t tmp2;
-   uint32_t tmp3;
-   register_t sr;
-
-   sr = intr_disable();
-
-   __asm __volatile (
-   .set push\n
-.set mips64\n
-   .set noreorder\n
-   .set noat\n
-   dsll   %0, %3, 32\n
-   dsll   %1, %5, 32\n
-   dsll   %2, %4, 32\n
-   dsrl   %2, %2, 32\n
-   or %0, %0, %2\n
-   dsll   %2, %6, 32\n
-   dsrl   %2, %2, 32\n
-   or %1, %1, %2\n
-   sd %0, 0(%1)\n
-.set pop\n
-   : =r (tmp1), =r (tmp2), =r (tmp3)
-   : r (valh), r (vall), r (csr_addrh), r (csr_addrl));
-
-   intr_restore(sr);
-}
-
-static inline uint64_t oct_read64 (uint64_t csr_addr)
-{
-   uint32_t csr_addrh = csr_addr  32;
-   uint32_t csr_addrl = csr_addr;
-   uint32_t valh;
-   uint32_t vall;
-   register_t sr;
-
-   sr = intr_disable();
-
-   __asm __volatile (
-   .set push\n
-.set mips64\n
-   .set noreorder\n
-   .set noat\n
-   dsll   %0, %2, 32\n
-   dsll   %1, %3, 32\n
-   dsrl   %1, %1, 32\n
-   or %0, %0, %1\n
-   ld %1, 0(%0)\n
-   dsrl   %0, %1, 32\n
-   dsll   %1, %1, 32\n
-   dsrl   %1, %1, 32\n
-   .set pop\n
-   : =r (valh), =r (vall)
-   : r (csr_addrh), r (csr_addrl));
-
-   intr_restore(sr);
-
-   return ((uint64_t)valh  32) | vall;

svn commit: r242346 - in head/sys/mips/cavium: . octe

2012-10-30 Thread Juli Mallett
Author: jmallett
Date: Tue Oct 30 06:36:14 2012
New Revision: 242346
URL: http://svn.freebsd.org/changeset/base/242346

Log:
  Actually check board type rather than using a specialized octeon_is_simulation
  function.

Modified:
  head/sys/mips/cavium/octe/ethernet-common.c
  head/sys/mips/cavium/octe/ethernet-rgmii.c
  head/sys/mips/cavium/octe/ethernet-sgmii.c
  head/sys/mips/cavium/octe/ethernet-xaui.c
  head/sys/mips/cavium/octe/ethernet.c
  head/sys/mips/cavium/octeon_ebt3000_cf.c
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/cavium/octeon_pcmap_regs.h

Modified: head/sys/mips/cavium/octe/ethernet-common.c
==
--- head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 30 06:29:17 2012
(r242345)
+++ head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 30 06:36:14 2012
(r242346)
@@ -44,8 +44,6 @@ __FBSDID($FreeBSD$);
 #include wrapper-cvmx-includes.h
 #include ethernet-headers.h
 
-extern int octeon_is_simulation(void);
-
 static uint64_t cvm_oct_mac_addr = 0;
 static uint32_t cvm_oct_mac_addr_offset = 0;
 
@@ -243,7 +241,7 @@ int cvm_oct_common_open(struct ifnet *if
/*
 * Set the link state unless we are using MII.
 */
-if (!octeon_is_simulation()  priv-miibus == NULL) {
+if (cvmx_sysinfo_get()-board_type != CVMX_BOARD_TYPE_SIM  
priv-miibus == NULL) {
  link_info = cvmx_helper_link_get(priv-port);
  if (!link_info.s.link_up)  
if_link_state_change(ifp, LINK_STATE_DOWN);
@@ -282,7 +280,7 @@ void cvm_oct_common_poll(struct ifnet *i
/*
 * If this is a simulation, do nothing.
 */
-   if (octeon_is_simulation())
+   if (cvmx_sysinfo_get()-board_type == CVMX_BOARD_TYPE_SIM)
return;
 
/*

Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c
==
--- head/sys/mips/cavium/octe/ethernet-rgmii.c  Tue Oct 30 06:29:17 2012
(r242345)
+++ head/sys/mips/cavium/octe/ethernet-rgmii.c  Tue Oct 30 06:36:14 2012
(r242346)
@@ -49,7 +49,6 @@ __FBSDID($FreeBSD$);
 
 #include octebusvar.h
 
-extern int octeon_is_simulation(void);
 extern struct ifnet *cvm_oct_device[];
 
 static struct mtx global_register_lock;
@@ -256,7 +255,7 @@ int cvm_oct_rgmii_init(struct ifnet *ifp
if (((priv-imode == CVMX_HELPER_INTERFACE_MODE_GMII)  (priv-port == 
0)) ||
(priv-imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
 
-   if (!octeon_is_simulation()) {
+   if (cvmx_sysinfo_get()-board_type != CVMX_BOARD_TYPE_SIM) {
 
cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
int interface = INTERFACE(priv-port);
@@ -285,7 +284,7 @@ void cvm_oct_rgmii_uninit(struct ifnet *
if (((priv-imode == CVMX_HELPER_INTERFACE_MODE_GMII)  (priv-port == 
0)) ||
(priv-imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
 
-   if (!octeon_is_simulation()) {
+   if (cvmx_sysinfo_get()-board_type != CVMX_BOARD_TYPE_SIM) {
 
cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
int interface = INTERFACE(priv-port);

Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c
==
--- head/sys/mips/cavium/octe/ethernet-sgmii.c  Tue Oct 30 06:29:17 2012
(r242345)
+++ head/sys/mips/cavium/octe/ethernet-sgmii.c  Tue Oct 30 06:36:14 2012
(r242346)
@@ -44,8 +44,6 @@ __FBSDID($FreeBSD$);
 #include wrapper-cvmx-includes.h
 #include ethernet-headers.h
 
-extern int octeon_is_simulation(void);
-
 int cvm_oct_sgmii_init(struct ifnet *ifp)
 {
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp-if_softc;

Modified: head/sys/mips/cavium/octe/ethernet-xaui.c
==
--- head/sys/mips/cavium/octe/ethernet-xaui.c   Tue Oct 30 06:29:17 2012
(r242345)
+++ head/sys/mips/cavium/octe/ethernet-xaui.c   Tue Oct 30 06:36:14 2012
(r242346)
@@ -44,8 +44,6 @@ __FBSDID($FreeBSD$);
 #include wrapper-cvmx-includes.h
 #include ethernet-headers.h
 
-extern int octeon_is_simulation(void);
-
 int cvm_oct_xaui_init(struct ifnet *ifp)
 {
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp-if_softc;

Modified: head/sys/mips/cavium/octe/ethernet.c
==
--- head/sys/mips/cavium/octe/ethernet.cTue Oct 30 06:29:17 2012
(r242345)
+++ head/sys/mips/cavium/octe/ethernet.cTue Oct 30 06:36:14 2012
(r242346)
@@ -74,8 +74,6 @@ TUNABLE_INT(hw.octe.pow_receive_group,
 \t\tgroup. Also any other software can submit packets to 
this\n
 \t\tgroup for the kernel to process. */
 
-extern int octeon_is_simulation(void);
-
 /**
  * Periodic timer to 

svn commit: r242389 - head/sys/mips/cavium

2012-10-30 Thread Juli Mallett
Author: jmallett
Date: Wed Oct 31 04:23:36 2012
New Revision: 242389
URL: http://svn.freebsd.org/changeset/base/242389

Log:
  If the CF physical base is 0, attach no CF devices.  This fixes a warning
  about a 0 passed to cvmx_phys_to_ptr on systems without a CF interface,
  such as the RSYS4GBE.

Modified:
  head/sys/mips/cavium/octeon_ebt3000_cf.c

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cWed Oct 31 04:07:52 2012
(r242388)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cWed Oct 31 04:23:36 2012
(r242389)
@@ -622,6 +622,8 @@ static void cf_identify (driver_t *drv, 
return;
 
phys_base = cvmx_sysinfo_get()-compact_flash_common_base_addr;
+   if (phys_base == 0)
+   return;
base_addr = cvmx_phys_to_ptr(phys_base);
 
 for (bus_region = 0; bus_region  8; bus_region++)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242390 - head/sys/mips/cavium/octe

2012-10-30 Thread Juli Mallett
Author: jmallett
Date: Wed Oct 31 04:44:32 2012
New Revision: 242390
URL: http://svn.freebsd.org/changeset/base/242390

Log:
  Fix longstanding misprint.

Modified:
  head/sys/mips/cavium/octe/ethernet-rx.c

Modified: head/sys/mips/cavium/octe/ethernet-rx.c
==
--- head/sys/mips/cavium/octe/ethernet-rx.c Wed Oct 31 04:23:36 2012
(r242389)
+++ head/sys/mips/cavium/octe/ethernet-rx.c Wed Oct 31 04:44:32 2012
(r242390)
@@ -317,7 +317,7 @@ void cvm_oct_tasklet_rx(void *context, i
} else {
/* Drop any packet received for a device that
   doesn't exist */
-   DEBUGPRINT(Port %d not controlled by Linux, packet 
dropped\n, work-word1.cn38xx.ipprt);
+   DEBUGPRINT(Port %d not controlled by FreeBSD, packet 
dropped\n, work-word1.cn38xx.ipprt);
m_freem(m);
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242302 - head/sys/mips/cavium

2012-10-29 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 07:06:23 2012
New Revision: 242302
URL: http://svn.freebsd.org/changeset/base/242302

Log:
  Add a sysctl to change the LED display.

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 06:31:51 2012
(r242301)
+++ head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 07:06:23 2012
(r242302)
@@ -45,6 +45,7 @@ __FBSDID($FreeBSD$);
 #include sys/ptrace.h
 #include sys/reboot.h
 #include sys/signalvar.h
+#include sys/sysctl.h
 #include sys/sysent.h
 #include sys/sysproto.h
 #include sys/time.h
@@ -366,6 +367,46 @@ octeon_get_timecount(struct timecounter 
return ((unsigned)octeon_get_ticks());
 }
 
+static int
+sysctl_machdep_led_display(SYSCTL_HANDLER_ARGS)
+{
+   size_t buflen;
+   char buf[9];
+   int error;
+
+   if (req-newptr == NULL)
+   return (EINVAL);
+
+   if (cvmx_sysinfo_get()-led_display_base_addr == 0)
+   return (ENODEV);
+
+   /*
+* Revision 1.x of the EBT3000 only supports 4 characters, but
+* other devices support 8.
+*/
+   if (cvmx_sysinfo_get()-board_type == CVMX_BOARD_TYPE_EBT3000 
+   cvmx_sysinfo_get()-board_rev_major == 1)
+   buflen = 4;
+   else
+   buflen = 8;
+
+   if (req-newlen  buflen)
+   return (E2BIG);
+
+   error = SYSCTL_IN(req, buf, req-newlen);
+   if (error != 0)
+   return (error);
+
+   buf[req-newlen] = '\0';
+   ebt3000_str_write(buf);
+
+   return (0);
+}
+
+SYSCTL_PROC(_machdep, OID_AUTO, led_display, CTLTYPE_STRING | CTLFLAG_WR,
+NULL, 0, sysctl_machdep_led_display, A,
+String to display on LED display);
+
 /**
  * version of printf that works better in exception context.
  *
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242272 - head/sys/dev/mii

2012-10-28 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 00:17:12 2012
New Revision: 242272
URL: http://svn.freebsd.org/changeset/base/242272

Log:
  Recognize the Marvell 88E1145 Quad Gigabit PHY.

Modified:
  head/sys/dev/mii/e1000phy.c

Modified: head/sys/dev/mii/e1000phy.c
==
--- head/sys/dev/mii/e1000phy.c Sun Oct 28 21:13:12 2012(r242271)
+++ head/sys/dev/mii/e1000phy.c Mon Oct 29 00:17:12 2012(r242272)
@@ -108,6 +108,7 @@ static const struct mii_phydesc e1000phy
MII_PHY_DESC(xxMARVELL, E1116R),
MII_PHY_DESC(xxMARVELL, E1116R_29),
MII_PHY_DESC(xxMARVELL, E1118),
+   MII_PHY_DESC(xxMARVELL, E1145),
MII_PHY_DESC(xxMARVELL, E1149R),
MII_PHY_DESC(xxMARVELL, E3016),
MII_PHY_DESC(xxMARVELL, PHYG65G),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242273 - in head/sys: contrib/octeon-sdk mips/cavium

2012-10-28 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 00:51:53 2012
New Revision: 242273
URL: http://svn.freebsd.org/changeset/base/242273

Log:
  Use Simple Executive LED display routines, which correctly use the LED base
  address passed from the bootloader, rather than using a hard-coded value.
  
  Make FreeBSD announce itself on the LED display similar to other kernels.
  
  Remove uses of the previous LED routines, which were under-used and only used
  in drivers for what seem like debugging purposes, despite those drivers being
  widely-tested.
  
  Remove several inlines for accessing memory that duplicate other functions
  which are now used instead, as they are now entirely unused.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-ebt3000.c
  head/sys/mips/cavium/files.octeon1
  head/sys/mips/cavium/octeon_ebt3000_cf.c
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/cavium/octeon_pcmap_regs.h
  head/sys/mips/cavium/uart_dev_oct16550.c

Modified: head/sys/contrib/octeon-sdk/cvmx-ebt3000.c
==
--- head/sys/contrib/octeon-sdk/cvmx-ebt3000.c  Mon Oct 29 00:17:12 2012
(r242272)
+++ head/sys/contrib/octeon-sdk/cvmx-ebt3000.c  Mon Oct 29 00:51:53 2012
(r242273)
@@ -52,15 +52,18 @@
  *
  */
 
+#if !defined(__FreeBSD__) || !defined(_KERNEL)
 #include cvmx-config.h
+#endif
 #include cvmx.h
+#include cvmx-ebt3000.h
 #include cvmx-sysinfo.h
 
 
 void ebt3000_char_write(int char_position, char val)
 {
 /* Note: phys_to_ptr won't work here, as we are most likely going to 
access the boot bus. */
-void *led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()-led_display_base_addr));
+char *led_base = CASTPTR(char , CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()-led_display_base_addr));
 if (!led_base)
 return;
 if (cvmx_sysinfo_get()-board_type == CVMX_BOARD_TYPE_EBT3000  
cvmx_sysinfo_get()-board_rev_major == 1)
@@ -82,10 +85,10 @@ void ebt3000_char_write(int char_positio
 void ebt3000_str_write(const char *str)
 {
 /* Note: phys_to_ptr won't work here, as we are most likely going to 
access the boot bus. */
-void *led_base;
+char *led_base;
 if (!cvmx_sysinfo_get()-led_display_base_addr)
 return;
-led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()-led_display_base_addr));
+led_base = CASTPTR(char, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()-led_display_base_addr));
 if (cvmx_sysinfo_get()-board_type == CVMX_BOARD_TYPE_EBT3000  
cvmx_sysinfo_get()-board_rev_major == 1)
 {
 char *ptr = (char *)(led_base + 4);

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Mon Oct 29 00:17:12 2012
(r242272)
+++ head/sys/mips/cavium/files.octeon1  Mon Oct 29 00:51:53 2012
(r242273)
@@ -58,6 +58,7 @@ mips/cavium/octeon_gpio.c optional gpi
 contrib/octeon-sdk/cvmx-cmd-queue.cstandard
 contrib/octeon-sdk/cvmx-bootmem.c  standard
 contrib/octeon-sdk/cvmx-clock.cstandard
+contrib/octeon-sdk/cvmx-ebt3000.c  standard
 contrib/octeon-sdk/cvmx-fpa.c  standard
 contrib/octeon-sdk/cvmx-helper.c   standard
 contrib/octeon-sdk/cvmx-helper-board.c standard

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cMon Oct 29 00:17:12 2012
(r242272)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cMon Oct 29 00:51:53 2012
(r242273)
@@ -326,15 +326,10 @@ static int cf_cmd_read (uint32_t nr_sect
uint8_t  *ptr_8;
int error;
 
-//#define OCTEON_VISUAL_CF_0 1
-#ifdef OCTEON_VISUAL_CF_0
-octeon_led_write_char(0, 'R');
-#endif
ptr_8  = (uint8_t*)buf;
ptr_16 = (uint16_t*)buf;
lba = start_sector; 
 
-
while (nr_sectors--) {
error = cf_send_cmd(lba, CMD_READ_SECTOR);
if (error != 0) {
@@ -366,9 +361,6 @@ static int cf_cmd_read (uint32_t nr_sect
 
lba++;
}
-#ifdef OCTEON_VISUAL_CF_0
-octeon_led_write_char(0, ' ');
-#endif
return (0);
 }
 
@@ -387,10 +379,6 @@ static int cf_cmd_write (uint32_t nr_sec
uint8_t  *ptr_8;
int error;

-//#define OCTEON_VISUAL_CF_1 1
-#ifdef OCTEON_VISUAL_CF_1
-octeon_led_write_char(1, 'W');
-#endif
lba = start_sector;
ptr_8  = (uint8_t*)buf;
ptr_16 = (uint16_t*)buf;
@@ -425,9 +413,6 @@ static int cf_cmd_write (uint32_t nr_sec
 
lba++;
}
-#ifdef OCTEON_VISUAL_CF_1
-octeon_led_write_char(1, ' ');
-#endif
return (0);
 }
 
@@ -543,13 +528,6 @@ static int cf_wait_busy (void)
 {
uint8_t 

svn commit: r242276 - head/sys/mips/cavium

2012-10-28 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 02:10:20 2012
New Revision: 242276
URL: http://svn.freebsd.org/changeset/base/242276

Log:
  Wrap some long lines and display board serial numbers at boot.

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 01:51:24 2012
(r242275)
+++ head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 02:10:20 2012
(r242276)
@@ -512,14 +512,19 @@ octeon_process_app_desc_ver_6(void)
octeon_bootinfo-board_rev_major,
octeon_bootinfo-board_rev_minor,
octeon_bootinfo-eclock_hz);
-   memcpy(cvmx_sysinfo_get()-mac_addr_base, 
octeon_bootinfo-mac_addr_base, 6);
+   memcpy(cvmx_sysinfo_get()-mac_addr_base,
+  octeon_bootinfo-mac_addr_base, 6);
cvmx_sysinfo_get()-mac_addr_count = octeon_bootinfo-mac_addr_count;
cvmx_sysinfo_get()-compact_flash_common_base_addr = 
octeon_bootinfo-compact_flash_common_base_addr;
cvmx_sysinfo_get()-compact_flash_attribute_base_addr = 
octeon_bootinfo-compact_flash_attribute_base_addr;
cvmx_sysinfo_get()-core_mask = octeon_bootinfo-core_mask;
-   cvmx_sysinfo_get()-led_display_base_addr = 
octeon_bootinfo-led_display_base_addr;
+   cvmx_sysinfo_get()-led_display_base_addr =
+   octeon_bootinfo-led_display_base_addr;
+   memcpy(cvmx_sysinfo_get()-board_serial_number,
+  octeon_bootinfo-board_serial_number,
+  sizeof cvmx_sysinfo_get()-board_serial_number);
 }
 
 static void
@@ -588,5 +593,6 @@ octeon_boot_params_init(register_t ptr)
 #endif
strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id()));
printf(Model: %s\n, cpu_model);
+   printf(Serial number: %s\n, cvmx_sysinfo_get()-board_serial_number);
 }
 /* impEND: This stuff should move back into the Cavium SDK */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242201 - head/sys/mips/cavium

2012-10-27 Thread Juli Mallett
Author: jmallett
Date: Sat Oct 27 23:36:41 2012
New Revision: 242201
URL: http://svn.freebsd.org/changeset/base/242201

Log:
  Add missing return that broke 8-bit CF support in refactoring in r222671.
  Tested on a Cavium CN5860-EVB-NIC4.  This was broken for over a year.

Modified:
  head/sys/mips/cavium/octeon_ebt3000_cf.c

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cSat Oct 27 23:34:18 2012
(r242200)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cSat Oct 27 23:36:41 2012
(r242201)
@@ -280,6 +280,7 @@ static void cf_outb_8(int port, uint8_t 
if (bus_type == CF_8) {
volatile uint8_t *task_file = (volatile uint8_t *)base_addr;
task_file[port] = val;
+   return;
}
 
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r242142 - in stable/9: sys/dev/filemon tools/regression/filemon

2012-10-26 Thread Juli Mallett
On Fri, Oct 26, 2012 at 9:07 AM, David E. O'Brien obr...@freebsd.org wrote:
 Author: obrien
 Date: Fri Oct 26 16:07:53 2012
 New Revision: 242142
 URL: http://svn.freebsd.org/changeset/base/242142

 Log:
   MFC: r242137: Iterate rather than use recursion.  We can blow out the
kernel stack if there is a long chain of fork(2)s.

Under half an hour of MFC time seems rather too quick.  If this was
being insta-MFC'd because of some kind of security concern, then it
would be nice to have seen it signed off by SO, and treated like a
security issue.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242103 - head/sys/mips/cavium

2012-10-25 Thread Juli Mallett
Author: jmallett
Date: Fri Oct 26 00:04:05 2012
New Revision: 242103
URL: http://svn.freebsd.org/changeset/base/242103

Log:
  Don't attach if the bootloader has not indicated that we're a PCI host.  This
  fixes booting on systems which are PCI targets.

Modified:
  head/sys/mips/cavium/octopci.c

Modified: head/sys/mips/cavium/octopci.c
==
--- head/sys/mips/cavium/octopci.c  Thu Oct 25 23:18:05 2012
(r242102)
+++ head/sys/mips/cavium/octopci.c  Fri Oct 26 00:04:05 2012
(r242103)
@@ -104,7 +104,9 @@ static uint64_t octopci_cs_addr(unsigned
 static void
 octopci_identify(driver_t *drv, device_t parent)
 {
-   /* XXX Check sysinfo flag.  */
+   /* Check whether we are a PCI host.  */
+   if ((cvmx_sysinfo_get()-bootloader_config_flags  
CVMX_BOOTINFO_CFG_FLAG_PCI_HOST) == 0)
+   return;
 
BUS_ADD_CHILD(parent, 0, pcib, 0);
if (octeon_has_feature(OCTEON_FEATURE_PCIE))
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242104 - in head/sys: conf contrib/octeon-sdk mips/conf

2012-10-25 Thread Juli Mallett
Author: jmallett
Date: Fri Oct 26 00:08:50 2012
New Revision: 242104
URL: http://svn.freebsd.org/changeset/base/242104

Log:
  Add support for Radisys as a vendor of Octeon hardware.  Add some preliminary
  support for what their boot loader refers to as the RSYS4GBE, of which there
  are two instances (Data Processing Blocks) on the Radisys ATCA-7220.

Modified:
  head/sys/conf/options.mips
  head/sys/contrib/octeon-sdk/cvmx-app-init.h
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c
  head/sys/contrib/octeon-sdk/cvmx-helper.c
  head/sys/mips/conf/OCTEON1

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Fri Oct 26 00:04:05 2012(r242103)
+++ head/sys/conf/options.mips  Fri Oct 26 00:08:50 2012(r242104)
@@ -72,6 +72,7 @@ MAXMEMopt_global.h
 # Options that control the Cavium Simple Executive.
 #
 OCTEON_VENDOR_LANNER   opt_cvmx.h
+OCTEON_VENDOR_RADISYS  opt_cvmx.h
 OCTEON_BOARD_CAPK_0100ND   opt_cvmx.h
 
 #

Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h
==
--- head/sys/contrib/octeon-sdk/cvmx-app-init.h Fri Oct 26 00:04:05 2012
(r242103)
+++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Fri Oct 26 00:08:50 2012
(r242104)
@@ -299,6 +299,9 @@ enum cvmx_board_types_enum {
 CVMX_BOARD_TYPE_CUST_LANNER_MR320= 20002,
 CVMX_BOARD_TYPE_CUST_LANNER_MR321X=20007,
 #endif
+#if defined(OCTEON_VENDOR_RADISYS)
+CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE=20002,
+#endif
 CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 3,
 
 
@@ -423,6 +426,9 @@ static inline const char *cvmx_board_typ
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR320)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR321X)
 #endif
+#if defined(OCTEON_VENDOR_RADISYS)
+   ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE)
+#endif
 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
 
 /* Module range */

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Oct 26 00:04:05 
2012(r242103)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Oct 26 00:08:50 
2012(r242104)
@@ -1296,6 +1296,14 @@ int __cvmx_helper_board_interface_probe(
return 12;
break;
 #endif
+#if defined(OCTEON_VENDOR_RADISYS)
+   case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE:
+   if (interface == 0)
+   return 13;
+   if (interface == 1)
+   return 8;
+   return 0;
+#endif
 }
 #ifdef CVMX_BUILD_FOR_UBOOT
 if (CVMX_HELPER_INTERFACE_MODE_SPI == 
cvmx_helper_interface_get_mode(interface)  getenv(disable_spi))

Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper.c   Fri Oct 26 00:04:05 2012
(r242103)
+++ head/sys/contrib/octeon-sdk/cvmx-helper.c   Fri Oct 26 00:08:50 2012
(r242104)
@@ -146,6 +146,10 @@ int cvmx_helper_get_number_of_interfaces
case CVMX_BOARD_TYPE_CUST_LANNER_MR730:
return 1;
 #endif
+#if defined(OCTEON_VENDOR_RADISYS)
+   case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE:
+   return 2;
+#endif
default:
break;
 }

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Fri Oct 26 00:04:05 2012(r242103)
+++ head/sys/mips/conf/OCTEON1  Fri Oct 26 00:08:50 2012(r242104)
@@ -38,6 +38,7 @@ makeoptions   DEBUG=-g#Build kernel with
 
 # Board-specific support that cannot be auto-detected at runtime.
 #options   OCTEON_VENDOR_LANNER# Support for Lanner boards.
+#options   OCTEON_VENDOR_RADISYS   # Support for Radisys boards.
 #options   OCTEON_BOARD_CAPK_0100ND# Support for CAPK-0100nd.
 
 optionsSCHED_ULE   # ULE scheduler
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242116 - head/sys/contrib/octeon-sdk

2012-10-25 Thread Juli Mallett
Author: jmallett
Date: Fri Oct 26 02:09:55 2012
New Revision: 242116
URL: http://svn.freebsd.org/changeset/base/242116

Log:
  No MII on the RSYS4GBE (AMC-7211/ATCA-7220).

Modified:
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Oct 26 01:47:59 
2012(r242115)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Oct 26 02:09:55 
2012(r242116)
@@ -586,6 +586,11 @@ int cvmx_helper_board_get_mii_address(in
return -1;
}
 #endif
+#if defined(OCTEON_VENDOR_RADISYS)
+   case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE:
+   /* No MII.  */
+   return -1;
+#endif
 }
 
 /* Some unknown board. Somebody forgot to update this function... */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r235070 - head/sys/mips/gxemul

2012-05-06 Thread Juli Mallett
Author: jmallett
Date: Sun May  6 05:58:56 2012
New Revision: 235070
URL: http://svn.freebsd.org/changeset/base/235070

Log:
  Get the memory size from the gxemul mp device.  Don't dump the environment if
  it is not present.

Added:
  head/sys/mips/gxemul/mpreg.h   (contents, props changed)
Modified:
  head/sys/mips/gxemul/files.gxemul
  head/sys/mips/gxemul/gxemul_machdep.c

Modified: head/sys/mips/gxemul/files.gxemul
==
--- head/sys/mips/gxemul/files.gxemul   Sun May  6 05:49:23 2012
(r235069)
+++ head/sys/mips/gxemul/files.gxemul   Sun May  6 05:58:56 2012
(r235070)
@@ -3,3 +3,6 @@ dev/gxemul/cons/gxemul_cons.c   optional 
 mips/gxemul/gxemul_machdep.c   standard
 mips/mips/intr_machdep.c   standard
 mips/mips/tick.c   standard
+
+dev/gxemul/disk/gxemul_disk.c  optional gxemul_disk
+dev/gxemul/ether/gxemul_ether.coptional gxemul_ether

Modified: head/sys/mips/gxemul/gxemul_machdep.c
==
--- head/sys/mips/gxemul/gxemul_machdep.c   Sun May  6 05:49:23 2012
(r235069)
+++ head/sys/mips/gxemul/gxemul_machdep.c   Sun May  6 05:58:56 2012
(r235070)
@@ -62,6 +62,8 @@ __FBSDID($FreeBSD$);
 #include machine/pmap.h
 #include machine/trap.h
 
+#include mips/gxemul/mpreg.h
+
 extern int *edata;
 extern int *end;
 
@@ -123,7 +125,6 @@ platform_start(__register_t a0, __regist
int argc = a0;
char **argv = (char **)a1;
char **envp = (char **)a2;
-   unsigned int memsize = a3;
int i;
 
/* clear the BSS and SBSS segments */
@@ -152,14 +153,16 @@ platform_start(__register_t a0, __regist
printf(%s , argv[i]);
printf(\n);
 
-   printf(envp:\n);
-   for (i = 0; envp[i]; i += 2)
-   printf(\t%s = %s\n, envp[i], envp[i+1]);
-
-   printf(memsize = %08x\n, memsize);
+   if (envp != NULL) {
+   printf(envp:\n);
+   for (i = 0; envp[i]; i += 2)
+   printf(\t%s = %s\n, envp[i], envp[i+1]);
+   } else {
+   printf(no envp.\n);
+   }
}
 
-   realmem = btoc(memsize);
+   realmem = btoc(GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_MEMORY));
mips_init();
 
mips_timer_init_params(platform_counter_freq, 0);

Added: head/sys/mips/gxemul/mpreg.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/gxemul/mpreg.hSun May  6 05:58:56 2012
(r235070)
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2004-2012 Juli Mallett jmall...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef_MIPS_GXEMUL_MPREG_H_
+#define_MIPS_GXEMUL_MPREG_H_
+
+#defineGXEMUL_MP_DEV_BASE  0x1100
+
+#defineGXEMUL_MP_DEV_WHOAMI0x
+#defineGXEMUL_MP_DEV_NCPUS 0x0010
+#defineGXEMUL_MP_DEV_START 0x0020
+#defineGXEMUL_MP_DEV_STARTADDR 0x0030
+#defineGXEMUL_MP_DEV_STACK 0x0070
+#defineGXEMUL_MP_DEV_MEMORY0x0090
+#defineGXEMUL_MP_DEV_IPI_ONE   0x00a0
+#defineGXEMUL_MP_DEV_IPI_MANY  0x00b0
+#defineGXEMUL_MP_DEV_IPI_READ  0x00c0
+
+#defineGXEMUL_MP_DEV_FUNCTION(f)   
\
+   (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_MP_DEV_BASE + 
(f

svn commit: r235073 - in head/sys: dev/gxemul/disk mips/conf

2012-05-06 Thread Juli Mallett
Author: jmallett
Date: Sun May  6 08:28:08 2012
New Revision: 235073
URL: http://svn.freebsd.org/changeset/base/235073

Log:
  Add a driver for the GXemul test machine's disk controller and disk devices.
  Prefer it to using an md device in the GXEMUL kernel configuration.
  
  Requested by: rwatson, theraven

Added:
  head/sys/dev/gxemul/disk/
  head/sys/dev/gxemul/disk/gxemul_disk.c   (contents, props changed)
  head/sys/dev/gxemul/disk/gxemul_diskreg.h   (contents, props changed)
Modified:
  head/sys/mips/conf/GXEMUL

Added: head/sys/dev/gxemul/disk/gxemul_disk.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/gxemul/disk/gxemul_disk.c  Sun May  6 08:28:08 2012
(r235073)
@@ -0,0 +1,315 @@
+/*-
+ * Copyright (c) 2008-2012 Juli Mallett jmall...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/bio.h
+#include sys/systm.h
+#include sys/bus.h
+#include sys/kernel.h
+#include sys/lock.h
+#include sys/malloc.h
+#include sys/module.h
+#include sys/mutex.h
+#include sys/rman.h
+
+#include geom/geom.h
+
+#include machine/cpuregs.h
+
+#include dev/gxemul/disk/gxemul_diskreg.h
+
+struct gxemul_disk_softc {
+   device_t sc_dev;
+   uint64_t sc_size;
+   struct g_geom *sc_geom;
+   struct g_provider *sc_provider;
+};
+
+static struct mtx gxemul_disk_controller_mutex;
+
+static g_start_t   gxemul_disk_start;
+static g_access_t  gxemul_disk_access;
+
+struct g_class g_gxemul_disk_class = {
+   .name = GXemul,
+   .version = G_VERSION,
+   .start = gxemul_disk_start,
+   .access = gxemul_disk_access,
+};
+
+DECLARE_GEOM_CLASS(g_gxemul_disk_class, g_gxemul_disk);
+
+static voidgxemul_disk_identify(driver_t *, device_t);
+static int gxemul_disk_probe(device_t);
+static int gxemul_disk_attach(device_t);
+static voidgxemul_disk_attach_geom(void *, int);
+
+static int gxemul_disk_read(unsigned, void *, off_t);
+static int gxemul_disk_size(unsigned, uint64_t *);
+static int gxemul_disk_write(unsigned, const void *, off_t);
+
+static void
+gxemul_disk_start(struct bio *bp)
+{
+   struct gxemul_disk_softc *sc;
+   unsigned diskid;
+   off_t offset;
+   uint8_t *buf;
+   int error;
+
+   sc = bp-bio_to-geom-softc;
+   diskid = device_get_unit(sc-sc_dev);
+
+   if ((bp-bio_length % GXEMUL_DISK_DEV_BLOCKSIZE) != 0) {
+   g_io_deliver(bp, EINVAL);
+   return;
+   }
+
+   buf = bp-bio_data;
+   offset = bp-bio_offset;
+   bp-bio_resid = bp-bio_length;
+   while (bp-bio_resid != 0) {
+   switch (bp-bio_cmd) {
+   case BIO_READ:
+   mtx_lock(gxemul_disk_controller_mutex);
+   error = gxemul_disk_read(diskid, buf, offset);
+   mtx_unlock(gxemul_disk_controller_mutex);
+   break;
+   case BIO_WRITE:
+   mtx_lock(gxemul_disk_controller_mutex);
+   error = gxemul_disk_write(diskid, buf, offset);
+   mtx_unlock(gxemul_disk_controller_mutex);
+   break;
+   default:
+   g_io_deliver(bp, EOPNOTSUPP);
+   return;
+   }
+   if (error != 0) {
+   g_io_deliver(bp, error);
+   return;
+   }
+
+   buf += GXEMUL_DISK_DEV_BLOCKSIZE;
+   offset

svn commit: r235117 - in head/sys: dev/gxemul/ether mips/conf mips/gxemul

2012-05-06 Thread Juli Mallett
Author: jmallett
Date: Mon May  7 04:15:46 2012
New Revision: 235117
URL: http://svn.freebsd.org/changeset/base/235117

Log:
  Add a trivial driver for the GXemul Ethernet device.  Probably quite buggy and
  certainly non-optimal, but enough for basic networking use.
  
  Requested by: rwatson

Added:
  head/sys/dev/gxemul/ether/
  head/sys/dev/gxemul/ether/gxreg.h   (contents, props changed)
  head/sys/dev/gxemul/ether/if_gx.c   (contents, props changed)
Modified:
  head/sys/mips/conf/GXEMUL
  head/sys/mips/gxemul/files.gxemul

Added: head/sys/dev/gxemul/ether/gxreg.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/gxemul/ether/gxreg.h   Mon May  7 04:15:46 2012
(r235117)
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2008-2012 Juli Mallett jmall...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef_DEV_GXEMUL_ETHER_GXREG_H_
+#define_DEV_GXEMUL_ETHER_GXREG_H_
+
+#defineGXEMUL_ETHER_DEV_BASE   (0x1400)
+#defineGXEMUL_ETHER_DEV_IRQ(3)
+
+#defineGXEMUL_ETHER_DEV_MTU(0x4000)
+
+#defineGXEMUL_ETHER_DEV_BUFFER (0x)
+#defineGXEMUL_ETHER_DEV_STATUS (0x4000)
+#defineGXEMUL_ETHER_DEV_LENGTH (0x4010)
+#defineGXEMUL_ETHER_DEV_COMMAND(0x4020)
+#defineGXEMUL_ETHER_DEV_MAC(0x4040)
+
+#defineGXEMUL_ETHER_DEV_FUNCTION(f)
\
+   (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_ETHER_DEV_BASE 
+ (f))
+#defineGXEMUL_ETHER_DEV_READ(f)
\
+   (volatile uint64_t)*GXEMUL_ETHER_DEV_FUNCTION(f)
+#defineGXEMUL_ETHER_DEV_WRITE(f, v)
\
+   *GXEMUL_ETHER_DEV_FUNCTION(f) = (v)
+
+#defineGXEMUL_ETHER_DEV_STATUS_RX_OK   (0x01)
+#defineGXEMUL_ETHER_DEV_STATUS_RX_MORE (0x02)
+
+#defineGXEMUL_ETHER_DEV_COMMAND_RX (0x00)
+#defineGXEMUL_ETHER_DEV_COMMAND_TX (0x01)
+
+#endif /* !_DEV_GXEMUL_ETHER_GXREG_H_ */

Added: head/sys/dev/gxemul/ether/if_gx.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/gxemul/ether/if_gx.c   Mon May  7 04:15:46 2012
(r235117)
@@ -0,0 +1,398 @@
+/*-
+ * Copyright (c) 2008-2012 Juli Mallett jmall...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY

svn commit: r235118 - in head/sys/mips: conf gxemul

2012-05-06 Thread Juli Mallett
Author: jmallett
Date: Mon May  7 04:36:48 2012
New Revision: 235118
URL: http://svn.freebsd.org/changeset/base/235118

Log:
  Add basic SMP support for GXemul.  Ideally we would have some way to override
  some of the IPI mechanisms used by the common MIPS SMP code so we could use
  the multicast IPI facilities, on GXemul as well as on several real hardware
  platforms, and the ability to have multiple hard IPI types.

Modified:
  head/sys/mips/conf/GXEMUL
  head/sys/mips/gxemul/gxemul_machdep.c
  head/sys/mips/gxemul/mpreg.h

Modified: head/sys/mips/conf/GXEMUL
==
--- head/sys/mips/conf/GXEMUL   Mon May  7 04:15:46 2012(r235117)
+++ head/sys/mips/conf/GXEMUL   Mon May  7 04:36:48 2012(r235118)
@@ -26,6 +26,9 @@ makeoptions   MODULES_OVERRIDE=
 optionsDDB
 optionsKDB
 
+# Make an SMP-capable kernel by default
+optionsSMP # Symmetric MultiProcessor Kernel
+
 optionsSCHED_ULE
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols

Modified: head/sys/mips/gxemul/gxemul_machdep.c
==
--- head/sys/mips/gxemul/gxemul_machdep.c   Mon May  7 04:15:46 2012
(r235117)
+++ head/sys/mips/gxemul/gxemul_machdep.c   Mon May  7 04:36:48 2012
(r235118)
@@ -62,6 +62,11 @@ __FBSDID($FreeBSD$);
 #include machine/pmap.h
 #include machine/trap.h
 
+#ifdef SMP
+#include sys/smp.h
+#include machine/smp.h
+#endif
+
 #include mips/gxemul/mpreg.h
 
 extern int *edata;
@@ -167,3 +172,67 @@ platform_start(__register_t a0, __regist
 
mips_timer_init_params(platform_counter_freq, 0);
 }
+
+#ifdef SMP
+void
+platform_ipi_send(int cpuid)
+{
+   GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_IPI_ONE, (1  16) | cpuid);
+}
+
+void
+platform_ipi_clear(void)
+{
+   GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_IPI_READ, 0);
+}
+
+int
+platform_ipi_intrnum(void)
+{
+   return (GXEMUL_MP_DEV_IPI_INTERRUPT - 2);
+}
+
+struct cpu_group *
+platform_smp_topo(void)
+{
+   return (smp_topo_none());
+}
+
+void
+platform_init_ap(int cpuid)
+{
+   int ipi_int_mask, clock_int_mask;
+
+   /*
+* Unmask the clock and ipi interrupts.
+*/
+   clock_int_mask = hard_int_mask(5);
+   ipi_int_mask = hard_int_mask(platform_ipi_intrnum());
+   set_intr_mask(ipi_int_mask | clock_int_mask);
+}
+
+void
+platform_cpu_mask(cpuset_t *mask)
+{
+   unsigned i, n;
+
+   n = GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_NCPUS);
+   CPU_ZERO(mask);
+   for (i = 0; i  n; i++)
+   CPU_SET(i, mask);
+}
+
+int
+platform_processor_id(void)
+{
+   return (GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_WHOAMI));
+}
+
+int
+platform_start_ap(int cpuid)
+{
+   GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_STARTADDR, (intptr_t)mpentry);
+   GXEMUL_MP_DEV_WRITE(GXEMUL_MP_DEV_START, cpuid);
+   return (0);
+}
+#endif /* SMP */

Modified: head/sys/mips/gxemul/mpreg.h
==
--- head/sys/mips/gxemul/mpreg.hMon May  7 04:15:46 2012
(r235117)
+++ head/sys/mips/gxemul/mpreg.hMon May  7 04:36:48 2012
(r235118)
@@ -36,10 +36,12 @@
 #defineGXEMUL_MP_DEV_START 0x0020
 #defineGXEMUL_MP_DEV_STARTADDR 0x0030
 #defineGXEMUL_MP_DEV_STACK 0x0070
+#defineGXEMUL_MP_DEV_RANDOM0x0080
 #defineGXEMUL_MP_DEV_MEMORY0x0090
 #defineGXEMUL_MP_DEV_IPI_ONE   0x00a0
 #defineGXEMUL_MP_DEV_IPI_MANY  0x00b0
 #defineGXEMUL_MP_DEV_IPI_READ  0x00c0
+#defineGXEMUL_MP_DEV_CYCLES0x00d0
 
 #defineGXEMUL_MP_DEV_FUNCTION(f)   
\
(volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_MP_DEV_BASE + 
(f))
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r234337 - in head: lib/libc/arm/gen sys/arm/include

2012-04-16 Thread Juli Mallett
On Mon, Apr 16, 2012 at 02:38, Andrew Turner and...@freebsd.org wrote:
 Log:
  Replace the C implementation of __aeabi_read_tp with an assembly version.
  This ensures we follow the ABI by preserving registers r1-r3.

 +ENTRY(__aeabi_read_tp)
 +       ldr     r0, .Larm_tp_address
 +       ldr     r0, [r0]
 +       RET
 +
 +.Larm_tp_address:
 +       .word ARM_TP_ADDRESS
 +

Why is this indirection required?  Can't you just use ARM_TP_ADDRESS
instead of loading it from data?  Also, is our convention for ARM to
use END() with ENTRY() or not?
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r234107 - head/lib/libgeom

2012-04-10 Thread Juli Mallett
Author: jmallett
Date: Tue Apr 10 17:37:24 2012
New Revision: 234107
URL: http://svn.freebsd.org/changeset/base/234107

Log:
  Back out r233646.  Although it fixed most libgeom consumers under 32-bit
  compatibility, it broke programs using devstat, under 32-bit compatibility and
  not.
  
  It's very difficult to fix the identifiers used by devstat, so this change is
  simply being backed out.  Since changes to 3rd-party code seem likely, and 
may be
  necessary to properly fix 32-bit binaries on 64-bit kernel, it would seem 
better
  to make more invasive changes to fix GEOM's problems with 32-bit 
compatibility in
  general.
  
  The right thing to do is to replace all of the use of pointers as opaque
  identifiers with a fixed-size (64-bit or even 32-bit should be enough for 
tracking
  unique GEOM elments) field.  That probably maintains source compatibility with
  most GEOM consumers, and allows xml2tree to make better assumptions about how 
to
  decode the identifiers.
  
  Submitted by: Anton Yuzhaninov

Modified:
  head/lib/libgeom/geom_xml2tree.c
  head/lib/libgeom/libgeom.h

Modified: head/lib/libgeom/geom_xml2tree.c
==
--- head/lib/libgeom/geom_xml2tree.cTue Apr 10 16:33:19 2012
(r234106)
+++ head/lib/libgeom/geom_xml2tree.cTue Apr 10 17:37:24 2012
(r234107)
@@ -55,56 +55,9 @@ struct mystate {
int level;
struct sbuf *sbuf[20];
struct gconf*config;
-   unsignednident;
+   int nident;
 };
 
-static void *
-internalize_ident(struct mystate *mt, const char *element, const char *str)
-{
-   struct gident *gip;
-   unsigned i;
-
-   if (mt-nident != 0  mt-mesh-lg_ident == NULL) {
-   warn(Cannot continue due to previous memory exhaustion.);
-   return (NULL);
-   }
-
-   for (i = 0; i  mt-nident; i++) {
-   if (strcmp(mt-mesh-lg_ident[i].lg_id, str) != 0)
-   continue;
-   return ((void *)(uintptr_t)(i + 1));
-   }
-
-   i = mt-nident;
-   mt-nident++;
-   mt-mesh-lg_ident = reallocf(mt-mesh-lg_ident, (mt-nident + 1) * 
sizeof mt-mesh-lg_ident[0]);
-   if (mt-mesh-lg_ident == NULL) {
-   warn(Cannot allocate memory during processing of '%s' 
-   element for identifier '%s', element, str);
-   return (NULL);
-   }
-
-   gip = mt-mesh-lg_ident[i];
-   gip-lg_id = strdup(str);
-   if (gip-lg_id == NULL) {
-   free(mt-mesh-lg_ident);
-   mt-mesh-lg_ident = NULL;
-   warn(Cannot allocate memory during processing of '%s' 
-   element for identifier '%s', element, str);
-   return (NULL);
-   }
-   gip-lg_ptr = NULL;
-   gip-lg_what = ISUNRESOLVED;
-
-   /* Terminator entry.  */
-   gip = mt-mesh-lg_ident[i + 1];
-   gip-lg_id = NULL;
-   gip-lg_ptr = NULL;
-   gip-lg_what = ISUNRESOLVED;
-
-   return ((void *)(uintptr_t)(i + 1));
-}
-
 static void
 StartElement(void *userData, const char *name, const char **attr)
 {
@@ -120,9 +73,10 @@ StartElement(void *userData, const char 
ref = NULL;
for (i = 0; attr[i] != NULL; i += 2) {
if (!strcmp(attr[i], id)) {
-   id = internalize_ident(mt, name, attr[i + 1]);
+   id = (void *)strtoul(attr[i + 1], NULL, 0);
+   mt-nident++;
} else if (!strcmp(attr[i], ref)) {
-   ref = internalize_ident(mt, name, attr[i + 1]);
+   ref = (void *)strtoul(attr[i + 1], NULL, 0);
} else
printf(%*.*s[%s = %s]\n,
mt-level + 1, mt-level + 1, ,
@@ -363,16 +317,11 @@ CharData(void *userData , const XML_Char
 struct gident *
 geom_lookupid(struct gmesh *gmp, const void *id)
 {
-   unsigned i;
-
-   if (gmp-lg_ident == NULL)
-   return (NULL);
+   struct gident *gip;
 
-   for (i = 0; gmp-lg_ident[i].lg_id != NULL; i++) {
-   if (i + 1 != (unsigned)(uintptr_t)id)
-   continue;
-   return (gmp-lg_ident[i]);
-   }
+   for (gip = gmp-lg_ident; gip-lg_id != NULL; gip++)
+   if (gip-lg_id == id)
+   return (gip);
return (NULL);
 }
 
@@ -385,7 +334,6 @@ geom_xml2tree(struct gmesh *gmp, char *p
struct ggeom *ge;
struct gprovider *pr;
struct gconsumer *co;
-   struct gident *gip;
int i;
 
memset(gmp, 0, sizeof *gmp);
@@ -408,30 +356,33 @@ geom_xml2tree(struct gmesh *gmp, char *p
free(mt);
return (-1);
}
-   if (gmp-lg_ident == NULL  mt-nident != 0) {
-   free(mt);
-   return (ENOMEM);
-   

Re: svn commit: r233646 - head/lib/libgeom

2012-04-10 Thread Juli Mallett
On Tue, Apr 10, 2012 at 04:50, Anton Yuzhaninov cit...@citrin.ru wrote:
 New Revision: 233646

 Log:
   Fix 32-bit libgeom consumers run on 64-bit kernels with
 COMPAT_FREEBSD32.


 Unfortunately, gstat don't work after this commit (64-bit kernel with
 COMPAT_FREEBSD32).

 more info:
 http://docs.freebsd.org/cgi/mid.cgi?jm1509$66p$1

 After reverting r233646 gstat works.

I've backed out the commit as it appears all consumers of the devstat
interface would be broken, and to fix that would be non-trivial, and
still leave those programs broken under 32-bit compatibility.  Thanks
for the report!
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r234014 - head/lib/libc/arm/gen

2012-04-09 Thread Juli Mallett
On Sun, Apr 8, 2012 at 21:14, Andrew Turner and...@fubar.geek.nz wrote:
 We can implement it as a naked function but we will need to store all
 registers other than r0 and pc which seems a waste.

 The problem implementing it in an assembly file is we are unable to use
 ARM_TP_ADDRESS is defined as:
 #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000)

 Where ARM_VECTORS_HIGH is defined as:
 #define ARM_VECTORS_HIGH 0xU

 I could remove the U from ARM_VECTORS_HIGH however I'm not sure on the
 implications of that change.

Oh, is that all?  :)  It's easy to have an ifdef that adds the u
suffix in C and not in assembly.  That's perfectly appropriate in this
case.  If you want to be fancy you can use a macro which adds the U to
the constant in C and not in assembly, and use it in other places, but
that's usually unnecessary.  In the kernel we sometimes use assym to
get around this sort of thing, but that's fully unnecessary.

Look at powerpc/include/vmparam.h for an example of a header where we
do this currently (VM_MAXUSER_ADDRESS specifically.)  This is the
right thing to do by far over using C as a wrapper for assembly in
this way.

 How do you know GCC won't allocate r2 to be used as a temporary in
 between the assembly and the return?

 The compiler is free to use r2 with the current code. I have attached a
 patch that fools the compiler into thinking we are using r1-r3 by
 placing them in the clobber list.

If this file is ever compiled with the correct ABI, then, it will do
excessive saves and restores of r1-r3, I think.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r234014 - head/lib/libc/arm/gen

2012-04-09 Thread Juli Mallett
On Mon, Apr 9, 2012 at 01:44, Andrew Turner and...@fubar.geek.nz wrote:
 How does the attached (untested) patch look. It explicitly loads
 ARM_TP_ADDRESS into a r0 to ensure r1-3 are not touched.

The example file I pointed at was for the kernel, where the
LOCORE-related ifdefs (almost) make sense, but for userland you
probably want to conditionalize on __ASSEMBLER__.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r234014 - head/lib/libc/arm/gen

2012-04-08 Thread Juli Mallett
On Sat, Apr 7, 2012 at 21:45, Andrew Turner and...@fubar.geek.nz wrote:
 On Sun, 8 Apr 2012 04:36:27 + (UTC)
 Andrew Turner and...@freebsd.org wrote:

 Author: andrew
 Date: Sun Apr  8 04:36:27 2012
 New Revision: 234014
 URL: http://svn.freebsd.org/changeset/base/234014

 Log:
   Unlike other functions __aeabi_read_tp function must preserve
 r1-r3. The currently generated code clobbers r3. Fix this by loading
 ARM_TP_ADDRESS using inline assembly.

   Approved by:        imp (mentor)

 This fixes thread local storage on ARM in cases when the compiler loads
 the offset of the variable in r3 before calling __aeabi_read_tp as has
 been observed when the variable is in a shared library.

I don't believe this is safe unless you specify __attribute__
((__naked__)) in the declaration — currently the compiler is free to
clobber registers that the calling convention/ABI allows it to
clobber.  I don't see the benefit of implementing this in C over using
an assembly file, that said, although GCC does have this attribute
precisely to allow one to write assembly in a C source file without
having to worry about unexpected behavior.

How do you know GCC won't allocate r2 to be used as a temporary in
between the assembly and the return?

I tried to raise this concern on IRC previously, but hopefully it's clearer now.

Thanks,
Juli.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233636 - head/sys/mips/nlm/dev/net

2012-03-28 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 29 02:02:23 2012
New Revision: 233636
URL: http://svn.freebsd.org/changeset/base/233636

Log:
  Fix little-endian built.

Modified:
  head/sys/mips/nlm/dev/net/nae.c

Modified: head/sys/mips/nlm/dev/net/nae.c
==
--- head/sys/mips/nlm/dev/net/nae.c Thu Mar 29 02:02:14 2012
(r233635)
+++ head/sys/mips/nlm/dev/net/nae.c Thu Mar 29 02:02:23 2012
(r233636)
@@ -194,7 +194,7 @@ nlm_reset_nae(int node)
 
 #if BYTE_ORDER == LITTLE_ENDIAN
if (nlm_is_xlp8xx_ax()) {
-   uchar_t val;
+   uint8_t val;
/* membar fixup */
val = (bar0  24)  0xff;
bar0 = (val  24) | (val  16) | (val  8) | val;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233637 - head/sys/mips/nlm

2012-03-28 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 29 02:03:06 2012
New Revision: 233637
URL: http://svn.freebsd.org/changeset/base/233637

Log:
  Supply endianness implied by the -m flag when compiling ucore code.

Modified:
  head/sys/mips/nlm/files.xlp

Modified: head/sys/mips/nlm/files.xlp
==
--- head/sys/mips/nlm/files.xlp Thu Mar 29 02:02:23 2012(r233636)
+++ head/sys/mips/nlm/files.xlp Thu Mar 29 02:03:06 2012(r233637)
@@ -26,7 +26,7 @@ mips/nlm/dev/net/sgmii.c  optional xlpg
 mips/nlm/dev/net/xaui.coptional xlpge
 mips/nlm/dev/net/xlpge.c   optional xlpge
 ucore_app.bin  optional xlpge  \
-   compile-with${CC} -march=mips32 -mabi=32 -msoft-float -I. -I$S -O3 
-funroll-loops -finline-limit=2 -fno-tree-loop-optimize 
-fomit-frame-pointer -mno-branch-likely -fno-pic -mno-abicalls 
-ffunction-sections -fdata-sections -G0 -Wall -Werror -c 
$S/$M/nlm/dev/net/ucore/crt0_basic.S  $S/$M/nlm/dev/net/ucore/ucore_app.c  
${LD} -melf32btsmip_fbsd -d -warn-common -T$S/$M/nlm/dev/net/ucore/ld.ucore.S 
crt0_basic.o ucore_app.o -o ucore_app  ${OBJCOPY} -S -O binary -R .note -R 
.comment ucore_app ${.TARGET} \
+   compile-with${CC} -EB -march=mips32 -mabi=32 -msoft-float -I. -I$S 
-O3 -funroll-loops -finline-limit=2 -fno-tree-loop-optimize 
-fomit-frame-pointer -mno-branch-likely -fno-pic -mno-abicalls 
-ffunction-sections -fdata-sections -G0 -Wall -Werror -c 
$S/$M/nlm/dev/net/ucore/crt0_basic.S  $S/$M/nlm/dev/net/ucore/ucore_app.c  
${LD} -melf32btsmip_fbsd -d -warn-common -T$S/$M/nlm/dev/net/ucore/ld.ucore.S 
crt0_basic.o ucore_app.o -o ucore_app  ${OBJCOPY} -S -O binary -R .note -R 
.comment ucore_app ${.TARGET} \
no-obj no-implicit-rule before-depend   \
clean   crt0_basic.o ucore_app.o ucore_app ucore_app.bin
 ucore_app_bin.hoptional xlpge  \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233638 - head/sys/mips/mips

2012-03-28 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 29 02:04:15 2012
New Revision: 233638
URL: http://svn.freebsd.org/changeset/base/233638

Log:
  Disable FP instruction emulation by default on !o32 because of ABI concerns.
  
  Note that in practice this isn't needed because we get a coprocessor unusable
  exception first, but that's actually something like a bug.

Modified:
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/mips/trap.c
==
--- head/sys/mips/mips/trap.c   Thu Mar 29 02:03:06 2012(r233637)
+++ head/sys/mips/mips/trap.c   Thu Mar 29 02:04:15 2012(r233638)
@@ -290,6 +290,20 @@ static int allow_unaligned_acc = 1;
 SYSCTL_INT(_vm, OID_AUTO, allow_unaligned_acc, CTLFLAG_RW,
 allow_unaligned_acc, 0, Allow unaligned accesses);
 
+/*
+ * FP emulation is assumed to work on O32, but the code is outdated and crufty
+ * enough that it's a more sensible default to have it disabled when using
+ * other ABIs.  At the very least, it needs a lot of help in using
+ * type-semantic ABI-oblivious macros for everything it does.
+ */
+#if defined(__mips_o32)
+static int emulate_fp = 1;
+#else
+static int emulate_fp = 0;
+#endif
+SYSCTL_INT(_machdep, OID_AUTO, emulate_fp, CTLFLAG_RW,
+allow_unaligned_acc, 0, Emulate unimplemented FPU instructions);
+
 static int emulate_unaligned_access(struct trapframe *frame, int mode);
 
 extern void fswintrberr(void); /* XXX */
@@ -988,6 +1002,11 @@ dofault:
 #endif
 
case T_FPE + T_USER:
+   if (!emulate_fp) {
+   i = SIGILL;
+   addr = trapframe-pc;
+   break;
+   }
MipsFPTrap(trapframe-sr, trapframe-cause, trapframe-pc);
goto out;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233639 - head/sys/mips/cavium

2012-03-28 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 29 02:05:11 2012
New Revision: 233639
URL: http://svn.freebsd.org/changeset/base/233639

Log:
  Turn on messages from the Simple Executive codebase, what few there are.

Modified:
  head/sys/mips/cavium/cvmx_config.h

Modified: head/sys/mips/cavium/cvmx_config.h
==
--- head/sys/mips/cavium/cvmx_config.h  Thu Mar 29 02:04:15 2012
(r233638)
+++ head/sys/mips/cavium/cvmx_config.h  Thu Mar 29 02:05:11 2012
(r233639)
@@ -159,6 +159,9 @@
 #define CVMX_ENABLE_PKO_FUNCTIONS
 #endif
 
+/* Enable debug and informational printfs */
+#define CVMX_CONFIG_ENABLE_DEBUG_PRINTS1
+
 /* Config Specific Defines /
 #define CVMX_LLM_NUM_PORTS 1
 #define CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 1  /** PKO queues 
per port for interface 0 (ports 0-15) */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233644 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb kerberos5/lib/libkafs5 share/man/man5 share/mk sys/conf sys/mips/atheros s...

2012-03-28 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 29 02:54:35 2012
New Revision: 233644
URL: http://svn.freebsd.org/changeset/base/233644

Log:
  Assume a big-endian default on MIPS and drop the eb suffix from 
MACHINE_ARCH.
  This makes our naming scheme more closely match other systems and the
  expectations of much third-party software.  MIPS builds which are 
little-endian
  should require and exhibit no changes.  Big-endian TARGET_ARCHes must be
  changed:
From:   To:
mipseb  mips
mipsn32eb   mipsn32
mips64ebmips64
  
  An entry has been added to UPDATING and some foot-shooting protection 
(complete
  with warnings which should become errors in the near future) to the top-level
  base system Makefile.

Modified:
  head/Makefile
  head/Makefile.inc1
  head/UPDATING
  head/gnu/lib/libgcc/Makefile
  head/gnu/usr.bin/binutils/Makefile.inc0
  head/gnu/usr.bin/cc/Makefile.tgt
  head/gnu/usr.bin/gdb/Makefile.inc
  head/gnu/usr.bin/gdb/libgdb/Makefile
  head/kerberos5/lib/libkafs5/Makefile
  head/share/man/man5/src.conf.5
  head/share/mk/bsd.endian.mk
  head/share/mk/sys.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk
  head/sys/mips/atheros/std.ar71xx
  head/sys/mips/cavium/std.octeon1
  head/sys/mips/conf/AR71XX_BASE
  head/sys/mips/conf/AR91XX_BASE
  head/sys/mips/conf/SWARM
  head/sys/mips/conf/SWARM64
  head/sys/mips/conf/SWARM64_SMP
  head/sys/mips/conf/SWARM_SMP
  head/sys/mips/conf/XLP
  head/sys/mips/conf/XLP64
  head/sys/mips/conf/XLPN32
  head/sys/mips/conf/XLR
  head/sys/mips/conf/XLR64
  head/sys/mips/conf/XLRN32
  head/sys/mips/include/param.h
  head/usr.bin/xlint/Makefile.inc
  head/usr.sbin/Makefile.mips

Modified: head/Makefile
==
--- head/Makefile   Thu Mar 29 02:47:01 2012(r233643)
+++ head/Makefile   Thu Mar 29 02:54:35 2012(r233644)
@@ -132,20 +132,19 @@ _MAKE=PATH=${PATH} ${BINMAKE} -f Makefi
 
 # Guess machine architecture from machine type, and vice versa.
 .if !defined(TARGET_ARCH)  defined(TARGET)
-_TARGET_ARCH=  ${TARGET:S/pc98/i386/:S/mips/mipsel/}
+_TARGET_ARCH=  ${TARGET:S/pc98/i386/}
 .elif !defined(TARGET)  defined(TARGET_ARCH)  \
 ${TARGET_ARCH} != ${MACHINE_ARCH}
-_TARGET=   ${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/}
+_TARGET=   ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/armeb/arm/}
 .endif
-# Legacy names, for a transition period mips:mips - mipsel:mips
+# Legacy names, for another transition period mips:mips(n32|64)?eb - 
mips:mips\1
 .if defined(TARGET)  defined(TARGET_ARCH)  \
-${TARGET_ARCH} == mips  ${TARGET} == mips
-.warning TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb
-.if defined(TARGET_BIG_ENDIAN)
-_TARGET_ARCH=mipseb
-.else
-_TARGET_ARCH=mipsel
+${TARGET} == mips  ${TARGET_ARCH:Mmips*eb}
+_TARGET_ARCH=  ${TARGET_ARCH:C/eb$//}
+.warning TARGET_ARCH of ${TARGET_ARCH} is deprecated in favor of 
${_TARGET_ARCH}
 .endif
+.if defined(TARGET)  ${TARGET} == mips  defined(TARGET_BIG_ENDIAN)
+.warning TARGET_BIG_ENDIAN is no longer necessary for MIPS.  Big-endian is 
not the default.
 .endif
 # arm with TARGET_BIG_ENDIAN - armeb
 .if defined(TARGET_ARCH)  ${TARGET_ARCH} == arm  
defined(TARGET_BIG_ENDIAN)
@@ -331,7 +330,7 @@ kernel-toolchains:
 .if make(universe) || make(universe_kernels) || make(tinderbox) || 
make(targets)
 TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64
 TARGET_ARCHES_arm?=arm armeb
-TARGET_ARCHES_mips?=   mipsel mipseb mips64el mips64eb mipsn32eb
+TARGET_ARCHES_mips?=   mipsel mips mips64el mips64 mipsn32
 TARGET_ARCHES_powerpc?=powerpc powerpc64
 TARGET_ARCHES_pc98?=   i386
 .for target in ${TARGETS}

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Mar 29 02:47:01 2012(r233643)
+++ head/Makefile.inc1  Thu Mar 29 02:54:35 2012(r233644)
@@ -136,7 +136,7 @@ VERSION!=   uname -srp
 VERSION+=  ${OSRELDATE}
 .endif
 
-KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips 
mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc 
powerpc64/powerpc sparc64
+KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mips/mips 
mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc 
sparc64
 .if ${TARGET} == ${TARGET_ARCH}
 _t=${TARGET}
 .else

Modified: head/UPDATING
==
--- head/UPDATING   Thu Mar 29 02:47:01 2012(r233643)
+++ head/UPDATING   Thu Mar 29 02:54:35 2012(r233644)
@@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20120328:
+   Big-endian MIPS TARGET_ARCH values no longer end in eb.  mips64eb
+   is now 

svn commit: r233645 - in head: . share/man/man5

2012-03-28 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 29 03:04:59 2012
New Revision: 233645
URL: http://svn.freebsd.org/changeset/base/233645

Log:
  o) Fix mips/mips - mips for Makefile.inc1.
  o) Rebuild src.conf.5.

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

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Mar 29 02:54:35 2012(r233644)
+++ head/Makefile.inc1  Thu Mar 29 03:04:59 2012(r233645)
@@ -136,7 +136,7 @@ VERSION!=   uname -srp
 VERSION+=  ${OSRELDATE}
 .endif
 
-KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mips/mips 
mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc 
sparc64
+KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mips mipsel/mips 
mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc 
sparc64
 .if ${TARGET} == ${TARGET_ARCH}
 _t=${TARGET}
 .else

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Thu Mar 29 02:54:35 2012
(r233644)
+++ head/share/man/man5/src.conf.5  Thu Mar 29 03:04:59 2012
(r233645)
@@ -1,7 +1,7 @@
 .\ DO NOT EDIT-- this file is automatically generated.
 .\ from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z 
ru
 .\ $FreeBSD$
-.Dd February 29, 2012
+.Dd March 25, 2012
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -270,7 +270,7 @@ When set, it also enforces the following
 Set to not build the Clang C/C++ compiler.
 .Pp
 It is a default setting on
-arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32eb and sparc64/sparc64.
+arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32 and sparc64/sparc64.
 When set, it also enforces the following options:
 .Pp
 .Bl -item -compact
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r233428 - head/share/examples/cvsup

2012-03-24 Thread Juli Mallett
On Sat, Mar 24, 2012 at 11:25, Eitan Adler ead...@freebsd.org wrote:
 Author: eadler
 Date: Sat Mar 24 18:25:16 2012
 New Revision: 233428
 URL: http://svn.freebsd.org/changeset/base/233428

 Log:
  Direct users to csup instead of cvsup in the csup-file boilerplate text.

Thanks for doing this!  I'm not sure about this one change that was
made in several places:

 -# CVSup (CVS Update Protocol) allows you to download the latest CVS
 +# csup (CVS Update Protocol) allows you to download the latest CVS

The name of the protocol is certainly CVSup and not csup.  And the
protocol is what is being referred to here (as is suggested by the
parenthetical.)  If the protocol weren't being referred to, it would
be a literal cvsup since that's the spelling of the command, not
CVSup.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r233278 - head/sys/mips/cavium

2012-03-21 Thread Juli Mallett
Author: jmallett
Date: Wed Mar 21 10:27:12 2012
New Revision: 233278
URL: http://svn.freebsd.org/changeset/base/233278

Log:
  o) Don't keep drive parameters in a global, put them in the softc.
  o) Don't report a bogus stripesize.
  o) Eliminate a nearby gratuitous proxy indirection.

Modified:
  head/sys/mips/cavium/octeon_ebt3000_cf.c

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cWed Mar 21 10:03:52 2012
(r233277)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cWed Mar 21 10:27:12 2012
(r233278)
@@ -133,17 +133,6 @@ const char *const cf_type[] = {
True IDE
 };
 
-/* Device softc */
-struct cf_priv {
-   device_t dev;
-   struct drive_param *drive_param;
-
-   struct bio_queue_head cf_bq;
-   struct g_geom *cf_geom;
-   struct g_provider *cf_provider;
-
-};
-
 /* Device parameters */
 struct drive_param{
union {
@@ -157,8 +146,18 @@ struct drive_param{
uint16_t heads;
uint16_t tracks;
uint16_t sec_track;
+};
 
-} drive_param;
+/* Device softc */
+struct cf_priv {
+   device_t dev;
+   struct drive_param drive_param;
+
+   struct bio_queue_head cf_bq;
+   struct g_geom *cf_geom;
+   struct g_provider *cf_provider;
+
+};
 
 /* GEOM class implementation */
 static g_access_t   cf_access;
@@ -179,15 +178,14 @@ DECLARE_GEOM_CLASS(g_cf_class, g_cf);
 static int cf_probe(device_t);
 static voidcf_identify(driver_t *, device_t);
 static int cf_attach(device_t);
-static int cf_attach_geom(void *, int);
+static voidcf_attach_geom(void *, int);
 
 /* ATA methods */
-static int cf_cmd_identify(void);
+static int cf_cmd_identify(struct cf_priv *);
 static int cf_cmd_write(uint32_t, uint32_t, void *);
 static int cf_cmd_read(uint32_t, uint32_t, void *);
 static int cf_wait_busy(void);
 static int cf_send_cmd(uint32_t, uint8_t);
-static voidcf_attach_geom_proxy(void *arg, int flag);
 
 /* Miscelenous */
 static voidcf_swap_ascii(unsigned char[], char[]);
@@ -198,11 +196,6 @@ static voidcf_swap_ascii(unsigned char[
  * --- */
 static int cf_access (struct g_provider *pp, int r, int w, int e)
 {
-
-   pp-sectorsize = drive_param.sector_size;
-pp-stripesize = drive_param.heads * drive_param.sec_track * 
drive_param.sector_size;
-pp-mediasize  = pp-stripesize * drive_param.tracks;
-
return (0);
 }
 
@@ -212,17 +205,20 @@ static int cf_access (struct g_provider 
  * --- */
 static void cf_start (struct bio *bp)
 {
+   struct cf_priv *cf_priv;
int error;
 
+   cf_priv = bp-bio_to-geom-softc;
+
/*
* Handle actual I/O requests. The request is passed down through
* the bio struct.
*/
 
if(bp-bio_cmd  BIO_GETATTR) {
-   if (g_handleattr_int(bp, GEOM::fwsectors, 
drive_param.sec_track))
+   if (g_handleattr_int(bp, GEOM::fwsectors, 
cf_priv-drive_param.sec_track))
 return;
-if (g_handleattr_int(bp, GEOM::fwheads,   drive_param.heads))
+if (g_handleattr_int(bp, GEOM::fwheads, 
cf_priv-drive_param.heads))
 return;
 g_io_deliver(bp, ENOIOCTL);
 return;
@@ -231,11 +227,11 @@ static void cf_start (struct bio *bp)
if ((bp-bio_cmd  (BIO_READ | BIO_WRITE))) {
 
if (bp-bio_cmd  BIO_READ) {
-   error = cf_cmd_read(bp-bio_length / 
drive_param.sector_size,
-   bp-bio_offset / drive_param.sector_size, 
bp-bio_data);
+   error = cf_cmd_read(bp-bio_length / 
cf_priv-drive_param.sector_size,
+   bp-bio_offset / cf_priv-drive_param.sector_size, 
bp-bio_data);
} else if (bp-bio_cmd  BIO_WRITE) {
-   error = cf_cmd_write(bp-bio_length / 
drive_param.sector_size,
-   bp-bio_offset/drive_param.sector_size, 
bp-bio_data);
+   error = cf_cmd_write(bp-bio_length / 
cf_priv-drive_param.sector_size,
+   bp-bio_offset/cf_priv-drive_param.sector_size, 
bp-bio_data);
} else {
printf(%s: unrecognized bio_cmd %x.\n, __func__, 
bp-bio_cmd);
error = ENOTSUP;
@@ -443,7 +439,7 @@ static int cf_cmd_write (uint32_t nr_sec
  * it in the drive_param structure
  *
  */
-static int cf_cmd_identify (void)
+static int cf_cmd_identify(struct cf_priv *cf_priv)
 {
int count;
int error;
@@ -457,7 +453,7 @@ static int cf_cmd_identify (void)
{
case CF_8:
for (count = 0; count  SECTOR_SIZE; count++) 
-   

  1   2   3   4   >