svn commit: r264963 - head/sys/netpfil/ipfw

2014-04-26 Thread Mikolaj Golub
Author: trociny
Date: Sat Apr 26 08:05:16 2014
New Revision: 264963
URL: http://svnweb.freebsd.org/changeset/base/264963

Log:
  Define startup order the same way as it is in dummynet.

Modified:
  head/sys/netpfil/ipfw/ip_fw_nat.c

Modified: head/sys/netpfil/ipfw/ip_fw_nat.c
==
--- head/sys/netpfil/ipfw/ip_fw_nat.c   Sat Apr 26 01:00:37 2014
(r264962)
+++ head/sys/netpfil/ipfw/ip_fw_nat.c   Sat Apr 26 08:05:16 2014
(r264963)
@@ -676,8 +676,8 @@ static moduledata_t ipfw_nat_mod = {
 };
 
 /* Define startup order. */
-#defineIPFW_NAT_SI_SUB_FIREWALL(SI_SUB_PROTO_IFATTACHDOMAIN + 
1)
-#defineIPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 255)
+#defineIPFW_NAT_SI_SUB_FIREWALLSI_SUB_PROTO_IFATTACHDOMAIN
+#defineIPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 128) /* after 
ipfw */
 #defineIPFW_NAT_MODULE_ORDER   (IPFW_NAT_MODEVENT_ORDER + 1)
 #defineIPFW_NAT_VNET_ORDER (IPFW_NAT_MODEVENT_ORDER + 2)
 
___
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: r264964 - head/lib/libcrypt

2014-04-26 Thread Dag-Erling Smørgrav
Author: des
Date: Sat Apr 26 11:50:25 2014
New Revision: 264964
URL: http://svnweb.freebsd.org/changeset/base/264964

Log:
  r261913 broke DES passwords, because the only way they could work,
  since they don't have an easily recognizable signature, was if they
  were the default.  This commit rewrites crypt_set_format(3) etc to
  address this:
  
   - Use a pointer instead of an index to identify the default format.
 This pointer is initialized at compile time to point to the first
 first element in the list of supported formats, eliminating the
 need for crypt_setdefault().  Using a pointer also simplifies
 iterating through the list.
  
   - Associate DES with the magic string _, which takes care of the
 Extended DES format.
  
   - Finally, as a special case, if the salt does not match any known
 magic string but matches ^[./0-9A-Za-z]{13}$, it is assumed to be a
 DES password and is passed on to crypt_des().
  
  MFC after:1 week

Modified:
  head/lib/libcrypt/crypt.c

Modified: head/lib/libcrypt/crypt.c
==
--- head/lib/libcrypt/crypt.c   Sat Apr 26 08:05:16 2014(r264963)
+++ head/lib/libcrypt/crypt.c   Sat Apr 26 11:50:25 2014(r264964)
@@ -1,6 +1,7 @@
-/*
- * Copyright (c) 1999
- *  Mark Murray.  All rights reserved.
+/*-
+ * Copyright (c) 1999 Mark Murray
+ * Copyright (c) 2014 Dag-Erling Smørgrav
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,110 +29,88 @@
 __FBSDID($FreeBSD$);
 
 #include sys/types.h
-#include string.h
+
 #include libutil.h
+#include string.h
 #include unistd.h
+
 #include crypt.h
 
-static const struct {
+/*
+ * List of supported crypt(3) formats.  The first element in the list will
+ * be the default.
+ */
+static const struct crypt_format {
const char *const name;
char *(*const func)(const char *, const char *);
const char *const magic;
-} crypt_types[] = {
-#ifdef HAS_DES
-   {
-   des,
-   crypt_des,
-   NULL
-   },
-#endif
-   {
-   md5,
-   crypt_md5,
-   $1$
-   },
+} crypt_formats[] = {
+   /* default format */
+   { sha512, crypt_sha512,   $6$   },
+
+   /* other supported formats */
+   { md5,crypt_md5,  $1$   },
 #ifdef HAS_BLOWFISH
-   {
-   blf,
-   crypt_blowfish,
-   $2
-   },
+   { blf,crypt_blowfish, $2},
+#endif
+   { nth,crypt_nthash,   $3$   },
+   { sha256, crypt_sha256,   $5$   },
+#ifdef HAS_DES
+   { des,crypt_des,  _ },
 #endif
-   {
-   nth,
-   crypt_nthash,
-   $3$
-   },
-   {
-   sha256,
-   crypt_sha256,
-   $5$
-   },
-   {
-   sha512,
-   crypt_sha512,
-   $6$
-   },
-   {
-   NULL,
-   NULL,
-   NULL
-   }
-};
-
-#define CRYPT_DEFAULT  sha512
 
-static int crypt_type = -1;
+   /* sentinel */
+   { NULL, NULL,   NULL}
+};
 
-static void
-crypt_setdefault(void)
-{
-   size_t i;
+static const struct crypt_format *crypt_format = crypt_formats[0];
 
-   if (crypt_type != -1)
-   return;
-   for (i = 0; i  sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) {
-   if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) {
-   crypt_type = (int)i;
-   return;
-   }
-   }
-   crypt_type = 0;
-}
+#define DES_SALT_ALPHABET \
+   ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 
+/*
+ * Returns the name of the currently selected format.
+ */
 const char *
 crypt_get_format(void)
 {
 
-   crypt_setdefault();
-   return (crypt_types[crypt_type].name);
+   return (crypt_format-name);
 }
 
+/*
+ * Selects the format to use for subsequent crypt(3) invocations.
+ */
 int
-crypt_set_format(const char *type)
+crypt_set_format(const char *format)
 {
-   size_t i;
+   const struct crypt_format *cf;
 
-   crypt_setdefault();
-   for (i = 0; i  sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) {
-   if (strcmp(type, crypt_types[i].name) == 0) {
-   crypt_type = (int)i;
+   for (cf = crypt_formats; cf-name != NULL; ++cf) {
+   if (strcasecmp(cf-name, format) == 0) {
+   crypt_format = cf;
return (1);
}
}
return (0);
 }
 
+/*
+ * Hash the given password with the given salt.  If the salt begins with a
+ * magic string (e.g. $6$ for sha512), the 

svn commit: r264965 - head/tools/regression/vfs

2014-04-26 Thread Dag-Erling Smørgrav
Author: des
Date: Sat Apr 26 12:16:40 2014
New Revision: 264965
URL: http://svnweb.freebsd.org/changeset/base/264965

Log:
  Note that the bug was fixed, and when.

Modified:
  head/tools/regression/vfs/trailing_slash.t

Modified: head/tools/regression/vfs/trailing_slash.t
==
--- head/tools/regression/vfs/trailing_slash.t  Sat Apr 26 11:50:25 2014
(r264964)
+++ head/tools/regression/vfs/trailing_slash.t  Sat Apr 26 12:16:40 2014
(r264965)
@@ -3,7 +3,7 @@
 # $FreeBSD$
 #
 # Tests vfs_lookup()'s handling of trailing slashes for symlinks that
-# point to files.  See kern/21768
+# point to files.  See kern/21768 for details.  Fixed in r193028.
 #
 
 testfile=/tmp/testfile-$$
___
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: r264966 - head/sys/vm

2014-04-26 Thread Dag-Erling Smørgrav
Author: des
Date: Sat Apr 26 12:18:17 2014
New Revision: 264966
URL: http://svnweb.freebsd.org/changeset/base/264966

Log:
  Add sysctl OIDs showing the actual size and capacity of the swap zone.
  
  MFC after:1 week

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cSat Apr 26 12:16:40 2014(r264965)
+++ head/sys/vm/swap_pager.cSat Apr 26 12:18:17 2014(r264966)
@@ -164,6 +164,12 @@ static int overcommit = 0;
 SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, overcommit, 0,
 Configure virtual memory overcommit behavior. See tuning(7) 
 for details.);
+static unsigned long swzone;
+SYSCTL_ULONG(_vm, OID_AUTO, swzone, CTLFLAG_RD, swzone, 0,
+Actual size of swap metadata zone);
+static unsigned long swap_maxpages;
+SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, swap_maxpages, 0,
+Maximum amount of swap supported);
 
 /* bits from overcommit */
 #defineSWAP_RESERVE_FORCE_ON   (1  0)
@@ -506,7 +512,7 @@ swap_pager_init(void)
 void
 swap_pager_swap_init(void)
 {
-   int n, n2;
+   unsigned long n, n2;
 
/*
 * Number of in-transit swap bp operations.  Don't
@@ -542,7 +548,7 @@ swap_pager_swap_init(void)
/*
 * Initialize our zone.  Right now I'm just guessing on the number
 * we need based on the number of pages in the system.  Each swblock
-* can hold 16 pages, so this is probably overkill.  This reservation
+* can hold 32 pages, so this is probably overkill.  This reservation
 * is typically limited to around 32MB by default.
 */
n = vm_cnt.v_page_count / 2;
@@ -563,7 +569,9 @@ swap_pager_swap_init(void)
n -= ((n + 2) / 3);
} while (n  0);
if (n2 != n)
-   printf(Swap zone entries reduced from %d to %d.\n, n2, n);
+   printf(Swap zone entries reduced from %lu to %lu.\n, n2, n);
+   swap_maxpages = n * SWAP_META_PAGES;
+   swzone = n * sizeof(struct swblock);
n2 = 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


svn commit: r264968 - head/bin/date

2014-04-26 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Sat Apr 26 13:05:56 2014
New Revision: 264968
URL: http://svnweb.freebsd.org/changeset/base/264968

Log:
  date(1): Add -R flag to use RFC 2822 date and time output format
  
  As stated in the man page, this is equivalent to use %a, %d %b %Y %T %z
  as the output format while LC_TIME is set to the C locale.
  
  This is compatible with date(1) from the GNU core utilities.

Modified:
  head/bin/date/date.1
  head/bin/date/date.c

Modified: head/bin/date/date.1
==
--- head/bin/date/date.1Sat Apr 26 12:19:40 2014(r264967)
+++ head/bin/date/date.1Sat Apr 26 13:05:56 2014(r264968)
@@ -40,7 +40,7 @@
 .Nd display or set date and time
 .Sh SYNOPSIS
 .Nm
-.Op Fl ju
+.Op Fl jRu
 .Op Fl r Ar seconds
 .Oo
 .Fl v
@@ -58,7 +58,7 @@
 .Ar MM Op Ar .ss
 .Sm on
 .Nm
-.Op Fl jnu
+.Op Fl jnRu
 .Fl f Ar input_fmt new_date
 .Op Cm + Ns Ar output_fmt
 .Nm
@@ -130,6 +130,16 @@ The
 .Fl n
 option suppresses this behavior and causes the time to be set only on the
 current machine.
+.It Fl R
+Use RFC 2822 date and time output format. This is equivalent to use
+.Dq Li %a, %d %b %Y \%T %z
+as
+.Ar output_fmt
+while
+.Ev LC_TIME
+is set to the
+.Dq C
+locale .
 .It Fl r Ar seconds
 Print the date and time represented by
 .Ar seconds ,

Modified: head/bin/date/date.c
==
--- head/bin/date/date.cSat Apr 26 12:19:40 2014(r264967)
+++ head/bin/date/date.cSat Apr 26 13:05:56 2014(r264968)
@@ -69,12 +69,14 @@ static void setthetime(const char *, con
 static void badformat(void);
 static void usage(void);
 
+static const char *rfc2822_format = %a, %d %b %Y %T %z;
+
 int
 main(int argc, char *argv[])
 {
struct timezone tz;
int ch, rflag;
-   int jflag, nflag;
+   int jflag, nflag, Rflag;
const char *format;
char buf[1024];
char *endptr, *fmt;
@@ -89,9 +91,9 @@ main(int argc, char *argv[])
(void) setlocale(LC_TIME, );
tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 0;
-   jflag = nflag = 0;
+   jflag = nflag = Rflag = 0;
set_timezone = 0;
-   while ((ch = getopt(argc, argv, d:f:jnr:t:uv:)) != -1)
+   while ((ch = getopt(argc, argv, d:f:jnRr:t:uv:)) != -1)
switch((char)ch) {
case 'd':   /* daylight savings time */
tz.tz_dsttime = strtol(optarg, endptr, 10) ? 1 : 0;
@@ -108,6 +110,9 @@ main(int argc, char *argv[])
case 'n':   /* don't set network */
nflag = 1;
break;
+   case 'R':   /* RFC 2822 datetime format */
+   Rflag = 1;
+   break;
case 'r':   /* user specified seconds */
rflag = 1;
tval = strtoq(optarg, tmp, 0);
@@ -145,6 +150,9 @@ main(int argc, char *argv[])
 
format = %+;
 
+   if (Rflag)
+   format = rfc2822_format;
+
/* allow the operands in any order */
if (*argv  **argv == '+') {
format = *argv + 1;
@@ -169,6 +177,14 @@ main(int argc, char *argv[])
usage();
}
vary_destroy(v);
+
+   if (format == rfc2822_format)
+   /*
+* When using RFC 2822 datetime format, don't honor the
+* locale.
+*/
+   setlocale(LC_TIME, C);
+
(void)strftime(buf, sizeof(buf), format, lt);
(void)printf(%s\n, buf);
if (fflush(stdout))
@@ -301,7 +317,7 @@ static void
 usage(void)
 {
(void)fprintf(stderr, %s\n%s\n,
-   usage: date [-jnu] [-d dst] [-r seconds] [-t west] 
+   usage: date [-jnRu] [-d dst] [-r seconds] [-t west] 
[-v[+|-]val[ymwdHMS]] ... ,

[-f fmt date | [cc]yy]mm]dd]HH]MM[.ss]] [+format]);
___
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: r264969 - head/sys/dev/random

2014-04-26 Thread Mark Murray
Author: markm
Date: Sat Apr 26 13:21:28 2014
New Revision: 264969
URL: http://svnweb.freebsd.org/changeset/base/264969

Log:
  Correctly set the sysctl format to Alphanumeric, rather than letting it 
default.
  
  Approved by: security-officer(des)

Modified:
  head/sys/dev/random/random_adaptors.c

Modified: head/sys/dev/random/random_adaptors.c
==
--- head/sys/dev/random/random_adaptors.c   Sat Apr 26 13:05:56 2014
(r264968)
+++ head/sys/dev/random/random_adaptors.c   Sat Apr 26 13:21:28 2014
(r264969)
@@ -220,12 +220,12 @@ random_adaptors_init(void *unused)
 
SYSCTL_PROC(_kern_random, OID_AUTO, adaptors,
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
-   NULL, 0, random_sysctl_adaptors_handler, ,
+   NULL, 0, random_sysctl_adaptors_handler, A,
Random Number Generator adaptors);
 
SYSCTL_PROC(_kern_random, OID_AUTO, active_adaptor,
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
-   NULL, 0, random_sysctl_active_adaptor_handler, ,
+   NULL, 0, random_sysctl_active_adaptor_handler, A,
Active Random Number Generator Adaptor);
 
sx_init(adaptors_lock, random_adaptors);
___
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: r264970 - head/bin/date

2014-04-26 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Sat Apr 26 13:53:04 2014
New Revision: 264970
URL: http://svnweb.freebsd.org/changeset/base/264970

Log:
  date(1): Forgot to update manpage date in r264968
  
  MFC after:1 week
  MFC with: 264968

Modified:
  head/bin/date/date.1

Modified: head/bin/date/date.1
==
--- head/bin/date/date.1Sat Apr 26 13:21:28 2014(r264969)
+++ head/bin/date/date.1Sat Apr 26 13:53:04 2014(r264970)
@@ -32,7 +32,7 @@
 .\ @(#)date.1 8.3 (Berkeley) 4/28/95
 .\ $FreeBSD$
 .\
-.Dd June 3, 2010
+.Dd April 26, 2014
 .Dt DATE 1
 .Os
 .Sh NAME
___
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: r264972 - head/sys/dev/usb/wlan

2014-04-26 Thread Kevin Lo
Author: kevlo
Date: Sat Apr 26 14:39:58 2014
New Revision: 264972
URL: http://svnweb.freebsd.org/changeset/base/264972

Log:
  Initialize rssi variable.

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSat Apr 26 13:55:03 2014
(r264971)
+++ head/sys/dev/usb/wlan/if_urtwn.cSat Apr 26 14:39:58 2014
(r264972)
@@ -1738,6 +1738,7 @@ urtwn_r88e_get_rssi(struct urtwn_softc *
uint8_t cck_agc_rpt, lna_idx, vga_idx;
int8_t rssi;
 
+   rssi = 0;
if (rate = 3) {
cck = (struct r88e_rx_cck *)physt;
cck_agc_rpt = cck-agc_rpt;
___
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: r264973 - in head/sys: net netinet6

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Apr 26 14:52:03 2014
New Revision: 264973
URL: http://svnweb.freebsd.org/changeset/base/264973

Log:
  Unify sa_equal() macro usage.
  
  MFC after:2 weeks

Modified:
  head/sys/net/if.c
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/rtsock.c
  head/sys/netinet6/ip6_input.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Sat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/if.c   Sat Apr 26 14:52:03 2014(r264973)
@@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr 
  * to perform a different comparison.
  */
 
-#definesa_equal(a1, a2)\
-   (bcmp((a1), (a2), ((a1))-sa_len) == 0)
-
 #definesa_dl_equal(a1, a2) \
struct sockaddr_dl *)(a1))-sdl_len ==  \
 ((struct sockaddr_dl *)(a2))-sdl_len)   \

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/route.cSat Apr 26 14:52:03 2014(r264973)
@@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes no
 #defineV_rttrash   VNET(rttrash)
 
 
-/* compare two sockaddr structures */
-#definesa_equal(a1, a2) (((a1)-sa_len == (a2)-sa_len)  \
-(bcmp((a1), (a2), (a1)-sa_len) == 0))
-
 /*
  * Convert a 'struct radix_node *' to a 'struct rtentry *'.
  * The operation can be done safely (in this code) because a

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hSat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/route.hSat Apr 26 14:52:03 2014(r264973)
@@ -275,6 +275,10 @@ struct rt_addrinfo {
sizeof(long):   \
1 + ( (((struct sockaddr *)(sa))-sa_len - 1) | (sizeof(long) - 1) ) )
 
+#definesa_equal(a, b) (\
+(((struct sockaddr *)(a))-sa_len == ((struct sockaddr *)(b))-sa_len)  \
+(bcmp((a), (b), ((struct sockaddr *)(b))-sa_len) == 0))
+
 #ifdef _KERNEL
 
 #define RT_LINK_IS_UP(ifp) (!((ifp)-if_capabilities  IFCAP_LINKSTATE) \

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Sat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/rtsock.c   Sat Apr 26 14:52:03 2014(r264973)
@@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info,
 static int
 route_output(struct mbuf *m, struct socket *so)
 {
-#definesa_equal(a1, a2) (bcmp((a1), (a2), (a1)-sa_len) == 0)
struct rt_msghdr *rtm = NULL;
struct rtentry *rt = NULL;
struct radix_node_head *rnh;
@@ -960,7 +959,6 @@ flush:
Free(rtm);
 }
return (error);
-#undef sa_equal
 }
 
 static void

Modified: head/sys/netinet6/ip6_input.c
==
--- head/sys/netinet6/ip6_input.c   Sat Apr 26 14:39:58 2014
(r264972)
+++ head/sys/netinet6/ip6_input.c   Sat Apr 26 14:52:03 2014
(r264973)
@@ -695,8 +695,6 @@ passin:
int bad;
 
bad = 1;
-#definesa_equal(a1, a2)
\
-   (bcmp((a1), (a2), ((a1))-sin6_len) == 0)
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, ifp-if_addrhead, ifa_link) {
if (ifa-ifa_addr-sa_family != dst6.sin6_family)
@@ -706,7 +704,6 @@ passin:
}
KASSERT(ifa != NULL, (%s: ifa not found for lle %p,
__func__, lle));
-#undef sa_equal
 
ia6 = (struct in6_ifaddr *)ifa;
if (!(ia6-ia6_flags  IN6_IFF_NOTREADY)) {
___
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: r264973 - in head/sys: net netinet6

2014-04-26 Thread Ian Lepore
On Sat, 2014-04-26 at 14:52 +, Alexander V. Chernikov wrote:
 Author: melifaro
 Date: Sat Apr 26 14:52:03 2014
 New Revision: 264973
 URL: http://svnweb.freebsd.org/changeset/base/264973
 
 Log:
   Unify sa_equal() macro usage.
   
   MFC after:  2 weeks
 
 Modified:
   head/sys/net/if.c
   head/sys/net/route.c
   head/sys/net/route.h
   head/sys/net/rtsock.c
   head/sys/netinet6/ip6_input.c
 

FYI, there's another #define sa_equal (and sa_dl_equal) in
usr.sbin/ifmcstat/ifmcstat.c, which is now getting a redefined error.

-- Ian

 Modified: head/sys/net/if.c
 ==
 --- head/sys/net/if.c Sat Apr 26 14:39:58 2014(r264972)
 +++ head/sys/net/if.c Sat Apr 26 14:52:03 2014(r264973)
 @@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr 
   * to perform a different comparison.
   */
  
 -#define  sa_equal(a1, a2)\
 - (bcmp((a1), (a2), ((a1))-sa_len) == 0)
 -
  #define  sa_dl_equal(a1, a2) \
   struct sockaddr_dl *)(a1))-sdl_len ==  \
((struct sockaddr_dl *)(a2))-sdl_len)   \
 
 Modified: head/sys/net/route.c
 ==
 --- head/sys/net/route.c  Sat Apr 26 14:39:58 2014(r264972)
 +++ head/sys/net/route.c  Sat Apr 26 14:52:03 2014(r264973)
 @@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash);   /* routes no
  #define  V_rttrash   VNET(rttrash)
  
 
 -/* compare two sockaddr structures */
 -#define  sa_equal(a1, a2) (((a1)-sa_len == (a2)-sa_len)  \
 -(bcmp((a1), (a2), (a1)-sa_len) == 0))
 -
  /*
   * Convert a 'struct radix_node *' to a 'struct rtentry *'.
   * The operation can be done safely (in this code) because a
 
 Modified: head/sys/net/route.h
 ==
 --- head/sys/net/route.h  Sat Apr 26 14:39:58 2014(r264972)
 +++ head/sys/net/route.h  Sat Apr 26 14:52:03 2014(r264973)
 @@ -275,6 +275,10 @@ struct rt_addrinfo {
   sizeof(long):   \
   1 + ( (((struct sockaddr *)(sa))-sa_len - 1) | (sizeof(long) - 1) ) )
  
 +#define  sa_equal(a, b) (\
 +(((struct sockaddr *)(a))-sa_len == ((struct sockaddr *)(b))-sa_len) 
  \
 +(bcmp((a), (b), ((struct sockaddr *)(b))-sa_len) == 0))
 +
  #ifdef _KERNEL
  
  #define RT_LINK_IS_UP(ifp)   (!((ifp)-if_capabilities  IFCAP_LINKSTATE) \
 
 Modified: head/sys/net/rtsock.c
 ==
 --- head/sys/net/rtsock.c Sat Apr 26 14:39:58 2014(r264972)
 +++ head/sys/net/rtsock.c Sat Apr 26 14:52:03 2014(r264973)
 @@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info,
  static int
  route_output(struct mbuf *m, struct socket *so)
  {
 -#define  sa_equal(a1, a2) (bcmp((a1), (a2), (a1)-sa_len) == 0)
   struct rt_msghdr *rtm = NULL;
   struct rtentry *rt = NULL;
   struct radix_node_head *rnh;
 @@ -960,7 +959,6 @@ flush:
   Free(rtm);
  }
   return (error);
 -#undef   sa_equal
  }
  
  static void
 
 Modified: head/sys/netinet6/ip6_input.c
 ==
 --- head/sys/netinet6/ip6_input.c Sat Apr 26 14:39:58 2014
 (r264972)
 +++ head/sys/netinet6/ip6_input.c Sat Apr 26 14:52:03 2014
 (r264973)
 @@ -695,8 +695,6 @@ passin:
   int bad;
  
   bad = 1;
 -#define  sa_equal(a1, a2)
 \
 - (bcmp((a1), (a2), ((a1))-sin6_len) == 0)
   IF_ADDR_RLOCK(ifp);
   TAILQ_FOREACH(ifa, ifp-if_addrhead, ifa_link) {
   if (ifa-ifa_addr-sa_family != dst6.sin6_family)
 @@ -706,7 +704,6 @@ passin:
   }
   KASSERT(ifa != NULL, (%s: ifa not found for lle %p,
   __func__, lle));
 -#undef sa_equal
  
   ia6 = (struct in6_ifaddr *)ifa;
   if (!(ia6-ia6_flags  IN6_IFF_NOTREADY)) {
 


___
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: r264974 - head/usr.sbin/ifmcstat

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Apr 26 16:12:39 2014
New Revision: 264974
URL: http://svnweb.freebsd.org/changeset/base/264974

Log:
  Remove sa_equal() definition since it is already defined in net/route.h.
  
  Noted by: ian
  MFC after:2 weeks

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

Modified: head/usr.sbin/ifmcstat/ifmcstat.c
==
--- head/usr.sbin/ifmcstat/ifmcstat.c   Sat Apr 26 14:52:03 2014
(r264973)
+++ head/usr.sbin/ifmcstat/ifmcstat.c   Sat Apr 26 16:12:39 2014
(r264974)
@@ -116,9 +116,6 @@ int Kflag = 0;
 #endif
 intvflag = 0;
 
-#definesa_equal(a1, a2)\
-   (bcmp((a1), (a2), ((a1))-sa_len) == 0)
-
 #definesa_dl_equal(a1, a2) \
struct sockaddr_dl *)(a1))-sdl_len ==  \
 ((struct sockaddr_dl *)(a2))-sdl_len)   \
___
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: r264973 - in head/sys: net netinet6

2014-04-26 Thread Alexander V. Chernikov

On 26.04.2014 20:06, Ian Lepore wrote:

On Sat, 2014-04-26 at 14:52 +, Alexander V. Chernikov wrote:

Author: melifaro
Date: Sat Apr 26 14:52:03 2014
New Revision: 264973
URL: http://svnweb.freebsd.org/changeset/base/264973

Log:
   Unify sa_equal() macro usage.
   
   MFC after:	2 weeks


Modified:
   head/sys/net/if.c
   head/sys/net/route.c
   head/sys/net/route.h
   head/sys/net/rtsock.c
   head/sys/netinet6/ip6_input.c


FYI, there's another #define sa_equal (and sa_dl_equal) in
usr.sbin/ifmcstat/ifmcstat.c, which is now getting a redefined error.

Thanks, removed in r264974.


-- Ian


Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Sat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/if.c   Sat Apr 26 14:52:03 2014(r264973)
@@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr
   * to perform a different comparison.
   */
  
-#define	sa_equal(a1, a2)	\

-   (bcmp((a1), (a2), ((a1))-sa_len) == 0)
-
  #define   sa_dl_equal(a1, a2) \
struct sockaddr_dl *)(a1))-sdl_len ==   \
 ((struct sockaddr_dl *)(a2))-sdl_len)\

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/route.cSat Apr 26 14:52:03 2014(r264973)
@@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes no
  #define   V_rttrash   VNET(rttrash)
  


-/* compare two sockaddr structures */
-#definesa_equal(a1, a2) (((a1)-sa_len == (a2)-sa_len)  \
-(bcmp((a1), (a2), (a1)-sa_len) == 0))
-
  /*
   * Convert a 'struct radix_node *' to a 'struct rtentry *'.
   * The operation can be done safely (in this code) because a

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hSat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/route.hSat Apr 26 14:52:03 2014(r264973)
@@ -275,6 +275,10 @@ struct rt_addrinfo {
sizeof(long):   \
1 + ( (((struct sockaddr *)(sa))-sa_len - 1) | (sizeof(long) - 1) ) )
  
+#define	sa_equal(a, b) (	\

+(((struct sockaddr *)(a))-sa_len == ((struct sockaddr *)(b))-sa_len)  \
+(bcmp((a), (b), ((struct sockaddr *)(b))-sa_len) == 0))
+
  #ifdef _KERNEL
  
  #define RT_LINK_IS_UP(ifp)	(!((ifp)-if_capabilities  IFCAP_LINKSTATE) \


Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Sat Apr 26 14:39:58 2014(r264972)
+++ head/sys/net/rtsock.c   Sat Apr 26 14:52:03 2014(r264973)
@@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info,
  static int
  route_output(struct mbuf *m, struct socket *so)
  {
-#definesa_equal(a1, a2) (bcmp((a1), (a2), (a1)-sa_len) == 0)
struct rt_msghdr *rtm = NULL;
struct rtentry *rt = NULL;
struct radix_node_head *rnh;
@@ -960,7 +959,6 @@ flush:
Free(rtm);
  }
return (error);
-#undef sa_equal
  }
  
  static void


Modified: head/sys/netinet6/ip6_input.c
==
--- head/sys/netinet6/ip6_input.c   Sat Apr 26 14:39:58 2014
(r264972)
+++ head/sys/netinet6/ip6_input.c   Sat Apr 26 14:52:03 2014
(r264973)
@@ -695,8 +695,6 @@ passin:
int bad;
  
  		bad = 1;

-#definesa_equal(a1, a2)
\
-   (bcmp((a1), (a2), ((a1))-sin6_len) == 0)
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, ifp-if_addrhead, ifa_link) {
if (ifa-ifa_addr-sa_family != dst6.sin6_family)
@@ -706,7 +704,6 @@ passin:
}
KASSERT(ifa != NULL, (%s: ifa not found for lle %p,
__func__, lle));
-#undef sa_equal
  
  		ia6 = (struct in6_ifaddr *)ifa;

if (!(ia6-ia6_flags  IN6_IFF_NOTREADY)) {






___
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: r264975 - head/sys/boot/amd64/boot1.efi

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Apr 26 16:34:22 2014
New Revision: 264975
URL: http://svnweb.freebsd.org/changeset/base/264975

Log:
  Add generation of an EFI filesystem to hold boot1.efi. This is a near-exact
  copy of the code from boot1.chrp again.
  
  The resulting image is installed to /boot/boot1.efifat. If dd'ed to an 800K
  efi partition, it should result in a bootable system.

Added:
  head/sys/boot/amd64/boot1.efi/Makefile.fat   (contents, props changed)
  head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu   (contents, props changed)
  head/sys/boot/amd64/boot1.efi/generate-fat.sh   (contents, props changed)
Modified:
  head/sys/boot/amd64/boot1.efi/Makefile

Modified: head/sys/boot/amd64/boot1.efi/Makefile
==
--- head/sys/boot/amd64/boot1.efi/Makefile  Sat Apr 26 16:12:39 2014
(r264974)
+++ head/sys/boot/amd64/boot1.efi/Makefile  Sat Apr 26 16:34:22 2014
(r264975)
@@ -26,7 +26,7 @@ CFLAGS+=  -I${.CURDIR}/../../..
 .PATH: ${.CURDIR}/../efi ${.CURDIR}/../../common
 CFLAGS+=   -I${.CURDIR}/../../common
 
-FILES= boot1.efi
+FILES= boot1.efi boot1.efifat
 FILESMODE_boot1.efi=   ${BINMODE}
 
 LDSCRIPT=  ${.CURDIR}/../efi/ldscript.${MACHINE_CPUARCH}
@@ -57,6 +57,20 @@ CFLAGS+= -I${.CURDIR}/../../common
 
 boot1.o: ${.CURDIR}/../../common/ufsread.c
 
+# The following inserts out objects into a template FAT file system
+# created by generate-fat.sh
+
+.include ${.CURDIR}/Makefile.fat
+
+boot1.efifat: boot1.efi
+   echo ${.OBJDIR}
+   uudecode ${.CURDIR}/fat.tmpl.bz2.uu
+   mv fat.tmpl.bz2 ${.TARGET}.bz2
+   bzip2 -f -d ${.TARGET}.bz2
+   dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
+
+CLEANFILES= boot1.efifat
+
 .endif # ${COMPILER_TYPE} != gcc
 
 .include bsd.prog.mk

Added: head/sys/boot/amd64/boot1.efi/Makefile.fat
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/amd64/boot1.efi/Makefile.fat  Sat Apr 26 16:34:22 2014
(r264975)
@@ -0,0 +1,3 @@
+# This file autogenerated by generate-fat.sh - DO NOT EDIT
+# $FreeBSD$
+BOOT1_OFFSET=0x2d

Added: head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu   Sat Apr 26 16:34:22 
2014(r264975)
@@ -0,0 +1,22 @@
+FAT template boot filesystem created by generate-fat.sh
+DO NOT EDIT
+$FreeBSD$
+begin 644 fat.tmpl.bz2
+M0EIH.3%!62936?1V`!$`J7[ZZKJJ_^N_ZO^Z_^[ON_\`4`00!0$#$$
+M0D)$6(P`(Y=SNY1(2DHTC:::-`!H`@-#)IH#3(@:`!IIDT--,@E
+M53TFCWZJGJ`-!D`-`#(::```:```@:!D`!D``*B3:C]4T]0#0`:``-`T``
+M``@)131/4T-*IZC3RGZH\B$,UAH#)B:,$8TAF@@]0TIZFA
+MGZID,1IZFAMO%FPGL0(QIZV3_!`$@N(@`DD$?C$[`)`!)$6@#\HOB42
+M0`2(X0FGX1#L`'7E,'#-'HM!'QUD0\R,?9U,6ZE8F,Y6*L9S6PH)%_
+MX'_PL4A),QB(`B(=14*-8,(QCG.(2$A(1J'010CBR$(0B00FPP(0A$)E
+M#`A$(1]LB!$(0B41#`A$(14W9J.:A@8!@8'`Z$(D(02@^L=UL:+
+MBG:Q5+4'[/P4@D2?M,E!0YBF8+],4^%$`4YVD4=K)O.IZ\#)``!CU-1
+M``!L%C7V^RL80`#K(AUU+D])9/B4@*%$N9MF:Z29-_VG2G7$LJ-44RST
+MB53YE@H%(G5G$.FU;=L[DQVA](V4B1+%BP%.A-10-%#R#NKR='@\'#_'U
+M'I36ZT:8QIN*3E$:HZIZRJ?$Y1L1'C)G(=8,E.L(KU9X=%/NX.6\=@^IW
+M\-PC$BIT\!(VI3K!X:\%.01Y#X/83[SH.J*H5BH:ILFV1'X/D/V1$W6'\
+MFYYE:*(I!.X@'DH_(PY'(W1+B;:,Y?H8Y%(Q')!DDE;\J1-DRXJJ/O(1@
+M'X/24=!+/V8S1)B(R:UE01:PUS(1`!$04``++GZ/8(CE5P1P8?^7QB[DB
+(GA(CL`(``
+`
+end

Added: head/sys/boot/amd64/boot1.efi/generate-fat.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/amd64/boot1.efi/generate-fat.sh   Sat Apr 26 16:34:22 
2014(r264975)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# This script generates the dummy FAT filesystem used for the EFI boot
+# blocks. It uses newfs_msdos to generate a template filesystem with the
+# relevant interesting files. These are then found by grep, and the offsets
+# written to a Makefile snippet.
+#
+# Because it requires root, and because it is overkill, we do not
+# do this as part of the normal build. If makefs(8) grows workable FAT
+# support, this should be revisited.
+
+# $FreeBSD$
+
+FAT_SIZE=1600  #Size in 512-byte blocks of the produced image
+
+BOOT1_SIZE=64k
+
+# Generate 800K FAT image
+OUTPUT_FILE=fat.tmpl
+
+dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$FAT_SIZE
+DEVICE=`mdconfig -a -f $OUTPUT_FILE`
+newfs_msdos -F 12 $DEVICE
+mkdir stub
+mount -t msdosfs /dev/$DEVICE stub
+
+# Create and bless a directory for the boot loader
+mkdir -p stub/efi/boot
+
+# Make a dummy file for boot1
+echo 'Boot1 START' | dd of=stub/efi/boot/BOOTx64.efi cbs=$BOOT1_SIZE count=1 
conv=block
+
+umount stub
+mdconfig -d -u $DEVICE
+rmdir stub
+
+# Locate the offsets of the two fake files

svn commit: r264976 - head/sys/netinet6

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Apr 26 16:46:33 2014
New Revision: 264976
URL: http://svnweb.freebsd.org/changeset/base/264976

Log:
  Use hash value in rtalloc_mpath_fib() instead of RTF_ANNOUNCE flag.
  Hashing method is the same as in in6_src.c. (Probably we need better one).
  
  MFC after:2 weeks

Modified:
  head/sys/netinet6/nd6_nbr.c

Modified: head/sys/netinet6/nd6_nbr.c
==
--- head/sys/netinet6/nd6_nbr.c Sat Apr 26 16:34:22 2014(r264975)
+++ head/sys/netinet6/nd6_nbr.c Sat Apr 26 16:46:33 2014(r264976)
@@ -242,7 +242,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 
/* Always use the default FIB. */
 #ifdef RADIX_MPATH
-   rtalloc_mpath_fib((struct route *)ro, RTF_ANNOUNCE,
+   rtalloc_mpath_fib((struct route *)ro, 
ntohl(taddr6.s6_addr32[3]),
RT_DEFAULT_FIB);
 #else
in6_rtalloc(ro, RT_DEFAULT_FIB);
___
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: r264977 - in head/sys: arm/freescale/imx dev/usb/controller

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sat Apr 26 16:48:09 2014
New Revision: 264977
URL: http://svnweb.freebsd.org/changeset/base/264977

Log:
  Stop calling imx51_ccm_foo() clock functions from imx6 code.  Instead
  define a few imx_ccm_foo() functions that are implemented by the imx51 or
  imx6 ccm code.  Of course, the imx6 ccm code is still more a wish than
  reality, so for now its implementations just return hard-coded numbers.

Added:
  head/sys/arm/freescale/imx/imx_ccmvar.h   (contents, props changed)
Modified:
  head/sys/arm/freescale/imx/imx51_ccm.c
  head/sys/arm/freescale/imx/imx6_ccm.c
  head/sys/arm/freescale/imx/imx6_usbphy.c
  head/sys/arm/freescale/imx/imx_gpt.c
  head/sys/arm/freescale/imx/imx_machdep.h
  head/sys/arm/freescale/imx/imx_nop_usbphy.c
  head/sys/arm/freescale/imx/imx_sdhci.c
  head/sys/dev/usb/controller/ehci_imx.c

Modified: head/sys/arm/freescale/imx/imx51_ccm.c
==
--- head/sys/arm/freescale/imx/imx51_ccm.c  Sat Apr 26 16:46:33 2014
(r264976)
+++ head/sys/arm/freescale/imx/imx51_ccm.c  Sat Apr 26 16:48:09 2014
(r264977)
@@ -83,6 +83,7 @@ __FBSDID($FreeBSD$);
 #include arm/freescale/imx/imx51_ccmvar.h
 #include arm/freescale/imx/imx51_ccmreg.h
 #include arm/freescale/imx/imx51_dpllreg.h
+#include arm/freescale/imx/imx_ccmvar.h
 #include arm/freescale/imx/imx_machdep.h
 
 #defineIMXCCMDEBUG
@@ -552,3 +553,30 @@ imx_ccm_usbphy_enable(device_t dev)
}
 }
 
+uint32_t
+imx_ccm_ipg_hz(void)
+{
+
+   return (imx51_get_clock(IMX51CLK_IPG_CLK_ROOT));
+}
+
+uint32_t
+imx_ccm_sdhci_hz(void)
+{
+
+   return (imx51_get_clock(IMX51CLK_ESDHC1_CLK_ROOT));
+}
+
+uint32_t
+imx_ccm_perclk_hz(void)
+{
+
+   return (imx51_get_clock(IMX51CLK_PERCLK_ROOT));
+}
+
+uint32_t
+imx_ccm_uart_hz(void)
+{
+
+   return (imx51_get_clock(IMX51CLK_UART_CLK_ROOT));
+}

Modified: head/sys/arm/freescale/imx/imx6_ccm.c
==
--- head/sys/arm/freescale/imx/imx6_ccm.c   Sat Apr 26 16:46:33 2014
(r264976)
+++ head/sys/arm/freescale/imx/imx6_ccm.c   Sat Apr 26 16:48:09 2014
(r264977)
@@ -45,13 +45,15 @@ __FBSDID($FreeBSD$);
 
 #include arm/freescale/imx/imx6_anatopreg.h
 #include arm/freescale/imx/imx6_anatopvar.h
-#include arm/freescale/imx/imx_machdep.h
 #include arm/freescale/imx/imx6_ccmreg.h
+#include arm/freescale/imx/imx_machdep.h
+#include arm/freescale/imx/imx_ccmvar.h
 
-
-/* XXX temp kludge for imx51_get_clock. */
-#include arm/freescale/imx/imx51_ccmvar.h
-#include arm/freescale/imx/imx51_ccmreg.h
+#ifndef CCGR_CLK_MODE_ALWAYS
+#defineCCGR_CLK_MODE_OFF   0
+#defineCCGR_CLK_MODE_RUNMODE   1
+#defineCCGR_CLK_MODE_ALWAYS3
+#endif
 
 struct ccm_softc {
device_tdev;
@@ -208,24 +210,32 @@ imx_ccm_usbphy_enable(device_t _phydev)
 #endif
 }
 
+uint32_t
+imx_ccm_ipg_hz(void)
+{
 
+   return (6600);
+}
 
+uint32_t
+imx_ccm_perclk_hz(void)
+{
 
+   return (6600);
+}
 
-// XXX Fix this.  This has to be here for other code to link,
-// but it doesn't have to return anything useful for imx6 right now.
-u_int
-imx51_get_clock(enum imx51_clock clk)
-{
-   switch (clk)
-   {
-   case IMX51CLK_IPG_CLK_ROOT:
-   return 6600;
-   default:
-   printf(imx51_get_clock() on imx6 doesn't know about clock 
%d\n, clk);
-   break;
-   }
-   return 0;
+uint32_t
+imx_ccm_sdhci_hz(void)
+{
+
+   return (2);
+}
+
+uint32_t
+imx_ccm_uart_hz(void)
+{
+
+   return (8000);
 }
 
 static device_method_t ccm_methods[] = {

Modified: head/sys/arm/freescale/imx/imx6_usbphy.c
==
--- head/sys/arm/freescale/imx/imx6_usbphy.cSat Apr 26 16:46:33 2014
(r264976)
+++ head/sys/arm/freescale/imx/imx6_usbphy.cSat Apr 26 16:48:09 2014
(r264977)
@@ -45,7 +45,7 @@ __FBSDID($FreeBSD$);
 
 #include machine/bus.h
 
-#include arm/freescale/imx/imx_machdep.h
+#include arm/freescale/imx/imx_ccmvar.h
 #include arm/freescale/imx/imx6_anatopreg.h
 #include arm/freescale/imx/imx6_anatopvar.h
 

Added: head/sys/arm/freescale/imx/imx_ccmvar.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx_ccmvar.h Sat Apr 26 16:48:09 2014
(r264977)
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2014 Ian Lepore i...@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 

svn commit: r264978 - head/usr.sbin/bsdinstall/partedit

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Apr 26 16:55:38 2014
New Revision: 264978
URL: http://svnweb.freebsd.org/changeset/base/264978

Log:
  Add EFI support to the installer. This requires that the kernel provide
  a sysctl to determine what firmware is in use. This sysctl does not exist
  yet, so the following blocks are in front of the wheels:
  - I've provisionally called this hw.platform after the equivalent thing
on PPC
  - The logic to check the sysctl is short-circuited to always choose BIOS.
There's a comment in the top of the file about how to turn this off.
  
  If IA64 acquired a boot1.efifat-like thing (probably with very few
  modifications), the same code could be adapted there.

Modified:
  head/usr.sbin/bsdinstall/partedit/gpart_ops.c
  head/usr.sbin/bsdinstall/partedit/partedit.h
  head/usr.sbin/bsdinstall/partedit/partedit_generic.c
  head/usr.sbin/bsdinstall/partedit/partedit_pc98.c
  head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c
  head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c
  head/usr.sbin/bsdinstall/partedit/partedit_x86.c

Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c
==
--- head/usr.sbin/bsdinstall/partedit/gpart_ops.c   Sat Apr 26 16:48:09 
2014(r264977)
+++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c   Sat Apr 26 16:55:38 
2014(r264978)
@@ -584,7 +584,7 @@ set_default_part_metadata(const char *na
 
if (strcmp(type, freebsd-swap) == 0)
mountpoint = none;
-   if (strcmp(type, freebsd-boot) == 0)
+   if (strcmp(type, bootpart_type(scheme)) == 0)
md-bootcode = 1;
 
/* VTOC8 needs partcode in UFS partitions */
@@ -949,7 +949,8 @@ addpartform:
LIST_FOREACH(gc, pp-lg_config, lg_config)
if (strcmp(gc-lg_name, type) == 0)
break;
-   if (gc != NULL  strcmp(gc-lg_val, freebsd-boot) == 0)
+   if (gc != NULL  strcmp(gc-lg_val,
+   bootpart_type(scheme)) == 0)
break;
}
 
@@ -971,7 +972,7 @@ addpartform:
gctl_ro_param(r, arg0, -1, geom-lg_name);
gctl_ro_param(r, flags, -1, GPART_FLAGS);
gctl_ro_param(r, verb, -1, add);
-   gctl_ro_param(r, type, -1, freebsd-boot);
+   gctl_ro_param(r, type, -1, bootpart_type(scheme));
snprintf(sizestr, sizeof(sizestr), %jd,
bootpart_size(scheme) / sector);
gctl_ro_param(r, size, -1, sizestr);
@@ -1031,7 +1032,7 @@ addpartform:
gctl_issue(r); /* Error usually expected and non-fatal */
gctl_free(r);
 
-   if (strcmp(items[0].text, freebsd-boot) == 0)
+   if (strcmp(items[0].text, bootpart_type(scheme)) == 0)
get_part_metadata(newpartname, 1)-bootcode = 1;
else if (strcmp(items[0].text, freebsd) == 0)
gpart_partition(newpartname, BSD);

Modified: head/usr.sbin/bsdinstall/partedit/partedit.h
==
--- head/usr.sbin/bsdinstall/partedit/partedit.hSat Apr 26 16:48:09 
2014(r264977)
+++ head/usr.sbin/bsdinstall/partedit/partedit.hSat Apr 26 16:55:38 
2014(r264978)
@@ -74,9 +74,10 @@ void set_default_part_metadata(const cha
 
 /* machine-dependent bootability checks */
 const char *default_scheme(void);
-int is_scheme_bootable(const char *part_type);
-size_t bootpart_size(const char *part_type);
-const char *bootcode_path(const char *part_type);
-const char *partcode_path(const char *part_type);
+int is_scheme_bootable(const char *scheme);
+size_t bootpart_size(const char *scheme);
+const char *bootpart_type(const char *scheme);
+const char *bootcode_path(const char *scheme);
+const char *partcode_path(const char *scheme);
 
 #endif

Modified: head/usr.sbin/bsdinstall/partedit/partedit_generic.c
==
--- head/usr.sbin/bsdinstall/partedit/partedit_generic.cSat Apr 26 
16:48:09 2014(r264977)
+++ head/usr.sbin/bsdinstall/partedit/partedit_generic.cSat Apr 26 
16:55:38 2014(r264978)
@@ -58,6 +58,11 @@ bootpart_size(const char *part_type) {
 }
 
 const char *
+bootpart_type(const char *scheme) {
+   return (freebsd-boot);
+}
+
+const char *
 bootcode_path(const char *part_type) {
return (NULL);
 }

Modified: head/usr.sbin/bsdinstall/partedit/partedit_pc98.c
==
--- head/usr.sbin/bsdinstall/partedit/partedit_pc98.c   Sat Apr 26 16:48:09 
2014(r264977)
+++ head/usr.sbin/bsdinstall/partedit/partedit_pc98.c   Sat Apr 26 16:55:38 
2014(r264978)
@@ -52,6 +52,11 @@ bootpart_size(const char *part_type) {
 }
 

svn commit: r264979 - head

2014-04-26 Thread Warner Losh
Author: imp
Date: Sat Apr 26 16:58:35 2014
New Revision: 264979
URL: http://svnweb.freebsd.org/changeset/base/264979

Log:
  make_dtb.sh is designed to be used in a kernel build environment where
  MACHINE is defined to the target's value, not the host's
  value. However, in Makefile.inc1, it is still defined to be the host's
  value. Make the makedtb target work by expanding TARGET in the
  existance test, and passing MACHINE=$TARGET in the call to make_dtb.sh

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Apr 26 16:55:38 2014(r264978)
+++ head/Makefile.inc1  Sat Apr 26 16:58:35 2014(r264979)
@@ -1833,7 +1833,7 @@ builddtb:
echo ERROR: FDT_DTS_FILE must be specified!; \
exit 1; \
fi; \
-   if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; 
then \
+   if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; then 
\
echo ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \
exist!; \
exit 1; \
@@ -1843,6 +1843,7 @@ builddtb:
directory; \
fi
@PATH=${TMPPATH} \
+   MACHINE=${TARGET} \
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
${FDT_DTS_FILE} \
${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts`
___
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: r264980 - head/sys/boot/amd64/boot1.efi

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Apr 26 17:51:41 2014
New Revision: 264980
URL: http://svnweb.freebsd.org/changeset/base/264980

Log:
  Apparently this is supposed to be FAT32, not FAT12.

Modified:
  head/sys/boot/amd64/boot1.efi/Makefile.fat
  head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu
  head/sys/boot/amd64/boot1.efi/generate-fat.sh

Modified: head/sys/boot/amd64/boot1.efi/Makefile.fat
==
--- head/sys/boot/amd64/boot1.efi/Makefile.fat  Sat Apr 26 16:58:35 2014
(r264979)
+++ head/sys/boot/amd64/boot1.efi/Makefile.fat  Sat Apr 26 17:51:41 2014
(r264980)
@@ -1,3 +1,3 @@
 # This file autogenerated by generate-fat.sh - DO NOT EDIT
 # $FreeBSD$
-BOOT1_OFFSET=0x2d
+BOOT1_OFFSET=0x3b

Modified: head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu
==
--- head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu   Sat Apr 26 16:58:35 
2014(r264979)
+++ head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu   Sat Apr 26 17:51:41 
2014(r264980)
@@ -2,21 +2,24 @@ FAT template boot filesystem created by 
 DO NOT EDIT
 $FreeBSD$
 begin 644 fat.tmpl.bz2
-M0EIH.3%!62936?1V`!$`J7[ZZKJJ_^N_ZO^Z_^[ON_\`4`00!0$#$$
-M0D)$6(P`(Y=SNY1(2DHTC:::-`!H`@-#)IH#3(@:`!IIDT--,@E
-M53TFCWZJGJ`-!D`-`#(::```:```@:!D`!D``*B3:C]4T]0#0`:``-`T``
-M``@)131/4T-*IZC3RGZH\B$,UAH#)B:,$8TAF@@]0TIZFA
-MGZID,1IZFAMO%FPGL0(QIZV3_!`$@N(@`DD$?C$[`)`!)$6@#\HOB42
-M0`2(X0FGX1#L`'7E,'#-'HM!'QUD0\R,?9U,6ZE8F,Y6*L9S6PH)%_
-MX'_PL4A),QB(`B(=14*-8,(QCG.(2$A(1J'010CBR$(0B00FPP(0A$)E
-M#`A$(1]LB!$(0B41#`A$(14W9J.:A@8!@8'`Z$(D(02@^L=UL:+
-MBG:Q5+4'[/P4@D2?M,E!0YBF8+],4^%$`4YVD4=K)O.IZ\#)``!CU-1
-M``!L%C7V^RL80`#K(AUU+D])9/B4@*%$N9MF:Z29-_VG2G7$LJ-44RST
-MB53YE@H%(G5G$.FU;=L[DQVA](V4B1+%BP%.A-10-%#R#NKR='@\'#_'U
-M'I36ZT:8QIN*3E$:HZIZRJ?$Y1L1'C)G(=8,E.L(KU9X=%/NX.6\=@^IW
-M\-PC$BIT\!(VI3K!X:\%.01Y#X/83[SH.J*H5BH:ILFV1'X/D/V1$W6'\
-MFYYE:*(I!.X@'DH_(PY'(W1+B;:,Y?H8Y%(Q')!DDE;\J1-DRXJJ/O(1@
-M'X/24=!+/V8S1)B(R:UE01:PUS(1`!$04``++GZ/8(CE5P1P8?^7QB[DB
-(GA(CL`(``
+M0EIH.3%!629362X?*4`'$M^`T`8`!0$#%$
+M0$($26(P`+]@@``08$T::FFF)B:FFA@(P,(#)@)IHP$`8`$R,`FF0#(`
+M8AID!55*,3)B/29#)H9,U,F1HT#308B#3,$0:--I`PC3)H`R::,9-`R9
+M$!-FAIIIB8FAIIH8,`C`R8::,!``!,C`)ID`R`(:9`5))$Q*0F1
+MIH#31H--/48U#0--:#0`80@TT,@`-FFF@'J::U/34NO5O]KH,P3D
+M9TC0KV+%M5^)$Y=$D2(S=*LB`@R#`))MDFE$%-NDVQ;AN6'M4LC-TEV[;Q
+MO4PF6^32;0F_3B=!/)]P74#AN(H7%9QW(E1.4HW+QS7.0J12J93JA4H
+M:J5;GN@Z+I(:L=-6*U7*]8.HZJQ62S2ZT6KK.N[#LK9;NT[;N.ZN'=]O`N
+MD1=O\3QO(\J\7J]7R_9YV`]#!83TL-$IZWLU[G#?8XC[6LXKC..Y]R7
+MW+2`DCI_O6(CB*@F:HXU$D_U22''VTEIJ0$D5XJTGX,_@%TB=+22.G#2]
+M8%U/0HF\HDJE]1'D[:R*HAO::Y1KJ51.W[.PJD;.AF*B305`)(Y*D=,J3E
+M*C32FALJLNYP*93W5YF*=$IQU.`L6-.HP.$[I9CM*JD4QN57Y6Z'FK\?B
+MH64E.:LD:EHV\H=:H/3=1U!J@Z_P%2`,'![YLWM2IC2`:`CEJT49+FZ_
+M1LE?,Y33\]9\*FD5,=K=4NCB[FR1YF3ZC%OGB-9C3?UV/,;:Y_5*BJJ2SV
+M'4VCKU)D*.INFX6:M1L6Q:1O*,QA]=P,BTPWK[0W7FOQU632YRP7U%AQ
+M*N5LEBY4NTSK%.Y7B;M1VC`LZJF)3*7+)HFR:3E],AB;Y_R\RX9+6N$OS
+MG.@F!CKTC7,*\N.HCJ9JLU)CN\93G:R2HF-)RY.9[:-NSFY;)AW3_YC
+MGE^EGLW+WC-:)@V^HRU+@$D4`RL\!$JAO6TM%S=C+LRM7_XNY(IPH2!./
+E*``
 `
 end

Modified: head/sys/boot/amd64/boot1.efi/generate-fat.sh
==
--- head/sys/boot/amd64/boot1.efi/generate-fat.sh   Sat Apr 26 16:58:35 
2014(r264979)
+++ head/sys/boot/amd64/boot1.efi/generate-fat.sh   Sat Apr 26 17:51:41 
2014(r264980)
@@ -20,7 +20,7 @@ OUTPUT_FILE=fat.tmpl
 
 dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$FAT_SIZE
 DEVICE=`mdconfig -a -f $OUTPUT_FILE`
-newfs_msdos -F 12 $DEVICE
+newfs_msdos -F 32 $DEVICE
 mkdir stub
 mount -t msdosfs /dev/$DEVICE stub
 
___
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: r264981 - head/sys/dev/uart

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sat Apr 26 17:56:39 2014
New Revision: 264981
URL: http://svnweb.freebsd.org/changeset/base/264981

Log:
  The freescale imx uart driver works for the whole i.MX family, so rename the
  header file to not have 5xx in the name.

Added:
  head/sys/dev/uart/uart_dev_imx.h
 - copied unchanged from r264979, head/sys/dev/uart/uart_dev_imx5xx.h
Deleted:
  head/sys/dev/uart/uart_dev_imx5xx.h
Modified:
  head/sys/dev/uart/uart_dev_imx.c

Modified: head/sys/dev/uart/uart_dev_imx.c
==
--- head/sys/dev/uart/uart_dev_imx.cSat Apr 26 17:51:41 2014
(r264980)
+++ head/sys/dev/uart/uart_dev_imx.cSat Apr 26 17:56:39 2014
(r264981)
@@ -44,7 +44,7 @@ __FBSDID($FreeBSD$);
 #include dev/uart/uart_cpu.h
 #include dev/uart/uart_bus.h
 
-#include dev/uart/uart_dev_imx5xx.h
+#include dev/uart/uart_dev_imx.h
 
 #include uart_if.h
 /*

Copied: head/sys/dev/uart/uart_dev_imx.h (from r264979, 
head/sys/dev/uart/uart_dev_imx5xx.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/uart/uart_dev_imx.hSat Apr 26 17:56:39 2014
(r264981, copy of r264979, head/sys/dev/uart/uart_dev_imx5xx.h)
@@ -0,0 +1,222 @@
+/*-
+ * Copyright (c) 2012 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Oleksandr Rybalko under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * 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_UART_DEV_IMX5XX_H
+#define_UART_DEV_IMX5XX_H
+
+#defineIMXUART_URXD_REG0x /* UART Receiver Register */
+#defineIMXUART_URXD_CHARRDY(1  15)
+#defineIMXUART_URXD_ERR(1  14)
+#defineIMXUART_URXD_OVRRUN (1  13)
+#defineIMXUART_URXD_FRMERR (1  12)
+#defineIMXUART_URXD_BRK(1  11)
+#defineIMXUART_URXD_PRERR  (1  10)
+#defineIMXUART_URXD_RX_DATA_MASK   0xff
+
+#defineIMXUART_UTXD_REG0x0040 /* UART Transmitter Register */
+#defineIMXUART_UTXD_TX_DATA_MASK   0xff
+
+#defineIMXUART_UCR1_REG0x0080 /* UART Control Register 1 */
+#defineIMXUART_UCR1_ADEN   (1  15)
+#defineIMXUART_UCR1_ADBR   (1  14)
+#defineIMXUART_UCR1_TRDYEN (1  13)
+#defineIMXUART_UCR1_IDEN   (1  12)
+#defineIMXUART_UCR1_ICD_MASK   (3  10)
+#defineIMXUART_UCR1_ICD_IDLE4  (0  10)
+#defineIMXUART_UCR1_ICD_IDLE8  (1  10)
+#defineIMXUART_UCR1_ICD_IDLE16 (2  10)
+#defineIMXUART_UCR1_ICD_IDLE32 (3  10)
+#defineIMXUART_UCR1_RRDYEN (1  9)
+#defineIMXUART_UCR1_RXDMAEN(1  8)
+#defineIMXUART_UCR1_IREN   (1  7)
+#defineIMXUART_UCR1_TXMPTYEN   (1  6)
+#defineIMXUART_UCR1_RTSDEN (1  5)
+#defineIMXUART_UCR1_SNDBRK (1  4)
+#defineIMXUART_UCR1_TXDMAEN(1  3)
+#defineIMXUART_UCR1_ATDMAEN(1  2)
+#defineIMXUART_UCR1_DOZE   (1  1)
+#defineIMXUART_UCR1_UARTEN (1  0)
+
+#defineIMXUART_UCR2_REG0x0084 /* UART Control Register 2 */
+#define

svn commit: r264982 - head/sys/dev/usb/wlan

2014-04-26 Thread Andreas Tobler
Author: andreast
Date: Sat Apr 26 19:30:04 2014
New Revision: 264982
URL: http://svnweb.freebsd.org/changeset/base/264982

Log:
  Fix gcc build, initialize off variable.

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSat Apr 26 17:56:39 2014
(r264981)
+++ head/sys/dev/usb/wlan/if_urtwn.cSat Apr 26 19:30:04 2014
(r264982)
@@ -1302,6 +1302,7 @@ urtwn_r88e_read_rom(struct urtwn_softc *
uint8_t off, msk, tmp;
int i;
 
+   off = 0;
urtwn_efuse_switch_power(sc);
 
/* Read full ROM image. */
___
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: r264983 - head/sys/dev/uart

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sat Apr 26 20:03:04 2014
New Revision: 264983
URL: http://svnweb.freebsd.org/changeset/base/264983

Log:
  Flesh out imx_uart_init() so that we're not relying on u-boot to init
  the hardware (meaning uarts other than the console will work).

Modified:
  head/sys/dev/uart/uart_dev_imx.c

Modified: head/sys/dev/uart/uart_dev_imx.c
==
--- head/sys/dev/uart/uart_dev_imx.cSat Apr 26 19:30:04 2014
(r264982)
+++ head/sys/dev/uart/uart_dev_imx.cSat Apr 26 20:03:04 2014
(r264983)
@@ -43,10 +43,11 @@ __FBSDID($FreeBSD$);
 #include dev/uart/uart.h
 #include dev/uart/uart_cpu.h
 #include dev/uart/uart_bus.h
-
 #include dev/uart/uart_dev_imx.h
-
 #include uart_if.h
+
+#include arm/freescale/imx/imx_ccmvar.h
+
 /*
  * Low-level UART interface.
  */
@@ -66,6 +67,22 @@ static struct uart_ops uart_imx_uart_ops
.getc = imx_uart_getc,
 };
 
+#if 0 /* Handy when debugging. */
+static void
+dumpregs(struct uart_bas *bas, const char * msg)
+{
+
+   if (!bootverbose)
+   return;
+   printf(%s bsh 0x%08lx UCR1 0x%08x UCR2 0x%08x 
+   UCR3 0x%08x UCR4 0x%08x USR1 0x%08x USR2 0x%08x\n,
+   msg, bas-bsh,
+   GETREG(bas, REG(UCR1)), GETREG(bas, REG(UCR2)), 
+   GETREG(bas, REG(UCR3)), GETREG(bas, REG(UCR4)),
+   GETREG(bas, REG(USR1)), GETREG(bas, REG(USR2)));
+}
+#endif
+
 static int
 imx_uart_probe(struct uart_bas *bas)
 {
@@ -77,7 +94,59 @@ static void
 imx_uart_init(struct uart_bas *bas, int baudrate, int databits, 
 int stopbits, int parity)
 {
+   uint32_t baseclk, reg;
+
+/* Enable the device and the RX/TX channels. */
+   SET(bas, REG(UCR1), FLD(UCR1, UARTEN));
+   SET(bas, REG(UCR2), FLD(UCR2, RXEN) | FLD(UCR2, TXEN));
+
+   if (databits == 7)
+   DIS(bas, UCR2, WS);
+   else
+   ENA(bas, UCR2, WS);
+
+   if (stopbits == 2)
+   ENA(bas, UCR2, STPB);
+   else
+   DIS(bas, UCR2, STPB);
+
+   switch (parity) {
+   case UART_PARITY_ODD:
+   DIS(bas, UCR2, PROE);
+   ENA(bas, UCR2, PREN);
+   break;
+   case UART_PARITY_EVEN:
+   ENA(bas, UCR2, PROE);
+   ENA(bas, UCR2, PREN);
+   break;
+   case UART_PARITY_MARK:
+   case UART_PARITY_SPACE:
+/* FALLTHROUGH: Hardware doesn't support mark/space. */
+   case UART_PARITY_NONE:
+   default:
+   DIS(bas, UCR2, PREN);
+   break;
+   }
 
+   /*
+* The hardware has an extremely flexible baud clock: it allows setting
+* both the numerator and denominator of the divider, as well as a
+* separate pre-divider.  We simplify that problem by assuming a
+* pre-divider and numerator of one because our base clock is so fast we
+* can reach virtually any reasonable speed with a simple divisor.  The
+* numerator value actually includes the 16x over-sampling; the register
+* value is the numerator-1, so we have a hard-coded 15.  Note that a
+* quirk of the hardware requires that both UBIR and UBMR be set back to
+* back in order for the change to take effect.
+*/
+   if (baudrate  0) {
+   baseclk = imx_ccm_uart_hz();
+   reg = GETREG(bas, REG(UFCR));
+   reg = (reg  ~IMXUART_UFCR_RFDIV_MASK) | 
IMXUART_UFCR_RFDIV_DIV1;
+   SETREG(bas, REG(UFCR), reg);
+   SETREG(bas, REG(UBIR), 15);
+   SETREG(bas, REG(UBMR), (baseclk / baudrate) - 1);
+   }
 }
 
 static void
@@ -218,6 +287,8 @@ imx_uart_bus_attach(struct uart_softc *s
DIS(bas, UCR3, RI);
DIS(bas, UCR3, DCD);
DIS(bas, UCR3, DTRDEN);
+   ENA(bas, UCR2, IRTS);
+   ENA(bas, UCR3, RXDMUXSEL);
 
/* ACK all interrupts */
SETREG(bas, REG(USR1), 0x);
___
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: r264985 - head/sys/dev/uart

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sat Apr 26 20:27:58 2014
New Revision: 264985
URL: http://svnweb.freebsd.org/changeset/base/264985

Log:
  Reword a comment block a bit; no functional changes.

Modified:
  head/sys/dev/uart/uart_dev_imx.c

Modified: head/sys/dev/uart/uart_dev_imx.c
==
--- head/sys/dev/uart/uart_dev_imx.cSat Apr 26 20:27:54 2014
(r264984)
+++ head/sys/dev/uart/uart_dev_imx.cSat Apr 26 20:27:58 2014
(r264985)
@@ -131,13 +131,14 @@ imx_uart_init(struct uart_bas *bas, int 
/*
 * The hardware has an extremely flexible baud clock: it allows setting
 * both the numerator and denominator of the divider, as well as a
-* separate pre-divider.  We simplify that problem by assuming a
-* pre-divider and numerator of one because our base clock is so fast we
-* can reach virtually any reasonable speed with a simple divisor.  The
-* numerator value actually includes the 16x over-sampling; the register
-* value is the numerator-1, so we have a hard-coded 15.  Note that a
-* quirk of the hardware requires that both UBIR and UBMR be set back to
-* back in order for the change to take effect.
+* separate pre-divider.  We simplify the problem of coming up with a
+* workable pair of numbers by assuming a pre-divider and numerator of
+* one because our base clock is so fast we can reach virtually any
+* reasonable speed with a simple divisor.  The numerator value actually
+* includes the 16x over-sampling (so a value of 16 means divide by 1);
+* the register value is the numerator-1, so we have a hard-coded 15.
+* Note that a quirk of the hardware requires that both UBIR and UBMR be
+* set back to back in order for the change to take effect.
 */
if (baudrate  0) {
baseclk = imx_ccm_uart_hz();
___
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: r264984 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sys

2014-04-26 Thread Scott Long
Author: scottl
Date: Sat Apr 26 20:27:54 2014
New Revision: 264984
URL: http://svnweb.freebsd.org/changeset/base/264984

Log:
  Retire smp_active.  It was racey and caused demonstrated problems with
  the cpufreq code.  Replace its use with smp_started.  There's at least
  one userland tool that still looks at the kern.smp.active sysctl, so
  preserve it but point it to smp_started as well.
  
  Discussed with: peter, jhb
  MFC after: 3 days
  Obtained from: Netflix

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/arm/arm/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/i386/vm_machdep.c
  head/sys/i386/xen/mp_machdep.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/kern/kern_cpu.c
  head/sys/kern/subr_smp.c
  head/sys/mips/mips/mp_machdep.c
  head/sys/powerpc/powerpc/mp_machdep.c
  head/sys/sparc64/sparc64/mp_machdep.c
  head/sys/sys/smp.h

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/amd64/amd64/mp_machdep.c   Sat Apr 26 20:27:54 2014
(r264984)
@@ -771,7 +771,6 @@ init_secondary(void)
if (smp_cpus == mp_ncpus) {
/* enable IPI's, tlb shootdown, freezes etc */
atomic_store_rel_int(smp_started, 1);
-   smp_active = 1;  /* historic */
}
 
/*

Modified: head/sys/amd64/amd64/vm_machdep.c
==
--- head/sys/amd64/amd64/vm_machdep.c   Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/amd64/amd64/vm_machdep.c   Sat Apr 26 20:27:54 2014
(r264984)
@@ -597,7 +597,7 @@ cpu_reset()
cpuset_t map;
u_int cnt;
 
-   if (smp_active) {
+   if (smp_started) {
map = all_cpus;
CPU_CLR(PCPU_GET(cpuid), map);
CPU_NAND(map, stopped_cpus);

Modified: head/sys/arm/arm/mp_machdep.c
==
--- head/sys/arm/arm/mp_machdep.c   Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/arm/arm/mp_machdep.c   Sat Apr 26 20:27:54 2014
(r264984)
@@ -219,7 +219,6 @@ init_secondary(int cpu)
if (smp_cpus == mp_ncpus) {
/* enable IPI's, tlb shootdown, freezes etc */
atomic_store_rel_int(smp_started, 1);
-   smp_active = 1;
}
 
mtx_unlock_spin(ap_boot_mtx);

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/i386/i386/mp_machdep.c Sat Apr 26 20:27:54 2014
(r264984)
@@ -805,7 +805,6 @@ init_secondary(void)
if (smp_cpus == mp_ncpus) {
/* enable IPI's, tlb shootdown, freezes etc */
atomic_store_rel_int(smp_started, 1);
-   smp_active = 1;  /* historic */
}
 
mtx_unlock_spin(ap_boot_mtx);

Modified: head/sys/i386/i386/vm_machdep.c
==
--- head/sys/i386/i386/vm_machdep.c Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/i386/i386/vm_machdep.c Sat Apr 26 20:27:54 2014
(r264984)
@@ -619,7 +619,7 @@ cpu_reset()
cpuset_t map;
u_int cnt;
 
-   if (smp_active) {
+   if (smp_started) {
map = all_cpus;
CPU_CLR(PCPU_GET(cpuid), map);
CPU_NAND(map, stopped_cpus);

Modified: head/sys/i386/xen/mp_machdep.c
==
--- head/sys/i386/xen/mp_machdep.c  Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/i386/xen/mp_machdep.c  Sat Apr 26 20:27:54 2014
(r264984)
@@ -655,7 +655,6 @@ init_secondary(void)
if (smp_cpus == mp_ncpus) {
/* enable IPI's, tlb shootdown, freezes etc */
atomic_store_rel_int(smp_started, 1);
-   smp_active = 1;  /* historic */
}
 
mtx_unlock_spin(ap_boot_mtx);

Modified: head/sys/ia64/ia64/mp_machdep.c
==
--- head/sys/ia64/ia64/mp_machdep.c Sat Apr 26 20:03:04 2014
(r264983)
+++ head/sys/ia64/ia64/mp_machdep.c Sat Apr 26 20:27:54 2014
(r264984)
@@ -475,7 +475,7 @@ cpu_mp_unleash(void *dummy)
mp_ncpus, cpus, smp_cpus);
}
 
-   smp_active = 1;
+   /* XXX Atomic set operation? */
smp_started = 1;
 
/*

Modified: head/sys/kern/kern_cpu.c
==
--- head/sys/kern/kern_cpu.cSat Apr 26 20:03:04 2014(r264983)
+++ head/sys/kern/kern_cpu.cSat Apr 

svn commit: r264986 - head/sys/net

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Apr 26 21:03:41 2014
New Revision: 264986
URL: http://svnweb.freebsd.org/changeset/base/264986

Log:
  Decouple RTM_CHANGE from RTM_GET handling in rtsock.c:route_output().
  RTM_CHANGE is now handled inside route.c:rtrequest1_fib() as it should be.
  Note change change handler is a separate function rtrequest1_fib_change().
  
  MFC after:1 month

Modified:
  head/sys/net/route.c
  head/sys/net/rtsock.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Apr 26 20:27:58 2014(r264985)
+++ head/sys/net/route.cSat Apr 26 21:03:41 2014(r264986)
@@ -140,6 +140,9 @@ VNET_DEFINE(int, rttrash);  /* routes no
 static VNET_DEFINE(uma_zone_t, rtzone);/* Routing table UMA 
zone. */
 #defineV_rtzoneVNET(rtzone)
 
+static int rtrequest1_fib_change(struct radix_node_head *, struct rt_addrinfo 
*,
+struct rtentry **, u_int);
+
 /*
  * handler for net.my_fibnum
  */
@@ -1408,6 +1411,9 @@ rtrequest1_fib(int req, struct rt_addrin
}
RT_UNLOCK(rt);
break;
+   case RTM_CHANGE:
+   error = rtrequest1_fib_change(rnh, info, ret_nrt, fibnum);
+   break;
default:
error = EOPNOTSUPP;
}
@@ -1425,6 +1431,95 @@ bad:
 #undef ifpaddr
 #undef flags
 
+#definesenderr(e) { error = e; goto bad; }
+static int
+rtrequest1_fib_change(struct radix_node_head *rnh, struct rt_addrinfo *info,
+struct rtentry **ret_nrt, u_int fibnum)
+{
+   struct rtentry *rt = NULL;
+   int error = 0;
+   int free_ifa = 0;
+
+   rt = (struct rtentry *)rnh-rnh_lookup(info-rti_info[RTAX_DST],
+   info-rti_info[RTAX_NETMASK], rnh);
+
+   if (rt == NULL)
+   return (ESRCH);
+
+#ifdef RADIX_MPATH
+   /*
+* If we got multipath routes,
+* we require users to specify a matching RTAX_GATEWAY.
+*/
+   if (rn_mpath_capable(rnh)) {
+   rt = rt_mpath_matchgate(rt, info-rti_info[RTAX_GATEWAY]);
+   if (rt == NULL)
+   return (ESRCH);
+   }
+#endif
+
+   RT_LOCK(rt);
+
+   /*
+* New gateway could require new ifaddr, ifp;
+* flags may also be different; ifp may be specified
+* by ll sockaddr when protocol address is ambiguous
+*/
+   if (((rt-rt_flags  RTF_GATEWAY) 
+   info-rti_info[RTAX_GATEWAY] != NULL) ||
+   info-rti_info[RTAX_IFP] != NULL ||
+   (info-rti_info[RTAX_IFA] != NULL 
+!sa_equal(info-rti_info[RTAX_IFA], rt-rt_ifa-ifa_addr))) {
+
+   error = rt_getifa_fib(info, fibnum);
+   if (info-rti_ifa != NULL)
+   free_ifa = 1;
+
+   if (error != 0)
+   senderr(error);
+   }
+
+   /* Check if outgoing interface has changed */
+   if (info-rti_ifa != NULL  info-rti_ifa != rt-rt_ifa 
+   rt-rt_ifa != NULL  rt-rt_ifa-ifa_rtrequest != NULL) {
+   rt-rt_ifa-ifa_rtrequest(RTM_DELETE, rt, info);
+   ifa_free(rt-rt_ifa);
+   }
+   /* Update gateway address */
+   if (info-rti_info[RTAX_GATEWAY] != NULL) {
+   error = rt_setgate(rt, rt_key(rt), 
info-rti_info[RTAX_GATEWAY]);
+   if (error != 0)
+   senderr(error);
+
+   rt-rt_flags = ~RTF_GATEWAY;
+   rt-rt_flags |= (RTF_GATEWAY  info-rti_flags);
+   }
+
+   if (info-rti_ifa != NULL  info-rti_ifa != rt-rt_ifa) {
+   ifa_ref(info-rti_ifa);
+   rt-rt_ifa = info-rti_ifa;
+   rt-rt_ifp = info-rti_ifp;
+   }
+   /* Allow some flags to be toggled on change. */
+   rt-rt_flags = ~RTF_FMASK;
+   rt-rt_flags |= info-rti_flags  RTF_FMASK;
+
+   if (rt-rt_ifa  rt-rt_ifa-ifa_rtrequest != NULL)
+  rt-rt_ifa-ifa_rtrequest(RTM_ADD, rt, info);
+
+   if (ret_nrt) {
+   *ret_nrt = rt;
+   RT_ADDREF(rt);
+   }
+bad:
+   RT_UNLOCK(rt);
+   if (free_ifa != 0)
+   ifa_free(info-rti_ifa);
+   return (error);
+}
+#undef senderr
+
+
 int
 rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate)
 {

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Sat Apr 26 20:27:58 2014(r264985)
+++ head/sys/net/rtsock.c   Sat Apr 26 21:03:41 2014(r264986)
@@ -621,6 +621,7 @@ route_output(struct mbuf *m, struct sock
struct rtentry *saved_nrt;
 
case RTM_ADD:
+   case RTM_CHANGE:
if (info.rti_info[RTAX_GATEWAY] == NULL)
senderr(EINVAL);
saved_nrt = NULL;
@@ -635,9 +636,9 @@ route_output(struct mbuf *m, struct sock
 #endif

svn commit: r264987 - head/sys/net

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Apr 26 22:32:04 2014
New Revision: 264987
URL: http://svnweb.freebsd.org/changeset/base/264987

Log:
  Determine fibnum once in the beginning of route_output().
  
  MFC after:1 month

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Sat Apr 26 21:03:41 2014(r264986)
+++ head/sys/net/rtsock.c   Sat Apr 26 22:32:04 2014(r264987)
@@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock
struct sockaddr_in6 *sin6;
int i, rti_need_deembed = 0;
 #endif
-   int len, error = 0;
+   int len, error = 0, fibnum;
struct ifnet *ifp = NULL;
union sockaddr_union saun;
sa_family_t saf = AF_UNSPEC;
@@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock
senderr(error);
}
 
+   fibnum = so-so_fibnum;
+
/*
 * The given gateway address may be an interface address.
 * For example, issuing a route change command on a route
@@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock
 
bzero(gw_ro, sizeof(gw_ro));
gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
-   rtalloc_ign_fib(gw_ro, 0, so-so_fibnum);
+   rtalloc_ign_fib(gw_ro, 0, fibnum);
/* 
 * A host route through the loopback interface is 
 * installed for each interface adddress. In pre 8.0
@@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock
break;
}
error = rtrequest1_fib(rtm-rtm_type, info, saved_nrt,
-   so-so_fibnum);
+   fibnum);
if (error == 0  saved_nrt != NULL) {
 #ifdef INET6
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
@@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock
 #endif
break;
}
-   error = rtrequest1_fib(RTM_DELETE, info, saved_nrt,
-   so-so_fibnum);
+   error = rtrequest1_fib(RTM_DELETE, info, saved_nrt, fibnum);
if (error == 0) {
RT_LOCK(saved_nrt);
rt = saved_nrt;
@@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock
break;
 
case RTM_GET:
-   rnh = rt_tables_get_rnh(so-so_fibnum,
-   info.rti_info[RTAX_DST]-sa_family);
+   rnh = rt_tables_get_rnh(fibnum, saf);
if (rnh == NULL)
senderr(EAFNOSUPPORT);
 
@@ -867,7 +867,7 @@ flush:
m_adj(m, rtm-rtm_msglen - m-m_pkthdr.len);
}
if (m) {
-   M_SETFIB(m, so-so_fibnum);
+   M_SETFIB(m, fibnum);
m-m_flags |= RTS_FILTER_FIB;
if (rp) {
/*
___
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: r264988 - head/sys/amd64/vmm/intel

2014-04-26 Thread Neel Natu
Author: neel
Date: Sat Apr 26 22:37:56 2014
New Revision: 264988
URL: http://svnweb.freebsd.org/changeset/base/264988

Log:
  A VMCS is always inactive when it exits the vmx_run() loop.
  Remove redundant code and the misleading comment that suggest otherwise.
  
  Reviewed by:  grehan@

Modified:
  head/sys/amd64/vmm/intel/vmx.c

Modified: head/sys/amd64/vmm/intel/vmx.c
==
--- head/sys/amd64/vmm/intel/vmx.c  Sat Apr 26 22:32:04 2014
(r264987)
+++ head/sys/amd64/vmm/intel/vmx.c  Sat Apr 26 22:37:56 2014
(r264988)
@@ -2234,7 +2234,7 @@ vmx_run(void *arg, int vcpu, register_t 
 static void
 vmx_vmcleanup(void *arg)
 {
-   int i, error;
+   int i;
struct vmx *vmx = arg;
 
if (apic_access_virtualization(vmx, 0))
@@ -2243,13 +2243,6 @@ vmx_vmcleanup(void *arg)
for (i = 0; i  VM_MAXCPU; i++)
vpid_free(vmx-state[i].vpid);
 
-   /*
-* XXXSMP we also need to clear the VMCS active on the other vcpus.
-*/
-   error = vmclear(vmx-vmcs[0]);
-   if (error != 0)
-   panic(vmx_vmcleanup: vmclear error %d on vcpu 0, error);
-
free(vmx, M_VMX);
 
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


svn commit: r264989 - head/sys/net

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sat Apr 26 22:42:21 2014
New Revision: 264989
URL: http://svnweb.freebsd.org/changeset/base/264989

Log:
  Remove useless `register' declarations.
  
  MFC after:1 month

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Apr 26 22:37:56 2014(r264988)
+++ head/sys/net/route.cSat Apr 26 22:42:21 2014(r264989)
@@ -725,7 +725,7 @@ struct ifaddr *
 ifa_ifwithroute_fib(int flags, struct sockaddr *dst, struct sockaddr *gateway,
u_int fibnum)
 {
-   register struct ifaddr *ifa;
+   struct ifaddr *ifa;
int not_found = 0;
 
if ((flags  RTF_GATEWAY) == 0) {
@@ -1041,7 +1041,7 @@ rn_mpath_update(int req, struct rt_addri
 * a matching RTAX_GATEWAY.
 */
struct rtentry *rt, *rto = NULL;
-   register struct radix_node *rn;
+   struct radix_node *rn;
int error = 0;
 
rn = rnh-rnh_lookup(dst, netmask, rnh);
@@ -1143,12 +1143,12 @@ rtrequest1_fib(int req, struct rt_addrin
u_int fibnum)
 {
int error = 0, needlock = 0;
-   register struct rtentry *rt;
+   struct rtentry *rt;
 #ifdef FLOWTABLE
-   register struct rtentry *rt0;
+   struct rtentry *rt0;
 #endif
-   register struct radix_node *rn;
-   register struct radix_node_head *rnh;
+   struct radix_node *rn;
+   struct radix_node_head *rnh;
struct ifaddr *ifa;
struct sockaddr *ndst;
struct sockaddr_storage mdst;
@@ -1571,9 +1571,9 @@ rt_setgate(struct rtentry *rt, struct so
 void
 rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr 
*netmask)
 {
-   register u_char *cp1 = (u_char *)src;
-   register u_char *cp2 = (u_char *)dst;
-   register u_char *cp3 = (u_char *)netmask;
+   u_char *cp1 = (u_char *)src;
+   u_char *cp2 = (u_char *)dst;
+   u_char *cp3 = (u_char *)netmask;
u_char *cplim = cp2 + *cp3;
u_char *cplim2 = cp2 + *cp1;
 
___
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: r264990 - head/sys/arm/include

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sat Apr 26 23:09:01 2014
New Revision: 264990
URL: http://svnweb.freebsd.org/changeset/base/264990

Log:
  Call cpu_icache_sync_range() rather than sync_all since we know the range
  and flushing the entire icache is needlessly expensive.

Modified:
  head/sys/arm/include/kdb.h

Modified: head/sys/arm/include/kdb.h
==
--- head/sys/arm/include/kdb.h  Sat Apr 26 22:42:21 2014(r264989)
+++ head/sys/arm/include/kdb.h  Sat Apr 26 23:09:01 2014(r264990)
@@ -49,7 +49,7 @@ static __inline void
 kdb_cpu_sync_icache(unsigned char *addr, size_t size)
 {
 
-   cpu_icache_sync_all();
+   cpu_icache_sync_range((vm_offset_t)addr, size);
 }
 
 static __inline void
___
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: r264987 - head/sys/net

2014-04-26 Thread Ian Lepore
On Sat, 2014-04-26 at 22:32 +, Alexander V. Chernikov wrote:
 Author: melifaro
 Date: Sat Apr 26 22:32:04 2014
 New Revision: 264987
 URL: http://svnweb.freebsd.org/changeset/base/264987
 
 Log:
   Determine fibnum once in the beginning of route_output().
   
   MFC after:  1 month
 
 Modified:
   head/sys/net/rtsock.c

 Modified: head/sys/net/rtsock.c
 ==
 --- head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014(r264986)
 +++ head/sys/net/rtsock.c Sat Apr 26 22:32:04 2014(r264987)
 @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock
   struct sockaddr_in6 *sin6;
   int i, rti_need_deembed = 0;
  #endif
 - int len, error = 0;
 + int len, error = 0, fibnum;
   struct ifnet *ifp = NULL;
   union sockaddr_union saun;
   sa_family_t saf = AF_UNSPEC;
 @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock
   senderr(error);
   }
  
 + fibnum = so-so_fibnum;
 +
   /*
* The given gateway address may be an interface address.
* For example, issuing a route change command on a route
 @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock
  
   bzero(gw_ro, sizeof(gw_ro));
   gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
 - rtalloc_ign_fib(gw_ro, 0, so-so_fibnum);
 + rtalloc_ign_fib(gw_ro, 0, fibnum);
   /* 
* A host route through the loopback interface is 
* installed for each interface adddress. In pre 8.0
 @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock
   break;
   }
   error = rtrequest1_fib(rtm-rtm_type, info, saved_nrt,
 - so-so_fibnum);
 + fibnum);
   if (error == 0  saved_nrt != NULL) {
  #ifdef INET6
   rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
 @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock
  #endif
   break;
   }
 - error = rtrequest1_fib(RTM_DELETE, info, saved_nrt,
 - so-so_fibnum);
 + error = rtrequest1_fib(RTM_DELETE, info, saved_nrt, fibnum);
   if (error == 0) {
   RT_LOCK(saved_nrt);
   rt = saved_nrt;
 @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock
   break;
  
   case RTM_GET:
 - rnh = rt_tables_get_rnh(so-so_fibnum,
 - info.rti_info[RTAX_DST]-sa_family);
 + rnh = rt_tables_get_rnh(fibnum, saf);
   if (rnh == NULL)
   senderr(EAFNOSUPPORT);
  
 @@ -867,7 +867,7 @@ flush:
   m_adj(m, rtm-rtm_msglen - m-m_pkthdr.len);
   }
   if (m) {
 - M_SETFIB(m, so-so_fibnum);
 + M_SETFIB(m, fibnum);
   m-m_flags |= RTS_FILTER_FIB;
   if (rp) {
   /*
 

I've got build breakage that I think may be from this change...

/local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 
'route_output':
/local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 'fibnum' 
may be used uninitialized in this function

-- Ian


___
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: r264991 - head/sys/net80211

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sat Apr 26 23:22:49 2014
New Revision: 264991
URL: http://svnweb.freebsd.org/changeset/base/264991

Log:
  Use logical rather than bitwise OR in if() expression.

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==
--- head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:09:01 2014
(r264990)
+++ head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:22:49 2014
(r264991)
@@ -602,7 +602,7 @@ ieee80211_ioctl_getcurchan(struct ieee80
 * in use.  When in RUN state report the vap-specific channel.
 * Otherwise return curchan.
 */
-   if (vap-iv_state == IEEE80211_S_RUN | vap-iv_state == 
IEEE80211_S_SLEEP)
+   if (vap-iv_state == IEEE80211_S_RUN || vap-iv_state == 
IEEE80211_S_SLEEP)
c = vap-iv_bss-ni_chan;
else
c = ic-ic_curchan;
___
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: r264991 - head/sys/net80211

2014-04-26 Thread Adrian Chadd
oops!


-a


On 26 April 2014 16:22, Ian Lepore i...@freebsd.org wrote:
 Author: ian
 Date: Sat Apr 26 23:22:49 2014
 New Revision: 264991
 URL: http://svnweb.freebsd.org/changeset/base/264991

 Log:
   Use logical rather than bitwise OR in if() expression.

 Modified:
   head/sys/net80211/ieee80211_ioctl.c

 Modified: head/sys/net80211/ieee80211_ioctl.c
 ==
 --- head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:09:01 2014
 (r264990)
 +++ head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:22:49 2014
 (r264991)
 @@ -602,7 +602,7 @@ ieee80211_ioctl_getcurchan(struct ieee80
  * in use.  When in RUN state report the vap-specific channel.
  * Otherwise return curchan.
  */
 -   if (vap-iv_state == IEEE80211_S_RUN | vap-iv_state == 
 IEEE80211_S_SLEEP)
 +   if (vap-iv_state == IEEE80211_S_RUN || vap-iv_state == 
 IEEE80211_S_SLEEP)
 c = vap-iv_bss-ni_chan;
 else
 c = ic-ic_curchan;

___
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: r264992 - head/release/amd64

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 00:40:18 2014
New Revision: 264992
URL: http://svnweb.freebsd.org/changeset/base/264992

Log:
  Make a dual-boot BIOS/UEFI memstick image. Testing required before this gets
  renamed make-memstick.sh.

Modified:
  head/release/amd64/make-uefi-memstick.sh

Modified: head/release/amd64/make-uefi-memstick.sh
==
--- head/release/amd64/make-uefi-memstick.shSat Apr 26 23:22:49 2014
(r264991)
+++ head/release/amd64/make-uefi-memstick.shSun Apr 27 00:40:18 2014
(r264992)
@@ -1,12 +1,9 @@
 #!/bin/sh
 #
-# This script generates a memstick image for UEFI-capable systems.
-#
-# Prerequisites:
-#  - 'make release'
-#  - KERNCONF *must* be VT (or vt_efifb(4) compiled into the kernel)
-#
-# Note:  This only works for amd64, because i386 lacks the EFI boot bits.
+# This script generates a memstick image (image that can be copied to a
+# USB memory stick) from a directory tree.  Note that the script does not
+# clean up after itself very well for error conditions on purpose so the
+# problem can be diagnosed (full filesystem most likely but ...).
 #
 # Usage: make-memstick.sh directory tree image filename
 #
@@ -31,43 +28,14 @@ if [ -e ${2} ]; then
exit 1
 fi
 
-dirsize=$(du -shLm ${1} | awk '{print $1}')
-dirsize=$(( $(( $(( ${dirsize} + 256 )) * 1024 * 1024 )) ))
-truncate -s ${dirsize} ${2}
-
-unit=$(mdconfig -a -t vnode -f ${2})
-gpart create -s mbr /dev/${unit}
-gpart add -t '!0xEF' -s 32M /dev/${unit}
-gpart add -t freebsd /dev/${unit}
-gpart set -a active -i 2 /dev/${unit}
-gpart bootcode -b ${1}/boot/boot0 /dev/${unit}
-gpart create -s bsd -n 20 /dev/${unit}s2
-gpart add -t freebsd-ufs /dev/${unit}s2
-gpart bootcode -b ${1}/boot/boot /dev/${unit}s2
-newfs_msdos /dev/${unit}s1
-newfs -L rootfs /dev/${unit}s2a
-mkdir -p ${1}/mnt
-mount -t msdosfs /dev/${unit}s1 ${1}/mnt
-mkdir -p ${1}/mnt/efi/boot
-cp -p ${1}/boot/boot1.efi ${1}/mnt/efi/boot/BOOTx64.efi
-
-while ! umount ${1}/mnt; do
-   sleep 1
-done
-
-mkdir -p mnt
-mount /dev/${unit}s2a mnt
-tar -cf - -C ${1} . | tar -xf - -C mnt
-echo /dev/ufs/rootfs / ufs ro,noatime 1 1  mnt/etc/fstab
-
-while ! umount mnt; do
-   sleep 1
-done
-
-# Default boot selection to MBR so systems that do not support UEFI
-# do not fail to boot without human interaction.
-boot0cfg -s 2 /dev/${unit}
+echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1'  ${1}/etc/fstab
+makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
+if [ $? -ne 0 ]; then
+   echo makefs failed
+   exit 1
+fi
+rm ${1}/etc/fstab
 
-mdconfig -d -u ${unit}
-rmdir mnt
+mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p 
efi:=${1}/boot/boot1.efifat -p freebsd-ufs:=${2}.part -o ${2}
+rm ${2}.part
 
___
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: r264993 - head/sys/boot/amd64/boot1.efi

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 00:45:08 2014
New Revision: 264993
URL: http://svnweb.freebsd.org/changeset/base/264993

Log:
  Revert to FAT12. This file system is apparently too small for FAT32, even
  if the old (pre r264889) newfs_msdos allowed it. And FAT12 seems to work
  perfectly well.

Modified:
  head/sys/boot/amd64/boot1.efi/Makefile.fat
  head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu
  head/sys/boot/amd64/boot1.efi/generate-fat.sh

Modified: head/sys/boot/amd64/boot1.efi/Makefile.fat
==
--- head/sys/boot/amd64/boot1.efi/Makefile.fat  Sun Apr 27 00:40:18 2014
(r264992)
+++ head/sys/boot/amd64/boot1.efi/Makefile.fat  Sun Apr 27 00:45:08 2014
(r264993)
@@ -1,3 +1,3 @@
 # This file autogenerated by generate-fat.sh - DO NOT EDIT
 # $FreeBSD$
-BOOT1_OFFSET=0x3b
+BOOT1_OFFSET=0x2d

Modified: head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu
==
--- head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu   Sun Apr 27 00:40:18 
2014(r264992)
+++ head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu   Sun Apr 27 00:45:08 
2014(r264993)
@@ -2,24 +2,20 @@ FAT template boot filesystem created by 
 DO NOT EDIT
 $FreeBSD$
 begin 644 fat.tmpl.bz2
-M0EIH.3%!629362X?*4`'$M^`T`8`!0$#%$
-M0$($26(P`+]@@``08$T::FFF)B:FFA@(P,(#)@)IHP$`8`$R,`FF0#(`
-M8AID!55*,3)B/29#)H9,U,F1HT#308B#3,$0:--I`PC3)H`R::,9-`R9
-M$!-FAIIIB8FAIIH8,`C`R8::,!``!,C`)ID`R`(:9`5))$Q*0F1
-MIH#31H--/48U#0--:#0`80@TT,@`-FFF@'J::U/34NO5O]KH,P3D
-M9TC0KV+%M5^)$Y=$D2(S=*LB`@R#`))MDFE$%-NDVQ;AN6'M4LC-TEV[;Q
-MO4PF6^32;0F_3B=!/)]P74#AN(H7%9QW(E1.4HW+QS7.0J12J93JA4H
-M:J5;GN@Z+I(:L=-6*U7*]8.HZJQ62S2ZT6KK.N[#LK9;NT[;N.ZN'=]O`N
-MD1=O\3QO(\J\7J]7R_9YV`]#!83TL-$IZWLU[G#?8XC[6LXKC..Y]R7
-MW+2`DCI_O6(CB*@F:HXU$D_U22''VTEIJ0$D5XJTGX,_@%TB=+22.G#2]
-M8%U/0HF\HDJE]1'D[:R*HAO::Y1KJ51.W[.PJD;.AF*B305`)(Y*D=,J3E
-M*C32FALJLNYP*93W5YF*=$IQU.`L6-.HP.$[I9CM*JD4QN57Y6Z'FK\?B
-MH64E.:LD:EHV\H=:H/3=1U!J@Z_P%2`,'![YLWM2IC2`:`CEJT49+FZ_
-M1LE?,Y33\]9\*FD5,=K=4NCB[FR1YF3ZC%OGB-9C3?UV/,;:Y_5*BJJ2SV
-M'4VCKU)D*.INFX6:M1L6Q:1O*,QA]=P,BTPWK[0W7FOQU632YRP7U%AQ
-M*N5LEBY4NTSK%.Y7B;M1VC`LZJF)3*7+)HFR:3E],AB;Y_R\RX9+6N$OS
-MG.@F!CKTC7,*\N.HCJ9JLU)CN\93G:R2HF-)RY.9[:-NSFY;)AW3_YC
-MGE^EGLW+WC-:)@V^HRU+@$D4`RL\!$JAO6TM%S=C+LRM7_XNY(IPH2!./
-E*``
+M0EIH.3%!62936=AO?0`J9[ZZKJJ_^N_ZO^Z_^[OO_\`5`(0!0#$D
+M0$)$2(P`(\K5,M95%DQ---,FAH,0```TR-!HQ`30`-#)ID$JF
+M1)[U4_5-@`T```#0AH(,F`$P`!,`1IA9-,308`1@
+M!))!BDVI/U0`]0RH:`81HT#)D!H-#U`T#31IH-(``R8$9_I)6[MY/,
+M(H=/()+4!(3V020C3J5$L5@2`219,T6JI,@02*2\=LAD6=N6O!'F.
+MQ2`;9$.P]202RN9I3BX[E0;C7/9BF'`((K?M1ZK0B2Q;BLJ9!(`21P1:;B
+MDD)S!-L5BL5BL/173`@@M!X@BQ0@@CJA`TWD!B!`@0($J
+M9(E`B,1(D2)$B;V]S-,#!@P8,'1\*$+59`:41,';;/)32*G*Q52N![20F8
+M9CCYSB#!2=[EG.),$:P,(8QSW'U+N42P^'5X@7X``23=EA``#Z,O)^-VTX@
+M`+E!=,6PV11C:*D8K#^%FTG-%!@PR72@\ZU0BD6I$FT/1\A#/`;ET5$)
+MKT-MBW97\J.P/H0ADE(EBN6;@5#$2#!(\F/E8M+!8-A-S+$U5[\JF1Y]
+MF-FPGL2L4QCUO/89^#H$6^;WKC9W52KUX.CM6+GD;(=1!MUD,,?Y[]
+MTLAG0];,:B^]M%BH0J1:_C-*2I9R3AS#,0$RCY'T/R?HR!?'5$MILQ:!
+M+;10A*!^(_/8D8CDN9]HO)OH13W(Q())?'R2WTV9*G_4T=Y!'1+'9,(
+J1-/VME.9Q3LKI2S$(`$D,``'_=FF*).\[A.)#4HU1=R13A0D-AO?0
 `
 end

Modified: head/sys/boot/amd64/boot1.efi/generate-fat.sh
==
--- head/sys/boot/amd64/boot1.efi/generate-fat.sh   Sun Apr 27 00:40:18 
2014(r264992)
+++ head/sys/boot/amd64/boot1.efi/generate-fat.sh   Sun Apr 27 00:45:08 
2014(r264993)
@@ -20,7 +20,7 @@ OUTPUT_FILE=fat.tmpl
 
 dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$FAT_SIZE
 DEVICE=`mdconfig -a -f $OUTPUT_FILE`
-newfs_msdos -F 32 $DEVICE
+newfs_msdos -F 12 $DEVICE
 mkdir stub
 mount -t msdosfs /dev/$DEVICE stub
 
___
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: r264994 - in head/sys/arm: arm include

2014-04-26 Thread Ian Lepore
Author: ian
Date: Sun Apr 27 00:46:01 2014
New Revision: 264994
URL: http://svnweb.freebsd.org/changeset/base/264994

Log:
  Provide a proper armv7 implementation of icache_sync_all rather than
  using armv7_idcache_wbinv_all, because wbinv_all doesn't broadcast the
  operation to other cores.  In elf_cpu_load_file() use icache_sync_all()
  and explain why it's needed (and why other sync operations aren't).
  
  As part of doing this, all callers of cpu_icache_sync_all() were
  inspected to ensure they weren't relying on the old side effect of
  doing a wbinv_all along with the icache work.

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/arm/cpufunc_asm_armv7.S
  head/sys/arm/arm/elf_machdep.c
  head/sys/arm/include/cpufunc.h

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Sun Apr 27 00:45:08 2014(r264993)
+++ head/sys/arm/arm/cpufunc.c  Sun Apr 27 00:46:01 2014(r264994)
@@ -769,7 +769,7 @@ struct cpu_functions cortexa_cpufuncs = 

/* Cache operations */

-   armv7_idcache_wbinv_all, /* icache_sync_all  */
+   armv7_icache_sync_all,  /* icache_sync_all  */
armv7_icache_sync_range,/* icache_sync_range*/

armv7_dcache_wbinv_all, /* dcache_wbinv_all */

Modified: head/sys/arm/arm/cpufunc_asm_armv7.S
==
--- head/sys/arm/arm/cpufunc_asm_armv7.SSun Apr 27 00:45:08 2014
(r264993)
+++ head/sys/arm/arm/cpufunc_asm_armv7.SSun Apr 27 00:46:01 2014
(r264994)
@@ -250,6 +250,13 @@ ENTRY(armv7_idcache_wbinv_range)
RET
 END(armv7_idcache_wbinv_range)
 
+ENTRY_NP(armv7_icache_sync_all)
+   mcr p15, 0, r0, c7, c1, 0   /* Invalidate all I cache to PoU Inner 
Shareable */
+   isb /* instruction synchronization barrier 
*/
+   dsb /* data synchronization barrier */
+   RET
+END(armv7_icache_sync_all)
+
 ENTRY_NP(armv7_icache_sync_range)
ldr ip, .Larmv7_line_size
 .Larmv7_sync_next:

Modified: head/sys/arm/arm/elf_machdep.c
==
--- head/sys/arm/arm/elf_machdep.c  Sun Apr 27 00:45:08 2014
(r264993)
+++ head/sys/arm/arm/elf_machdep.c  Sun Apr 27 00:46:01 2014
(r264994)
@@ -220,9 +220,19 @@ int
 elf_cpu_load_file(linker_file_t lf __unused)
 {
 
-   cpu_idcache_wbinv_all();
-   cpu_l2cache_wbinv_all();
-   cpu_tlb_flushID();
+   /*
+* The pmap code does not do an icache sync upon establishing executable
+* mappings in the kernel pmap.  It's an optimization based on the fact
+* that kernel memory allocations always have EXECUTABLE protection even
+* when the memory isn't going to hold executable code.  The only time
+* kernel memory holding instructions does need a sync is after loading
+* a kernel module, and that's when this function gets called.  Normal
+* data cache maintenance has already been done by the IO code, and TLB
+* maintenance has been done by the pmap code, so all we have to do here
+* is invalidate the instruction cache (which also invalidates the
+* branch predictor cache on platforms that have one).
+*/
+   cpu_icache_sync_all();
return (0);
 }
 

Modified: head/sys/arm/include/cpufunc.h
==
--- head/sys/arm/include/cpufunc.h  Sun Apr 27 00:45:08 2014
(r264993)
+++ head/sys/arm/include/cpufunc.h  Sun Apr 27 00:46:01 2014
(r264994)
@@ -411,6 +411,7 @@ voidarmv6_idcache_wbinv_range   (vm_offse
 void   armv7_setttb(u_int);
 void   armv7_tlb_flushID   (void);
 void   armv7_tlb_flushID_SE(u_int);
+void   armv7_icache_sync_all   ();
 void   armv7_icache_sync_range (vm_offset_t, vm_size_t);
 void   armv7_idcache_wbinv_range   (vm_offset_t, vm_size_t);
 void   armv7_idcache_inv_all   (void);
___
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: r264995 - head/release/amd64

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 01:06:02 2014
New Revision: 264995
URL: http://svnweb.freebsd.org/changeset/base/264995

Log:
  Add script to setup bootable CD ISOs for both BIOS and EFI systems. Tested
  and working on QEMU. Actually using this script as the regular image
  generator, like with the memstick one, will require that the kernel support
  EFI too. In particular, the following two things are required:
  1. vt(9) be the default console driver
  2. vt_efifb and vt_vga be able to coexist usefully in the same kernel
  
  One other note here is that this requires newfs_msdos and mdconfig, which is
  really ugly. NetBSD's makefs at least seems to support FAT now. If that
  actually works, it should be imported and we can get rid of the mdconfig mess.

Added:
  head/release/amd64/mkisoimages-uefi.sh
 - copied, changed from r264979, head/release/amd64/mkisoimages.sh

Copied and modified: head/release/amd64/mkisoimages-uefi.sh (from r264979, 
head/release/amd64/mkisoimages.sh)
==
--- head/release/amd64/mkisoimages.sh   Sat Apr 26 16:58:35 2014
(r264979, copy source)
+++ head/release/amd64/mkisoimages-uefi.sh  Sun Apr 27 01:06:02 2014
(r264995)
@@ -26,6 +26,20 @@
 if [ x$1 = x-b ]; then
# This is highly x86-centric and will be used directly below.
bootable=-o bootimage=i386;$4/boot/cdboot -o no-emul-boot
+
+   # Make EFI system partition (should be done with makefs in the future)
+   dd if=/dev/zero of=efiboot.img bs=4k count=100
+   device=`mdconfig -a -t vnode -f efiboot.img`
+   newfs_msdos -F 12 -m 0xf8 /dev/$device
+   mkdir efi
+   mount -t msdosfs /dev/$device efi
+   mkdir -p efi/efi/boot
+   cp ${4}/boot/loader.efi efi/efi/boot/bootx64.efi
+   umount efi
+   rmdir efi
+   mdconfig -d -u $device
+   bootable=-o bootimage=i386;efiboot.img -o no-emul-boot $bootable
+   
shift
 else
bootable=
@@ -43,3 +57,4 @@ publisher=The FreeBSD Project.  http://
 echo /dev/iso9660/$LABEL / cd9660 ro 0 0  $1/etc/fstab
 makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o 
publisher=$publisher $NAME $*
 rm $1/etc/fstab
+rm -f efiboot.img
___
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: r264996 - in stable/10: . bin/pkill bin/pkill/tests etc/mtree sbin sbin/dhclient sbin/dhclient/tests sbin/growfs sbin/growfs/tests sbin/mdconfig sbin/mdconfig/tests sbin/tests tools/bui...

2014-04-26 Thread Julio Merino
Author: jmmv
Date: Sun Apr 27 01:15:10 2014
New Revision: 264996
URL: http://svnweb.freebsd.org/changeset/base/264996

Log:
  MFC various moves of tools/regressions/ tests to the new infrastructure.
  
  - r263220 Migrate tools/regression/sbin/ to the new tests layout.
  - r263222 Add Makefile missed in r263220.
  - r263226 Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new 
tests layout.
  - r263227 Migrate most of tools/regression/usr.bin/ to the new tests layout.
  - r263345 Expand tabs that sneaked in into spaces.
  - r263346 Migrate tools/regression/usr.bin/make/ to the new tests layout.
  - r263348 Add Makefiles missed in r263346.
  - r263351 Migrate tools/regression/usr.bin/pkill/ to the new tests layout.
  - r263388 Mark multi_test as requiring /usr/share/dict/words.
  - r263814 Fix path to the run.pl script to let these tests run.
  - r264742 Prevent building tests when bootstrapping make.
  
  This is 'make tinderbox' clean.

Added:
  stable/10/bin/pkill/tests/
 - copied from r263351, head/bin/pkill/tests/
  stable/10/sbin/dhclient/tests/
 - copied from r263220, head/sbin/dhclient/tests/
  stable/10/sbin/growfs/tests/
 - copied from r263220, head/sbin/growfs/tests/
  stable/10/sbin/mdconfig/tests/
 - copied from r263220, head/sbin/mdconfig/tests/
  stable/10/sbin/mdconfig/tests/Makefile
 - copied unchanged from r263222, head/sbin/mdconfig/tests/Makefile
  stable/10/sbin/tests/
 - copied from r263220, head/sbin/tests/
  stable/10/usr.bin/apply/tests/
 - copied from r263227, head/usr.bin/apply/tests/
  stable/10/usr.bin/calendar/tests/
 - copied from r263227, head/usr.bin/calendar/tests/
  stable/10/usr.bin/comm/tests/
 - copied from r263227, head/usr.bin/comm/tests/
  stable/10/usr.bin/file2c/tests/
 - copied from r263227, head/usr.bin/file2c/tests/
  stable/10/usr.bin/join/tests/
 - copied from r263227, head/usr.bin/join/tests/
  stable/10/usr.bin/jot/tests/
 - copied from r263227, head/usr.bin/jot/tests/
  stable/10/usr.bin/lastcomm/tests/
 - copied from r263226, head/usr.bin/lastcomm/tests/
  stable/10/usr.bin/m4/tests/
 - copied from r263227, head/usr.bin/m4/tests/
  stable/10/usr.bin/make/tests/
 - copied from r263346, head/usr.bin/make/tests/
  stable/10/usr.bin/make/tests/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/Makefile
  stable/10/usr.bin/make/tests/archives/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/archives/Makefile
  stable/10/usr.bin/make/tests/archives/fmt_44bsd/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/archives/fmt_44bsd/Makefile
  stable/10/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile
  stable/10/usr.bin/make/tests/archives/fmt_oldbsd/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile
  stable/10/usr.bin/make/tests/basic/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/basic/Makefile
  stable/10/usr.bin/make/tests/basic/t0/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/basic/t0/Makefile
  stable/10/usr.bin/make/tests/basic/t1/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/basic/t1/Makefile
  stable/10/usr.bin/make/tests/basic/t2/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/basic/t2/Makefile
  stable/10/usr.bin/make/tests/basic/t3/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/basic/t3/Makefile
  stable/10/usr.bin/make/tests/execution/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/execution/Makefile
  stable/10/usr.bin/make/tests/execution/ellipsis/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/execution/ellipsis/Makefile
  stable/10/usr.bin/make/tests/execution/empty/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/execution/empty/Makefile
  stable/10/usr.bin/make/tests/execution/joberr/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/execution/joberr/Makefile
  stable/10/usr.bin/make/tests/execution/plus/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/execution/plus/Makefile
  stable/10/usr.bin/make/tests/shell/Makefile
 - copied unchanged from r263348, head/usr.bin/make/tests/shell/Makefile
  stable/10/usr.bin/make/tests/shell/builtin/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/shell/builtin/Makefile
  stable/10/usr.bin/make/tests/shell/meta/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/shell/meta/Makefile
  stable/10/usr.bin/make/tests/shell/path/Makefile
 - copied unchanged from r263348, 
head/usr.bin/make/tests/shell/path/Makefile
  stable/10/usr.bin/make/tests/shell/path_select/Makefile
 - copied unchanged from r263348, 

svn commit: r264997 - head/sys/dev/vt/hw/vga

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 02:19:53 2014
New Revision: 264997
URL: http://svnweb.freebsd.org/changeset/base/264997

Log:
  Disable vga if EFI framebuffer present. vt(9) should handle this internally
  based on efifb's higher priority, but it doesn't, and this at least lets
  us build a kernel that boots on both BIOS and EFI systems for now.

Modified:
  head/sys/dev/vt/hw/vga/vga.c

Modified: head/sys/dev/vt/hw/vga/vga.c
==
--- head/sys/dev/vt/hw/vga/vga.cSun Apr 27 01:15:10 2014
(r264996)
+++ head/sys/dev/vt/hw/vga/vga.cSun Apr 27 02:19:53 2014
(r264997)
@@ -45,8 +45,10 @@ __FBSDID($FreeBSD$);
 #if defined(__amd64__) || defined(__i386__)
 #include vm/vm.h
 #include vm/pmap.h
+#include machine/metadata.h
 #include machine/pmap.h
 #include machine/vmparam.h
+#include sys/linker.h
 #endif /* __amd64__ || __i386__ */
 
 struct vga_softc {
@@ -637,6 +639,19 @@ vga_init(struct vt_device *vd)
int textmode = 0;
 
 #if defined(__amd64__) || defined(__i386__)
+   /* Disable if EFI framebuffer present. Should be handled by priority
+* logic in vt(9), but this will do for now. XXX */
+
+   caddr_t kmdp, efifb;
+   kmdp = preload_search_by_type(elf kernel);
+   if (kmdp == NULL)
+   kmdp = preload_search_by_type(elf64 kernel);
+   efifb = preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB);
+   if (efifb != NULL)
+   return (CN_DEAD);
+#endif
+
+#if defined(__amd64__) || defined(__i386__)
sc-vga_fb_tag = X86_BUS_SPACE_MEM;
sc-vga_fb_handle = KERNBASE + VGA_MEM_BASE;
sc-vga_reg_tag = X86_BUS_SPACE_IO;
___
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: r264998 - head/sys/net

2014-04-26 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun Apr 27 02:20:09 2014
New Revision: 264998
URL: http://svnweb.freebsd.org/changeset/base/264998

Log:
  Move up fibnum to ensure it is always defined.
  
  Found by: ian
  MFC with: r264987

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Sun Apr 27 02:19:53 2014(r264997)
+++ head/sys/net/rtsock.c   Sun Apr 27 02:20:09 2014(r264998)
@@ -531,6 +531,8 @@ route_output(struct mbuf *m, struct sock
union sockaddr_union saun;
sa_family_t saf = AF_UNSPEC;
 
+   fibnum = so-so_fibnum;
+
 #define senderr(e) { error = e; goto flush;}
if (m == NULL || ((m-m_len  sizeof(long)) 
   (m = m_pullup(m, sizeof(long))) == NULL))
@@ -582,8 +584,6 @@ route_output(struct mbuf *m, struct sock
senderr(error);
}
 
-   fibnum = so-so_fibnum;
-
/*
 * The given gateway address may be an interface address.
 * For example, issuing a route change command on a route
___
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: r264999 - head/sys/dev/vt

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 02:20:51 2014
New Revision: 264999
URL: http://svnweb.freebsd.org/changeset/base/264999

Log:
  Increase the maximum framebuffer size to more reasonable values reflecting
  the high-resolution boot consoles present on Open Firmware and EFI systems.

Modified:
  head/sys/dev/vt/vt.h

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hSun Apr 27 02:20:09 2014(r264998)
+++ head/sys/dev/vt/vt.hSun Apr 27 02:20:51 2014(r264999)
@@ -337,10 +337,10 @@ void vt_upgrade(struct vt_device *vd);
 #definePIXEL_HEIGHT(h) ((h) / 16)
 
 #ifndef VT_FB_DEFAULT_WIDTH
-#defineVT_FB_DEFAULT_WIDTH 640
+#defineVT_FB_DEFAULT_WIDTH 2048
 #endif
 #ifndef VT_FB_DEFAULT_HEIGHT
-#defineVT_FB_DEFAULT_HEIGHT480
+#defineVT_FB_DEFAULT_HEIGHT1200
 #endif
 
 #defineVT_CONSDEV_DECLARE(driver, width, height, softc)
\
___
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: r265000 - head/sys/amd64/conf

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 02:22:21 2014
New Revision: 265000
URL: http://svnweb.freebsd.org/changeset/base/265000

Log:
  Add vt_efifb to VT kernel configuration now that that actually works. This
  kernel will now boot on both BIOS and EFI systems without modification.
  Equivalent functionality in GENERIC requires making vt(9) the default console
  driver, which is probably appropriate at this point.

Modified:
  head/sys/amd64/conf/VT

Modified: head/sys/amd64/conf/VT
==
--- head/sys/amd64/conf/VT  Sun Apr 27 02:20:51 2014(r264999)
+++ head/sys/amd64/conf/VT  Sun Apr 27 02:22:21 2014(r265000)
@@ -12,3 +12,4 @@ nodevice  vga
 
 device vt
 device vt_vga
+device vt_efifb
___
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: r264987 - head/sys/net

2014-04-26 Thread Alexander V. Chernikov
On 27.04.2014 03:16, Ian Lepore wrote:
 On Sat, 2014-04-26 at 22:32 +, Alexander V. Chernikov wrote:
 Author: melifaro
 Date: Sat Apr 26 22:32:04 2014
 New Revision: 264987
 URL: http://svnweb.freebsd.org/changeset/base/264987

 Log:
   Determine fibnum once in the beginning of route_output().
   
   MFC after: 1 month

 Modified:
   head/sys/net/rtsock.c
 
 Modified: head/sys/net/rtsock.c
 ==
 --- head/sys/net/rtsock.cSat Apr 26 21:03:41 2014(r264986)
 +++ head/sys/net/rtsock.cSat Apr 26 22:32:04 2014(r264987)
 @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock
  struct sockaddr_in6 *sin6;
  int i, rti_need_deembed = 0;
  #endif
 -int len, error = 0;
 +int len, error = 0, fibnum;
  struct ifnet *ifp = NULL;
  union sockaddr_union saun;
  sa_family_t saf = AF_UNSPEC;
 @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock
  senderr(error);
  }
  
 +fibnum = so-so_fibnum;
 +
  /*
   * The given gateway address may be an interface address.
   * For example, issuing a route change command on a route
 @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock
  
  bzero(gw_ro, sizeof(gw_ro));
  gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
 -rtalloc_ign_fib(gw_ro, 0, so-so_fibnum);
 +rtalloc_ign_fib(gw_ro, 0, fibnum);
  /* 
   * A host route through the loopback interface is 
   * installed for each interface adddress. In pre 8.0
 @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock
  break;
  }
  error = rtrequest1_fib(rtm-rtm_type, info, saved_nrt,
 -so-so_fibnum);
 +fibnum);
  if (error == 0  saved_nrt != NULL) {
  #ifdef INET6
  rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
 @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock
  #endif
  break;
  }
 -error = rtrequest1_fib(RTM_DELETE, info, saved_nrt,
 -so-so_fibnum);
 +error = rtrequest1_fib(RTM_DELETE, info, saved_nrt, fibnum);
  if (error == 0) {
  RT_LOCK(saved_nrt);
  rt = saved_nrt;
 @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock
  break;
  
  case RTM_GET:
 -rnh = rt_tables_get_rnh(so-so_fibnum,
 -info.rti_info[RTAX_DST]-sa_family);
 +rnh = rt_tables_get_rnh(fibnum, saf);
  if (rnh == NULL)
  senderr(EAFNOSUPPORT);
  
 @@ -867,7 +867,7 @@ flush:
  m_adj(m, rtm-rtm_msglen - m-m_pkthdr.len);
  }
  if (m) {
 -M_SETFIB(m, so-so_fibnum);
 +M_SETFIB(m, fibnum);
  m-m_flags |= RTS_FILTER_FIB;
  if (rp) {
  /*

 
 I've got build breakage that I think may be from this change...
 
 /local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 
 'route_output':
 /local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 'fibnum' 
 may be used uninitialized in this function
Fixed in r264998, thank you!
Twice per night is a kind of record for me :(
I'm wondering why clang hasn't seen any issue here..

 
 -- Ian
 
 
 
 

___
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: r265001 - head/sys/amd64/conf

2014-04-26 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Apr 27 02:28:32 2014
New Revision: 265001
URL: http://svnweb.freebsd.org/changeset/base/265001

Log:
  Don't need this now. VT does the same thing, but better.
  
  Submitted by: gjb

Deleted:
  head/sys/amd64/conf/UEFI
___
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: r264987 - head/sys/net

2014-04-26 Thread Ian Lepore
On Sun, 2014-04-27 at 06:23 +0400, Alexander V. Chernikov wrote:
 On 27.04.2014 03:16, Ian Lepore wrote:
  On Sat, 2014-04-26 at 22:32 +, Alexander V. Chernikov wrote:
  Author: melifaro
  Date: Sat Apr 26 22:32:04 2014
  New Revision: 264987
  URL: http://svnweb.freebsd.org/changeset/base/264987
 
  Log:
Determine fibnum once in the beginning of route_output().

MFC after:   1 month
 
  Modified:
head/sys/net/rtsock.c
  
  Modified: head/sys/net/rtsock.c
  ==
  --- head/sys/net/rtsock.c  Sat Apr 26 21:03:41 2014(r264986)
  +++ head/sys/net/rtsock.c  Sat Apr 26 22:32:04 2014(r264987)
  @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock
 struct sockaddr_in6 *sin6;
 int i, rti_need_deembed = 0;
   #endif
  -  int len, error = 0;
  +  int len, error = 0, fibnum;
 struct ifnet *ifp = NULL;
 union sockaddr_union saun;
 sa_family_t saf = AF_UNSPEC;
  @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock
 senderr(error);
 }
   
  +  fibnum = so-so_fibnum;
  +
 /*
  * The given gateway address may be an interface address.
  * For example, issuing a route change command on a route
  @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock
   
 bzero(gw_ro, sizeof(gw_ro));
 gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
  -  rtalloc_ign_fib(gw_ro, 0, so-so_fibnum);
  +  rtalloc_ign_fib(gw_ro, 0, fibnum);
 /* 
  * A host route through the loopback interface is 
  * installed for each interface adddress. In pre 8.0
  @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock
 break;
 }
 error = rtrequest1_fib(rtm-rtm_type, info, saved_nrt,
  -  so-so_fibnum);
  +  fibnum);
 if (error == 0  saved_nrt != NULL) {
   #ifdef INET6
 rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
  @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock
   #endif
 break;
 }
  -  error = rtrequest1_fib(RTM_DELETE, info, saved_nrt,
  -  so-so_fibnum);
  +  error = rtrequest1_fib(RTM_DELETE, info, saved_nrt, fibnum);
 if (error == 0) {
 RT_LOCK(saved_nrt);
 rt = saved_nrt;
  @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock
 break;
   
 case RTM_GET:
  -  rnh = rt_tables_get_rnh(so-so_fibnum,
  -  info.rti_info[RTAX_DST]-sa_family);
  +  rnh = rt_tables_get_rnh(fibnum, saf);
 if (rnh == NULL)
 senderr(EAFNOSUPPORT);
   
  @@ -867,7 +867,7 @@ flush:
 m_adj(m, rtm-rtm_msglen - m-m_pkthdr.len);
 }
 if (m) {
  -  M_SETFIB(m, so-so_fibnum);
  +  M_SETFIB(m, fibnum);
 m-m_flags |= RTS_FILTER_FIB;
 if (rp) {
 /*
 
  
  I've got build breakage that I think may be from this change...
  
  /local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 
  'route_output':
  /local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 
  'fibnum' may be used uninitialized in this function
 Fixed in r264998, thank you!
 Twice per night is a kind of record for me :(
 I'm wondering why clang hasn't seen any issue here..
 

I've been doing a bunch of arm universe kernel builds that bring both
clang and gcc into play; they do sometimes whine about different things.

-- Ian


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

2014-04-26 Thread Konstantin Belousov
Author: kib
Date: Sun Apr 27 05:19:01 2014
New Revision: 265002
URL: http://svnweb.freebsd.org/changeset/base/265002

Log:
  When vm_fault_copy_entry() is called from vm_map_protect() for a wired
  entry and performs the upgrade of the entry permissions from read-only
  to read-write, we must allow to search for the source pages in the
  backing object, like we do in the case of forking the read-only wired
  entry. For the fork case, the behaviour is allowed by src_readonly
  boolean, which in fact is only used to assert that read-write case
  provides all source pages in the top-level object.
  
  Eliminate the src_readonly variable.  Allow for the copy loop to look
  into the backing objects, add explicit asserts to ensure that only
  read-only and upgrade case actually does.
  
  Expand comments. Change the panic call into assert.
  
  Reported by:  markj
  Tested by:markj, pho (previous version)
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Sun Apr 27 02:28:32 2014(r265001)
+++ head/sys/vm/vm_fault.c  Sun Apr 27 05:19:01 2014(r265002)
@@ -1240,7 +1240,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm
vm_offset_t vaddr;
vm_page_t dst_m;
vm_page_t src_m;
-   boolean_t src_readonly, upgrade;
+   boolean_t upgrade;
 
 #ifdef lint
src_map++;
@@ -1250,7 +1250,6 @@ vm_fault_copy_entry(vm_map_t dst_map, vm
 
src_object = src_entry-object.vm_object;
src_pindex = OFF_TO_IDX(src_entry-offset);
-   src_readonly = (src_entry-protection  VM_PROT_WRITE) == 0;
 
/*
 * Create the top-level object for the destination entry. (Doesn't
@@ -1321,25 +1320,33 @@ vm_fault_copy_entry(vm_map_t dst_map, vm
 
/*
 * Find the page in the source object, and copy it in.
-* (Because the source is wired down, the page will be in
-* memory.)
+* Because the source is wired down, the page will be
+* in memory.
 */
VM_OBJECT_RLOCK(src_object);
object = src_object;
pindex = src_pindex + dst_pindex;
while ((src_m = vm_page_lookup(object, pindex)) == NULL 
-   src_readonly 
(backing_object = object-backing_object) != NULL) {
/*
-* Allow fallback to backing objects if we are reading.
+* Unless the source mapping is read-only or
+* it is presently being upgraded from
+* read-only, the first object in the shadow
+* chain should provide all of the pages.  In
+* other words, this loop body should never be
+* executed when the source mapping is already
+* read/write.
 */
+   KASSERT((src_entry-protection  VM_PROT_WRITE) == 0 ||
+   upgrade,
+   (vm_fault_copy_entry: main object missing page));
+
VM_OBJECT_RLOCK(backing_object);
pindex += OFF_TO_IDX(object-backing_object_offset);
VM_OBJECT_RUNLOCK(object);
object = backing_object;
}
-   if (src_m == NULL)
-   panic(vm_fault_copy_wired: page missing);
+   KASSERT(src_m != NULL, (vm_fault_copy_entry: page missing));
pmap_copy_page(src_m, dst_m);
VM_OBJECT_RUNLOCK(object);
dst_m-valid = VM_PAGE_BITS_ALL;
___
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: r265003 - head/secure/usr.sbin/sshd

2014-04-26 Thread Konstantin Belousov
Author: kib
Date: Sun Apr 27 05:28:14 2014
New Revision: 265003
URL: http://svnweb.freebsd.org/changeset/base/265003

Log:
  Fix order of libthr and libc in the global dso list for sshd, by
  explicitely linking main binary with -lpthread.  Before, libthr
  appeared in the list due to dependency of one of the kerberos libs.
  Due to the change in ld(1) behaviour of not copying NEEDED entries
  from direct dependencies into the link results, the order becomes
  reversed.
  
  The libthr must appear before libc to properly interpose libc symbols
  and provide working rtld locks implementation.  The symptom was sshd
  hanging on rtld bind lock during nested symbol binding from a signal
  handler.
  
  Approved by:  des (openssh maintainer)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/secure/usr.sbin/sshd/Makefile

Modified: head/secure/usr.sbin/sshd/Makefile
==
--- head/secure/usr.sbin/sshd/Makefile  Sun Apr 27 05:19:01 2014
(r265002)
+++ head/secure/usr.sbin/sshd/Makefile  Sun Apr 27 05:28:14 2014
(r265003)
@@ -57,6 +57,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED
 DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ}
 LDADD+= -lcrypt -lcrypto -lz
 
+# Fix the order of NEEDED entries for libthr and libc. The libthr
+# needs to interpose libc symbols, leaving the libthr loading as
+# dependency of krb causes reversed order and broken interposing. Put
+# the threading library last on the linker command line, just before
+# the -lc added by a compiler driver.
+.if ${MK_KERBEROS_SUPPORT} != no
+DPADD+= ${LIBPTHREAD}
+LDADD+= -lpthread
+.endif
+
 .if defined(LOCALBASE)
 CFLAGS+= -DXAUTH_PATH=\${LOCALBASE}/bin/xauth\
 .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


svn commit: r265004 - head/sys/amd64/amd64

2014-04-26 Thread Konstantin Belousov
Author: kib
Date: Sun Apr 27 05:37:01 2014
New Revision: 265004
URL: http://svnweb.freebsd.org/changeset/base/265004

Log:
  Same as it was done in r263878 for invlrng_handler(), fix order of
  checks for special pcid values in invlpg_pcid_handler().  Forst check
  for special values, and only then do PCID-specific page invalidation.
  
  Minor fix to the style compliance, declare local variable at the
  function start.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Sun Apr 27 05:28:14 2014
(r265003)
+++ head/sys/amd64/amd64/mp_machdep.c   Sun Apr 27 05:37:01 2014
(r265004)
@@ -1566,6 +1566,7 @@ invlpg_handler(void)
 void
 invlpg_pcid_handler(void)
 {
+   uint64_t cr3;
 #ifdef COUNT_XINVLTLB_HITS
xhits_pg[PCPU_GET(cpuid)]++;
 #endif /* COUNT_XINVLTLB_HITS */
@@ -1573,15 +1574,13 @@ invlpg_pcid_handler(void)
(*ipi_invlpg_counts[PCPU_GET(cpuid)])++;
 #endif /* COUNT_IPIS */
 
-   if (invpcid_works) {
-   invpcid(smp_tlb_invpcid, INVPCID_ADDR);
+   if (smp_tlb_invpcid.pcid == (uint64_t)-1) {
+   invltlb_globpcid();
} else if (smp_tlb_invpcid.pcid == 0) {
invlpg(smp_tlb_invpcid.addr);
-   } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) {
-   invltlb_globpcid();
+   } else if (invpcid_works) {
+   invpcid(smp_tlb_invpcid, INVPCID_ADDR);
} else {
-   uint64_t cr3;
-
/*
 * PCID supported, but INVPCID is not.
 * Temporarily switch to the target address
___
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: r265000 - head/sys/amd64/conf

2014-04-26 Thread Steve Kargl
   Equivalent functionality in GENERIC requires making vt(9)
   the default console driver, which is probably appropriate
   at this point.

No.  It is not appropriate! Please stop referring to
nonexistent man pages in your commit mesasges.  There
is NO vt(9) manpage.

-- 
Steve
___
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