aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/linux_common
Commit message (Collapse)AuthorAgeFilesLines
* linux: Add required symbol to EXPORT_SYMS listEd Maste2025-12-291-0/+1
| | | | PR: 291270
* linux: separate all ifnet(9) related code into linux_ifnet.cGleb Smirnoff2025-12-081-2/+1
| | | | | | | | Remove linux_use_real_ifname(). It is no longer used outside of the file since 3ab3c9c29cf0. There is no functional change. Reviewed by: melifaro, dchagin Differential Revision: https://reviews.freebsd.org/D54076
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* netlink: move NETLINK define to opt_global.hKristof Provost2023-10-131-2/+1
| | | | | | | | | | | | | Move the NETLINK define into opt_global.h so we can rely on it being set correctly, without having to remember to include opt_netlink.h. This ensures that the NETLINK define is correctly set. If not we may end up with unloadable modules, due to missing symbols (such as nlmsg_get_group_writer). PR: 274306 Reviewed by: imp, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42179
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* linux(4): Make linux_emul_path privateDmitry Chagin2023-05-291-1/+0
| | | | | | There is no need to refer to linux_emul_path from outside anymore. MFC after: 2 month
* linux(4): Fix opt_netlink.h inclusionDmitry Chagin2023-03-311-1/+2
| | | | | | | | Add opt_netlink.h to the linux_common module, on i386, where we don't uses linux_common module, move opt_netlink.h inclusion under i386 condition. MFC after: 2 weeks
* linux_common: Fixup .PATH.Dmitry Chagin2023-01-281-1/+4
| | | | | | | Since we have arm64, and awaiting ppc64 Linuxulator, do not include x86 specific path to the module build for non x86 architectures. MFC after: 1 week
* modules: Add missing opt_*.h files for stand-alone compileWarner Losh2022-10-291-1/+1
| | | | | | Standalone compile that we at least create these opt_*.h files. Sponsored by: Netflix
* linuxolator: add netlink supportAlexander V. Chernikov2022-10-011-1/+1
| | | | | | | | | | | | | | | | | Add the glue code to support netlink in Linuxolator. linux_common(4) now depends on netlink(4). All netlink protocol constants are consistent with the Linux version. However, certain OS-specific constants such as AF_INET6, interface flags or default routing table id, are different between FreeBSD and Linux. Thus, it may be needed to rewrite some message parts or even rewrite the whole message, adding or removing some TLVs. The core netlink implementation code provides efficient rewriting callbacks which Linuxolator now uses. Reviewed by: dchagin Differential Revision: https://reviews.freebsd.org/D36361 MFC after: 2 months
* linux(4); Move vdso_selector_x86.c to the linux_common moduleDmitry Chagin2022-05-231-1/+1
| | | | MFC after: 2 weeks
* linux(4): Deduplicate translate_traps()Dmitry Chagin2022-05-231-1/+5
| | | | | | | As translate_traps() is common for x86 Linuxulators, move it under x86/linux. MFC after: 2 weeks
* linux: add sysctl to pass untranslated interface namesAlexander V. Chernikov2022-01-171-0/+1
| | | | | | Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33792
* Fix some modules to export more used symbolsKonstantin Belousov2021-11-181-2/+2
| | | | | | | | | and remove non-present symbols that are now reported by kmod_syms.awk. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32878
* linux(4): Deduplicate unimpl/dummy syscall handlersConrad Meyer2020-11-051-1/+1
| | | | | | | | | | No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 Notes: svn path=/head/; revision=367395
* Make linux_errtbl[] static.Edward Tomasz Napierala2020-11-031-1/+0
| | | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27004 Notes: svn path=/head/; revision=367301
* Add warning to the Linuxulator makefiles that building it outside of aDmitry Chagin2019-05-131-0/+4
| | | | | | | | | | | kernel does not make sence. PR: 222861 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20179 Notes: svn path=/head/; revision=347540
* Linuxulator depends on a fundamental kernel settings such as SMP. ManyDmitry Chagin2019-05-131-9/+0
| | | | | | | | | | | | | | | | | | | | | | of them listed in opt_global.h which is not generated while building modules outside of a kernel and such modules never match real cofigured kernel. So, we should prevent our users from building obviously defective modules. Therefore, remove the root cause of the building of modules outside of a kernel - the possibility of building modules with DEBUG or KTR flags. And remove all of DEBUG printfs as it is incomplete and in threaded programms not informative, also a half of system call does not have DEBUG printf. For debuging Linux programms we have dtrace, ktr and ktrace ability. PR: 222861 Reviewed by: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20178 Notes: svn path=/head/; revision=347538
* Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functionsDmitry Chagin2019-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | alter the userspace sockaddr to convert the format between linux and BSD versions. That's the minimum 3 of copyin/copyout operations for one syscall. Also some syscall uses linux_sa_put() and linux_getsockaddr() when load sockaddr to userspace or from userspace accordingly. To avoid this chaos, especially converting sockaddr in the userspace, rewrite these 4 functions to convert sockaddr only in kernel and leave only 2 of this functions. Also in order to reduce duplication between MD parts of the Linuxulator put struct sockaddr conversion functions that are MI out into linux_common module. PR: 232920 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20157 Notes: svn path=/head/; revision=347533
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* Share Linux errno table with libsysdecodeEd Maste2018-03-221-1/+1
| | | | | | | | | Requested by: jhb Reviewed by: jhb Sponsored by: Turing Robotic Industries Inc. Notes: svn path=/head/; revision=331356
* Share a single bsd-linux errno table across MD consumersEd Maste2018-03-161-0/+2
| | | | | | | | | | | | | | | | | | | | Three copies of the linuxulator linux_sysvec.c contained identical BSD to Linux errno translation tables, and future work to support other architectures will also use the same table. Move the table to a common file to be used by all. Make it 'const int' to place it in .rodata. (Some existing Linux architectures use MD errno values, but x86 and Arm share the generic set.) This change should introduce no functional change; a followup will add missing errno values. MFC after: 3 weeks Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D14665 Notes: svn path=/head/; revision=331056
* sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper2017-03-041-1/+1
| | | | | | | | | | | This simplifies make output/logic Tested with: `cd sys/modules; make ALL_MODULES=` on amd64 MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314651
* Fix a copy/paste bug introduced during X86_64 Linuxulator work.Dmitry Chagin2016-07-101-1/+1
| | | | | | | | | | | | | | | | FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation use READ_IMPLIES_EXEC flag, introduced in r302515. While here move common part of mmap() and mprotect() code to the files in compat/linux to reduce code dupcliation between Linuxulator's. Reported by: Johannes Jost Meixner, Shawn Webb MFC after: 1 week XMFC with: r302515, r302516 Notes: svn path=/head/; revision=302517
* Rework signal code to allow using it by other modules, like linprocfs:Dmitry Chagin2015-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | 1. Linux sigset always 64 bit on all platforms. In order to move Linux sigset code to the linux_common module define it as 64 bit int. Move Linux sigset manipulation routines to the MI path. 2. Move Linux signal number definitions to the MI path. In general, they are the same on all platforms except for a few signals. 3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion tables to avoid conversion errors. 4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside of allowed on Linux signal numbers. PR: 197216 Notes: svn path=/head/; revision=283474
* Refund the proc emuldata struct for future use. For now move flags fromDmitry Chagin2015-05-241-1/+1
| | | | | | | | | | | | | thread emuldata to proc emuldata as it was originally intended. As we can have both 64 & 32 bit Linuxulator running any eventhandler can be called twice for us. To prevent this move eventhandlers code from linux_emul.c to the linux_common.ko module. Differential Revision: https://reviews.freebsd.org/D1073 Notes: svn path=/head/; revision=283422
* Introduce a new module linux_common.ko which is intended for theDmitry Chagin2015-05-241-0/+25
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 Differential Revision: https://reviews.freebsd.org/D1072 In collaboration with: Vassilis Laganakos. Reviewed by: trasz Notes: svn path=/head/; revision=283421