aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge r191877 from HEAD to stable/7:Dmitry Chagin2009-05-261-0/+29
| | | | | | | | | Add preliminary KTR(9) support to the linux emulation layer. Approved by: kib (mentor) Notes: svn path=/stable/7/; revision=192806
* Implement the openat() linux syscallJulian Elischer2007-03-291-2/+5
| | | | | | | | Submitted by: Roman Divacky (rdivacky@) MFC after: 2 weeks Notes: svn path=/head/; revision=168014
* Axe the stackgap macros as the Linux ABIs no longer use the stackgap.John Baldwin2006-06-271-26/+0
| | | | Notes: svn path=/head/; revision=159992
* Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.Doug 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 Notes: svn path=/head/; revision=158311
* Suppress logging about unimplemented syscalls to one time per process. ThisGleb Smirnoff2005-12-081-9/+7
| | | | | | | | | prevents hard flood of the system console. Reviewed by: bde Notes: svn path=/head/; revision=153236
* Remove linux_emul_find() and the CHECKALT*() macros as they are no longerJohn Baldwin2005-03-011-13/+0
| | | | | | | used. Notes: svn path=/head/; revision=142939
* Start each of the license/copyright comments with /*-Warner Losh2005-01-051-1/+1
| | | | Notes: svn path=/head/; revision=139743
* Rename thread args to be called "td" rather than "p" to beDavid Malone2004-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 Notes: svn path=/head/; revision=136356
* Use sv_psstrings from the current process's sysentvec structure insteadTim J. Robbins2004-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. Notes: svn path=/head/; revision=133745
* Add function linux_msg() for regulating output from the linux emulationAlfred Perlstein2003-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 Notes: svn path=/head/; revision=108541
* When complaining about obsolete/unimplemented syscalls output the processAlfred Perlstein2003-01-011-2/+2
| | | | | | | | | | name to make things more clear for the user. PR: 46661 MFC After: 3 days Notes: svn path=/head/; revision=108523
* Add a new function linux_emul_convpath(), which is a version ofIan Dowse2002-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(). Notes: svn path=/head/; revision=102803
* Remove __P.Alfred Perlstein2002-03-201-1/+1
| | | | Notes: svn path=/head/; revision=92761
* Garbage collect options AVM_A1_PCI, AVM_A1_PCMCIA, DEBUG_LINUX, DEV_APM,Bruce Evans2002-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. Notes: svn path=/head/; revision=90690
* Eliminate the prefix parameter to linux_emul_find(), which was alwaysDag-Erling Smørgrav2001-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 Notes: svn path=/head/; revision=85599
* Whitespace fix.Dag-Erling Smørgrav2001-10-191-1/+1
| | | | Notes: svn path=/head/; revision=85125
* KSE Milestone 2Julian Elischer2001-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 Notes: svn path=/head/; revision=83366
* The MI/MD split wasn't perfect and the MI files need hacks for theDavid E. O'Brien2000-11-011-0/+17
| | | | | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel Notes: svn path=/head/; revision=68201
* Remove the only use of SCARG and perform dead code elimination.Marcel Moolenaar2000-07-271-4/+0
| | | | Notes: svn path=/head/; revision=63903
* Add bounds checking to stackgap_alloc. Previously it was possibleMarcel Moolenaar2000-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 Notes: svn path=/head/; revision=63778
* Implement pluggable ioctl handlers.Marcel Moolenaar1999-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 Notes: svn path=/head/; revision=54122
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* We don't end up checking for a return value of EFAULT from the copyinstr()Brian Feldman1999-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. Notes: svn path=/head/; revision=49478
* Removed the cast to a pointer in the definition of PS_STRINGS andBruce Evans1998-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. Notes: svn path=/head/; revision=41871
* remove option LINUX as it did nothing, add DEBUG_LINUX to debug theJohn-Mark Gurney1998-06-301-1/+3
| | | | | | | | | linux emulation... (actually moved LINUX to opt_dontuse.h) Notes: svn path=/head/; revision=37287
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Fix a (mostly harmless) bogon when allocating space above the stackPeter Wemm1996-03-101-2/+2
| | | | | | | in the stack gap.. Notes: svn path=/head/; revision=14463
* First attempt at FreeBSD & Linux ELF support.Søren Schmidt1996-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 :) Notes: svn path=/head/; revision=14456
* Mega-commit for Linux emulator update.. This has been stress tested underPeter Wemm1996-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. Notes: svn path=/head/; revision=14331