Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 May 2009 13:37:05 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r192806 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal dev/cxgb modules/linux
Message-ID:  <200905261337.n4QDb5rM059605@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Tue May 26 13:37:05 2009
New Revision: 192806
URL: http://svn.freebsd.org/changeset/base/192806

Log:
  Merge r191877 from HEAD to stable/7:
  
  Add preliminary KTR(9) support to the linux emulation layer.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/compat/linux/linux_mib.c
  stable/7/sys/compat/linux/linux_util.h
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/modules/linux/Makefile

Modified: stable/7/sys/compat/linux/linux_mib.c
==============================================================================
--- stable/7/sys/compat/linux/linux_mib.c	Tue May 26 12:01:37 2009	(r192805)
+++ stable/7/sys/compat/linux/linux_mib.c	Tue May 26 13:37:05 2009	(r192806)
@@ -318,7 +318,7 @@ linux_set_oss_version(struct thread *td,
 	return (0);
 }
 
-#ifdef DEBUG
+#if defined(DEBUG) || defined(KTR)
 
 u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))];
 
@@ -377,4 +377,4 @@ SYSCTL_PROC(_compat_linux, OID_AUTO, deb
             0, 0, linux_sysctl_debug, "A",
             "Linux debugging control");
 
-#endif /* DEBUG */
+#endif /* DEBUG || KTR */

Modified: stable/7/sys/compat/linux/linux_util.h
==============================================================================
--- stable/7/sys/compat/linux/linux_util.h	Tue May 26 12:01:37 2009	(r192805)
+++ stable/7/sys/compat/linux/linux_util.h	Tue May 26 13:37:05 2009	(r192806)
@@ -104,4 +104,33 @@ int	linux_driver_get_major_minor(char *n
 char	*linux_get_char_devices(void);
 void	linux_free_get_char_devices(char *string);
 
+#if defined(KTR)
+
+#define	KTR_LINUX				KTR_SUBSYS
+#define	LINUX_CTRFMT(nm, fmt)	#nm"("fmt")"
+
+#define	LINUX_CTR6(f, m, p1, p2, p3, p4, p5, p6) do {			\
+	if (ldebug(f))							\
+		CTR6(KTR_LINUX, LINUX_CTRFMT(f, m),			\
+		    p1, p2, p3, p4, p5, p6);				\
+} while (0)
+
+#define	LINUX_CTR(f)			LINUX_CTR6(f, "", 0, 0, 0, 0, 0, 0)
+#define	LINUX_CTR0(f, m)		LINUX_CTR6(f, m, 0, 0, 0, 0, 0, 0)
+#define	LINUX_CTR1(f, m, p1)		LINUX_CTR6(f, m, p1, 0, 0, 0, 0, 0)
+#define	LINUX_CTR2(f, m, p1, p2)	LINUX_CTR6(f, m, p1, p2, 0, 0, 0, 0)
+#define	LINUX_CTR3(f, m, p1, p2, p3)	LINUX_CTR6(f, m, p1, p2, p3, 0, 0, 0)
+#define	LINUX_CTR4(f, m, p1, p2, p3, p4)	LINUX_CTR6(f, m, p1, p2, p3, p4, 0, 0)
+#define	LINUX_CTR5(f, m, p1, p2, p3, p4, p5)	LINUX_CTR6(f, m, p1, p2, p3, p4, p5, 0)
+#else
+#define	LINUX_CTR(f)
+#define	LINUX_CTR0(f, m)
+#define	LINUX_CTR1(f, m, p1)
+#define	LINUX_CTR2(f, m, p1, p2)
+#define	LINUX_CTR3(f, m, p1, p2, p3)
+#define	LINUX_CTR4(f, m, p1, p2, p3, p4)
+#define	LINUX_CTR5(f, m, p1, p2, p3, p4, p5)
+#define	LINUX_CTR6(f, m, p1, p2, p3, p4, p5, p6)
+#endif
+
 #endif /* !_LINUX_UTIL_H_ */

Modified: stable/7/sys/modules/linux/Makefile
==============================================================================
--- stable/7/sys/modules/linux/Makefile	Tue May 26 12:01:37 2009	(r192805)
+++ stable/7/sys/modules/linux/Makefile	Tue May 26 13:37:05 2009	(r192806)
@@ -55,6 +55,9 @@ linux${SFX}_genassym.o: linux${SFX}_gena
 .if !defined(KERNBUILDDIR)
 opt_inet6.h:
 	echo "#define INET6 1" > opt_inet6.h
+.if defined(KTR)
+CFLAGS+=	-DKTR
+.endif
 .endif
 
 .include <bsd.kmod.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905261337.n4QDb5rM059605>