summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-01-09 16:08:22 +0000
committerdchagin <dchagin@FreeBSD.org>2016-01-09 16:08:22 +0000
commitd30e84112a87337209ea45237f3d9b12e29abaa9 (patch)
tree25ceb202feb35d8ee393e9616532af439b0df74a /sys/modules
parente6de850e0541afec795082daf12bf197bd4fca79 (diff)
downloadFreeBSD-src-d30e84112a87337209ea45237f3d9b12e29abaa9.zip
FreeBSD-src-d30e84112a87337209ea45237f3d9b12e29abaa9.tar.gz
MFC r283421:
Introduce a new module linux_common.ko which is intended for the following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/Makefile2
-rw-r--r--sys/modules/linprocfs/Makefile7
-rw-r--r--sys/modules/linsysfs/Makefile7
-rw-r--r--sys/modules/linux/Makefile9
-rw-r--r--sys/modules/linux_common/Makefile25
5 files changed, 34 insertions, 16 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 609c72c..49c4a74 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -197,6 +197,7 @@ SUBDIR= \
${_linprocfs} \
${_linsysfs} \
${_linux} \
+ ${_linux_common} \
lmc \
lpt \
mac_biba \
@@ -799,6 +800,7 @@ _viawd= viawd
_virtio= virtio
.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
_vmm= vmm
+_linux_common= linux_common
.endif
_vxge= vxge
_x86bios= x86bios
diff --git a/sys/modules/linprocfs/Makefile b/sys/modules/linprocfs/Makefile
index 4b1b375..979429f 100644
--- a/sys/modules/linprocfs/Makefile
+++ b/sys/modules/linprocfs/Makefile
@@ -5,11 +5,6 @@
KMOD= linprocfs
SRCS= vnode_if.h \
device_if.h bus_if.h \
- linprocfs.c \
- opt_compat.h
-
-.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+=-DCOMPAT_LINUX32
-.endif
+ linprocfs.c
.include <bsd.kmod.mk>
diff --git a/sys/modules/linsysfs/Makefile b/sys/modules/linsysfs/Makefile
index 4017967..13230ff 100644
--- a/sys/modules/linsysfs/Makefile
+++ b/sys/modules/linsysfs/Makefile
@@ -5,11 +5,6 @@
KMOD= linsysfs
SRCS= vnode_if.h \
device_if.h bus_if.h pci_if.h \
- linsysfs.c \
- opt_compat.h
-
-.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+=-DCOMPAT_LINUX32
-.endif
+ linsysfs.c
.include <bsd.kmod.mk>
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index 17341ab..1e8fda1 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -12,9 +12,9 @@ VDSO= linux${SFX}_vdso
KMOD= linux
SRCS= linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \
linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
- linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
+ linux${SFX}_machdep.c linux_misc.c linux_signal.c \
linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
- linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
+ linux${SFX}_sysvec.c linux_uid16.c linux_time.c \
linux_timer.c linux_vdso.c \
opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \
vnode_if.h device_if.h bus_if.h assym.s \
@@ -30,16 +30,17 @@ SRCS+= opt_apic.h
OBJS= ${VDSO}.so
.if ${MACHINE_CPUARCH} == "i386"
-SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h
+SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c opt_cpu.h
.endif
+.if ${MACHINE_CPUARCH} == "i386"
EXPORT_SYMS=
EXPORT_SYMS+= linux_emul_path
EXPORT_SYMS+= linux_get_osname
EXPORT_SYMS+= linux_get_osrelease
-EXPORT_SYMS+= linux_ifname
EXPORT_SYMS+= linux_ioctl_register_handler
EXPORT_SYMS+= linux_ioctl_unregister_handler
+.endif
CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o
diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile
new file mode 100644
index 0000000..4384d0b
--- /dev/null
+++ b/sys/modules/linux_common/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../compat/linux
+
+KMOD= linux_common
+SRCS= linux_common.c linux_mib.c linux_util.c \
+ opt_compat.h device_if.h vnode_if.h bus_if.h
+
+EXPORT_SYMS=
+EXPORT_SYMS+= linux_emul_path
+EXPORT_SYMS+= linux_ioctl_register_handler
+EXPORT_SYMS+= linux_ioctl_unregister_handler
+EXPORT_SYMS+= linux_get_osname
+EXPORT_SYMS+= linux_get_osrelease
+
+.if !defined(KERNBUILDDIR)
+.if defined(DEBUG)
+CFLAGS+=-DDEBUG
+.endif
+.if defined(KTR)
+CFLAGS+=-DKTR
+.endif
+.endif
+
+.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud