svn commit: r254839 - in projects/random_number_generator: bin/sh contrib/llvm/include/llvm/MC contrib/llvm/lib/MC contrib/llvm/lib/Target/X86/InstPrinter contrib/llvm/tools/lldb/source/Expression ...

Mark Murray markm at FreeBSD.org
Sun Aug 25 10:09:04 UTC 2013


Author: markm
Date: Sun Aug 25 10:08:58 2013
New Revision: 254839
URL: http://svnweb.freebsd.org/changeset/base/254839

Log:
  MFC

Added:
  projects/random_number_generator/sys/dev/drm2/drm_buffer.c
     - copied unchanged from r254838, head/sys/dev/drm2/drm_buffer.c
  projects/random_number_generator/sys/dev/drm2/drm_buffer.h
     - copied unchanged from r254838, head/sys/dev/drm2/drm_buffer.h
  projects/random_number_generator/sys/dev/drm2/drm_core.h
     - copied unchanged from r254838, head/sys/dev/drm2/drm_core.h
  projects/random_number_generator/sys/dev/drm2/drm_dp_helper.c
     - copied unchanged from r254838, head/sys/dev/drm2/drm_dp_helper.c
  projects/random_number_generator/tools/regression/bin/sh/expansion/arith13.0
     - copied unchanged from r254838, head/tools/regression/bin/sh/expansion/arith13.0
Modified:
  projects/random_number_generator/bin/sh/arith_yylex.c
  projects/random_number_generator/contrib/llvm/include/llvm/MC/MCInstPrinter.h
  projects/random_number_generator/contrib/llvm/lib/MC/MCInstPrinter.cpp
  projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
  projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
  projects/random_number_generator/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp
  projects/random_number_generator/etc/defaults/periodic.conf
  projects/random_number_generator/share/man/man9/EVENTHANDLER.9
  projects/random_number_generator/share/man/man9/pfil.9
  projects/random_number_generator/share/man/man9/timeout.9
  projects/random_number_generator/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_load.c
  projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_unload.c
  projects/random_number_generator/sys/cddl/dev/sdt/sdt.c
  projects/random_number_generator/sys/dev/cas/if_cas.c
  projects/random_number_generator/sys/dev/cxgb/cxgb_sge.c
  projects/random_number_generator/sys/dev/drm2/drmP.h
  projects/random_number_generator/sys/dev/drm2/drm_crtc.c
  projects/random_number_generator/sys/dev/drm2/drm_crtc.h
  projects/random_number_generator/sys/dev/drm2/drm_crtc_helper.h
  projects/random_number_generator/sys/dev/drm2/drm_dp_helper.h
  projects/random_number_generator/sys/dev/drm2/drm_dp_iic_helper.c
  projects/random_number_generator/sys/dev/drm2/drm_drv.c
  projects/random_number_generator/sys/dev/drm2/drm_edid.c
  projects/random_number_generator/sys/dev/drm2/drm_gem.c
  projects/random_number_generator/sys/dev/drm2/drm_gem_names.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_crt.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_display.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_dp.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_drv.h
  projects/random_number_generator/sys/dev/drm2/i915/intel_hdmi.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_lvds.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_panel.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_sdvo.c
  projects/random_number_generator/sys/dev/drm2/i915/intel_tv.c
  projects/random_number_generator/sys/dev/e1000/if_igb.c
  projects/random_number_generator/sys/dev/fdc/fdc.c
  projects/random_number_generator/sys/dev/hatm/if_hatm_intr.c
  projects/random_number_generator/sys/dev/hwpmc/hwpmc_core.c
  projects/random_number_generator/sys/dev/hwpmc/hwpmc_mod.c
  projects/random_number_generator/sys/dev/hwpmc/pmc_events.h
  projects/random_number_generator/sys/dev/iscsi_initiator/isc_soc.c
  projects/random_number_generator/sys/dev/ixgbe/ixgbe.c
  projects/random_number_generator/sys/dev/ixgbe/ixv.c
  projects/random_number_generator/sys/dev/jme/if_jme.c
  projects/random_number_generator/sys/dev/lge/if_lge.c
  projects/random_number_generator/sys/dev/mwl/if_mwl.c
  projects/random_number_generator/sys/dev/nfe/if_nfe.c
  projects/random_number_generator/sys/dev/patm/if_patm.c
  projects/random_number_generator/sys/dev/patm/if_patm_tx.c
  projects/random_number_generator/sys/dev/qlxgb/qla_hw.c
  projects/random_number_generator/sys/dev/sfxge/sfxge_rx.c
  projects/random_number_generator/sys/dev/usb/controller/dwc_otg.c
  projects/random_number_generator/sys/dev/usb/controller/musb_otg.c
  projects/random_number_generator/sys/kern/kern_linker.c
  projects/random_number_generator/sys/kern/kern_mbuf.c
  projects/random_number_generator/sys/kern/kern_physio.c
  projects/random_number_generator/sys/kern/link_elf.c
  projects/random_number_generator/sys/kern/subr_mbpool.c
  projects/random_number_generator/sys/kern/subr_taskqueue.c
  projects/random_number_generator/sys/kern/uipc_cow.c
  projects/random_number_generator/sys/kern/uipc_mbuf.c
  projects/random_number_generator/sys/kern/uipc_syscalls.c
  projects/random_number_generator/sys/modules/drm2/drm2/Makefile
  projects/random_number_generator/sys/modules/vmware/vmxnet3/Makefile
  projects/random_number_generator/sys/net/if.h
  projects/random_number_generator/sys/net/if_fddisubr.c
  projects/random_number_generator/sys/net/if_iso88025subr.c
  projects/random_number_generator/sys/net/if_llatbl.h
  projects/random_number_generator/sys/netinet/igmp.c
  projects/random_number_generator/sys/netinet/ip_input.c
  projects/random_number_generator/sys/netinet/sctp_input.c
  projects/random_number_generator/sys/netinet6/ip6_output.c
  projects/random_number_generator/sys/netinet6/mld6.c
  projects/random_number_generator/sys/netinet6/sctp6_usrreq.c
  projects/random_number_generator/sys/ofed/drivers/net/mlx4/en_frag.c
  projects/random_number_generator/sys/sys/eventhandler.h
  projects/random_number_generator/sys/sys/mbpool.h
  projects/random_number_generator/sys/sys/mbuf.h
  projects/random_number_generator/sys/sys/pmckern.h
  projects/random_number_generator/sys/sys/sf_buf.h
  projects/random_number_generator/usr.sbin/periodic/periodic.sh
Directory Properties:
  projects/random_number_generator/   (props changed)
  projects/random_number_generator/contrib/llvm/   (props changed)
  projects/random_number_generator/sys/   (props changed)
  projects/random_number_generator/sys/cddl/contrib/opensolaris/   (props changed)

Modified: projects/random_number_generator/bin/sh/arith_yylex.c
==============================================================================
--- projects/random_number_generator/bin/sh/arith_yylex.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/bin/sh/arith_yylex.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -218,9 +218,13 @@ checkeqcur:
 			value += ARITH_REM - '%';
 			goto checkeq;
 		case '+':
+			if (buf[1] == '+')
+				return ARITH_BAD;
 			value += ARITH_ADD - '+';
 			goto checkeq;
 		case '-':
+			if (buf[1] == '-')
+				return ARITH_BAD;
 			value += ARITH_SUB - '-';
 			goto checkeq;
 		case '~':

Modified: projects/random_number_generator/contrib/llvm/include/llvm/MC/MCInstPrinter.h
==============================================================================
--- projects/random_number_generator/contrib/llvm/include/llvm/MC/MCInstPrinter.h	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/contrib/llvm/include/llvm/MC/MCInstPrinter.h	Sun Aug 25 10:08:58 2013	(r254839)
@@ -21,6 +21,13 @@ class MCInstrInfo;
 class MCRegisterInfo;
 class StringRef;
 
+namespace HexStyle {
+    enum Style {
+        C,          ///< 0xff
+        Asm         ///< 0ffh
+    };
+}
+
 /// MCInstPrinter - This is an instance of a target assembly language printer
 /// that converts an MCInst to valid target assembly syntax.
 class MCInstPrinter {
@@ -42,13 +49,16 @@ protected:
   /// True if we are printing immediates as hex.
   bool PrintImmHex;
 
+  /// Which style to use for printing hexadecimal values.
+  HexStyle::Style PrintHexStyle;
+
   /// Utility function for printing annotations.
   void printAnnotation(raw_ostream &OS, StringRef Annot);
 public:
   MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii,
                 const MCRegisterInfo &mri)
     : CommentStream(0), MAI(mai), MII(mii), MRI(mri), AvailableFeatures(0),
-      UseMarkup(0), PrintImmHex(0) {}
+      UseMarkup(0), PrintImmHex(0), PrintHexStyle(HexStyle::C) {}
 
   virtual ~MCInstPrinter();
 
@@ -80,8 +90,16 @@ public:
   bool getPrintImmHex() const { return PrintImmHex; }
   void setPrintImmHex(bool Value) { PrintImmHex = Value; }
 
+  HexStyle::Style getPrintHexStyleHex() const { return PrintHexStyle; }
+  void setPrintImmHex(HexStyle::Style Value) { PrintHexStyle = Value; }
+
   /// Utility function to print immediates in decimal or hex.
-  format_object1<int64_t> formatImm(const int64_t Value) const;
+  format_object1<int64_t> formatImm(const int64_t Value) const { return PrintImmHex ? formatHex(Value) : formatDec(Value); }
+
+  /// Utility functions to print decimal/hexadecimal values.
+  format_object1<int64_t> formatDec(const int64_t Value) const;
+  format_object1<int64_t> formatHex(const int64_t Value) const;
+  format_object1<uint64_t> formatHex(const uint64_t Value) const;
 };
 
 } // namespace llvm

Modified: projects/random_number_generator/contrib/llvm/lib/MC/MCInstPrinter.cpp
==============================================================================
--- projects/random_number_generator/contrib/llvm/lib/MC/MCInstPrinter.cpp	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/contrib/llvm/lib/MC/MCInstPrinter.cpp	Sun Aug 25 10:08:58 2013	(r254839)
@@ -52,10 +52,53 @@ StringRef MCInstPrinter::markup(StringRe
     return b;
 }
 
-/// Utility function to print immediates in decimal or hex.
-format_object1<int64_t> MCInstPrinter::formatImm(const int64_t Value) const {
-  if (getPrintImmHex())
-    return format("0x%" PRIx64, Value);
-  else
-    return format("%" PRId64, Value);
+// For asm-style hex (e.g. 0ffh) the first digit always has to be a number.
+static bool needsLeadingZero(uint64_t Value)
+{
+  while(Value)
+  {
+    uint64_t digit = (Value >> 60) & 0xf;
+    if (digit != 0)
+      return (digit >= 0xa);
+    Value <<= 4;
+  }
+  return false;
+}
+
+format_object1<int64_t> MCInstPrinter::formatDec(const int64_t Value) const {
+  return format("%" PRId64, Value);
+}
+
+format_object1<int64_t> MCInstPrinter::formatHex(const int64_t Value) const {
+  switch(PrintHexStyle) {
+  case HexStyle::C:
+    if (Value < 0)
+      return format("-0x%" PRIx64, -Value);
+    else
+      return format("0x%" PRIx64, Value);
+  case HexStyle::Asm:
+    if (Value < 0) {
+      if (needsLeadingZero((uint64_t)(-Value)))
+        return format("-0%" PRIx64 "h", -Value);
+      else
+        return format("-%" PRIx64 "h", -Value);
+    } else {
+      if (needsLeadingZero((uint64_t)(Value)))
+        return format("0%" PRIx64 "h", Value);
+      else
+        return format("%" PRIx64 "h", Value);
+    }
+  }
+}
+
+format_object1<uint64_t> MCInstPrinter::formatHex(const uint64_t Value) const {
+  switch(PrintHexStyle) {
+  case HexStyle::C:
+     return format("0x%" PRIx64, Value);
+  case HexStyle::Asm:
+    if (needsLeadingZero(Value))
+      return format("0%" PRIx64 "h", Value);
+    else
+      return format("%" PRIx64 "h", Value);
+  }
 }

Modified: projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
==============================================================================
--- projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp	Sun Aug 25 10:08:58 2013	(r254839)
@@ -139,8 +139,7 @@ void X86ATTInstPrinter::printPCRelImm(co
     const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr());
     int64_t Address;
     if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) {
-      O << "0x";
-      O.write_hex(Address);
+      O << formatHex((uint64_t)Address);
     }
     else {
       // Otherwise, just print the expression.

Modified: projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
==============================================================================
--- projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp	Sun Aug 25 10:08:58 2013	(r254839)
@@ -119,7 +119,7 @@ void X86IntelInstPrinter::printPCRelImm(
                                         raw_ostream &O) {
   const MCOperand &Op = MI->getOperand(OpNo);
   if (Op.isImm())
-    O << Op.getImm();
+    O << formatImm(Op.getImm());
   else {
     assert(Op.isExpr() && "unknown pcrel immediate operand");
     // If a symbolic branch target was added as a constant expression then print
@@ -127,8 +127,7 @@ void X86IntelInstPrinter::printPCRelImm(
     const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr());
     int64_t Address;
     if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) {
-      O << "0x";
-      O.write_hex(Address);
+      O << formatHex((uint64_t)Address);
     }
     else {
       // Otherwise, just print the expression.
@@ -148,7 +147,7 @@ void X86IntelInstPrinter::printOperand(c
   if (Op.isReg()) {
     PrintRegName(O, getRegisterName(Op.getReg()));
   } else if (Op.isImm()) {
-    O << Op.getImm();
+    O << formatImm((int64_t)Op.getImm());
   } else {
     assert(Op.isExpr() && "unknown operand kind in printOperand");
     O << *Op.getExpr();
@@ -200,7 +199,7 @@ void X86IntelInstPrinter::printMemRefere
           DispVal = -DispVal;
         }
       }
-      O << DispVal;
+      O << formatImm(DispVal);
     }
   }
   

Modified: projects/random_number_generator/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp
==============================================================================
--- projects/random_number_generator/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp	Sun Aug 25 10:08:58 2013	(r254839)
@@ -356,20 +356,6 @@ IRForTarget::ResolveFunctionPointers(llv
         
         if (value_ptr)
             *value_ptr = value;
-
-        // If we are replacing a function with the nobuiltin attribute, it may
-        // be called with the builtin attribute on call sites. Remove any such
-        // attributes since it's illegal to have a builtin call to something
-        // other than a nobuiltin function.
-        if (fun->hasFnAttribute(Attribute::NoBuiltin)) {
-            Attribute builtin = Attribute::get(fun->getContext(), Attribute::Builtin);
-
-            for (auto u = fun->use_begin(), e = fun->use_end(); u != e; ++u) {
-                if (auto call = dyn_cast<CallInst>(*u)) {
-                    call->removeAttribute(AttributeSet::FunctionIndex, builtin);
-                }
-            }
-        }
         
         fun->replaceAllUsesWith(value);
     }

Modified: projects/random_number_generator/etc/defaults/periodic.conf
==============================================================================
--- projects/random_number_generator/etc/defaults/periodic.conf	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/etc/defaults/periodic.conf	Sun Aug 25 10:08:58 2013	(r254839)
@@ -166,7 +166,6 @@ daily_local="/etc/daily.local"				# Loca
 # 450.status-security above.
 daily_status_security_inline="NO"			# Run inline ?
 daily_status_security_output="root"			# user or /file
-daily_status_security_noamd="NO"			# Don't check amd mounts
 daily_status_security_logdir="/var/log"			# Directory for logs
 daily_status_security_diff_flags="-b -u"		# flags for diff output
 
@@ -180,6 +179,7 @@ daily_status_security_neggrpperm_enable=
 daily_status_security_chkmounts_enable="YES"
 #daily_status_security_chkmounts_ignore="^amd:"		# Don't check matching
 							# FS types
+daily_status_security_noamd="NO"			# Don't check amd mounts
 
 # 300.chkuid0
 daily_status_security_chkuid0_enable="YES"

Modified: projects/random_number_generator/share/man/man9/EVENTHANDLER.9
==============================================================================
--- projects/random_number_generator/share/man/man9/EVENTHANDLER.9	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/share/man/man9/EVENTHANDLER.9	Sun Aug 25 10:08:58 2013	(r254839)
@@ -202,6 +202,8 @@ Callbacks invoked when a BPF listener at
 .It Vt kld_load
 Callbacks invoked after a linker file has been loaded.
 .It Vt kld_unload
+Callbacks invoked after a linker file has been successfully unloaded.
+.It Vt kld_unload_try
 Callbacks invoked before a linker file is about to be unloaded.
 These callbacks may be used to return an error and prevent the unload from
 proceeding.

Modified: projects/random_number_generator/share/man/man9/pfil.9
==============================================================================
--- projects/random_number_generator/share/man/man9/pfil.9	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/share/man/man9/pfil.9	Sun Aug 25 10:08:58 2013	(r254839)
@@ -71,6 +71,7 @@ typedef int (*pfil_func_t)(void *arg, st
 .Fn pfil_wlock "struct pfil_head *"
 .Ft void
 .Fn pfil_wunlock "struct pfil_head *"
+.Ed
 .Sh DESCRIPTION
 The
 .Nm
@@ -241,8 +242,7 @@ Fine-grained locking was added in
 lock export was added in
 .Fx 10.0 .
 .Sh BUGS
-The
-.Fn When a
+When a
 .Vt pfil_head
 is being modified, no traffic is diverted
 (to avoid deadlock).

Modified: projects/random_number_generator/share/man/man9/timeout.9
==============================================================================
--- projects/random_number_generator/share/man/man9/timeout.9	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/share/man/man9/timeout.9	Sun Aug 25 10:08:58 2013	(r254839)
@@ -256,7 +256,7 @@ after the callout function returns.
 .Pp
 The
 .Fn callout_init_rw
-and the 
+and the
 .Fn callout_init_rm
 fuctions serve the need of using rwlocks and rmlocks in conjunction
 with callouts.

Modified: projects/random_number_generator/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- projects/random_number_generator/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -242,7 +242,7 @@ int		dtrace_in_probe;	/* non-zero if exe
 uintptr_t	dtrace_in_probe_addr;	/* Address of invop when already in probe */
 #endif
 static eventhandler_tag	dtrace_kld_load_tag;
-static eventhandler_tag	dtrace_kld_unload_tag;
+static eventhandler_tag	dtrace_kld_unload_try_tag;
 #endif
 
 /*
@@ -15351,7 +15351,7 @@ dtrace_kld_load(void *arg __unused, link
 }
 
 static void
-dtrace_kld_unload(void *arg __unused, linker_file_t lf, int *error)
+dtrace_kld_unload_try(void *arg __unused, linker_file_t lf, int *error)
 {
 
 	if (*error != 0)

Modified: projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_load.c
==============================================================================
--- projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_load.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_load.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -59,8 +59,8 @@ dtrace_load(void *dummy)
 	/* Register callbacks for linker file load and unload events. */
 	dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load,
 	    dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY);
-	dtrace_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload,
-	    dtrace_kld_unload, NULL, EVENTHANDLER_PRI_ANY);
+	dtrace_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try,
+	    dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY);
 
 	/*
 	 * Initialise the mutexes without 'witness' because the dtrace

Modified: projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_unload.c
==============================================================================
--- projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_unload.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/cddl/dev/dtrace/dtrace_unload.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -68,7 +68,7 @@ dtrace_unload()
 
 	dtrace_provider = NULL;
 	EVENTHANDLER_DEREGISTER(kld_load, dtrace_kld_load_tag);
-	EVENTHANDLER_DEREGISTER(kld_unload, dtrace_kld_unload_tag);
+	EVENTHANDLER_DEREGISTER(kld_unload_try, dtrace_kld_unload_try_tag);
 
 	if ((state = dtrace_anon_grab()) != NULL) {
 		/*

Modified: projects/random_number_generator/sys/cddl/dev/sdt/sdt.c
==============================================================================
--- projects/random_number_generator/sys/cddl/dev/sdt/sdt.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/cddl/dev/sdt/sdt.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -59,7 +59,7 @@ static int	sdt_unload(void *);
 static void	sdt_create_provider(struct sdt_provider *);
 static void	sdt_create_probe(struct sdt_probe *);
 static void	sdt_kld_load(void *, struct linker_file *);
-static void	sdt_kld_unload(void *, struct linker_file *, int *);
+static void	sdt_kld_unload_try(void *, struct linker_file *, int *);
 
 static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers");
 
@@ -95,7 +95,7 @@ static struct cdev	*sdt_cdev;
 static TAILQ_HEAD(, sdt_provider) sdt_prov_list;
 
 eventhandler_tag	sdt_kld_load_tag;
-eventhandler_tag	sdt_kld_unload_tag;
+eventhandler_tag	sdt_kld_unload_try_tag;
 
 static void
 sdt_create_provider(struct sdt_provider *prov)
@@ -264,7 +264,7 @@ sdt_kld_load(void *arg __unused, struct 
 }
 
 static void
-sdt_kld_unload(void *arg __unused, struct linker_file *lf, int *error __unused)
+sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused)
 {
 	struct sdt_provider *prov, **curr, **begin, **end, *tmp;
 
@@ -319,8 +319,8 @@ sdt_load(void *arg __unused)
 
 	sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL,
 	    EVENTHANDLER_PRI_ANY);
-	sdt_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, sdt_kld_unload,
-	    NULL, EVENTHANDLER_PRI_ANY);
+	sdt_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try,
+	    sdt_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY);
 
 	/* Pick up probes from the kernel and already-loaded linker files. */
 	linker_file_foreach(sdt_linker_file_cb, NULL);
@@ -332,7 +332,7 @@ sdt_unload(void *arg __unused)
 	struct sdt_provider *prov, *tmp;
 
 	EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag);
-	EVENTHANDLER_DEREGISTER(kld_unload, sdt_kld_unload_tag);
+	EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag);
 
 	sdt_probe_func = sdt_probe_stub;
 

Modified: projects/random_number_generator/sys/dev/cas/if_cas.c
==============================================================================
--- projects/random_number_generator/sys/dev/cas/if_cas.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/dev/cas/if_cas.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -132,7 +132,7 @@ static void	cas_detach(struct cas_softc 
 static int	cas_disable_rx(struct cas_softc *sc);
 static int	cas_disable_tx(struct cas_softc *sc);
 static void	cas_eint(struct cas_softc *sc, u_int status);
-static void	cas_free(void *arg1, void* arg2);
+static void	cas_free(struct mbuf *m, void *arg1, void* arg2);
 static void	cas_init(void *xsc);
 static void	cas_init_locked(struct cas_softc *sc);
 static void	cas_init_regs(struct cas_softc *sc);
@@ -1888,7 +1888,7 @@ cas_rint(struct cas_softc *sc)
 }
 
 static void
-cas_free(void *arg1, void *arg2)
+cas_free(struct mbuf *m, void *arg1, void *arg2)
 {
 	struct cas_rxdsoft *rxds;
 	struct cas_softc *sc;

Modified: projects/random_number_generator/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- projects/random_number_generator/sys/dev/cxgb/cxgb_sge.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/dev/cxgb/cxgb_sge.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -1470,9 +1470,9 @@ t3_encap(struct sge_qset *qs, struct mbu
 		hdr->len = htonl(mlen | 0x80000000);
 
 		if (__predict_false(mlen < TCPPKTHDRSIZE)) {
-			printf("mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%#x,flags=%#x",
+			printf("mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%b,flags=%#x",
 			    m0, mlen, m0->m_pkthdr.tso_segsz,
-			    m0->m_pkthdr.csum_flags, m0->m_flags);
+			    (int)m0->m_pkthdr.csum_flags, CSUM_BITS, m0->m_flags);
 			panic("tx tso packet too small");
 		}
 
@@ -2634,7 +2634,6 @@ t3_rx_eth(struct adapter *adap, struct m
 	} 
 
 	m->m_pkthdr.rcvif = ifp;
-	m->m_pkthdr.header = mtod(m, uint8_t *) + sizeof(*cpl) + ethpad;
 	/*
 	 * adjust after conversion to mbuf chain
 	 */

Modified: projects/random_number_generator/sys/dev/drm2/drmP.h
==============================================================================
--- projects/random_number_generator/sys/dev/drm2/drmP.h	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/dev/drm2/drmP.h	Sun Aug 25 10:08:58 2013	(r254839)
@@ -317,6 +317,9 @@ typedef int8_t s8;
 
 #define DRM_HZ			hz
 #define DRM_UDELAY(udelay)	DELAY(udelay)
+#define DRM_MDELAY(msecs)	do { int loops = (msecs);		\
+	                          while (loops--) DELAY(1000);		\
+				} while (0)
 #define DRM_TIME_SLICE		(hz/20)  /* Time slice for GLXContexts	  */
 
 #define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do {	\
@@ -695,6 +698,7 @@ struct drm_gem_object {
 
 struct drm_driver_info {
 	int	(*load)(struct drm_device *, unsigned long flags);
+	int	(*use_msi)(struct drm_device *, unsigned long flags);
 	int	(*firstopen)(struct drm_device *);
 	int	(*open)(struct drm_device *, struct drm_file *);
 	void	(*preclose)(struct drm_device *, struct drm_file *file_priv);
@@ -733,6 +737,8 @@ struct drm_driver_info {
 
 	int	(*gem_init_object)(struct drm_gem_object *obj);
 	void	(*gem_free_object)(struct drm_gem_object *obj);
+	int	(*gem_open_object)(struct drm_gem_object *, struct drm_file *);
+	void	(*gem_close_object)(struct drm_gem_object *, struct drm_file *);
 
 	struct cdev_pager_ops *gem_pager_ops;
 
@@ -826,8 +832,10 @@ struct drm_device {
 	struct drm_driver_info *driver;
 	drm_pci_id_list_t *id_entry;	/* PCI ID, name, and chipset private */
 
-	u_int16_t pci_device;		/* PCI device id */
-	u_int16_t pci_vendor;		/* PCI vendor id */
+	uint16_t pci_device;		/* PCI device id */
+	uint16_t pci_vendor;		/* PCI vendor id */
+	uint16_t pci_subdevice;		/* PCI subsystem device id */
+	uint16_t pci_subvendor;		/* PCI subsystem vendor id */
 
 	char		  *unique;	/* Unique identifier: e.g., busid  */
 	int		  unique_len;	/* Length of unique field	   */
@@ -907,7 +915,7 @@ struct drm_device {
 	struct drm_minor *control;		/**< Control node for card */
 	struct drm_minor *primary;		/**< render type primary screen head */
 
-	void		  *drm_ttm_bo;
+	void		  *drm_ttm_bdev;
 	struct unrhdr	  *drw_unrhdr;
 	/* RB tree of drawable infos */
 	RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head;
@@ -1408,5 +1416,10 @@ do {									\
 #define	KTR_DRM		KTR_DEV
 #define	KTR_DRM_REG	KTR_SPARE3
 
+/* Error codes conversion from Linux to FreeBSD. */
+/* XXXKIB what is the right code for EREMOTEIO on FreeBSD? */
+#define	EREMOTEIO	ENXIO
+#define	ERESTARTSYS	ERESTART
+
 #endif /* __KERNEL__ */
 #endif /* _DRM_P_H_ */

Copied: projects/random_number_generator/sys/dev/drm2/drm_buffer.c (from r254838, head/sys/dev/drm2/drm_buffer.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/sys/dev/drm2/drm_buffer.c	Sun Aug 25 10:08:58 2013	(r254839, copy of r254838, head/sys/dev/drm2/drm_buffer.c)
@@ -0,0 +1,183 @@
+/**************************************************************************
+ *
+ * Copyright 2010 Pauli Nieminen.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ **************************************************************************/
+/*
+ * Multipart buffer for coping data which is larger than the page size.
+ *
+ * Authors:
+ * Pauli Nieminen <suokkos-at-gmail-dot-com>
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <dev/drm2/drm_buffer.h>
+
+/**
+ * Allocate the drm buffer object.
+ *
+ *   buf: Pointer to a pointer where the object is stored.
+ *   size: The number of bytes to allocate.
+ */
+int drm_buffer_alloc(struct drm_buffer **buf, int size)
+{
+	int nr_pages = size / PAGE_SIZE + 1;
+	int idx;
+
+	/* Allocating pointer table to end of structure makes drm_buffer
+	 * variable sized */
+	*buf = malloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *),
+			DRM_MEM_DRIVER, M_ZERO | M_WAITOK);
+
+	if (*buf == NULL) {
+		DRM_ERROR("Failed to allocate drm buffer object to hold"
+				" %d bytes in %d pages.\n",
+				size, nr_pages);
+		return -ENOMEM;
+	}
+
+	(*buf)->size = size;
+
+	for (idx = 0; idx < nr_pages; ++idx) {
+
+		(*buf)->data[idx] =
+			malloc(min(PAGE_SIZE, size - idx * PAGE_SIZE),
+				DRM_MEM_DRIVER, M_WAITOK);
+
+
+		if ((*buf)->data[idx] == NULL) {
+			DRM_ERROR("Failed to allocate %dth page for drm"
+					" buffer with %d bytes and %d pages.\n",
+					idx + 1, size, nr_pages);
+			goto error_out;
+		}
+
+	}
+
+	return 0;
+
+error_out:
+
+	/* Only last element can be null pointer so check for it first. */
+	if ((*buf)->data[idx])
+		free((*buf)->data[idx], DRM_MEM_DRIVER);
+
+	for (--idx; idx >= 0; --idx)
+		free((*buf)->data[idx], DRM_MEM_DRIVER);
+
+	free(*buf, DRM_MEM_DRIVER);
+	return -ENOMEM;
+}
+
+/**
+ * Copy the user data to the begin of the buffer and reset the processing
+ * iterator.
+ *
+ *   user_data: A pointer the data that is copied to the buffer.
+ *   size: The Number of bytes to copy.
+ */
+int drm_buffer_copy_from_user(struct drm_buffer *buf,
+			      void __user *user_data, int size)
+{
+	int nr_pages = size / PAGE_SIZE + 1;
+	int idx;
+
+	if (size > buf->size) {
+		DRM_ERROR("Requesting to copy %d bytes to a drm buffer with"
+				" %d bytes space\n",
+				size, buf->size);
+		return -EFAULT;
+	}
+
+	for (idx = 0; idx < nr_pages; ++idx) {
+
+		if (DRM_COPY_FROM_USER(buf->data[idx],
+			(char *)user_data + idx * PAGE_SIZE,
+			min(PAGE_SIZE, size - idx * PAGE_SIZE))) {
+			DRM_ERROR("Failed to copy user data (%p) to drm buffer"
+					" (%p) %dth page.\n",
+					user_data, buf, idx);
+			return -EFAULT;
+
+		}
+	}
+	buf->iterator = 0;
+	return 0;
+}
+
+/**
+ * Free the drm buffer object
+ */
+void drm_buffer_free(struct drm_buffer *buf)
+{
+
+	if (buf != NULL) {
+
+		int nr_pages = buf->size / PAGE_SIZE + 1;
+		int idx;
+		for (idx = 0; idx < nr_pages; ++idx)
+			free(buf->data[idx], DRM_MEM_DRIVER);
+
+		free(buf, DRM_MEM_DRIVER);
+	}
+}
+
+/**
+ * Read an object from buffer that may be split to multiple parts. If object
+ * is not split function just returns the pointer to object in buffer. But in
+ * case of split object data is copied to given stack object that is suplied
+ * by caller.
+ *
+ * The processing location of the buffer is also advanced to the next byte
+ * after the object.
+ *
+ *   objsize: The size of the objet in bytes.
+ *   stack_obj: A pointer to a memory location where object can be copied.
+ */
+void *drm_buffer_read_object(struct drm_buffer *buf,
+		int objsize, void *stack_obj)
+{
+	int idx = drm_buffer_index(buf);
+	int page = drm_buffer_page(buf);
+	void *obj = NULL;
+
+	if (idx + objsize <= PAGE_SIZE) {
+		obj = &buf->data[page][idx];
+	} else {
+		/* The object is split which forces copy to temporary object.*/
+		int beginsz = PAGE_SIZE - idx;
+		memcpy(stack_obj, &buf->data[page][idx], beginsz);
+
+		memcpy((char *)stack_obj + beginsz, &buf->data[page + 1][0],
+				objsize - beginsz);
+
+		obj = stack_obj;
+	}
+
+	drm_buffer_advance(buf, objsize);
+	return obj;
+}

Copied: projects/random_number_generator/sys/dev/drm2/drm_buffer.h (from r254838, head/sys/dev/drm2/drm_buffer.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/sys/dev/drm2/drm_buffer.h	Sun Aug 25 10:08:58 2013	(r254839, copy of r254838, head/sys/dev/drm2/drm_buffer.h)
@@ -0,0 +1,151 @@
+/**************************************************************************
+ *
+ * Copyright 2010 Pauli Nieminen.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ **************************************************************************/
+/*
+ * Multipart buffer for coping data which is larger than the page size.
+ *
+ * Authors:
+ * Pauli Nieminen <suokkos-at-gmail-dot-com>
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#ifndef _DRM_BUFFER_H_
+#define _DRM_BUFFER_H_
+
+#include <dev/drm2/drmP.h>
+
+struct drm_buffer {
+	int iterator;
+	int size;
+	char *data[];
+};
+
+
+/**
+ * Return the index of page that buffer is currently pointing at.
+ */
+static inline int drm_buffer_page(struct drm_buffer *buf)
+{
+	return buf->iterator / PAGE_SIZE;
+}
+/**
+ * Return the index of the current byte in the page
+ */
+static inline int drm_buffer_index(struct drm_buffer *buf)
+{
+	return buf->iterator & (PAGE_SIZE - 1);
+}
+/**
+ * Return number of bytes that is left to process
+ */
+static inline int drm_buffer_unprocessed(struct drm_buffer *buf)
+{
+	return buf->size - buf->iterator;
+}
+
+/**
+ * Advance the buffer iterator number of bytes that is given.
+ */
+static inline void drm_buffer_advance(struct drm_buffer *buf, int bytes)
+{
+	buf->iterator += bytes;
+}
+
+/**
+ * Allocate the drm buffer object.
+ *
+ *   buf: A pointer to a pointer where the object is stored.
+ *   size: The number of bytes to allocate.
+ */
+extern int drm_buffer_alloc(struct drm_buffer **buf, int size);
+
+/**
+ * Copy the user data to the begin of the buffer and reset the processing
+ * iterator.
+ *
+ *   user_data: A pointer the data that is copied to the buffer.
+ *   size: The Number of bytes to copy.
+ */
+extern int drm_buffer_copy_from_user(struct drm_buffer *buf,
+		void __user *user_data, int size);
+
+/**
+ * Free the drm buffer object
+ */
+extern void drm_buffer_free(struct drm_buffer *buf);
+
+/**
+ * Read an object from buffer that may be split to multiple parts. If object
+ * is not split function just returns the pointer to object in buffer. But in
+ * case of split object data is copied to given stack object that is suplied
+ * by caller.
+ *
+ * The processing location of the buffer is also advanced to the next byte
+ * after the object.
+ *
+ *   objsize: The size of the objet in bytes.
+ *   stack_obj: A pointer to a memory location where object can be copied.
+ */
+extern void *drm_buffer_read_object(struct drm_buffer *buf,
+		int objsize, void *stack_obj);
+
+/**
+ * Returns the pointer to the dword which is offset number of elements from the
+ * current processing location.
+ *
+ * Caller must make sure that dword is not split in the buffer. This
+ * requirement is easily met if all the sizes of objects in buffer are
+ * multiples of dword and PAGE_SIZE is multiple dword.
+ *
+ * Call to this function doesn't change the processing location.
+ *
+ *   offset: The index of the dword relative to the internat iterator.
+ */
+static inline void *drm_buffer_pointer_to_dword(struct drm_buffer *buffer,
+		int offset)
+{
+	int iter = buffer->iterator + offset * 4;
+	return &buffer->data[iter / PAGE_SIZE][iter & (PAGE_SIZE - 1)];
+}
+/**
+ * Returns the pointer to the dword which is offset number of elements from
+ * the current processing location.
+ *
+ * Call to this function doesn't change the processing location.
+ *
+ *   offset: The index of the byte relative to the internat iterator.
+ */
+static inline void *drm_buffer_pointer_to_byte(struct drm_buffer *buffer,
+		int offset)
+{
+	int iter = buffer->iterator + offset;
+	return &buffer->data[iter / PAGE_SIZE][iter & (PAGE_SIZE - 1)];
+}
+
+#endif

Copied: projects/random_number_generator/sys/dev/drm2/drm_core.h (from r254838, head/sys/dev/drm2/drm_core.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/sys/dev/drm2/drm_core.h	Sun Aug 25 10:08:58 2013	(r254839, copy of r254838, head/sys/dev/drm2/drm_core.h)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004 Jon Smirl <jonsmirl at gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#define CORE_AUTHOR		"Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl"
+
+#define CORE_NAME		"drm"
+#define CORE_DESC		"DRM shared core routines"
+#define CORE_DATE		"20060810"
+
+#define DRM_IF_MAJOR	1
+#define DRM_IF_MINOR	4
+
+#define CORE_MAJOR	1
+#define CORE_MINOR	1
+#define CORE_PATCHLEVEL 0

Modified: projects/random_number_generator/sys/dev/drm2/drm_crtc.c
==============================================================================
--- projects/random_number_generator/sys/dev/drm2/drm_crtc.c	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/dev/drm2/drm_crtc.c	Sun Aug 25 10:08:58 2013	(r254839)
@@ -170,6 +170,9 @@ static struct drm_prop_enum_list drm_enc
 	{ DRM_MODE_ENCODER_TVDAC, "TV" },
 };
 
+static void drm_property_destroy_blob(struct drm_device *dev,
+			       struct drm_property_blob *blob);
+
 char *drm_get_encoder_name(struct drm_encoder *encoder)
 {
 	static char buf[32];
@@ -520,6 +523,8 @@ void drm_connector_cleanup(struct drm_co
 		drm_mode_remove(connector, mode);
 
 	sx_xlock(&dev->mode_config.mutex);
+	if (connector->edid_blob_ptr)
+		drm_property_destroy_blob(dev, connector->edid_blob_ptr);
 	drm_mode_object_put(dev, &connector->base);
 	list_del(&connector->head);
 	dev->mode_config.num_connector--;

Modified: projects/random_number_generator/sys/dev/drm2/drm_crtc.h
==============================================================================
--- projects/random_number_generator/sys/dev/drm2/drm_crtc.h	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/dev/drm2/drm_crtc.h	Sun Aug 25 10:08:58 2013	(r254839)
@@ -659,7 +659,7 @@ struct drm_mode_config {
 
 	int min_width, min_height;
 	int max_width, max_height;
-	struct drm_mode_config_funcs *funcs;
+	const struct drm_mode_config_funcs *funcs;
 	resource_size_t fb_base;
 
 	/* output poll support */

Modified: projects/random_number_generator/sys/dev/drm2/drm_crtc_helper.h
==============================================================================
--- projects/random_number_generator/sys/dev/drm2/drm_crtc_helper.h	Sun Aug 25 10:04:10 2013	(r254838)
+++ projects/random_number_generator/sys/dev/drm2/drm_crtc_helper.h	Sun Aug 25 10:08:58 2013	(r254839)
@@ -51,7 +51,7 @@ struct drm_crtc_helper_funcs {
 
 	/* Provider can fixup or change mode timings before modeset occurs */
 	bool (*mode_fixup)(struct drm_crtc *crtc,
-			   struct drm_display_mode *mode,
+			   const struct drm_display_mode *mode,
 			   struct drm_display_mode *adjusted_mode);
 	/* Actually set the mode */
 	int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
@@ -78,7 +78,7 @@ struct drm_encoder_helper_funcs {
 	void (*restore)(struct drm_encoder *encoder);
 
 	bool (*mode_fixup)(struct drm_encoder *encoder,
-			   struct drm_display_mode *mode,
+			   const struct drm_display_mode *mode,
 			   struct drm_display_mode *adjusted_mode);
 	void (*prepare)(struct drm_encoder *encoder);
 	void (*commit)(struct drm_encoder *encoder);

Copied: projects/random_number_generator/sys/dev/drm2/drm_dp_helper.c (from r254838, head/sys/dev/drm2/drm_dp_helper.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/sys/dev/drm2/drm_dp_helper.c	Sun Aug 25 10:08:58 2013	(r254839, copy of r254838, head/sys/dev/drm2/drm_dp_helper.c)
@@ -0,0 +1,147 @@
+/*
+ * Copyright © 2009 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <dev/drm2/drmP.h>
+#include <dev/drm2/drm_dp_helper.h>
+
+/**
+ * DOC: dp helpers
+ *
+ * These functions contain some common logic and helpers at various abstraction
+ * levels to deal with Display Port sink devices and related things like DP aux
+ * channel transfers, EDID reading over DP aux channels, decoding certain DPCD
+ * blocks, ...
+ */
+
+static u8 dp_link_status(u8 link_status[DP_LINK_STATUS_SIZE], int r)
+{
+	return link_status[r - DP_LANE0_1_STATUS];
+}
+
+static u8 dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE],
+			     int lane)
+{
+	int i = DP_LANE0_1_STATUS + (lane >> 1);
+	int s = (lane & 1) * 4;
+	u8 l = dp_link_status(link_status, i);
+	return (l >> s) & 0xf;
+}
+
+bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
+			  int lane_count)
+{
+	u8 lane_align;
+	u8 lane_status;
+	int lane;
+
+	lane_align = dp_link_status(link_status,
+				    DP_LANE_ALIGN_STATUS_UPDATED);
+	if ((lane_align & DP_INTERLANE_ALIGN_DONE) == 0)
+		return false;
+	for (lane = 0; lane < lane_count; lane++) {
+		lane_status = dp_get_lane_status(link_status, lane);
+		if ((lane_status & DP_CHANNEL_EQ_BITS) != DP_CHANNEL_EQ_BITS)
+			return false;
+	}
+	return true;
+}
+
+bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
+			      int lane_count)
+{
+	int lane;
+	u8 lane_status;
+
+	for (lane = 0; lane < lane_count; lane++) {
+		lane_status = dp_get_lane_status(link_status, lane);
+		if ((lane_status & DP_LANE_CR_DONE) == 0)
+			return false;
+	}
+	return true;
+}
+
+u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
+				     int lane)
+{
+	int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
+	int s = ((lane & 1) ?
+		 DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT :
+		 DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT);
+	u8 l = dp_link_status(link_status, i);
+
+	return ((l >> s) & 0x3) << DP_TRAIN_VOLTAGE_SWING_SHIFT;
+}
+
+u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
+					  int lane)
+{
+	int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1);
+	int s = ((lane & 1) ?
+		 DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT :
+		 DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-projects mailing list