Add preliminary KTR(9) support to the linux emulation layer.
Approved by: kib (mentor) MFC after: 1 month
This commit is contained in:
parent
13f20d7e86
commit
4ec3ea90eb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191877
@ -318,7 +318,7 @@ linux_set_oss_version(struct thread *td, int oss_version)
|
||||
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, debug,
|
||||
0, 0, linux_sysctl_debug, "A",
|
||||
"Linux debugging control");
|
||||
|
||||
#endif /* DEBUG */
|
||||
#endif /* DEBUG || KTR */
|
||||
|
@ -106,4 +106,33 @@ int linux_driver_get_major_minor(char *node, int *major, int *minor);
|
||||
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_ */
|
||||
|
@ -55,6 +55,9 @@ linux${SFX}_genassym.o: linux${SFX}_genassym.c linux.h @ machine
|
||||
.if !defined(KERNBUILDDIR)
|
||||
opt_inet6.h:
|
||||
echo "#define INET6 1" > ${.TARGET}
|
||||
.if defined(KTR)
|
||||
CFLAGS+= -DKTR
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
Loading…
Reference in New Issue
Block a user