summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_util.h
Commit message (Collapse)AuthorAgeFilesLines
* MFC r283441:dchagin2016-01-091-0/+1
| | | | | | | | | | | Implement epoll family system calls. This is a tiny wrapper 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@.
* MFC r283427:dchagin2016-01-091-0/+2
| | | | | Where possible we will use M_LINUX malloc(9) type. Move M_FUTEX defines to the linux_common.ko.
* MFC r283421:dchagin2016-01-091-0/+2
| | | | | | | | | | | | | | | | | | | 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
* MFC r283447:dchagin2016-01-091-1/+0
| | | | Fix build with KTR option.
* - >500 static DTrace probes for the linuxulatornetchild2012-05-051-0/+8
| | | | | | | | | | | | | | | | | | - DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probe;s with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs).
* Remove direct access to si_name.ed2012-02-101-1/+1
| | | | | | | | Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks
* Remove stale comment.kib2010-10-141-5/+0
| | | | | Submitted by: arundel MFC after: 3 days
* Add preliminary KTR(9) support to the linux emulation layer.dchagin2009-05-071-0/+29
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Implement the linux syscallskib2008-04-081-5/+7
| | | | | | | | | openat, mkdirat, mknodat, fchownat, futimesat, fstatat, unlinkat, renameat, linkat, symlinkat, readlinkat, fchmodat, faccessat. Submitted by: rdivacky Sponsored by: Google Summer of Code 2007 Tested by: pho
* Implement the openat() linux syscalljulian2007-03-291-2/+5
| | | | | Submitted by: Roman Divacky (rdivacky@) MFC after: 2 weeks
* Axe the stackgap macros as the Linux ABIs no longer use the stackgap.jhb2006-06-271-26/+0
|
* Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.ambrisko2006-05-051-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Suppress logging about unimplemented syscalls to one time per process. Thisglebius2005-12-081-9/+7
| | | | | | prevents hard flood of the system console. Reviewed by: bde
* Remove linux_emul_find() and the CHECKALT*() macros as they are no longerjhb2005-03-011-13/+0
| | | | used.
* Start each of the license/copyright comments with /*-imp2005-01-051-1/+1
|
* Rename thread args to be called "td" rather than "p" to bedwmalone2004-10-101-6/+6
| | | | | | | | consistent with other bits of this file. There should be no functional change. Submitted by: Andrea Campi (many moons ago) MFC after: 2 month
* Use sv_psstrings from the current process's sysentvec structure insteadtjr2004-08-151-2/+3
| | | | | | of PS_STRINGS. This is a no-op at present, but it will be needed when running 32-bit Linux binaries on amd64 to ensure PS_STRINGS is in addressable memory.
* Add function linux_msg() for regulating output from the linux emulationalfred2003-01-021-4/+7
| | | | | | | | | | | code, make the emulator use it. Rename unsupported_msg() to unimplemented_syscall(). Rename some arguments for clarity Fixup grammar. Requested by: bde
* When complaining about obsolete/unimplemented syscalls output the processalfred2003-01-011-2/+2
| | | | | | | name to make things more clear for the user. PR: 46661 MFC After: 3 days
* Add a new function linux_emul_convpath(), which is a version ofiedowse2002-09-011-0/+16
| | | | | | | | linux_emul_find() that does not use stack gap storage but instead always returns the resulting path in a malloc'd kernel buffer. Implement linux_emul_find() in terms of this function. Also add LCONVPATH* macros that wrap linux_emul_convpath in the same way that the CHECKALT* macros wrap linux_emul_find().
* Remove __P.alfred2002-03-201-1/+1
|
* Garbage collect options AVM_A1_PCI, AVM_A1_PCMCIA, DEBUG_LINUX, DEV_APM,bde2002-02-151-2/+0
| | | | | GUS_DMA, GUS_DMA2, GUS_IRQ, OLTR_NO_BULLSEYE_MAC, OLTR_NO_HAWKEYE_MAC, OLTR_NO_TMS_MAC and PCIC_RESUME_RESET.
* Eliminate the prefix parameter to linux_emul_find(), which was alwaysdes2001-10-271-4/+2
| | | | | | | | linux_emul_path anyway. Linux_emul_find() has interesting bugs in its prefix handling (which luckily are not currently exploitable); this commit is preliminary to an attempt at cleaning it up. Approved by: marcel
* Whitespace fix.des2001-10-191-1/+1
|
* KSE Milestone 2julian2001-09-121-5/+5
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-0/+17
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* Remove the only use of SCARG and perform dead code elimination.marcel2000-07-271-4/+0
|
* Add bounds checking to stackgap_alloc. Previously it was possiblemarcel2000-07-231-10/+8
| | | | | | | | | | | to construct a path that was long enough (ie longer than SPARE_USRSPACE bytes) and trash the stack. Note that SPARE_USRSPACE is much smaller than MAXPATHLEN so that the Linuxulator will now return ENAMETOOLONG even if the path is smaller than MAXPATHLEN. PR: 12749
* Implement pluggable ioctl handlers.marcel1999-12-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Other modules can register and unregister ioctl handlers to extend the ioctls known by the Linuxulator. A recent application is the vmware port. The Linuxulator itself uses the new interface to register its handlers as well. Handlers for the following types of ioctls have been defined: cdrom console (=keyboard and VT handling) socket sound termio All ioctl related defines and declarations have been moved to a new file (linux_ioctl.h), except for the pluggable ioctl handler interface definition. While there, cleanup linux.h some more. linux.h and linux_ioctl.[ch] have been made to conform to style(9) as much as possible. Inspired and reviewed by: Vladimir N. Silyaev
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* We don't end up checking for a return value of EFAULT from the copyinstr()green1999-08-071-5/+12
| | | | | | | | | | | | in the pathname translation procedure. This proves fatal, and can be easily fixed. This or a similar change needs to be committed to svr4_util.h and ibcs2_util.h. I will update ibcs2_util.h, if noone else thinks of a better way to do this, in the same manner. I will leave svr4 to the respective maintainer. This closes the problem of the only crash I've been able to produce as a user recently, except for (currently not-in-the-source tree) fd table sharing fixes. Thanks goes to pho for his stress-testers.
* Removed the cast to a pointer in the definition of PS_STRINGS andbde1998-12-161-2/+2
| | | | | | | adjusted related casts to match (only in the kernel in this commit). The pointer was only wanted in one place in kern_exec.c. Applications should use the kern.ps_strings sysctl instead of PS_STRINGS, so they shouldn't notice this change.
* remove option LINUX as it did nothing, add DEBUG_LINUX to debug thejmg1998-06-301-1/+3
| | | | | | linux emulation... (actually moved LINUX to opt_dontuse.h)
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix a (mostly harmless) bogon when allocating space above the stackpeter1996-03-101-2/+2
| | | | in the stack gap..
* First attempt at FreeBSD & Linux ELF support.sos1996-03-101-3/+1
| | | | | | | | | | | | | | | | | Compile and link a new kernel, that will give native ELF support, and provide the hooks for other ELF interpreters as well. To make native ELF binaries use John Polstras elf-kit-1.0.1.. For the time being also use his ld-elf.so.1 and put it in /usr/libexec. The Linux emulator has been enhanced to also run ELF binaries, it is however in its very first incarnation. Just get some Linux ELF libs (Slackware-3.0) and put them in the prober place (/compat/linux/...). I've ben able to run all the Slackware-3.0 binaries I've tried so far. (No it won't run quake yet :)
* Mega-commit for Linux emulator update.. This has been stress tested underpeter1996-03-021-0/+92
netscape-2.0 for Linux running all the Java stuff. The scrollbars are now working, at least on my machine. (whew! :-) I'm uncomfortable with the size of this commit, but it's too inter-dependant to easily seperate out. The main changes: COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386 machine dependent section into the linux emulator itself. The int 0x80 syscall code was almost identical to the lcall 7,0 code and a minor tweak allows them to both be used with the same C code. All kernels can now just modload the lkm and it'll DTRT without having to rebuild the kernel first. Like IBCS2, you can statically compile it in with "options LINUX". A pile of new syscalls implemented, including getdents(), llseek(), readv(), writev(), msync(), personality(). The Linux-ELF libraries want to use some of these. linux_select() now obeys Linux semantics, ie: returns the time remaining of the timeout value rather than leaving it the original value. Quite a few bugs removed, including incorrect arguments being used in syscalls.. eg: mixups between passing the sigset as an int, vs passing it as a pointer and doing a copyin(), missing return values, unhandled cases, SIOC* ioctls, etc. The build for the code has changed. i386/conf/files now knows how to build linux_genassym and generate linux_assym.h on the fly. Supporting changes elsewhere in the kernel: The user-mode signal trampoline has moved from the U area to immediately below the top of the stack (below PS_STRINGS). This allows the different binary emulations to have their own signal trampoline code (which gets rid of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so that the emulator can provide the exact "struct sigcontext *" argument to the program's signal handlers. The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which have the same values as the re-used SA_DISABLE and SA_ONSTACK which are intended for sigaction only. This enables the support of a SA_RESETHAND flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal semantics where the signal handler is reset when it's triggered. makesyscalls.sh no longer appends the struct sysentvec on the end of the generated init_sysent.c code. It's a lot saner to have it in a seperate file rather than trying to update the structure inside the awk script. :-) At exec time, the dozen bytes or so of signal trampoline code are copied to the top of the user's stack, rather than obtaining the trampoline code the old way by getting a clone of the parent's user area. This allows Linux and native binaries to freely exec each other without getting trampolines mixed up.
OpenPOWER on IntegriCloud