aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r319053 due to lack of sence. As pointed out by kib@ opt_global.hDmitry Chagin2017-06-041-1/+1
| | | | | | | | | | contains such fundamental settings as e.g. SMP option and fake opt_global.h almost never match real configured kernels. Reported by: kib@ Notes: svn path=/head/; revision=319570
* On success, getrandom() Linux system call returns the number of bytes thatDmitry Chagin2017-05-281-1/+1
| | | | | | | | | | | | | | were copied to the buffer supplied by the user. Also fix getrandom() if Linuxulator modules are built without the kernel. PR: 219464 Submitted by: Maciej Pasternacki Reported by: Maciej Pasternacki MFC after: 1 week Notes: svn path=/head/; revision=319053
* Strip _binary_linux_locore_o_size from ${VDSO}.so as it is a low absoluteDmitry Chagin2017-05-281-0/+2
| | | | | | | | | | | symbol, and this breaks symbol lookup in ddb. Requested by: bde@ MFC after: 1 week Notes: svn path=/head/; revision=319052
* sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper2017-03-041-2/+2
| | | | | | | | | | | 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
* Exclude -flto when building *genassym.oEd Maste2017-02-211-1/+1
| | | | | | | | | | | | | | | | | The build process generates *assym.h using nm from *genassym.o (which is in turn created from *genassym.c). When compiling with link-time optimization (LTO) using -flto, .o files are LLVM bitcode, not ELF objects. This is not usable by genassym.sh, so remove -flto from those ${CC} invocations. Submitted by: George Rimar Reviewed by: dim MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9659 Notes: svn path=/head/; revision=314054
* 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
* pass -fPIC to the assembler, not linkerEd Maste2016-02-251-2/+2
| | | | | | | | | | | | | | -fPIC has no effect on linking although it seems to be ignored by GNU ld.bfd. However, it causes ld.lld to terminate with an invalid argument error. Reviewed by: dchagin, kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5444 Notes: svn path=/head/; revision=296057
* For objcopy, use --input-target and --output-targetCraig Rodrigues2015-05-251-2/+2
| | | | | | | | | | | | When building with gcc 4.9 and binutils 2.25, using '--input' and '--output' returns an error message: objcopy: option `--input' is ambiguous Reported by: Jenkins Notes: svn path=/head/; revision=283506
* 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
* Implement epoll family system calls. This is a tiny wrapperDmitry Chagin2015-05-241-1/+1
| | | | | | | | | | | | | | | around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata. Initial patch developed by rdivacky@ in 2007, then extended by Yuri Victorovich @ r255672 and finished by me in collaboration with mjg@ and jillies@. Differential Revision: https://reviews.freebsd.org/D1092 Notes: svn path=/head/; revision=283441
* Refund the proc emuldata struct for future use. For now move flags fromDmitry Chagin2015-05-241-2/+3
| | | | | | | | | | | | | 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-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement vdso - virtual dynamic shared object. Through vdso LinuxDmitry Chagin2015-05-241-4/+25
| | | | | | | | | | | | exposes functions from kernel with proper DWARF CFI information so that it becomes easier to unwind through them. Using vdso is a mandatory for a thread cancelation && cleanup on a modern glibc. Differential Revision: https://reviews.freebsd.org/D1060 Notes: svn path=/head/; revision=283407
* Retire the '@' symlink. It isn't really needed and causes moreWarner Losh2014-11-061-4/+1
| | | | | | | | | | | | problems than it solves. SYSDIR is already defined almost always and can be used instead. Working around the one case where it isn't is much easier than working around the fact that @ may not exist in 18 other places. Differential Revision: https://reviews.freebsd.org/D1100 Notes: svn path=/head/; revision=274184
* Add foo_genassym.c files to DPSRCS so dependencies for them are generated.John Baldwin2014-10-271-0/+1
| | | | | | | | This ensures these objects are rebuilt to generate an updated header of assembly constants if needed. Notes: svn path=/head/; revision=273744
* move linux*_locore.s and linux*_support.s to SRCS, remove the OBJSWarner Losh2014-10-171-6/+5
| | | | | | | | | | | | | entry and remove now-redunant dependencies. Add assym.s to linux*_locore.s build, as it depends on it. With this change, linux*.ko no longer builds every time through a KERNFAST run. Sponsored by: Netflix Notes: svn path=/head/; revision=273206
* Implement most of timer_{create,settime,gettime,getoverrun,delete}Bjoern A. Zeeb2014-09-181-0/+1
| | | | | | | | | | | | | | | | | for amd64/linux32. Fix the entirely bogus (untested) version from r161310 for i386/linux using the same shared code in compat/linux. It is unclear to me if we could support more clock mappings but the current set allows me to successfully run commercial 32bit linux software under linuxolator on amd64. Reviewed by: jhb Differential Revision: D784 MFC after: 3 days Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=271743
* Move most of the 15 variations on generating opt_inet.h andWarner Losh2014-08-041-2/+0
| | | | | | | | | opt_inet6.h into kmod.mk by forcing almost everybody to eat the same dogfood. While at it, consolidate the opt_bpf.h and opt_mroute.h targets here too. Notes: svn path=/head/; revision=269540
* - For kernel compiled only with KDTRACE_HOOKS and not any lock debuggingAttilio Rao2013-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | option, unbreak the lock tracing release semantic by embedding calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined version of the releasing functions for mutex, rwlock and sxlock. Failing to do so skips the lockstat_probe_func invokation for unlocking. - As part of the LOCKSTAT support is inlined in mutex operation, for kernel compiled without lock debugging options, potentially every consumer must be compiled including opt_kdtrace.h. Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES is linked there and it is only used as a compile-time stub [0]. [0] immediately shows some new bug as DTRACE-derived support for debug in sfxge is broken and it was never really tested. As it was not including correctly opt_kdtrace.h before it was never enabled so it was kept broken for a while. Fix this by using a protection stub, leaving sfxge driver authors the responsibility for fixing it appropriately [1]. Sponsored by: EMC / Isilon storage division Discussed with: rstone [0] Reported by: rstone [1] Discussed with: philip Notes: svn path=/head/; revision=258541
* Revert r255672, it has some serious flaws, leaking file references etc.Roman Divacky2013-09-181-1/+1
| | | | | | | Approved by: re (delphij) Notes: svn path=/head/; revision=255675
* Implement epoll support in Linuxulator. This is a tiny wrapper around kqueueRoman Divacky2013-09-181-1/+1
| | | | | | | | | | | | | | | | | to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data so this patch overrides kqueue fileops to maintain enough space in struct file. Initial patch developed by me in 2007 and then extended and finished by Yuri Victorovich. Approved by: re (delphij) Sponsored by: Google Summer of Code Submitted by: Yuri Victorovich <yuri at rawbw dot com> Tested by: Yuri Victorovich <yuri at rawbw dot com> Notes: svn path=/head/; revision=255672
* Assemble linux32_locore.s and ia32_sigtramp.S with clang integrated assembler.Roman Divacky2013-08-271-4/+0
| | | | | | | | | Support for .code32 and .code64 in llvm was implemented more than 2 years ago. Tested by: Dan McGregor <dan.mcgregor at usask dot ca> Notes: svn path=/head/; revision=254967
* Add missing dependency to linux${SFX}_genassym.cEitan Adler2013-06-171-1/+1
| | | | | | | | Submitted by: nox MFC After: 3 days Notes: svn path=/head/; revision=251869
* Fix make dependUlrich Spörlein2012-05-061-2/+2
| | | | Notes: svn path=/head/; revision=235078
* Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, toDimitry Andric2012-02-281-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp MFC after: 2 weeks Notes: svn path=/head/; revision=232263
* Upgrade our copy of llvm/clang to r126079, from upstream's trunk.Dimitry Andric2011-02-201-0/+5
| | | | | | | | This contains many improvements, primarily better C++ support, an integrated assembler for x86 and support for -pg. Notes: svn path=/head/; revision=218893
* Move linux_clone(), linux_fork(), linux_vfork() to a MI path.Dmitry Chagin2011-02-121-1/+1
| | | | Notes: svn path=/head/; revision=218616
* MFtbemd:Warner Losh2010-08-231-4/+4
| | | | | | | | | | | | Use MACHINE_CPUARCH in preference to MACHINE_ARCH. The former is the source code location of the machine, the latter the binary output. In general, we want to use MACHINE_CPUARCH instead of MACHINE_ARCH unless we're tesitng for a specific target. The isn't even moot for i386/amd64 where there's momemntum towards a MACHINE_CPUARCH == x86, although a specific cleanup for that likely would be needed... Notes: svn path=/head/; revision=211690
* Bring USB fixes for linux(4).Wojciech A. Koszek2010-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Intention of this commit is to let us take a full advantage of libusb(8) ported to Linux. This decreases a possibility of getting any collisions within ioctl() "command" space, especially with relation to LINUX_SNDCTL_SEQ... stuff. Basically, we provide commands, that will be mapped in the kernel to correct ones and forward those to the USB layer. Port enabling functionality brought with this patch is here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146895 Bump __FreeBSD_version to catch, since which version installing a port makes sense. This patch should bring no regressions. So far, only i386 is tested. Tested by: thompsa@ Reviewed by: thompsa@ OKed by: netchild@ Notes: svn path=/head/; revision=208486
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,Nathan Whitehorn2010-03-111-1/+1
| | | | | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb Notes: svn path=/head/; revision=205014
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onBjoern A. Zeeb2009-06-081-1/+1
| | | | | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c. Notes: svn path=/head/; revision=193744
* Remove opt_mac.h generation for various kernel modules that no longerRobert Watson2009-06-061-1/+1
| | | | | | | | | require it. Submitted by: pjd Notes: svn path=/head/; revision=193588
* Move opt_apic.h closer to the "XXX: for assym.s" comment.Dag-Erling Smørgrav2009-05-261-1/+4
| | | | | | | | Suggested by: jhb MFC after: 1 week Notes: svn path=/head/; revision=192855
* opt_apic.h is i386-only.Dag-Erling Smørgrav2009-05-261-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=192852
* Add preliminary KTR(9) support to the linux emulation layer.Dmitry Chagin2009-05-071-0/+3
| | | | | | | | Approved by: kib (mentor) MFC after: 1 month Notes: svn path=/head/; revision=191877
* Fix a few problems related to building modules in /sys/modules (notNick Hibma2009-02-121-1/+1
| | | | | | | | | | | | | checked whether this applies to builds in /sys/*/compile/* as well): - Create empty opt_*.h files were missing - Hook up svr4 to the build. It compiles fine here, so no reason to disconnect it in the Makefile. were missing - Hook up svr4 to the build. It compiles fine here, so no reason to disconnect it in the Makefile. Notes: svn path=/head/; revision=188516
* Rather than using hidden includes (with cicular dependencies),Bjoern A. Zeeb2008-12-021-1/+1
| | | | | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=185571
* Per email to arch@ a little while ago (that was greeted with silence),Warner Losh2008-09-011-1/+1
| | | | | | | | prefer the more common > ${.TARGET} over > opt_foo.h in modules makefiles. Notes: svn path=/head/; revision=182668
* Fix the dependency for the linux_support.s, explicitely add linux_assym.h.Konstantin Belousov2007-05-231-1/+1
| | | | | | | | | Reported by: rwatson In collaboration with: rdivacky Sponsored by: Google SoC 2007 Notes: svn path=/head/; revision=169903
* Move futex support code from <arch>/support.s into linux compat directory.Konstantin Belousov2007-05-231-2/+10
| | | | | | | | | | | | | Implement all futex atomic operations in assembler to not depend on the fuword() that does not allow to distinguish between -1 and failure return. Correctly return 0 from atomic operations on success. In collaboration with: rdivacky Tested by: Scot Hetzel <swhetzel gmail com>, Milos Vyletel <mvyletel mzm cz> Sponsored by: Google SoC 2007 Notes: svn path=/head/; revision=169895
* Backout the linux aio stuff. Several problems where identified and theAlexander Leidinger2006-10-291-1/+1
| | | | | | | | | | | | | | | | | | dynamic nature (if no native aio code is available, the linux part returns ENOSYS because of missing requisites) should be solved differently than it is. All this will be done in P4. Not included in this commit is a backout of the changes to the native aio code (removing static in some places). Those changes (and some more) will also be needed when the reworked linux aio stuff will reenter the tree. Requested by: rwatson Discussed with: rwatson Notes: svn path=/head/; revision=163760
* MFP4 (with some minor changes):Alexander Leidinger2006-10-151-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the linux_io_* syscalls (AIO). They are only enabled if the native AIO code is available (either compiled in to the kernel or as a module) at the time the functions are used. If the AIO stuff is not available there will be a ENOSYS. From the submitter: ---snip--- DESIGN NOTES: 1. Linux permits a process to own multiple AIO queues (distinguished by "context"), but FreeBSD creates only one single AIO queue per process. My code maintains a request queue (STAILQ of queue(3)) per "context", and throws all AIO requests of all contexts owned by a process into the single FreeBSD per-process AIO queue. When the process calls io_destroy(2), io_getevents(2), io_submit(2) and io_cancel(2), my code can pick out requests owned by the specified context from the single FreeBSD per-process AIO queue according to the per-context request queues maintained by my code. 2. The request queue maintained by my code stores contrast information between Linux IO control blocks (struct linux_iocb) and FreeBSD IO control blocks (struct aiocb). FreeBSD IO control block actually exists in userland memory space, required by FreeBSD native aio_XXXXXX(2). 3. It is quite troubling that the function io_getevents() of libaio-0.3.105 needs to use Linux-specific "struct aio_ring", which is a partial mirror of context in user space. I would rather take the address of context in kernel as the context ID, but the io_getevents() of libaio forces me to take the address of the "ring" in user space as the context ID. To my surprise, one comment line in the file "io_getevents.c" of libaio-0.3.105 reads: Ben will hate me for this REFERENCE: 1. Linux kernel source code: http://www.kernel.org/pub/linux/kernel/v2.6/ (include/linux/aio_abi.h, fs/aio.c) 2. Linux manual pages: http://www.kernel.org/pub/linux/docs/manpages/ (io_setup(2), io_destroy(2), io_getevents(2), io_submit(2), io_cancel(2)) 3. Linux Scalability Effort: http://lse.sourceforge.net/io/aio.html The design notes: http://lse.sourceforge.net/io/aionotes.txt 4. The package libaio, both source and binary: http://rpmfind.net/linux/rpm2html/search.php?query=libaio Simple transparent interface to Linux AIO system calls. 5. Libaio-oracle: http://oss.oracle.com/projects/libaio-oracle/ POSIX AIO implementation based on Linux AIO system calls (depending on libaio). ---snip--- Submitted by: Li, Xiao <intron@intron.ac> Notes: svn path=/head/; revision=163379
* - Add the new files to the linux module.Alexander Leidinger2006-08-151-13/+18
| | | | | | | | | | | | - Prepare the modules for build on amd64, but don't build them there as part of the kernel build yet. The code for the missing symbols on amd64 isn't committed and it may be solved differently. Sponsored by: Google SoC 2006 Submitted by: rdivacky Notes: svn path=/head/; revision=161312
* Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.Doug Ambrisko2006-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add back in a scheme to emulate old type major/minor numbers via hooks into stat, linprocfs to return major/minors that Linux app's expect. Currently only /dev/null is always registered. Drivers can register via the Linux type shim similar to the ioctl shim but by using linux_device_register_handler/linux_device_unregister_handler functions. The structure is: struct linux_device_handler { char *bsd_driver_name; char *linux_driver_name; char *bsd_device_name; char *linux_device_name; int linux_major; int linux_minor; int linux_char_device; }; Linprocfs uses this to display the major number of the driver. The soon to be available linsysfs will use it to fill in the driver name. Linux_stat uses it to translate the major/minor into Linux type values. Note major numbers are dynamically assigned via passing in a -1 for the major number so we don't need to keep track of them. This is somewhat needed due to us switching to our devfs. MegaCli will not run until I add in the linsysfs and mfi Linux compat changes. Sponsored by: IronPort Systems Notes: svn path=/head/; revision=158311
* Get rid of the need of COMPAT_43 in the linuxolator.Alexander Leidinger2006-03-181-4/+1
| | | | | | | | Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Obtained from: DragonFly (some parts) Notes: svn path=/head/; revision=156842
* opt_vmpage.h is no longer needed here because it is not included byAlan Cox2006-01-261-1/+1
| | | | | | | vm_page.h. Notes: svn path=/head/; revision=154865
* Let modules use the kernel's opt_*.h files if built along withYaroslav Tykhiy2005-10-141-0/+2
| | | | | | | | | | | | | | | | | the kernel by wrapping all targets for fake opt_*.h files in .if defined(KERNBUILDDIR). Thus, such fake files won't be created at all if modules are built with the kernel. Some modules undergo cleanup like removing unused or unneeded options or .h files, without which they wouldn't build this way or the other. Reviewed by: ru Tested by: no binary changes in modules built alone Tested on: i386 sparc64 amd64 Notes: svn path=/head/; revision=151350
* Move MAINTAINER documentation to MAINTAINERSWarner Losh2005-06-041-2/+0
| | | | Notes: svn path=/head/; revision=146961
* o Remove @- from the ln and change it to a -sf. This was bogus, andWarner Losh2003-11-191-1/+1
| | | | | | | | | | | | | | | regocnized as such at the time. Now that the other bogons in the tree have been fixed, we can remove this ugly kludge. o Remove stale/bogus opt_foo.h files. These are left over from by-gone resources. And they point to the need, yet again, to improve the build system so meta information is only in one place. Submitted by: ru Reviewed by: bde Approved by: re@ (jhb) Notes: svn path=/head/; revision=122894
* Add IPv6 support for Linuxlator.Hajimu UMEMOTO2003-02-031-2/+5
| | | | | | | | Reviewed by: dwmalone MFC after: 10 days Notes: svn path=/head/; revision=110295