diff options
author | jhb <jhb@FreeBSD.org> | 2016-01-20 01:09:53 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-01-20 01:09:53 +0000 |
commit | 77733541d454c3b987e985b85df345fc8c7f205d (patch) | |
tree | 06645c8b5fb21159a6ab7cfe6514945bca030b0f /sys/cddl/dev | |
parent | 2651e6b1c65c3a49c9390393bd44d1fc1d428f42 (diff) | |
download | FreeBSD-src-77733541d454c3b987e985b85df345fc8c7f205d.zip FreeBSD-src-77733541d454c3b987e985b85df345fc8c7f205d.tar.gz |
MFC 289769,289822,290143,290144:
Rename remaining linux32 symbols from linux_* to linux32_*.
289769:
Rename remaining linux32 symbols such as linux_sysent[] and
linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with
linux64.ko. While here, add support for linux64 binaries to systrace.
- Update NOPROTO entries in amd64/linux/syscalls.master to match the
main table to fix systrace build.
- Add a special case for union l_semun arguments to the systrace
generation.
- The systrace_linux32 module now only builds the systrace_linux32.ko.
module on amd64.
- Add a new systrace_linux module that builds on both i386 and amd64.
For i386 it builds the existing systrace_linux.ko. For amd64 it
builds a systrace_linux.ko for 64-bit binaries.
289822:
Fix build for the KTR-enabled kernels.
290143:
Fix build with DEBUG defined.
290144:
Update for LINUX32 rename. The assembler didn't complain about undefined
symbols but just used 0 after the rename.
Diffstat (limited to 'sys/cddl/dev')
-rw-r--r-- | sys/cddl/dev/systrace/systrace.c | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index 921393c..1796091 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -60,24 +60,37 @@ #ifdef LINUX_SYSTRACE #if defined(__amd64__) -#include <amd64/linux32/linux.h> -#include <amd64/linux32/linux32_proto.h> -#include <amd64/linux32/linux32_syscalls.c> -#include <amd64/linux32/linux32_systrace_args.c> -#define MODNAME "linux32" +#include <amd64/linux/linux.h> +#include <amd64/linux/linux_proto.h> +#include <amd64/linux/linux_syscalls.c> +#include <amd64/linux/linux_systrace_args.c> #elif defined(__i386__) #include <i386/linux/linux.h> #include <i386/linux/linux_proto.h> #include <i386/linux/linux_syscalls.c> #include <i386/linux/linux_systrace_args.c> -#define MODNAME "linux" #else #error Only i386 and amd64 are supported. #endif +#define MODNAME "linux" extern struct sysent linux_sysent[]; #define MAXSYSCALL LINUX_SYS_MAXSYSCALL #define SYSCALLNAMES linux_syscallnames #define SYSENT linux_sysent +#elif defined(LINUX32_SYSTRACE) +#if defined(__amd64__) +#include <amd64/linux32/linux.h> +#include <amd64/linux32/linux32_proto.h> +#include <amd64/linux32/linux32_syscalls.c> +#include <amd64/linux32/linux32_systrace_args.c> +#else +#error Only amd64 is supported. +#endif +#define MODNAME "linux32" +extern struct sysent linux32_sysent[]; +#define MAXSYSCALL LINUX32_SYS_MAXSYSCALL +#define SYSCALLNAMES linux32_syscallnames +#define SYSENT linux32_sysent #elif defined(FREEBSD32_SYSTRACE) /* * The syscall arguments are processed into a DTrace argument array @@ -103,6 +116,7 @@ extern const char *freebsd32_syscallnames[]; #define MAXSYSCALL SYS_MAXSYSCALL #define SYSCALLNAMES syscallnames #define SYSENT sysent +#define NATIVE_ABI #endif #define PROVNAME "syscall" @@ -132,7 +146,7 @@ static void systrace_load(void *); static struct cdevsw systrace_cdevsw = { .d_version = D_VERSION, .d_open = systrace_open, -#ifdef LINUX_SYSTRACE +#ifndef NATIVE_ABI .d_name = "systrace_" MODNAME, #else .d_name = "systrace", @@ -171,7 +185,7 @@ static dtrace_provider_id_t systrace_id; typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -#if !defined(LINUX_SYSTRACE) +#ifdef NATIVE_ABI /* * Probe callback function. * @@ -314,7 +328,7 @@ systrace_load(void *dummy) NULL, &systrace_pops, NULL, &systrace_id) != 0) return; -#if !defined(LINUX_SYSTRACE) +#ifdef NATIVE_ABI systrace_probe_func = systrace_probe; #endif } @@ -328,7 +342,7 @@ systrace_unload() if ((error = dtrace_unregister(systrace_id)) != 0) return (error); -#if !defined(LINUX_SYSTRACE) +#ifdef NATIVE_ABI systrace_probe_func = NULL; #endif @@ -370,6 +384,16 @@ SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_load, NULL SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL); #ifdef LINUX_SYSTRACE +DEV_MODULE(systrace_linux, systrace_modevent, NULL); +MODULE_VERSION(systrace_linux, 1); +#ifdef __amd64__ +MODULE_DEPEND(systrace_linux, linux64, 1, 1, 1); +#else +MODULE_DEPEND(systrace_linux, linux, 1, 1, 1); +#endif +MODULE_DEPEND(systrace_linux, dtrace, 1, 1, 1); +MODULE_DEPEND(systrace_linux, opensolaris, 1, 1, 1); +#elif defined(LINUX32_SYSTRACE) DEV_MODULE(systrace_linux32, systrace_modevent, NULL); MODULE_VERSION(systrace_linux32, 1); MODULE_DEPEND(systrace_linux32, linux, 1, 1, 1); |