From owner-svn-src-stable-7@FreeBSD.ORG Tue May 26 13:37:05 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 935AB106568C; Tue, 26 May 2009 13:37:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7627E8FC17; Tue, 26 May 2009 13:37:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4QDb5lj059608; Tue, 26 May 2009 13:37:05 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4QDb5rM059605; Tue, 26 May 2009 13:37:05 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200905261337.n4QDb5rM059605@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 26 May 2009 13:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192806 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal dev/cxgb modules/linux X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 13:37:06 -0000 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