svn commit: r259644 - head/sys/dev/ixgbe

2013-12-20 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 20 10:57:47 2013
New Revision: 259644
URL: http://svnweb.freebsd.org/changeset/base/259644

Log:
  ixgbe(4) takes packet counters from hardware in ixgbe_update_stats_counters(),
  so we don't need to do a per packet increment, which trashes cache line.
  
  Submitted by: oleg

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

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Fri Dec 20 10:49:57 2013(r259643)
+++ head/sys/dev/ixgbe/ixgbe.c  Fri Dec 20 10:57:47 2013(r259644)
@@ -3696,7 +3696,6 @@ ixgbe_txeof(struct tx_ring *txr)
}
++txr-packets;
++processed;
-   ++ifp-if_opackets;
txr-watchdog_time = ticks;
 
/* Try the next packet */
@@ -4553,7 +4552,6 @@ ixgbe_rxeof(struct ix_queue *que)
mp-m_next = nbuf-buf;
} else { /* Sending this frame */
sendmp-m_pkthdr.rcvif = ifp;
-   ifp-if_ipackets++;
rxr-rx_packets++;
/* capture data for AIM */
rxr-bytes += sendmp-m_pkthdr.len;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2013-12-20 Thread Alexander V. Chernikov
Author: melifaro
Date: Fri Dec 20 12:08:36 2013
New Revision: 259645
URL: http://svnweb.freebsd.org/changeset/base/259645

Log:
  Further split kvm(3) and sysctl interfaces for route table printing.
  
  MFC after:4 weeks
  Sponsored by: Yandex LLC

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

Modified: head/usr.bin/netstat/route.c
==
--- head/usr.bin/netstat/route.cFri Dec 20 10:57:47 2013
(r259644)
+++ head/usr.bin/netstat/route.cFri Dec 20 12:08:36 2013
(r259645)
@@ -139,7 +139,6 @@ int do_rtent = 0;
 struct rtentry rtentry;
 struct radix_node rnode;
 struct radix_mask rmask;
-struct radix_node_head **rt_tables;
 
 intNewTree = 1;
 
@@ -149,16 +148,17 @@ static struct sockaddr *kgetsa(struct so
 static void size_cols(int ef, struct radix_node *rn);
 static void size_cols_tree(struct radix_node *rn);
 static void size_cols_rtentry(struct rtentry *rt);
-static void p_tree(struct radix_node *);
-static void p_rtnode(void);
-static void ntreestuff(int fibnum, int af);
-static void np_rtentry(struct rt_msghdr *);
+static void p_rtnode_kvm(void);
+static void p_rtable_sysctl(int, int);
+static void p_rtable_kvm(int, int );
+static void p_rtree_kvm(struct radix_node *);
+static void p_rtentry_sysctl(struct rt_msghdr *);
 static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int);
 static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask,
 int flags);
 static void p_flags(int, const char *);
 static const char *fmt_flags(int f);
-static void p_rtentry(struct rtentry *);
+static void p_rtentry_kvm(struct rtentry *);
 static void domask(char *, in_addr_t, u_long);
 
 /*
@@ -167,10 +167,8 @@ static void domask(char *, in_addr_t, u_
 void
 routepr(int fibnum, int af)
 {
-   struct radix_node_head **rnhp, *rnh, head;
-   u_long rtree;
size_t intsize;
-   int fam, numfibs;
+   int numfibs;
 
intsize = sizeof(int);
if (fibnum == -1 
@@ -194,60 +192,12 @@ routepr(int fibnum, int af)
printf(\n);
 
if (Aflag == 0  live != 0  NewTree)
-   ntreestuff(fibnum, af);
-   else {
-   kresolve_list(rl);
-   if ((rtree = rl[N_RTREE].n_value) == 0) {
-   printf(rt_tables: symbol not in namelist\n);
-   return;
-   }
-
-   rt_tables = calloc(numfibs * (AF_MAX + 1),
-   sizeof(struct radix_node_head *));
-   if (rt_tables == NULL)
-   err(EX_OSERR, memory allocation failed);
-
-   if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs *
-   (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0)
-   return;
-   for (fam = 0; fam = AF_MAX; fam++) {
-   int tmpfib;
-
-   switch (fam) {
-   case AF_INET6:
-   case AF_INET:
-   tmpfib = fibnum;
-   break;
-   default:
-   tmpfib = 0;
-   }
-   rnhp = (struct radix_node_head **)*rt_tables;
-   /* Calculate the in-kernel address. */
-   rnhp += tmpfib * (AF_MAX+1) + fam;
-   /* Read the in kernel rhn pointer. */
-   if (kget(rnhp, rnh) != 0)
-   continue;
-   if (rnh == NULL)
-   continue;
-   /* Read the rnh data. */
-   if (kget(rnh, head) != 0)
-   continue;
-   if (fam == AF_UNSPEC) {
-   if (Aflag  af == 0) {
-   printf(Netmasks:\n);
-   p_tree(head.rnh_treetop);
-   }
-   } else if (af == AF_UNSPEC || af == fam) {
-   size_cols(fam, head.rnh_treetop);
-   pr_family(fam);
-   do_rtent = 1;
-   pr_rthdr(fam);
-   p_tree(head.rnh_treetop);
-   }
-   }
-   }
+   p_rtable_sysctl(fibnum, af);
+   else
+   p_rtable_kvm(fibnum, af);
 }
 
+
 /*
  * Print address family header before a section of the routing table.
  */
@@ -451,8 +401,75 @@ kgetsa(struct sockaddr *dst)
return (pt_u.u_sa);
 }
 
+/*
+ * Print kernel routing tables for given fib
+ * using debugging kvm(3) interface.
+ */
+static void
+p_rtable_kvm(int fibnum, int af)
+{
+   struct radix_node_head **rnhp, *rnh, head;
+   struct radix_node_head **rt_tables;
+   u_long rtree;
+   int fam, af_size;

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

2013-12-20 Thread Michael Tuexen
On Dec 20, 2013, at 11:57 AM, Gleb Smirnoff gleb...@freebsd.org wrote:

I think you need something like

[bsd5:~/head] tuexen% svn diff
Index: sys/dev/ixgbe/ixgbe.c
===
--- sys/dev/ixgbe/ixgbe.c   (revision 259645)
+++ sys/dev/ixgbe/ixgbe.c   (working copy)
@@ -3592,8 +3592,10 @@
 static void
 ixgbe_txeof(struct tx_ring *txr)
 {
+#ifdef DEV_NETMAP
struct adapter  *adapter = txr-adapter;
struct ifnet*ifp = adapter-ifp;
+#endif
u32 work, processed = 0;
u16 limit = txr-process_limit;
struct ixgbe_tx_buf *buf;

to get it compiling if DEV_NETMAP is not defined.

Best regards
Michael

 Author: glebius
 Date: Fri Dec 20 10:57:47 2013
 New Revision: 259644
 URL: http://svnweb.freebsd.org/changeset/base/259644
 
 Log:
  ixgbe(4) takes packet counters from hardware in 
 ixgbe_update_stats_counters(),
  so we don't need to do a per packet increment, which trashes cache line.
 
  Submitted by:oleg
 
 Modified:
  head/sys/dev/ixgbe/ixgbe.c
 
 Modified: head/sys/dev/ixgbe/ixgbe.c
 ==
 --- head/sys/dev/ixgbe/ixgbe.cFri Dec 20 10:49:57 2013
 (r259643)
 +++ head/sys/dev/ixgbe/ixgbe.cFri Dec 20 10:57:47 2013
 (r259644)
 @@ -3696,7 +3696,6 @@ ixgbe_txeof(struct tx_ring *txr)
   }
   ++txr-packets;
   ++processed;
 - ++ifp-if_opackets;
   txr-watchdog_time = ticks;
 
   /* Try the next packet */
 @@ -4553,7 +4552,6 @@ ixgbe_rxeof(struct ix_queue *que)
   mp-m_next = nbuf-buf;
   } else { /* Sending this frame */
   sendmp-m_pkthdr.rcvif = ifp;
 - ifp-if_ipackets++;
   rxr-rx_packets++;
   /* capture data for AIM */
   rxr-bytes += sendmp-m_pkthdr.len;
 

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


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

2013-12-20 Thread Gleb Smirnoff
On Fri, Dec 20, 2013 at 02:12:42PM +0100, Michael Tuexen wrote:
M On Dec 20, 2013, at 11:57 AM, Gleb Smirnoff gleb...@freebsd.org wrote:
M 
M I think you need something like
M 
M [bsd5:~/head] tuexen% svn diff
M Index: sys/dev/ixgbe/ixgbe.c
M ===
M --- sys/dev/ixgbe/ixgbe.c(revision 259645)
M +++ sys/dev/ixgbe/ixgbe.c(working copy)
M @@ -3592,8 +3592,10 @@
M  static void
M  ixgbe_txeof(struct tx_ring *txr)
M  {
M +#ifdef DEV_NETMAP
M  struct adapter  *adapter = txr-adapter;
M  struct ifnet*ifp = adapter-ifp;
M +#endif
M  u32 work, processed = 0;
M  u16 limit = txr-process_limit;
M  struct ixgbe_tx_buf *buf;
M 
M to get it compiling if DEV_NETMAP is not defined.

Thanks, Michael. And sorry for broken build.

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


svn commit: r259646 - head/sys/dev/ixgbe

2013-12-20 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 20 13:18:50 2013
New Revision: 259646
URL: http://svnweb.freebsd.org/changeset/base/259646

Log:
  Fix build broken in r259644.
  
  Submitted by: tuexen
  Pointy hat to:glebius

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

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Fri Dec 20 12:08:36 2013(r259645)
+++ head/sys/dev/ixgbe/ixgbe.c  Fri Dec 20 13:18:50 2013(r259646)
@@ -3592,8 +3592,10 @@ ixgbe_atr(struct tx_ring *txr, struct mb
 static void
 ixgbe_txeof(struct tx_ring *txr)
 {
+#ifdef DEV_NETMAP
struct adapter  *adapter = txr-adapter;
struct ifnet*ifp = adapter-ifp;
+#endif
u32 work, processed = 0;
u16 limit = txr-process_limit;
struct ixgbe_tx_buf *buf;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259647 - head/sys/dev/hwpmc

2013-12-20 Thread Attilio Rao
Author: attilio
Date: Fri Dec 20 14:03:56 2013
New Revision: 259647
URL: http://svnweb.freebsd.org/changeset/base/259647

Log:
  o Remove assertions on ipa_version as sometimes the version detection
using cpuid can be quirky (this is the case of VMWare without the
vPMC support) but fail to probe hwpmc.
  o Apply the fix for XEON family of processors as established by
315338-020 document (bug AJ85).
  
  Sponsored by: EMC / Isilon storage division
  Reviewed by:  fabient

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c
  head/sys/dev/hwpmc/hwpmc_core.h
  head/sys/dev/hwpmc/hwpmc_intel.c

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 20 13:18:50 2013
(r259646)
+++ head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 20 14:03:56 2013
(r259647)
@@ -2627,35 +2627,33 @@ core2_intr(int cpu, struct trapframe *tf
 }
 
 int
-pmc_core_initialize(struct pmc_mdep *md, int maxcpu)
+pmc_core_initialize(struct pmc_mdep *md, int maxcpu, int version_override)
 {
int cpuid[CORE_CPUID_REQUEST_SIZE];
int ipa_version, flags, nflags;
 
do_cpuid(CORE_CPUID_REQUEST, cpuid);
 
-   ipa_version = cpuid[CORE_CPUID_EAX]  0xFF;
+   ipa_version = (version_override  0) ? version_override :
+   cpuid[CORE_CPUID_EAX]  0xFF;
+   core_cputype = md-pmd_cputype;
 
PMCDBG(MDP,INI,1,core-init cputype=%d ncpu=%d ipa-version=%d,
-   md-pmd_cputype, maxcpu, ipa_version);
+   core_cputype, maxcpu, ipa_version);
 
-   if (ipa_version  1 || ipa_version  3) {
+   if (ipa_version  1 || ipa_version  3 ||
+   (core_cputype != PMC_CPU_INTEL_CORE  ipa_version == 1)) {
/* Unknown PMC architecture. */
printf(hwpc_core: unknown PMC architecture: %d\n,
ipa_version);
return (EPROGMISMATCH);
}
 
-   core_cputype = md-pmd_cputype;
-
core_pmcmask = 0;
 
/*
 * Initialize programmable counters.
 */
-   KASSERT(ipa_version = 1,
-   ([core,%d] ipa_version %d too small, __LINE__, ipa_version));
-
core_iap_npmc = (cpuid[CORE_CPUID_EAX]  8)  0xFF;
core_iap_width = (cpuid[CORE_CPUID_EAX]  16)  0xFF;
 
@@ -2670,10 +2668,6 @@ pmc_core_initialize(struct pmc_mdep *md,
 * Initialize fixed function counters, if present.
 */
if (core_cputype != PMC_CPU_INTEL_CORE) {
-   KASSERT(ipa_version = 2,
-   ([core,%d] ipa_version %d too small, __LINE__,
-   ipa_version));
-
core_iaf_ri = core_iap_npmc;
core_iaf_npmc = cpuid[CORE_CPUID_EDX]  0x1F;
core_iaf_width = (cpuid[CORE_CPUID_EDX]  5)  0xFF;

Modified: head/sys/dev/hwpmc/hwpmc_core.h
==
--- head/sys/dev/hwpmc/hwpmc_core.h Fri Dec 20 13:18:50 2013
(r259646)
+++ head/sys/dev/hwpmc/hwpmc_core.h Fri Dec 20 14:03:56 2013
(r259647)
@@ -175,7 +175,8 @@ struct pmc_md_iap_pmc {
  * Prototypes.
  */
 
-intpmc_core_initialize(struct pmc_mdep *_md, int _maxcpu);
+intpmc_core_initialize(struct pmc_mdep *_md, int _maxcpu,
+   int _version_override);
 void   pmc_core_finalize(struct pmc_mdep *_md);
 
 void   pmc_core_mark_started(int _cpu, int _pmc);

Modified: head/sys/dev/hwpmc/hwpmc_intel.c
==
--- head/sys/dev/hwpmc/hwpmc_intel.cFri Dec 20 13:18:50 2013
(r259646)
+++ head/sys/dev/hwpmc/hwpmc_intel.cFri Dec 20 14:03:56 2013
(r259647)
@@ -78,7 +78,7 @@ pmc_intel_initialize(void)
 {
struct pmc_mdep *pmc_mdep;
enum pmc_cputype cputype;
-   int error, model, nclasses, ncpus;
+   int error, model, nclasses, ncpus, stepping, verov;
 
KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL,
([intel,%d] Initializing non-intel processor, __LINE__));
@@ -88,7 +88,9 @@ pmc_intel_initialize(void)
cputype = -1;
nclasses = 2;
error = 0;
+   verov = 0;
model = ((cpu_id  0xF)  12) | ((cpu_id  0xF0)  4);
+   stepping = cpu_id  0xF;
 
switch (cpu_id  0xF00) {
 #ifdefined(__i386__)
@@ -119,8 +121,14 @@ pmc_intel_initialize(void)
cputype = PMC_CPU_INTEL_CORE;
break;
case 0xF:
-   cputype = PMC_CPU_INTEL_CORE2;
-   nclasses = 3;
+   /* Per Intel document 315338-020. */
+   if (stepping == 0x7) {
+   cputype = PMC_CPU_INTEL_CORE;
+   verov = 1;
+   } else {
+   cputype = PMC_CPU_INTEL_CORE2;
+   nclasses = 3;
+   

Re: svn commit: r259619 - in head/contrib/gcc: . cp doc

2013-12-20 Thread Andreas Tobler
On 19.12.13 19:27, Pedro F. Giffuni wrote:
 Author: pfg
 Date: Thu Dec 19 18:27:32 2013
 New Revision: 259619
 URL: http://svnweb.freebsd.org/changeset/base/259619
 
 Log:
   gcc: backport upstream fix for issue with C++'s placement new
   
   Fixes GCC libstdc++/29286
   
   Obtained from:  gcc 4.3 (rev. 125603, 125653; GPLv2)
   MFC after:  2 weeks

Pedro,

is this commit complete? If so, please revert. I get a compiler on
powerpc64 which immediately segfaults.

Thanks,
Andreas

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


svn commit: r259649 - in head/contrib/gcc: . config cp doc

2013-12-20 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 20 14:56:52 2013
New Revision: 259649
URL: http://svnweb.freebsd.org/changeset/base/259649

Log:
  gcc: more diff reductions against Apple GCC.
  
  Mostly cosmetical changes to aid further merges.
  
  Obtained from:gcc 4.3 (rev. 120611, 124839; GPLv2)
  MFC after:1 week

Modified:
  head/contrib/gcc/ChangeLog.gcc43
  head/contrib/gcc/config/darwin.h
  head/contrib/gcc/cp/ChangeLog.gcc43
  head/contrib/gcc/cp/Make-lang.in
  head/contrib/gcc/cp/mangle.c
  head/contrib/gcc/cp/rtti.c
  head/contrib/gcc/doc/tm.texi
  head/contrib/gcc/dwarf2out.c
  head/contrib/gcc/sched-vis.c
  head/contrib/gcc/target-def.h
  head/contrib/gcc/target.h
  head/contrib/gcc/tree-dump.c

Modified: head/contrib/gcc/ChangeLog.gcc43
==
--- head/contrib/gcc/ChangeLog.gcc43Fri Dec 20 14:33:48 2013
(r259648)
+++ head/contrib/gcc/ChangeLog.gcc43Fri Dec 20 14:56:52 2013
(r259649)
@@ -150,6 +150,14 @@
regs_invalidated_by_call, rather than just checking the
membership of REGNO (REG).
 
+2007-05-18  Geoffrey Keating  geo...@apple.com (r124839)
+ 
+   * dwarf2out.c (print_die): Use '%ld' not '%lu' to print a 'long'.
+   (output_die): Use 'unsigned long' with %x.
+   * sched-vis.c (print_value): Use 'unsigned HOST_WIDE_INT' and
+   HOST_WIDE_INT_PRINT_HEX to print HOST_WIDE_INT.
+   * tree-dump.c (dump_pointer): Use 'unsigned long' for %lx.
+
 2007-05-16  Eric Christopher  echri...@apple.com (r124763)
 
* config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register
@@ -470,6 +478,14 @@
* c-common.c (vector_types_convertible_p): Treat opaque types as
always convertible if they have the same size, but not otherwise.
 
+2007-01-08  Geoffrey Keating  geo...@apple.com (r120611)
+ 
+   * target.h (struct gcc_target): New field library_rtti_comdat.
+   * target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New.
+   (TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT.
+   * doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT.
+   * config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define.
+
 2007-01-08  Mark Shinwell  shinw...@codesourcery.com (r120572)
 
* c.opt: Add -flax-vector-conversions.

Modified: head/contrib/gcc/config/darwin.h
==
--- head/contrib/gcc/config/darwin.hFri Dec 20 14:33:48 2013
(r259648)
+++ head/contrib/gcc/config/darwin.hFri Dec 20 14:56:52 2013
(r259649)
@@ -467,6 +467,10 @@ extern GTY(()) int darwin_ms_struct;
with names, so it's safe to make the class data not comdat.  */
 #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false
 
+/* For efficiency, on Darwin the RTTI information that is always
+   emitted in the standard C++ library should not be COMDAT.  */
+#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_false
+
 /* We make exception information linkonce. */
 #undef TARGET_USES_WEAK_UNWIND_INFO
 #define TARGET_USES_WEAK_UNWIND_INFO 1

Modified: head/contrib/gcc/cp/ChangeLog.gcc43
==
--- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 14:33:48 2013
(r259648)
+++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 14:56:52 2013
(r259649)
@@ -35,6 +35,10 @@
 
* typeck.c (build_binary_op): Include types in error.
 
+2007-05-18  Geoffrey Keating  geo...@apple.com (r124839)
+
+   * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
+
 2007-05-05  Geoffrey Keating  geo...@apple.com (r124467)
 
PR 31775

Modified: head/contrib/gcc/cp/Make-lang.in
==
--- head/contrib/gcc/cp/Make-lang.inFri Dec 20 14:33:48 2013
(r259648)
+++ head/contrib/gcc/cp/Make-lang.inFri Dec 20 14:56:52 2013
(r259649)
@@ -265,7 +265,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_
   $(TARGET_H) debug.h
 cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
 cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \
-  gt-cp-rtti.h
+  $(TARGET_H) gt-cp-rtti.h
 cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \
   toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H)
 cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \

Modified: head/contrib/gcc/cp/mangle.c
==
--- head/contrib/gcc/cp/mangle.cFri Dec 20 14:33:48 2013
(r259648)
+++ head/contrib/gcc/cp/mangle.cFri Dec 20 14:56:52 2013
(r259649)
@@ -1340,7 +1340,7 @@ write_real_cst (const tree value)
 
   for (; i != limit; i += dir)
{
- sprintf (buffer, %08lx, target_real[i]);
+ sprintf (buffer, %08lx, (unsigned long) target_real[i]);
  

svn commit: r259650 - head/sys/dev/vt

2013-12-20 Thread Aleksandr Rybalko
Author: ray
Date: Fri Dec 20 15:37:57 2013
New Revision: 259650
URL: http://svnweb.freebsd.org/changeset/base/259650

Log:
  Set mouse level per window, instead of global.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hFri Dec 20 14:56:52 2013(r259649)
+++ head/sys/dev/vt/vt.hFri Dec 20 15:37:57 2013(r259650)
@@ -244,6 +244,7 @@ struct vt_window {
int  vw_kbdmode;/* (?) Keyboard mode. */
char*vw_kbdsq;  /* Escape sequence queue*/
unsigned int vw_flags;  /* (d) Per-window flags. */
+   int  vw_mouse_level;/* Mouse op mode. */
 #defineVWF_BUSY0x1 /* Busy reconfiguring device. */
 #defineVWF_OPENED  0x2 /* TTY in use. */
 #defineVWF_SCROLL  0x4 /* Keys influence scrollback. */

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Fri Dec 20 14:56:52 2013(r259649)
+++ head/sys/dev/vt/vt_core.c   Fri Dec 20 15:37:57 2013(r259650)
@@ -633,6 +633,9 @@ vtterm_param(struct terminal *tm, int cm
case TP_SHOWCURSOR:
vtbuf_cursor_visibility(vw-vw_buf, arg);
break;
+   case TP_MOUSE:
+   vw-vw_mouse_level = arg;
+   break;
}
 }
 
@@ -1206,7 +1209,7 @@ vt_mouse_event(int type, int x, int y, i
 * under mouse pointer when nothing changed.
 */
 
-   if (mlevel  0)
+   if (vw-vw_mouse_level  0)
vt_mouse_terminput(vd, type, x, y, event, cnt);
 
switch (type) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259651 - head/sys/dev/vt

2013-12-20 Thread Aleksandr Rybalko
Author: ray
Date: Fri Dec 20 15:45:22 2013
New Revision: 259651
URL: http://svnweb.freebsd.org/changeset/base/259651

Log:
  Enable AltGr key by default.
  
  Asked by: many
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Fri Dec 20 15:37:57 2013(r259650)
+++ head/sys/dev/vt/vt_core.c   Fri Dec 20 15:45:22 2013(r259651)
@@ -113,7 +113,7 @@ const struct terminal_class vt_termclass
 int sc_txtmouse_no_retrace_wait;
 
 static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, Newcons parameters);
-VT_SYSCTL_INT(enable_altgr, 0, Enable AltGr key (Do not assume R.Alt as 
Alt));
+VT_SYSCTL_INT(enable_altgr, 1, Enable AltGr key (Do not assume R.Alt as 
Alt));
 VT_SYSCTL_INT(debug, 0, Newcons debug level);
 VT_SYSCTL_INT(deadtimer, 15, Time to wait busy process in VT_PROCESS mode);
 VT_SYSCTL_INT(suspendswitch, 1, Switch to VT0 before suspend);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259655 - head/contrib/gcc/cp

2013-12-20 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 20 16:01:02 2013
New Revision: 259655
URL: http://svnweb.freebsd.org/changeset/base/259655

Log:
  gcc: merge upstream fix and new feature.
  
  Fix for PR c++/29928
  
  Add support for Rvalue references as described here:
  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
  
  Obtained from:gcc 4.3 (rev. 124724, 125211; GPLv2)
  MFC after:2 weeks

Modified:
  head/contrib/gcc/cp/ChangeLog.gcc43
  head/contrib/gcc/cp/call.c
  head/contrib/gcc/cp/cp-tree.h
  head/contrib/gcc/cp/decl.c
  head/contrib/gcc/cp/error.c
  head/contrib/gcc/cp/except.c
  head/contrib/gcc/cp/mangle.c
  head/contrib/gcc/cp/parser.c
  head/contrib/gcc/cp/pt.c
  head/contrib/gcc/cp/rtti.c
  head/contrib/gcc/cp/tree.c
  head/contrib/gcc/cp/typeck.c

Modified: head/contrib/gcc/cp/ChangeLog.gcc43
==
--- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 15:58:33 2013
(r259654)
+++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 16:01:02 2013
(r259655)
@@ -35,10 +35,75 @@
 
* typeck.c (build_binary_op): Include types in error.
 
+2007-05-30  Russell Yanofsky r...@yanofsky.org (r125211)
+Douglas Gregor doug.gre...@gmail.com
+Pedro Lamarao pedro.lama...@mndfck.org
+Howard Hinnant howard.hinn...@gmail.com
+
+   PR c++/7412
+   PR c++/29939
+   * typeck.c (comptypes): Don't consider rvalue and lvalue
+   reference types to be equivalent.
+   (check_return_expr): Move from certain lvalues when returning
+   them.
+   * decl.c (grokdeclarator): Implement reference collapsing.
+   (copy_fn_p): Don't consider constructors taking rvalue references
+   to be copy constructors.
+   (move_fn_p): New.
+* call.c (conversion): New rvaluedness_matches_p member.
+   (convert_class_to_reference): Require reference type as first
+   parameter instead of base type.
+   (reference_binding): Add logic to handle rvalue references.
+   (implicit_conversion): Update inaccurate comment.
+   (convert_like_real): Disable creation of temporaries that are
+   impossible to initialize for types with move constructors.
+   (build_over_call): Elide move constructors when possible.
+   (maybe_handle_implicit_object): Set rvaluedness_matches_p.
+   (maybe_handle_ref_bind): Return conversion instead of type node.
+   (compare_ics): Add logic to use rvaluedness_matches_p values to
+   determine preferred conversion sequences.
+   * cp-tree.h (TYPE_REF_IS_RVALUE): New.
+   (LOOKUP_PREFER_RVALUE): New.
+   (DECL_MOVE_CONSTRUCTOR_P): New.
+   (struct cp_declarator): Add reference member for reference
+   types, with new rvalue_ref flag.
+   (cp_build_reference_type): Declare.
+   (move_fn_p): Declare.
+   * error.c (dump_type_prefix): Format rvalue reference types
+   correctly in error messages.
+   * except.c (build_throw): Move from certain lvalues when
+   throwing.
+   * mangle.c (write_type): Mangle rvalue references differently
+   than regular references.
+   * parser.c (make_reference_declarator): Add boolean parameter for
+   rvalue references.
+   (cp_parser_make_indirect_declarator): New.
+   (cp_parser_new_declarator_opt): Call
+   cp_parser_make_indirect_declarator. 
+   (cp_parser_conversion_declarator_opt): Ditto.
+   (cp_parser_declarator): Ditto.
+   (cp_parser_ptr_operator): Parse  tokens into rvalue reference
+   declarators.
+   * pt.c (tsubst): Implement reference collapsing.
+   (maybe_adjust_types_for_deduction): Implement special template
+   parameter deduction rule for rvalue references.
+   (type_unification_real): Update calls to
+   maybe_adjust_types_for_deduction.
+   (try_one_overload): Ditto.
+   (unify_pack_expansion): Ditto.
+   * tree.c (lvalue_p_1): Handle rvalue reference types.
+   (cp_build_reference_type): New.
+
 2007-05-18  Geoffrey Keating  geo...@apple.com (r124839)
 
* mangle.c (write_real_cst): Use 'unsigned long' for %lx.
 
+2007-05-14  Paolo Carlini  pcarl...@suse.de (r124724)
+
+   PR c++/29928
+   * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
+   type only if is a class type (5.2.8/4).
+
 2007-05-05  Geoffrey Keating  geo...@apple.com (r124467)
 
PR 31775

Modified: head/contrib/gcc/cp/call.c
==
--- head/contrib/gcc/cp/call.c  Fri Dec 20 15:58:33 2013(r259654)
+++ head/contrib/gcc/cp/call.c  Fri Dec 20 16:01:02 2013(r259655)
@@ -95,6 +95,10 @@ struct conversion {
   /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion
  from a pointer-to-derived to pointer-to-base is being performed.  */
   BOOL_BITFIELD base_p : 1;
+  /* If KIND is ck_ref_bind, true when either an lvalue 

svn commit: r259657 - head/sys/powerpc/powermac

2013-12-20 Thread Justin Hibbits
Author: jhibbits
Date: Fri Dec 20 16:37:03 2013
New Revision: 259657
URL: http://svnweb.freebsd.org/changeset/base/259657

Log:
  Add suspend/resume handlers for ATI backlight ppc driver.
  
  With this, also shut shut off the display (DPMS-style) and disable the 
clocking
  when the backlight level is set to 0.  This is taken from the radeonkms driver
  (radeon_legacy_encoders.c) which doesn't yet support PowerPC, and won't for a
  while, as it's missing full AGP support.

Modified:
  head/sys/powerpc/powermac/atibl.c

Modified: head/sys/powerpc/powermac/atibl.c
==
--- head/sys/powerpc/powermac/atibl.c   Fri Dec 20 16:15:25 2013
(r259656)
+++ head/sys/powerpc/powermac/atibl.c   Fri Dec 20 16:37:03 2013
(r259657)
@@ -52,10 +52,15 @@ __FBSDID($FreeBSD$);
 #define  RADEON_LVDS_BL_MOD_EN(116)
 #define  RADEON_LVDS_DIGON(118)
 #define  RADEON_LVDS_BLON (119)
+#define RADEON_LVDS_PLL_CNTL 0x02d4
+#define  RADEON_LVDS_PLL_EN   (116)
+#define  RADEON_LVDS_PLL_RESET(117)
+#define RADEON_PIXCLKS_CNTL  0x002d
+#define  RADEON_PIXCLK_LVDS_ALWAYS_ONb (114)
 
 struct atibl_softc {
-   device_t dev;
struct resource *sc_memr;
+   int  sc_level;
 };
 
 static void atibl_identify(driver_t *driver, device_t parent);
@@ -63,13 +68,17 @@ static int atibl_probe(device_t dev);
 static int atibl_attach(device_t dev);
 static int atibl_setlevel(struct atibl_softc *sc, int newlevel);
 static int atibl_getlevel(struct atibl_softc *sc);
+static int atibl_resume(device_t dev);
+static int atibl_suspend(device_t dev);
 static int atibl_sysctl(SYSCTL_HANDLER_ARGS);
 
 static device_method_t atibl_methods[] = {
/* Device interface */
-   DEVMETHOD(device_identify, atibl_identify),
-   DEVMETHOD(device_probe, atibl_probe),
-   DEVMETHOD(device_attach, atibl_attach),
+   DEVMETHOD(device_identify,  atibl_identify),
+   DEVMETHOD(device_probe, atibl_probe),
+   DEVMETHOD(device_attach,atibl_attach),
+   DEVMETHOD(device_suspend,   atibl_suspend),
+   DEVMETHOD(device_resume,atibl_resume),
{0, 0},
 };
 
@@ -136,8 +145,8 @@ atibl_attach(device_t dev)
tree = device_get_sysctl_tree(dev);
 
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-   level, CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-   atibl_sysctl, I, Backlight level (0-100));
+   level, CTLTYPE_INT | CTLFLAG_RW, sc, 0,
+   atibl_sysctl, I, Backlight level (0-100));
 
return (0);
 }
@@ -146,6 +155,8 @@ static int
 atibl_setlevel(struct atibl_softc *sc, int newlevel)
 {
uint32_t lvds_gen_cntl;
+   uint32_t lvds_pll_cntl;
+   uint32_t pixclks_cntl;
 
if (newlevel  100)
newlevel = 100;
@@ -153,13 +164,38 @@ atibl_setlevel(struct atibl_softc *sc, i
if (newlevel  0)
newlevel = 0;
 
-   newlevel = (newlevel * 5) / 2 + 5;
lvds_gen_cntl = bus_read_4(sc-sc_memr, RADEON_LVDS_GEN_CNTL);
-   lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN;
-   lvds_gen_cntl = ~RADEON_LVDS_BL_MOD_LEVEL_MASK;
-   lvds_gen_cntl |= (newlevel  RADEON_LVDS_BL_MOD_LEVEL_SHIFT) 
-   RADEON_LVDS_BL_MOD_LEVEL_MASK;
-   bus_write_4(sc-sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
+
+   if (newlevel  0) {
+   newlevel = (newlevel * 5) / 2 + 5;
+   lvds_pll_cntl = bus_read_4(sc-sc_memr, RADEON_LVDS_PLL_CNTL);
+   lvds_pll_cntl |= RADEON_LVDS_PLL_EN;
+   bus_write_4(sc-sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl);
+   lvds_pll_cntl = ~RADEON_LVDS_PLL_RESET;
+   bus_write_4(sc-sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl);
+
+   lvds_gen_cntl = ~(RADEON_LVDS_DISPLAY_DIS | 
+   RADEON_LVDS_BL_MOD_LEVEL_MASK);
+   lvds_gen_cntl |= RADEON_LVDS_ON | RADEON_LVDS_EN |
+   RADEON_LVDS_DIGON | RADEON_LVDS_BLON;
+   lvds_gen_cntl |= (newlevel  RADEON_LVDS_BL_MOD_LEVEL_SHIFT) 
+   RADEON_LVDS_BL_MOD_LEVEL_MASK;
+   lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN;
+   DELAY(2000);
+   bus_write_4(sc-sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
+   } else {
+   pixclks_cntl = bus_read_4(sc-sc_memr, RADEON_PIXCLKS_CNTL);
+   bus_write_4(sc-sc_memr, RADEON_PIXCLKS_CNTL,
+   pixclks_cntl  ~RADEON_PIXCLK_LVDS_ALWAYS_ONb);
+   lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS;
+   lvds_gen_cntl = RADEON_LVDS_BL_MOD_EN;
+   bus_write_4(sc-sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl);
+   lvds_gen_cntl = ~(RADEON_LVDS_ON | RADEON_LVDS_EN);
+   DELAY(2000);
+   bus_write_4(sc-sc_memr, 

Re: svn commit: r259642 - head/sys/netinet

2013-12-20 Thread Adrian Chadd
On 20 December 2013 00:44, Gleb Smirnoff gleb...@freebsd.org wrote:

 I didn't get to review of actual patch, but IMO it would be better
 just to remove the code, not ifdef 0 it. The code ifdefed has zero
 probability to be enabled in its current form. If we ever fix it, code
 would look very different.

 No reason to do followup commit, that was just me muttering.

I figured it would be nicer in the short term to #if 0 it out whilst
some other discussions went on, just to make it really obvious in the
short term where the check was done. It's quite possible I'll
eventually just trim it entirely out.

Thanks,


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


svn commit: r259659 - in head/sys: nfs rpc

2013-12-20 Thread Alexander Motin
Author: mav
Date: Fri Dec 20 17:39:07 2013
New Revision: 259659
URL: http://svnweb.freebsd.org/changeset/base/259659

Log:
  Remove several linear list traversals per request from RPC server code.
  
Do not insert active ports into pool-sp_active list if they are success-
  fully assigned to some thread.  This makes that list include only ports that
  really require attention, and so traversal can be reduced to simple taking
  the first one.
  
Remove idle thread from pool-sp_idlethreads list when assigning some
  work (port of requests) to it.  That again makes possible to replace list
  traversals with simple taking the first element.

Modified:
  head/sys/nfs/nfs_fha.c
  head/sys/rpc/svc.c
  head/sys/rpc/svc.h

Modified: head/sys/nfs/nfs_fha.c
==
--- head/sys/nfs/nfs_fha.c  Fri Dec 20 16:50:52 2013(r259658)
+++ head/sys/nfs/nfs_fha.c  Fri Dec 20 17:39:07 2013(r259659)
@@ -289,19 +289,6 @@ fha_hash_entry_add_op(struct fha_hash_en
fhe-num_rw += count;
 }
 
-static SVCTHREAD *
-get_idle_thread(SVCPOOL *pool)
-{
-   SVCTHREAD *st;
-
-   LIST_FOREACH(st, pool-sp_idlethreads, st_ilink) {
-   if (st-st_xprt == NULL  STAILQ_EMPTY(st-st_reqs))
-   return (st);
-   }
-   return (NULL);
-}
-
-
 /*
  * Get the service thread currently associated with the fhe that is
  * appropriate to handle this operation.
@@ -386,7 +373,7 @@ fha_hash_entry_choose_thread(struct fha_
ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO,
fha: %p(%d)t, thread, thread-st_reqcount);
 #endif
-   } else if ((thread = get_idle_thread(pool))) {
+   } else if ((thread = LIST_FIRST(pool-sp_idlethreads))) {
 #if 0
ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO,
fha: %p(%d)i, thread, thread-st_reqcount);
@@ -418,7 +405,6 @@ SVCTHREAD *
 fha_assign(SVCTHREAD *this_thread, struct svc_req *req,
 struct fha_params *softc)
 {
-   SVCPOOL *pool;
SVCTHREAD *thread;
struct fha_info i;
struct fha_hash_entry *fhe;
@@ -439,7 +425,6 @@ fha_assign(SVCTHREAD *this_thread, struc
if (req-rq_vers != 2  req-rq_vers != 3)
return (this_thread);
 
-   pool = req-rq_xprt-xp_pool;
fha_extract_info(req, i, cb);
 
/*

Modified: head/sys/rpc/svc.c
==
--- head/sys/rpc/svc.c  Fri Dec 20 16:50:52 2013(r259658)
+++ head/sys/rpc/svc.c  Fri Dec 20 17:39:07 2013(r259659)
@@ -293,12 +293,10 @@ xprt_unregister_locked(SVCXPRT *xprt)
 {
SVCPOOL *pool = xprt-xp_pool;
 
+   mtx_assert(xprt-xp_mlock, MA_OWNED);
KASSERT(xprt-xp_registered == TRUE,
(xprt_unregister_locked: not registered));
-   if (xprt-xp_active) {
-   TAILQ_REMOVE(pool-sp_active, xprt, xp_alink);
-   xprt-xp_active = FALSE;
-   }
+   xprt_inactive_locked(xprt);
TAILQ_REMOVE(pool-sp_xlist, xprt, xp_link);
xprt-xp_registered = FALSE;
 }
@@ -320,25 +318,25 @@ xprt_unregister(SVCXPRT *xprt)
SVC_RELEASE(xprt);
 }
 
-static void
+/*
+ * Attempt to assign a service thread to this transport.
+ */
+static int
 xprt_assignthread(SVCXPRT *xprt)
 {
SVCPOOL *pool = xprt-xp_pool;
SVCTHREAD *st;
 
-   /*
-* Attempt to assign a service thread to this
-* transport.
-*/
-   LIST_FOREACH(st, pool-sp_idlethreads, st_ilink) {
-   if (st-st_xprt == NULL  STAILQ_EMPTY(st-st_reqs))
-   break;
-   }
+   mtx_assert(xprt-xp_mlock, MA_OWNED);
+   st = LIST_FIRST(pool-sp_idlethreads);
if (st) {
+   LIST_REMOVE(st, st_ilink);
+   st-st_idle = FALSE;
SVC_ACQUIRE(xprt);
xprt-xp_thread = st;
st-st_xprt = xprt;
cv_signal(st-st_cond);
+   return (TRUE);
} else {
/*
 * See if we can create a new thread. The
@@ -354,6 +352,7 @@ xprt_assignthread(SVCXPRT *xprt)
pool-sp_state = SVCPOOL_THREADWANTED;
}
}
+   return (FALSE);
 }
 
 void
@@ -372,9 +371,12 @@ xprt_active(SVCXPRT *xprt)
}
 
if (!xprt-xp_active) {
-   TAILQ_INSERT_TAIL(pool-sp_active, xprt, xp_alink);
xprt-xp_active = TRUE;
-   xprt_assignthread(xprt);
+   if (xprt-xp_thread == NULL) {
+   if (!xprt_assignthread(xprt))
+   TAILQ_INSERT_TAIL(pool-sp_active, xprt,
+   xp_alink);
+   }
}
 
mtx_unlock(pool-sp_lock);
@@ -385,8 +387,10 @@ xprt_inactive_locked(SVCXPRT *xprt)
 {
SVCPOOL *pool = 

Re: svn commit: r259642 - head/sys/netinet

2013-12-20 Thread Jack Vogel
I agree with Gleb, ifdef 0 is silly, after all, that's why we have source
history, its
not like the offending code is gone forever :) So I guess its both of us
muttering Gleb :)

Jack



On Fri, Dec 20, 2013 at 9:05 AM, Adrian Chadd adr...@freebsd.org wrote:

 On 20 December 2013 00:44, Gleb Smirnoff gleb...@freebsd.org wrote:

  I didn't get to review of actual patch, but IMO it would be better
  just to remove the code, not ifdef 0 it. The code ifdefed has zero
  probability to be enabled in its current form. If we ever fix it, code
  would look very different.
 
  No reason to do followup commit, that was just me muttering.

 I figured it would be nicer in the short term to #if 0 it out whilst
 some other discussions went on, just to make it really obvious in the
 short term where the check was done. It's quite possible I'll
 eventually just trim it entirely out.

 Thanks,


 -a

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


svn commit: r259660 - head/contrib/gcc/cp

2013-12-20 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 20 18:09:34 2013
New Revision: 259660
URL: http://svnweb.freebsd.org/changeset/base/259660

Log:
  gcc: revert Rvalue references.
  
  They are very useful but at this time I prefer not to figure out
  some  minor conflicts with the bigger Apple's blocks support
  patch that is being worked on for current.

Modified:
  head/contrib/gcc/cp/ChangeLog.gcc43
  head/contrib/gcc/cp/call.c
  head/contrib/gcc/cp/cp-tree.h
  head/contrib/gcc/cp/decl.c
  head/contrib/gcc/cp/error.c
  head/contrib/gcc/cp/except.c
  head/contrib/gcc/cp/mangle.c
  head/contrib/gcc/cp/parser.c
  head/contrib/gcc/cp/pt.c
  head/contrib/gcc/cp/tree.c
  head/contrib/gcc/cp/typeck.c

Modified: head/contrib/gcc/cp/ChangeLog.gcc43
==
--- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 17:39:07 2013
(r259659)
+++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013
(r259660)
@@ -35,65 +35,6 @@
 
* typeck.c (build_binary_op): Include types in error.
 
-2007-05-30  Russell Yanofsky r...@yanofsky.org (r125211)
-Douglas Gregor doug.gre...@gmail.com
-Pedro Lamarao pedro.lama...@mndfck.org
-Howard Hinnant howard.hinn...@gmail.com
-
-   PR c++/7412
-   PR c++/29939
-   * typeck.c (comptypes): Don't consider rvalue and lvalue
-   reference types to be equivalent.
-   (check_return_expr): Move from certain lvalues when returning
-   them.
-   * decl.c (grokdeclarator): Implement reference collapsing.
-   (copy_fn_p): Don't consider constructors taking rvalue references
-   to be copy constructors.
-   (move_fn_p): New.
-* call.c (conversion): New rvaluedness_matches_p member.
-   (convert_class_to_reference): Require reference type as first
-   parameter instead of base type.
-   (reference_binding): Add logic to handle rvalue references.
-   (implicit_conversion): Update inaccurate comment.
-   (convert_like_real): Disable creation of temporaries that are
-   impossible to initialize for types with move constructors.
-   (build_over_call): Elide move constructors when possible.
-   (maybe_handle_implicit_object): Set rvaluedness_matches_p.
-   (maybe_handle_ref_bind): Return conversion instead of type node.
-   (compare_ics): Add logic to use rvaluedness_matches_p values to
-   determine preferred conversion sequences.
-   * cp-tree.h (TYPE_REF_IS_RVALUE): New.
-   (LOOKUP_PREFER_RVALUE): New.
-   (DECL_MOVE_CONSTRUCTOR_P): New.
-   (struct cp_declarator): Add reference member for reference
-   types, with new rvalue_ref flag.
-   (cp_build_reference_type): Declare.
-   (move_fn_p): Declare.
-   * error.c (dump_type_prefix): Format rvalue reference types
-   correctly in error messages.
-   * except.c (build_throw): Move from certain lvalues when
-   throwing.
-   * mangle.c (write_type): Mangle rvalue references differently
-   than regular references.
-   * parser.c (make_reference_declarator): Add boolean parameter for
-   rvalue references.
-   (cp_parser_make_indirect_declarator): New.
-   (cp_parser_new_declarator_opt): Call
-   cp_parser_make_indirect_declarator. 
-   (cp_parser_conversion_declarator_opt): Ditto.
-   (cp_parser_declarator): Ditto.
-   (cp_parser_ptr_operator): Parse  tokens into rvalue reference
-   declarators.
-   * pt.c (tsubst): Implement reference collapsing.
-   (maybe_adjust_types_for_deduction): Implement special template
-   parameter deduction rule for rvalue references.
-   (type_unification_real): Update calls to
-   maybe_adjust_types_for_deduction.
-   (try_one_overload): Ditto.
-   (unify_pack_expansion): Ditto.
-   * tree.c (lvalue_p_1): Handle rvalue reference types.
-   (cp_build_reference_type): New.
-
 2007-05-18  Geoffrey Keating  geo...@apple.com (r124839)
 
* mangle.c (write_real_cst): Use 'unsigned long' for %lx.

Modified: head/contrib/gcc/cp/call.c
==
--- head/contrib/gcc/cp/call.c  Fri Dec 20 17:39:07 2013(r259659)
+++ head/contrib/gcc/cp/call.c  Fri Dec 20 18:09:34 2013(r259660)
@@ -95,10 +95,6 @@ struct conversion {
   /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion
  from a pointer-to-derived to pointer-to-base is being performed.  */
   BOOL_BITFIELD base_p : 1;
-  /* If KIND is ck_ref_bind, true when either an lvalue reference is
- being bound to an lvalue expression or an rvalue reference is
- being bound to an rvalue expression. */
-  BOOL_BITFIELD rvaluedness_matches_p: 1;
   /* The type of the expression resulting from the conversion.  */
   tree type;
   union {
@@ -178,7 +174,7 @@ static conversion *standard_conversion (
 static conversion *reference_binding (tree, tree, tree, bool, 

svn commit: r259661 - in head/contrib/gcc: . cp doc

2013-12-20 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 20 18:16:02 2013
New Revision: 259661
URL: http://svnweb.freebsd.org/changeset/base/259661

Log:
  Revert r259619:
  Fixes GCC libstdc++/29286
  
  The fix seems to work for amd64 but causes segfaults on powerpc.
  At this time gcc is much more important on powerpc than on amd64.
  
  Reported by:  andreast

Modified:
  head/contrib/gcc/ChangeLog.gcc43
  head/contrib/gcc/cp/ChangeLog.gcc43
  head/contrib/gcc/cp/init.c
  head/contrib/gcc/doc/c-tree.texi
  head/contrib/gcc/expr.c
  head/contrib/gcc/gimple-low.c
  head/contrib/gcc/gimplify.c
  head/contrib/gcc/omp-low.c
  head/contrib/gcc/print-tree.c
  head/contrib/gcc/tree-gimple.c
  head/contrib/gcc/tree-inline.c
  head/contrib/gcc/tree-pretty-print.c
  head/contrib/gcc/tree-ssa-alias.c
  head/contrib/gcc/tree-ssa-dce.c
  head/contrib/gcc/tree-ssa-operands.c
  head/contrib/gcc/tree-ssa-structalias.c
  head/contrib/gcc/tree.def
  head/contrib/gcc/tree.h

Modified: head/contrib/gcc/ChangeLog.gcc43
==
--- head/contrib/gcc/ChangeLog.gcc43Fri Dec 20 18:09:34 2013
(r259660)
+++ head/contrib/gcc/ChangeLog.gcc43Fri Dec 20 18:16:02 2013
(r259661)
@@ -65,48 +65,6 @@
fvisibility-ms-compat.
* c.opt (fvisibility-ms-compat): New.
 
-2007-06-12  Ian Lance Taylor  i...@google.com (r125653)
-   Daniel Berlin  dber...@dberlin.org
-
-   PR libstdc++/29286
-   * tree.def: Add CHANGE_DYNAMIC_TYPE_EXPR.
-   * tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Define.
-   (CHANGE_DYNAMIC_TYPE_LOCATION): Define.
-   (DECL_NO_TBAA_P): Define.
-   (struct tree_decl_common): Add no_tbaa_flag field.
-   * tree-ssa-structalias.c (struct variable_info): Add
-   no_tbaa_pruning field.
-   (new_var_info): Initialize no_tbaa_pruning field.
-   (unify_nodes): Copy no_tbaa_pruning field.
-   (find_func_aliases): Handle CHANGE_DYNAMIC_TYPE_EXPR.
-   (dump_solution_for_var): Print no_tbaa_pruning flag.
-   (set_uids_in_ptset): Add no_tbaa_pruning parameter.  Change all
-   callers.
-   (compute_tbaa_pruning): New static function.
-   (compute_points_to_sets): Remove CHANGE_DYNAMIC_TYPE_EXPR nodes.
-   Call compute_tbaa_pruning.
-   * tree-ssa-alias.c (may_alias_p): Test no_tbaa_flag for pointers.
-   * gimplify.c (gimplify_expr): Handle CHANGE_DYNAMIC_TYPE_EXPR.
-   * gimple-low.c (lower_stmt): Likewise.
-   * tree-gimple.c (is_gimple_stmt): Likewise.
-   * tree-ssa-operands.c (get_expr_operands): Likewise.
-   * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
-   * tree-inline.c (estimate_num_insns_1): Likewise.
-   (copy_result_decl_to_var): Likewise.
-   * expr.c (expand_expr_real_1): Likewise.
-   * tree-pretty-print.c (dump_generic_node): Likewise.
-   * tree-inline.c (copy_decl_to_var): Copy DECL_NO_TBAA_P flag.
-   * omp-low.c (omp_copy_decl_2): Likewise.
-   * print-tree.c (print_node): Print DECL_NO_TBAA_P flag.
-   * doc/c-tree.texi (Expression trees): Document
-   CHANGE_DYNAMIC_TYPE_EXPR.
-
-2007-06-09  Daniel Berlin  dber...@dberlin.org (r125603)
-
-   * tree-ssa-structalias.c (set_uids_in_ptset): Add is_deref'd
-   parameter, use it.
-   (find_what_p_points_to): Pass new parameter to set_uids_in_ptset.
-
 2007-06-05  Joerg Wunsch  j@uriah.heep.sax.de (r125346)
 
PR preprocessor/23479

Modified: head/contrib/gcc/cp/ChangeLog.gcc43
==
--- head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:09:34 2013
(r259660)
+++ head/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 20 18:16:02 2013
(r259661)
@@ -25,12 +25,6 @@
* decl2.c (determine_visibility): Remove duplicate code for
handling type info.
 
-2007-06-12  Ian Lance Taylor  i...@google.com (r125653)
-
-   PR libstdc++/29286
-   * init.c (avoid_placement_new_aliasing): New static function.
-   (build_new_1): Call it.
-
 2007-05-31  Daniel Berlin  dber...@dberlin.org (r125239)
 
* typeck.c (build_binary_op): Include types in error.

Modified: head/contrib/gcc/cp/init.c
==
--- head/contrib/gcc/cp/init.c  Fri Dec 20 18:09:34 2013(r259660)
+++ head/contrib/gcc/cp/init.c  Fri Dec 20 18:16:02 2013(r259661)
@@ -1,7 +1,6 @@
 /* Handle initialization things in C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-   Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiem...@cygnus.com)
 
 This file is part of GCC.
@@ -1565,55 +1564,6 @@ build_raw_new_expr (tree placement, tree
   return new_expr;
 }
 
-/* Make sure that there are no aliasing issues with T, a placement 

Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel

2013-12-20 Thread Benjamin Kaduk
On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu n...@freebsd.org wrote:

 Author: neel
 Date: Fri Dec 20 05:50:22 2013
 New Revision: 259641
 URL: http://svnweb.freebsd.org/changeset/base/259641

 Log:
   Re-arrange bits in the amd64/pmap 'pm_flags' field.

   The least significant 8 bits of 'pm_flags' are now used for the IPI
 vector
   to use for nested page table TLB shootdown.

   Previously we used IPI_AST to interrupt the host cpu which is
 functionally
   correct but could lead to misleading interrupt counts for AST handler.
 The
   AST handler was also doing a lot more than what is required for the
 nested
   page table TLB shootdown (EOI and IRET).


This represents a KBI change, does it not?  Should __FreeBSD_version be
bumped?

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


Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel

2013-12-20 Thread Neel Natu
Hi Ben,

On Fri, Dec 20, 2013 at 10:27 AM, Benjamin Kaduk bjkf...@gmail.com wrote:
 On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu n...@freebsd.org wrote:

 Author: neel
 Date: Fri Dec 20 05:50:22 2013
 New Revision: 259641
 URL: http://svnweb.freebsd.org/changeset/base/259641

 Log:
   Re-arrange bits in the amd64/pmap 'pm_flags' field.

   The least significant 8 bits of 'pm_flags' are now used for the IPI
 vector
   to use for nested page table TLB shootdown.

   Previously we used IPI_AST to interrupt the host cpu which is
 functionally
   correct but could lead to misleading interrupt counts for AST handler.
 The
   AST handler was also doing a lot more than what is required for the
 nested
   page table TLB shootdown (EOI and IRET).


 This represents a KBI change, does it not?  Should __FreeBSD_version be
 bumped?


I was under the impression that a bump would be required only if this
change is MFCed to a stable branch. I could be wrong about this and if
so would be happy to rectify it.

best
Neel

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


svn commit: r259662 - head/sys/rpc

2013-12-20 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 20 19:44:29 2013
New Revision: 259662
URL: http://svnweb.freebsd.org/changeset/base/259662

Log:
  Fix build.

Modified:
  head/sys/rpc/svc.c

Modified: head/sys/rpc/svc.c
==
--- head/sys/rpc/svc.c  Fri Dec 20 18:16:02 2013(r259661)
+++ head/sys/rpc/svc.c  Fri Dec 20 19:44:29 2013(r259662)
@@ -293,7 +293,7 @@ xprt_unregister_locked(SVCXPRT *xprt)
 {
SVCPOOL *pool = xprt-xp_pool;
 
-   mtx_assert(xprt-xp_mlock, MA_OWNED);
+   mtx_assert(pool-sp_lock, MA_OWNED);
KASSERT(xprt-xp_registered == TRUE,
(xprt_unregister_locked: not registered));
xprt_inactive_locked(xprt);
@@ -327,7 +327,7 @@ xprt_assignthread(SVCXPRT *xprt)
SVCPOOL *pool = xprt-xp_pool;
SVCTHREAD *st;
 
-   mtx_assert(xprt-xp_mlock, MA_OWNED);
+   mtx_assert(pool-sp_lock, MA_OWNED);
st = LIST_FIRST(pool-sp_idlethreads);
if (st) {
LIST_REMOVE(st, st_ilink);
@@ -387,7 +387,7 @@ xprt_inactive_locked(SVCXPRT *xprt)
 {
SVCPOOL *pool = xprt-xp_pool;
 
-   mtx_assert(xprt-xp_mlock, MA_OWNED);
+   mtx_assert(pool-sp_lock, MA_OWNED);
if (xprt-xp_active) {
if (xprt-xp_thread == NULL)
TAILQ_REMOVE(pool-sp_active, xprt, xp_alink);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259663 - head/sys/kern

2013-12-20 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 20 19:45:51 2013
New Revision: 259663
URL: http://svnweb.freebsd.org/changeset/base/259663

Log:
  Move list of ttys handling from the allocating procedures, to the
  device creation stage. A device creation can fail, and in that case
  an entry already on the list will be freed.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Fri Dec 20 19:44:29 2013(r259662)
+++ head/sys/kern/tty.c Fri Dec 20 19:45:51 2013(r259663)
@@ -1007,11 +1007,6 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo
knlist_init_mtx(tp-t_inpoll.si_note, tp-t_mtx);
knlist_init_mtx(tp-t_outpoll.si_note, tp-t_mtx);
 
-   sx_xlock(tty_list_sx);
-   TAILQ_INSERT_TAIL(tty_list, tp, t_list);
-   tty_list_count++;
-   sx_xunlock(tty_list_sx);
-
return (tp);
 }
 
@@ -1020,11 +1015,6 @@ tty_dealloc(void *arg)
 {
struct tty *tp = arg;
 
-   sx_xlock(tty_list_sx);
-   TAILQ_REMOVE(tty_list, tp, t_list);
-   tty_list_count--;
-   sx_xunlock(tty_list_sx);
-
/* Make sure we haven't leaked buffers. */
MPASS(ttyinq_getsize(tp-t_inq) == 0);
MPASS(ttyoutq_getsize(tp-t_outq) == 0);
@@ -1065,6 +1055,11 @@ tty_rel_free(struct tty *tp)
tp-t_dev = NULL;
tty_unlock(tp);
 
+   sx_xlock(tty_list_sx);
+   TAILQ_REMOVE(tty_list, tp, t_list);
+   tty_list_count--;
+   sx_xunlock(tty_list_sx);
+
if (dev != NULL)
destroy_dev_sched_cb(dev, tty_dealloc, tp);
 }
@@ -1279,6 +1274,11 @@ tty_makedevf(struct tty *tp, struct ucre
}
}
 
+   sx_xlock(tty_list_sx);
+   TAILQ_INSERT_TAIL(tty_list, tp, t_list);
+   tty_list_count++;
+   sx_xunlock(tty_list_sx);
+
return (0);
 
 fail:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259665 - head/sys/dev/hwpmc

2013-12-20 Thread George V. Neville-Neil
Author: gnn
Date: Fri Dec 20 20:22:10 2013
New Revision: 259665
URL: http://svnweb.freebsd.org/changeset/base/259665

Log:
  Add another Haswell model (0x45) to the set of supported chips.
  Model 0x45 appears, for example, in late 2013 Mac Book Pro models
  and is properly emulated by VMware.

Modified:
  head/sys/dev/hwpmc/hwpmc_intel.c

Modified: head/sys/dev/hwpmc/hwpmc_intel.c
==
--- head/sys/dev/hwpmc/hwpmc_intel.cFri Dec 20 20:14:54 2013
(r259664)
+++ head/sys/dev/hwpmc/hwpmc_intel.cFri Dec 20 20:22:10 2013
(r259665)
@@ -173,6 +173,7 @@ pmc_intel_initialize(void)
nclasses = 3;
break;
case 0x3C:  /* Per Intel document 325462-045US 01/2013. */
+   case 0x45:
cputype = PMC_CPU_INTEL_HASWELL;
nclasses = 5;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259666 - in head/contrib/gcc: . cp

2013-12-20 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 20 20:57:13 2013
New Revision: 259666
URL: http://svnweb.freebsd.org/changeset/base/259666

Log:
  gcc: clean some warnings from -Wformat-security
  
  Obtained from:Apple GCC 4.2 - 5646 (Radar 5764921)
  MFC after:1 week

Modified:
  head/contrib/gcc/c-common.c
  head/contrib/gcc/c-convert.c
  head/contrib/gcc/c-incpath.c
  head/contrib/gcc/c-typeck.c
  head/contrib/gcc/cfg.c
  head/contrib/gcc/collect2.c
  head/contrib/gcc/cp/cvt.c
  head/contrib/gcc/cp/pt.c
  head/contrib/gcc/cp/typeck.c
  head/contrib/gcc/fold-const.c
  head/contrib/gcc/gcc.c
  head/contrib/gcc/gcov.c
  head/contrib/gcc/tlink.c

Modified: head/contrib/gcc/c-common.c
==
--- head/contrib/gcc/c-common.c Fri Dec 20 20:22:10 2013(r259665)
+++ head/contrib/gcc/c-common.c Fri Dec 20 20:57:13 2013(r259666)
@@ -6014,11 +6014,11 @@ c_parse_error (const char *gmsgid, enum 
   message = NULL;
 }
   else
-error (gmsgid);
+error (gmsgid, );
 
   if (message)
 {
-  error (message);
+  error (message, );
   free (message);
 }
 #undef catenate_messages

Modified: head/contrib/gcc/c-convert.c
==
--- head/contrib/gcc/c-convert.cFri Dec 20 20:22:10 2013
(r259665)
+++ head/contrib/gcc/c-convert.cFri Dec 20 20:57:13 2013
(r259666)
@@ -80,7 +80,7 @@ convert (tree type, tree expr)
   if ((invalid_conv_diag
= targetm.invalid_conversion (TREE_TYPE (expr), type)))
 {
-  error (invalid_conv_diag);
+  error (invalid_conv_diag, );
   return error_mark_node;
 }
 

Modified: head/contrib/gcc/c-incpath.c
==
--- head/contrib/gcc/c-incpath.cFri Dec 20 20:22:10 2013
(r259665)
+++ head/contrib/gcc/c-incpath.cFri Dec 20 20:57:13 2013
(r259666)
@@ -72,7 +72,7 @@ free_path (struct cpp_dir *path, int rea
 case REASON_DUP_SYS:
   fprintf (stderr, _(ignoring duplicate directory \%s\\n), path-name);
   if (reason == REASON_DUP_SYS)
-   fprintf (stderr,
+   fprintf (stderr, %s,
  _(  as it is a non-system directory that duplicates a system directory\n));
   break;
 
@@ -292,16 +292,16 @@ merge_include_chains (cpp_reader *pfile,
 {
   struct cpp_dir *p;
 
-  fprintf (stderr, _(#include \...\ search starts here:\n));
+  fprintf (stderr, %s, _(#include \...\ search starts here:\n));
   for (p = heads[QUOTE];; p = p-next)
{
  if (p == heads[BRACKET])
-   fprintf (stderr, _(#include ... search starts here:\n));
+   fprintf (stderr, %s, _(#include ... search starts here:\n));
  if (!p)
break;
  fprintf (stderr,  %s\n, p-name);
}
-  fprintf (stderr, _(End of search list.\n));
+  fprintf (stderr, %s, _(End of search list.\n));
 }
 }
 

Modified: head/contrib/gcc/c-typeck.c
==
--- head/contrib/gcc/c-typeck.c Fri Dec 20 20:22:10 2013(r259665)
+++ head/contrib/gcc/c-typeck.c Fri Dec 20 20:57:13 2013(r259666)
@@ -2584,7 +2584,7 @@ convert_arguments (tree typelist, tree v
   else if ((invalid_func_diag =
targetm.calls.invalid_arg_for_unprototyped_fn (typelist, 
fundecl, val)))
{
- error (invalid_func_diag);
+ error (invalid_func_diag, );
  return error_mark_node;
}
   else
@@ -2781,7 +2781,7 @@ build_unary_op (enum tree_code code, tre
   if ((invalid_op_diag
= targetm.invalid_unary_op (code, TREE_TYPE (xarg
 {
-  error (invalid_op_diag);
+  error (invalid_op_diag, );
   return error_mark_node;
 }
 
@@ -7819,7 +7819,7 @@ build_binary_op (enum tree_code code, tr
   if ((invalid_op_diag
= targetm.invalid_binary_op (code, type0, type1)))
 {
-  error (invalid_op_diag);
+  error (invalid_op_diag, );
   return error_mark_node;
 }
 

Modified: head/contrib/gcc/cfg.c
==
--- head/contrib/gcc/cfg.c  Fri Dec 20 20:22:10 2013(r259665)
+++ head/contrib/gcc/cfg.c  Fri Dec 20 20:57:13 2013(r259666)
@@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc
else
  fprintf (file, , );
first = false;
-   fputs (bb_bitnames[i], file);
+   fprintf (file, %s, bb_bitnames[i]);
   }
   if (!first)
 fprintf (file, ));

Modified: head/contrib/gcc/collect2.c
==
--- head/contrib/gcc/collect2.c Fri Dec 20 20:22:10 2013(r259665)
+++ head/contrib/gcc/collect2.c Fri Dec 20 20:57:13 2013(r259666)
@@ -1562,10 +1562,10 @@ collect_execute (const char *prog, char 

svn commit: r259667 - in head/sys: dev/syscons dev/vt kern sys teken teken/demo

2013-12-20 Thread Ed Schouten
Author: ed
Date: Fri Dec 20 21:31:50 2013
New Revision: 259667
URL: http://svnweb.freebsd.org/changeset/base/259667

Log:
  Extend libteken to support CJK fullwidth characters.
  
  Introduce a new formatting bit (TF_CJK_RIGHT) that is set when putting a
  cell that is the right part of a CJK fullwidth character. This will
  allow drivers like vt(9) to support fullwidth characters properly.
  
  emaste@ has a patch to extend vt(9)'s font handling to increase the
  number of Unicode - glyph maps from 2 ({normal,bold)} to 4
  ({normal,bold} x {left,right}). This will need to use this formatting
  bit to determine whether to draw the left or right glyph.
  
  Reviewed by:  emaste

Modified:
  head/sys/dev/syscons/scterm-teken.c
  head/sys/dev/vt/vt_font.c
  head/sys/kern/subr_terminal.c
  head/sys/sys/terminal.h
  head/sys/teken/demo/teken_demo.c
  head/sys/teken/teken.h
  head/sys/teken/teken_subr.h

Modified: head/sys/dev/syscons/scterm-teken.c
==
--- head/sys/dev/syscons/scterm-teken.c Fri Dec 20 20:57:13 2013
(r259666)
+++ head/sys/dev/syscons/scterm-teken.c Fri Dec 20 21:31:50 2013
(r259667)
@@ -553,7 +553,14 @@ scteken_putchar(void *arg, const teken_p
vm_offset_t p;
int cursor, attr;
 
+   /*
+* No support for printing right hand sides for CJK fullwidth
+* characters. Simply print a space and assume that the left
+* hand side describes the entire character.
+*/
attr = scteken_attr(a)  8;
+   if (a-ta_format  TF_CJK_RIGHT)
+   c = ' ';
 #ifdef TEKEN_UTF8
scteken_get_cp437(c, attr);
 #endif /* TEKEN_UTF8 */

Modified: head/sys/dev/vt/vt_font.c
==
--- head/sys/dev/vt/vt_font.c   Fri Dec 20 20:57:13 2013(r259666)
+++ head/sys/dev/vt/vt_font.c   Fri Dec 20 21:31:50 2013(r259667)
@@ -87,7 +87,15 @@ vtfont_lookup(const struct vt_font *vf, 
uint16_t dst;
size_t stride;
 
+   /*
+* No support for printing right hand sides for CJK fullwidth
+* characters. Simply print a space and assume that the left
+* hand side describes the entire character.
+*/
src = TCHAR_CHARACTER(c);
+   if (TCHAR_FORMAT(c)  TF_CJK_RIGHT)
+   src = ' ';
+
if (TCHAR_FORMAT(c)  TF_BOLD) {
dst = vtfont_bisearch(vf-vf_bold, vf-vf_bold_length, src);
if (dst != 0)

Modified: head/sys/kern/subr_terminal.c
==
--- head/sys/kern/subr_terminal.c   Fri Dec 20 20:57:13 2013
(r259666)
+++ head/sys/kern/subr_terminal.c   Fri Dec 20 21:31:50 2013
(r259667)
@@ -128,7 +128,7 @@ static const teken_attr_t default_messag
 };
 
 #defineTCHAR_CREATE(c, a)  ((c) | \
-   (a)-ta_format  22 | \
+   (a)-ta_format  21 | \
teken_256to8((a)-ta_fgcolor)  26 | \
teken_256to8((a)-ta_bgcolor)  29)
 

Modified: head/sys/sys/terminal.h
==
--- head/sys/sys/terminal.h Fri Dec 20 20:57:13 2013(r259666)
+++ head/sys/sys/terminal.h Fri Dec 20 21:31:50 2013(r259667)
@@ -62,15 +62,14 @@ struct tty;
  *
  *  Bits  Meaning
  *  0-20: Character value
- *21: Unused
- * 22-25: Bold, underline, blink, reverse
+ * 21-25: Bold, underline, blink, reverse, right part of CJK fullwidth 
character
  * 26-28: Foreground color
  * 29-31: Background color
  */
 
 typedef uint32_t term_char_t;
 #defineTCHAR_CHARACTER(c)  ((c)  0x1f)
-#defineTCHAR_FORMAT(c) (((c)  22)  0xf)
+#defineTCHAR_FORMAT(c) (((c)  21)  0x1f)
 #defineTCHAR_FGCOLOR(c)(((c)  26)  0x7)
 #defineTCHAR_BGCOLOR(c)((c)  29)
 

Modified: head/sys/teken/demo/teken_demo.c
==
--- head/sys/teken/demo/teken_demo.cFri Dec 20 20:57:13 2013
(r259666)
+++ head/sys/teken/demo/teken_demo.cFri Dec 20 21:31:50 2013
(r259667)
@@ -86,9 +86,10 @@ printchar(const teken_pos_t *p)
assert(p-tp_row  NROWS);
assert(p-tp_col  NCOLS);
 
-   getyx(stdscr, y, x);
-
px = buffer[p-tp_col][p-tp_row];
+   /* No need to print right hand side of CJK character manually. */
+   if (px-a.ta_format  TF_CJK_RIGHT)
+   return;
 
/* Convert Unicode to UTF-8. */
if (px-c  0x80) {
@@ -118,8 +119,8 @@ printchar(const teken_pos_t *p)
 
bkgdset(attr | COLOR_PAIR(teken_256to8(px-a.ta_fgcolor) +
  8 * teken_256to8(px-a.ta_bgcolor)));
+   getyx(stdscr, y, x);
mvaddstr(p-tp_row, p-tp_col, str);
-
move(y, x);
 }
 

Modified: head/sys/teken/teken.h

Re: svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel

2013-12-20 Thread Benjamin Kaduk

On Fri, 20 Dec 2013, Neel Natu wrote:


Hi Ben,

On Fri, Dec 20, 2013 at 10:27 AM, Benjamin Kaduk bjkf...@gmail.com wrote:

On Thu, Dec 19, 2013 at 9:50 PM, Neel Natu n...@freebsd.org wrote:


Author: neel
Date: Fri Dec 20 05:50:22 2013
New Revision: 259641
URL: http://svnweb.freebsd.org/changeset/base/259641

Log:
  Re-arrange bits in the amd64/pmap 'pm_flags' field.

  The least significant 8 bits of 'pm_flags' are now used for the IPI
vector
  to use for nested page table TLB shootdown.

  Previously we used IPI_AST to interrupt the host cpu which is
functionally
  correct but could lead to misleading interrupt counts for AST handler.
The
  AST handler was also doing a lot more than what is required for the
nested
  page table TLB shootdown (EOI and IRET).



This represents a KBI change, does it not?  Should __FreeBSD_version be
bumped?



I was under the impression that a bump would be required only if this
change is MFCed to a stable branch. I could be wrong about this and if
so would be happy to rectify it.


I guess KBI is probably okay, that's true.  I have had a lot of headaches 
with KPI changes on -current and third-party modules, so I am a bit 
sensitive.  I'm also recovering from a laptop theft while on vacation, and 
thus a bit discombobulated.


Thanks,

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


svn commit: r259668 - head/sys/cddl/dev/fbt

2013-12-20 Thread Justin Hibbits
Author: jhibbits
Date: Fri Dec 20 23:18:14 2013
New Revision: 259668
URL: http://svnweb.freebsd.org/changeset/base/259668

Log:
  Fix a couple bugs in FBT PowerPC.  Clamp the size to a 'instruction size' not
  'byte size', and fix a typo.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/dev/fbt/fbt_powerpc.c

Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c
==
--- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013
(r259667)
+++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013
(r259668)
@@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_
return (0);
 
instr = (u_int32_t *) symval-value;
-   limit = (u_int32_t *) (symval-value + symval-size);
+   limit = (u_int32_t *) (symval-value + symval-size / 
sizeof(u_int32_t));
 
for (; instr  limit; instr++)
if (*instr == FBT_MFLR_R0)
@@ -278,7 +278,7 @@ again:
instr++;
 
for (j = 0; j  12  instr  limit; j++, instr++) {
-   if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) |
+   if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) ||
FBT_IS_JUMP(*instr))
break;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259669 - head

2013-12-20 Thread John-Mark Gurney
Author: jmg
Date: Fri Dec 20 23:34:10 2013
New Revision: 259669
URL: http://svnweb.freebsd.org/changeset/base/259669

Log:
  document how to install when src is newer than the world..  This allows
  people to build -current systems from older systems...
  
  Thanks to:  Thomas Mueller

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Fri Dec 20 23:18:14 2013(r259668)
+++ head/UPDATING   Fri Dec 20 23:34:10 2013(r259669)
@@ -1943,7 +1943,7 @@ COMMON ITEMS:
make buildkernel KERNCONF=YOUR_KERNEL_HERE
maybe newfs current's root partition
mount current's root partition on directory ${CURRENT_ROOT}
-   make installworld DESTDIR=${CURRENT_ROOT}
+   make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC
make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd
make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT}
cp /etc/fstab ${CURRENT_ROOT}/etc/fstab# if newfs'd
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259670 - head/share/man/man9

2013-12-20 Thread John-Mark Gurney
Author: jmg
Date: Fri Dec 20 23:57:05 2013
New Revision: 259670
URL: http://svnweb.freebsd.org/changeset/base/259670

Log:
  document the m_getjcl function...

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/mbuf.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileFri Dec 20 23:34:10 2013
(r259669)
+++ head/share/man/man9/MakefileFri Dec 20 23:57:05 2013
(r259670)
@@ -901,6 +901,7 @@ MLINKS+=\
mbuf.9 m_freem.9 \
mbuf.9 MGET.9 \
mbuf.9 m_get.9 \
+   mbuf.9 m_getjcl.9 \
mbuf.9 m_getcl.9 \
mbuf.9 m_getclr.9 \
mbuf.9 MGETHDR.9 \

Modified: head/share/man/man9/mbuf.9
==
--- head/share/man/man9/mbuf.9  Fri Dec 20 23:34:10 2013(r259669)
+++ head/share/man/man9/mbuf.9  Fri Dec 20 23:57:05 2013(r259670)
@@ -74,6 +74,8 @@
 .Ft struct mbuf *
 .Fn m_getm struct mbuf *orig int len int how int type
 .Ft struct mbuf *
+.Fn m_getjcl int how short type int flags int size
+.Ft struct mbuf *
 .Fn m_getcl int how short type int flags
 .Ft struct mbuf *
 .Fn m_getclr int how int type
@@ -592,6 +594,12 @@ together, as it avoids having to unlock/
 Returns
 .Dv NULL
 on failure.
+.It Fn m_getjcl how type flags size
+This is like
+.Fn m_getcl
+but it the size of the cluster allocated will be large enough for
+.Fa size
+bytes.
 .It Fn m_getclr how type
 Allocate an
 .Vt mbuf
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r259670 - head/share/man/man9

2013-12-20 Thread Glen Barber
On Fri, Dec 20, 2013 at 11:57:05PM +, John-Mark Gurney wrote:
 Author: jmg
 Date: Fri Dec 20 23:57:05 2013
 New Revision: 259670
 URL: http://svnweb.freebsd.org/changeset/base/259670
 
 Log:
   document the m_getjcl function...
 
 Modified:
   head/share/man/man9/Makefile
   head/share/man/man9/mbuf.9
 
 Modified: head/share/man/man9/Makefile
 ==
 --- head/share/man/man9/Makefile  Fri Dec 20 23:34:10 2013
 (r259669)
 +++ head/share/man/man9/Makefile  Fri Dec 20 23:57:05 2013
 (r259670)
 @@ -901,6 +901,7 @@ MLINKS+=\
   mbuf.9 m_freem.9 \
   mbuf.9 MGET.9 \
   mbuf.9 m_get.9 \
 + mbuf.9 m_getjcl.9 \
   mbuf.9 m_getcl.9 \
   mbuf.9 m_getclr.9 \
   mbuf.9 MGETHDR.9 \
 
 Modified: head/share/man/man9/mbuf.9
 ==
 --- head/share/man/man9/mbuf.9Fri Dec 20 23:34:10 2013
 (r259669)
 +++ head/share/man/man9/mbuf.9Fri Dec 20 23:57:05 2013
 (r259670)
 @@ -74,6 +74,8 @@
  .Ft struct mbuf *
  .Fn m_getm struct mbuf *orig int len int how int type
  .Ft struct mbuf *
 +.Fn m_getjcl int how short type int flags int size
 +.Ft struct mbuf *
  .Fn m_getcl int how short type int flags
  .Ft struct mbuf *
  .Fn m_getclr int how int type
 @@ -592,6 +594,12 @@ together, as it avoids having to unlock/
  Returns
  .Dv NULL
  on failure.
 +.It Fn m_getjcl how type flags size
 +This is like
 +.Fn m_getcl
 +but it the size of the cluster allocated will be large enough for
 +.Fa size
 +bytes.
  .It Fn m_getclr how type
  Allocate an
  .Vt mbuf

Please bump .Dd.

Glen



pgprukHTIhtv3.pgp
Description: PGP signature


svn commit: r259671 - head/sys/powerpc/powermac

2013-12-20 Thread Justin Hibbits
Author: jhibbits
Date: Sat Dec 21 00:07:56 2013
New Revision: 259671
URL: http://svnweb.freebsd.org/changeset/base/259671

Log:
  Add suspend/resume to DBDMA and ATA on PowerMacs.
  
  This, and several subsequent commits, are suspend/resume for various PowerMac
  drivers, which will include a change to the global suspend/resume code
  eventually.

Modified:
  head/sys/powerpc/powermac/ata_macio.c
  head/sys/powerpc/powermac/dbdma.c
  head/sys/powerpc/powermac/dbdmavar.h

Modified: head/sys/powerpc/powermac/ata_macio.c
==
--- head/sys/powerpc/powermac/ata_macio.c   Fri Dec 20 23:57:05 2013
(r259670)
+++ head/sys/powerpc/powermac/ata_macio.c   Sat Dec 21 00:07:56 2013
(r259671)
@@ -114,11 +114,15 @@ static  int  ata_macio_probe(device_t de
 static  int  ata_macio_setmode(device_t dev, int target, int mode);
 static  int  ata_macio_attach(device_t dev);
 static  int  ata_macio_begin_transaction(struct ata_request *request);
+static  int  ata_macio_suspend(device_t dev);
+static  int  ata_macio_resume(device_t dev);
 
 static device_method_t ata_macio_methods[] = {
 /* Device interface */
DEVMETHOD(device_probe, ata_macio_probe),
DEVMETHOD(device_attach,ata_macio_attach),
+   DEVMETHOD(device_suspend,   ata_macio_suspend),
+   DEVMETHOD(device_resume,ata_macio_resume),
 
/* ATA interface */
DEVMETHOD(ata_setmode,  ata_macio_setmode),
@@ -336,3 +340,34 @@ ata_macio_begin_transaction(struct ata_r
 
return ata_begin_transaction(request);
 }
+
+static int
+ata_macio_suspend(device_t dev)
+{
+   struct ata_dbdma_channel *ch = device_get_softc(dev);
+   int error;
+
+   if (!ch-sc_ch.attached)
+   return (0);
+
+   error = ata_suspend(dev);
+   dbdma_save_state(ch-dbdma);
+
+   return (error);
+}
+
+static int
+ata_macio_resume(device_t dev)
+{
+   struct ata_dbdma_channel *ch = device_get_softc(dev);
+   int error;
+
+   if (!ch-sc_ch.attached)
+   return (0);
+
+   dbdma_restore_state(ch-dbdma);
+   error = ata_resume(dev);
+
+   return (error);
+}
+

Modified: head/sys/powerpc/powermac/dbdma.c
==
--- head/sys/powerpc/powermac/dbdma.c   Fri Dec 20 23:57:05 2013
(r259670)
+++ head/sys/powerpc/powermac/dbdma.c   Sat Dec 21 00:07:56 2013
(r259671)
@@ -343,6 +343,31 @@ dbdma_sync_commands(dbdma_channel_t *cha
bus_dmamap_sync(chan-sc_dmatag, chan-sc_dmamap, op);
 }
 
+void
+dbdma_save_state(dbdma_channel_t *chan)
+{
+
+   chan-sc_saved_regs[0] = dbdma_read_reg(chan, CHAN_CMDPTR);
+   chan-sc_saved_regs[1] = dbdma_read_reg(chan, CHAN_CMDPTR_HI);
+   chan-sc_saved_regs[2] = dbdma_read_reg(chan, CHAN_INTR_SELECT);
+   chan-sc_saved_regs[3] = dbdma_read_reg(chan, CHAN_BRANCH_SELECT);
+   chan-sc_saved_regs[4] = dbdma_read_reg(chan, CHAN_WAIT_SELECT);
+
+   dbdma_stop(chan);
+}
+
+void
+dbdma_restore_state(dbdma_channel_t *chan)
+{
+
+   dbdma_wake(chan);
+   dbdma_write_reg(chan, CHAN_CMDPTR, chan-sc_saved_regs[0]);
+   dbdma_write_reg(chan, CHAN_CMDPTR_HI, chan-sc_saved_regs[1]);
+   dbdma_write_reg(chan, CHAN_INTR_SELECT, chan-sc_saved_regs[2]);
+   dbdma_write_reg(chan, CHAN_BRANCH_SELECT, chan-sc_saved_regs[3]);
+   dbdma_write_reg(chan, CHAN_WAIT_SELECT, chan-sc_saved_regs[4]);
+}
+
 static uint32_t
 dbdma_read_reg(dbdma_channel_t *chan, u_int offset)
 {

Modified: head/sys/powerpc/powermac/dbdmavar.h
==
--- head/sys/powerpc/powermac/dbdmavar.hFri Dec 20 23:57:05 2013
(r259670)
+++ head/sys/powerpc/powermac/dbdmavar.hSat Dec 21 00:07:56 2013
(r259671)
@@ -60,6 +60,7 @@ struct dbdma_channel {
 
bus_dma_tag_t   sc_dmatag;
bus_dmamap_tsc_dmamap;
+   uint32_tsc_saved_regs[5];
 };

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


Re: svn commit: r259670 - head/share/man/man9

2013-12-20 Thread John-Mark Gurney
Glen Barber wrote this message on Fri, Dec 20, 2013 at 18:59 -0500:
 On Fri, Dec 20, 2013 at 11:57:05PM +, John-Mark Gurney wrote:
  Author: jmg
  Date: Fri Dec 20 23:57:05 2013
  New Revision: 259670
  URL: http://svnweb.freebsd.org/changeset/base/259670
  
  Log:
document the m_getjcl function...
  
  Modified:
head/share/man/man9/Makefile
head/share/man/man9/mbuf.9
  
  Modified: head/share/man/man9/Makefile
  ==
  --- head/share/man/man9/MakefileFri Dec 20 23:34:10 2013
  (r259669)
  +++ head/share/man/man9/MakefileFri Dec 20 23:57:05 2013
  (r259670)
  @@ -901,6 +901,7 @@ MLINKS+=\
  mbuf.9 m_freem.9 \
  mbuf.9 MGET.9 \
  mbuf.9 m_get.9 \
  +   mbuf.9 m_getjcl.9 \
  mbuf.9 m_getcl.9 \
  mbuf.9 m_getclr.9 \
  mbuf.9 MGETHDR.9 \
  
  Modified: head/share/man/man9/mbuf.9
  ==
  --- head/share/man/man9/mbuf.9  Fri Dec 20 23:34:10 2013
  (r259669)
  +++ head/share/man/man9/mbuf.9  Fri Dec 20 23:57:05 2013
  (r259670)
  @@ -74,6 +74,8 @@
   .Ft struct mbuf *
   .Fn m_getm struct mbuf *orig int len int how int type
   .Ft struct mbuf *
  +.Fn m_getjcl int how short type int flags int size
  +.Ft struct mbuf *
   .Fn m_getcl int how short type int flags
   .Ft struct mbuf *
   .Fn m_getclr int how int type
  @@ -592,6 +594,12 @@ together, as it avoids having to unlock/
   Returns
   .Dv NULL
   on failure.
  +.It Fn m_getjcl how type flags size
  +This is like
  +.Fn m_getcl
  +but it the size of the cluster allocated will be large enough for
  +.Fa size
  +bytes.
   .It Fn m_getclr how type
   Allocate an
   .Vt mbuf
 
 Please bump .Dd.

Sorry, done in r259672.

Thanks for the reminder.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259672 - head/share/man/man9

2013-12-20 Thread John-Mark Gurney
Author: jmg
Date: Sat Dec 21 00:15:37 2013
New Revision: 259672
URL: http://svnweb.freebsd.org/changeset/base/259672

Log:
  bump Dd
  
  Reminded by:  gjb

Modified:
  head/share/man/man9/mbuf.9

Modified: head/share/man/man9/mbuf.9
==
--- head/share/man/man9/mbuf.9  Sat Dec 21 00:07:56 2013(r259671)
+++ head/share/man/man9/mbuf.9  Sat Dec 21 00:15:37 2013(r259672)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 13, 2012
+.Dd December 20, 2013
 .Dt MBUF 9
 .Os
 .\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r259670 - head/share/man/man9

2013-12-20 Thread Glen Barber
On Fri, Dec 20, 2013 at 04:15:57PM -0800, John-Mark Gurney wrote:
  Please bump .Dd.
 
 Sorry, done in r259672.
 
 Thanks for the reminder.
 

Thank you.

Glen



pgpa5kppZDKJw.pgp
Description: PGP signature


Re: svn commit: r259668 - head/sys/cddl/dev/fbt

2013-12-20 Thread Howard Su
On Saturday, December 21, 2013, Justin Hibbits wrote:

 Author: jhibbits
 Date: Fri Dec 20 23:18:14 2013
 New Revision: 259668
 URL: http://svnweb.freebsd.org/changeset/base/259668

 Log:
   Fix a couple bugs in FBT PowerPC.  Clamp the size to a 'instruction
 size' not
   'byte size', and fix a typo.

   MFC after:2 weeks

 Modified:
   head/sys/cddl/dev/fbt/fbt_powerpc.c

 Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c

 ==
 --- head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 21:31:50 2013
  (r259667)
 +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Fri Dec 20 23:18:14 2013
  (r259668)
 @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_
 return (0);

 instr = (u_int32_t *) symval-value;
 -   limit = (u_int32_t *) (symval-value + symval-size);
 +   limit = (u_int32_t *) (symval-value + symval-size /
 sizeof(u_int32_t));

 This change doesn't look right to me. symval-value is caddr_t (char*).
why add instruction size to it?

 for (; instr  limit; instr++)
 if (*instr == FBT_MFLR_R0)
 @@ -278,7 +278,7 @@ again:
 instr++;

 for (j = 0; j  12  instr  limit; j++, instr++) {
 -   if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) |
 +   if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) ||
 FBT_IS_JUMP(*instr))
 break;
 }
 ___
 svn-src-head@freebsd.org javascript:; mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-head
 To unsubscribe, send any mail to 
 svn-src-head-unsubscr...@freebsd.orgjavascript:;
 



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


svn commit: r259674 - head/sys/cddl/dev/fbt

2013-12-20 Thread Justin Hibbits
Author: jhibbits
Date: Sat Dec 21 00:37:32 2013
New Revision: 259674
URL: http://svnweb.freebsd.org/changeset/base/259674

Log:
  Fix a brain-o.  I had misread the limit as a size, but it's a pointer.
  
  Submitted by: Howard Su
  MFC after:2 weeks
  X-MFC-with:   r259668

Modified:
  head/sys/cddl/dev/fbt/fbt_powerpc.c

Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c
==
--- head/sys/cddl/dev/fbt/fbt_powerpc.c Sat Dec 21 00:20:06 2013
(r259673)
+++ head/sys/cddl/dev/fbt/fbt_powerpc.c Sat Dec 21 00:37:32 2013
(r259674)
@@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_
return (0);
 
instr = (u_int32_t *) symval-value;
-   limit = (u_int32_t *) (symval-value + symval-size / 
sizeof(u_int32_t));
+   limit = (u_int32_t *) (symval-value + symval-size);
 
for (; instr  limit; instr++)
if (*instr == FBT_MFLR_R0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259675 - in head/sys/dev/usb: . quirk

2013-12-20 Thread Don Lewis
Author: truckman
Date: Sat Dec 21 03:05:13 2013
New Revision: 259675
URL: http://svnweb.freebsd.org/changeset/base/259675

Log:
  Add quirks to make my old SanDisk Cruzer Mini 128MB happy.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Sat Dec 21 00:37:32 2013
(r259674)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Sat Dec 21 03:05:13 2013
(r259675)
@@ -332,6 +332,9 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(SANDISK, SDDR12, 0x, 0x, UQ_MSC_FORCE_WIRE_CBI,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1,
UQ_MSC_NO_GETMAXLUN),
+   USB_QUIRK(SANDISK, SDCZ2_128, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
+   UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE,
+   UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(SANDISK, SDCZ2_256, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_IGNORE_RESIDUE),
USB_QUIRK(SANDISK, SDCZ4_128, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSat Dec 21 00:37:32 2013(r259674)
+++ head/sys/dev/usb/usbdevsSat Dec 21 03:05:13 2013(r259675)
@@ -3718,6 +3718,7 @@ product SANDISK SDDR050x0005  ImageMate
 product SANDISK SDDR12 0x0100  ImageMate SDDR-12
 product SANDISK SDDR09 0x0200  ImageMate SDDR-09
 product SANDISK SDDR75 0x0810  ImageMate SDDR-75
+product SANDISK SDCZ2_128  0x7100  Cruzer Mini 128MB
 product SANDISK SDCZ2_256  0x7104  Cruzer Mini 256MB
 product SANDISK SDCZ4_128  0x7112  Cruzer Micro 128MB
 product SANDISK SDCZ4_256  0x7113  Cruzer Micro 256MB
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r259676 - in head/sys/powerpc: include ofw powermac powerpc psim

2013-12-20 Thread Justin Hibbits
Author: jhibbits
Date: Sat Dec 21 04:31:54 2013
New Revision: 259676
URL: http://svnweb.freebsd.org/changeset/base/259676

Log:
  Add suspend/resume state saving for OpenPIC on PowerMac.  It's likely this
  can be used on the others (cpcht and psim), but that has not been tested.

Modified:
  head/sys/powerpc/include/openpicreg.h
  head/sys/powerpc/include/openpicvar.h
  head/sys/powerpc/ofw/openpic_ofw.c
  head/sys/powerpc/powermac/cpcht.c
  head/sys/powerpc/powerpc/openpic.c
  head/sys/powerpc/psim/openpic_iobus.c

Modified: head/sys/powerpc/include/openpicreg.h
==
--- head/sys/powerpc/include/openpicreg.h   Sat Dec 21 03:05:13 2013
(r259675)
+++ head/sys/powerpc/include/openpicreg.h   Sat Dec 21 04:31:54 2013
(r259676)
@@ -99,6 +99,7 @@
  */
 
 /* interrupt vector/priority reg */
+#define OPENPIC_SRC_VECTOR_COUNT   64
 #ifndef OPENPIC_SRC_VECTOR
 #define OPENPIC_SRC_VECTOR(irq)(0x1 + (irq) * 0x20)
 #endif

Modified: head/sys/powerpc/include/openpicvar.h
==
--- head/sys/powerpc/include/openpicvar.h   Sat Dec 21 03:05:13 2013
(r259675)
+++ head/sys/powerpc/include/openpicvar.h   Sat Dec 21 04:31:54 2013
(r259676)
@@ -32,6 +32,14 @@
 
 #define OPENPIC_IRQMAX 256 /* h/w allows more */
 
+/* Names match the macros in openpicreg.h. */
+struct openpic_timer {
+   uint32_ttcnt;
+   uint32_ttbase;
+   uint32_ttvec;
+   uint32_ttdst;
+};
+
 struct openpic_softc {
device_tsc_dev;
struct resource *sc_memr;
@@ -45,6 +53,14 @@ struct openpic_softc {
u_int   sc_ncpu;
u_int   sc_nirq;
int sc_psim;
+
+   /* Saved states. */
+   uint32_tsc_saved_config;
+   uint32_tsc_saved_ipis[4];
+   uint32_tsc_saved_prios[4];
+   struct openpic_timersc_saved_timers[OPENPIC_TIMERS];
+   uint32_tsc_saved_vectors[OPENPIC_SRC_VECTOR_COUNT];
+   
 };
 
 extern devclass_t openpic_devclass;
@@ -66,4 +82,7 @@ void  openpic_ipi(device_t, u_int);
 void   openpic_mask(device_t, u_int);
 void   openpic_unmask(device_t, u_int);
 
+intopenpic_suspend(device_t dev);
+intopenpic_resume(device_t dev);
+
 #endif /* _POWERPC_OPENPICVAR_H_ */

Modified: head/sys/powerpc/ofw/openpic_ofw.c
==
--- head/sys/powerpc/ofw/openpic_ofw.c  Sat Dec 21 03:05:13 2013
(r259675)
+++ head/sys/powerpc/ofw/openpic_ofw.c  Sat Dec 21 04:31:54 2013
(r259676)
@@ -51,6 +51,7 @@ __FBSDID($FreeBSD$);
 
 #include sys/rman.h
 
+#include machine/openpicreg.h
 #include machine/openpicvar.h
 
 #include pic_if.h
@@ -68,6 +69,8 @@ static device_method_t  openpic_ofw_meth
/* Device interface */
DEVMETHOD(device_probe, openpic_ofw_probe),
DEVMETHOD(device_attach,openpic_ofw_attach),
+   DEVMETHOD(device_suspend,   openpic_suspend),
+   DEVMETHOD(device_resume,openpic_resume),
 
/* PIC interface */
DEVMETHOD(pic_bind, openpic_bind),

Modified: head/sys/powerpc/powermac/cpcht.c
==
--- head/sys/powerpc/powermac/cpcht.c   Sat Dec 21 03:05:13 2013
(r259675)
+++ head/sys/powerpc/powermac/cpcht.c   Sat Dec 21 04:31:54 2013
(r259676)
@@ -44,6 +44,7 @@ __FBSDID($FreeBSD$);
 #include machine/bus.h
 #include machine/intr_machdep.h
 #include machine/md_var.h
+#include machine/openpicreg.h
 #include machine/openpicvar.h
 #include machine/pio.h
 #include machine/resource.h

Modified: head/sys/powerpc/powerpc/openpic.c
==
--- head/sys/powerpc/powerpc/openpic.c  Sat Dec 21 03:05:13 2013
(r259675)
+++ head/sys/powerpc/powerpc/openpic.c  Sat Dec 21 04:31:54 2013
(r259676)
@@ -380,3 +380,64 @@ openpic_unmask(device_t dev, u_int irq)
openpic_write(sc, OPENPIC_IPI_VECTOR(0), x);
}
 }
+
+int
+openpic_suspend(device_t dev)
+{
+   struct openpic_softc *sc;
+   int i;
+
+   sc = device_get_softc(dev);
+
+   sc-sc_saved_config = bus_read_4(sc-sc_memr, OPENPIC_CONFIG);
+   for (i = 0; i  4; i++) {
+   sc-sc_saved_ipis[i] = bus_read_4(sc-sc_memr, 
OPENPIC_IPI_VECTOR(i));
+   }
+
+   for (i = 0; i  4; i++) {
+   sc-sc_saved_prios[i] = bus_read_4(sc-sc_memr, 
OPENPIC_PCPU_TPR(i));
+   }
+
+   for (i = 0; i  OPENPIC_TIMERS; i++) {
+   sc-sc_saved_timers[i].tcnt = bus_read_4(sc-sc_memr, 
OPENPIC_TCNT(i));
+   sc-sc_saved_timers[i].tbase = bus_read_4(sc-sc_memr, 
OPENPIC_TBASE(i));
+   

Re: svn commit: r259659 - in head/sys: nfs rpc

2013-12-20 Thread Steve Kargl
On Fri, Dec 20, 2013 at 05:39:07PM +, Alexander Motin wrote:
 Author: mav
 Date: Fri Dec 20 17:39:07 2013
 New Revision: 259659
 URL: http://svnweb.freebsd.org/changeset/base/259659
 
 Log:
   Remove several linear list traversals per request from RPC server code.
   
 Do not insert active ports into pool-sp_active list if they are success-
   fully assigned to some thread.  This makes that list include only ports that
   really require attention, and so traversal can be reduced to simple taking
   the first one.
   
 Remove idle thread from pool-sp_idlethreads list when assigning some
   work (port of requests) to it.  That again makes possible to replace list
   traversals with simple taking the first element.
 
 Modified:
   head/sys/nfs/nfs_fha.c
   head/sys/rpc/svc.c
   head/sys/rpc/svc.h

FYI.

cc  -c -O -pipe -march=core2 -std=c99 -g -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  
-Wmissing-include-dirs -fdiagnostics-show-option  
-Wno-error-tautological-compare -Wno-error-empty-body  
-Wno-error-parentheses-equality  -nostdinc  -I. -I/usr/src/sys 
-I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt -D_KERNEL 
-DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -mno-aes -mno-avx -mno-mmx 
-mno-sse -msoft-float -ffreestanding -fstack-protector -Werror  
/usr/src/sys/rpc/svc.c
/usr/src/sys/rpc/svc.c:296:20: error: no member named 'xp_mlock' in
  'struct __rpc_svcxprt'; did you mean 'xp_lock'?
mtx_assert(xprt-xp_mlock, MA_OWNED);
  ^
/usr/src/sys/sys/mutex.h:379:15: note: expanded from macro 'mtx_assert'
mtx_assert_((m), (what), __FILE__, __LINE__)
 ^
/usr/src/sys/sys/mutex.h:359:15: note: expanded from macro 'mtx_assert_'
_mtx_assert((m), (what), (file), (line))
 ^
/usr/src/sys/sys/mutex.h:158:17: note: expanded from macro '_mtx_assert'
__mtx_assert((m)-mtx_lock, w, f, l)
   ^
/usr/src/sys/rpc/svc.h:149:12: note: 'xp_lock' declared here
struct sx   xp_lock;
^
/usr/src/sys/rpc/svc.c:296:2: error: no member named 'mtx_lock' in 'struct sx';
  did you mean 'sx_lock'?
mtx_assert(xprt-xp_mlock, MA_OWNED);
^
/usr/src/sys/sys/mutex.h:379:2: note: expanded from macro 'mtx_assert'
mtx_assert_((m), (what), __FILE__, __LINE__)
^
/usr/src/sys/sys/mutex.h:359:2: note: expanded from macro 'mtx_assert_'
_mtx_assert((m), (what), (file), (line))
^
/usr/src/sys/sys/mutex.h:158:21: note: expanded from macro '_mtx_assert'
__mtx_assert((m)-mtx_lock, w, f, l)
   ^
/usr/src/sys/sys/_sx.h:39:21: note: 'sx_lock' declared here
volatile uintptr_t  sx_lock;


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