summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
Commit message (Collapse)AuthorAgeFilesLines
* regennetchild2006-03-183-5/+20
|
* Fixup some problems in my previous commit (COMPAT_43).netchild2006-03-181-3/+3
| | | | Pointyhat to: netchild
* regen after COMPAT_43 removalnetchild2006-03-186-20/+29
|
* Get rid of the need of COMPAT_43 in the linuxolator.netchild2006-03-181-11/+7
| | | | | Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Obtained from: DragonFly (some parts)
* Close some races between procfs/ptrace and exit(2):jhb2006-02-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reorder the events in exit(2) slightly so that we trigger the S_EXIT stop event earlier. After we have signalled that, we set P_WEXIT and then wait for any processes with a hold on the vmspace via PHOLD to release it. PHOLD now KASSERT()'s that P_WEXIT is clear when it is invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops to zero. - Change proc_rwmem() to require that the processing read from has its vmspace held via PHOLD by the caller and get rid of all the junk to screw around with the vmspace reference count as we no longer need it. - In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it doesn't exist. - Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem() to clear an earlier single-step simualted via a breakpoint). We only do one to avoid races. Also, by making the EINVAL error for unknown requests be part of the default: case in the switch, the various switch cases can now just break out to return which removes a _lot_ of duplicated PRELE and proc unlocks, etc. Also, it fixes at least one bug where a LWP ptrace command could return EINVAL with the proc lock still held. - Changed the locking for ptrace_single_step(), ptrace_set_pc(), and ptrace_clear_single_step() to always be called with the proc lock held (it was a mixed bag previously). Alpha and arm have to drop the lock while the mess around with breakpoints, but other archs avoid extra lock release/acquires in ptrace(). I did have to fix a couple of other consumers in kern_kse and a few other places to hold the proc lock and PHOLD. Tested by: ps (1 mostly, but some bits of 2-4 as well) MFC after: 1 week
* - Always call exec_free_args() in kern_execve() instead of doing it in alljhb2006-02-061-1/+0
| | | | | | the callers if the exec either succeeds or fails early. - Move the code to call exit1() if the exec fails after the vmspace is gone to the bottom of kern_execve() to cut down on some code duplication.
* Regenerate.rwatson2006-02-063-164/+164
|
* Assign audit event identifiers to Linux i386 system calls.rwatson2006-02-061-169/+177
| | | | Obtained from: TrustedBSD Project
* Remove kern.elf32.can_exec_dyn sysctl. Instead extend Brandinfo structuresobomax2005-12-261-0/+2
| | | | | | | | | | with flags bitfield and set BI_CAN_EXEC_DYN flag for all brands that usually allow executing elf dynamic binaries (aka shared libraries). When it is requested to execute ET_DYN elf image check if this flag is on after we know the elf brand allowing execution if so. PR: kern/87615 Submitted by: Marcin Koziej <creep@desk.pl>
* Remove linux_mib_destroy() (which I actually added in between 5.0 and 5.1)jhb2005-12-151-1/+0
| | | | | | | | | which existed to cleanup the linux_osname mutex. Now that MTX_SYSINIT() has grown a SYSUNINIT to destroy mutexes on unload, the extra destroy here was redundant and resulted in panics in debug kernels. MFC after: 1 week Reported by: Goran Gajic ggajic at afrodita dot rcub dot bg dot ac dot yu
* The signal code is now an int rather than a long, so update debug printfs.jhb2005-10-141-2/+2
|
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostdavidxu2005-10-141-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes in MD code are trivial, before this change, trapsignal and sendsig use discrete parameters, now they uses member fields of ksiginfo_t structure. For sendsig, this change allows us to pass POSIX realtime signal value to user code. 2. Remove cpu_thread_siginfo, it is no longer needed because we now always generate ksiginfo_t data and feed it to libpthread. 3. Add p_sigqueue to proc structure to hold shared signals which were blocked by all threads in the proc. 4. Add td_sigqueue to thread structure to hold all signals delivered to thread. 5. i386 and amd64 now return POSIX standard si_code, other arches will be fixed. 6. In this sigqueue implementation, pending signal set is kept as before, an extra siginfo list holds additional siginfo_t data for signals. kernel code uses psignal() still behavior as before, it won't be failed even under memory pressure, only exception is when deleting a signal, we should call sigqueue_delete to remove signal from sigqueue but not SIGDELSET. Current there is no kernel code will deliver a signal with additional data, so kernel should be as stable as before, a ksiginfo can carry more information, for example, allow signal to be delivered but throw away siginfo data if memory is not enough. SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can not be caught or masked. The sigqueue() syscall allows user code to queue a signal to target process, if resource is unavailable, EAGAIN will be returned as specification said. Just before thread exits, signal queue memory will be freed by sigqueue_flush. Current, all signals are allowed to be queued, not only realtime signals. Earlier patch reviewed by: jhb, deischen Tested on: i386, amd64
* Propagate error code of kern_execve() to the caller properly.sobomax2005-08-011-1/+1
| | | | | | PR: 81670 Submitted by: Andrew Bliznak <andriko.b@gmail.com> Pointy hat to: sobomax
* Move MODULE_DEPEND() statements for SYSVIPC dependencies to linux_ipc.cjhb2005-07-291-3/+0
| | | | | so that they aren't duplicated 3 times and are also in the same file as the code that depends on the SYSVIPC modules.
* Regen.jhb2005-07-133-128/+128
|
* Make a pass through all the compat ABIs sychronizing the MP safe flagsjhb2005-07-131-125/+125
| | | | | | | with the master syscall table as well as marking several ABI wrapper functions safe. MFC after: 1 week
* Remove the CPU_ENABLE_SSE option from the i386 and pc98 architectures,delphij2005-07-021-4/+1
| | | | | | | | | | | | | | | | | | | | | | | as they are already default for I686_CPU for almost 3 years, and CPU_DISABLE_SSE always disables it. On the other hand, CPU_ENABLE_SSE does not work for I486_CPU and I586_CPU. This commit has: - Removed the option from conf/options.* - Removed the option and comments from MD NOTES files - Simplified the CPU_ENABLE_SSE ifdef's so they don't deal with CPU_ENABLE_SSE from kernel configuration. (*) For most users, this commit should be largely no-op. If you used to place CPU_ENABLE_SSE into your kernel configuration for some reason, it is time to remove it. (*) The ifdef's of CPU_ENABLE_SSE are not removed at this point, since we need to change it to !defined(CPU_DISABLE_SSE) && defined(I686_CPU), not just !defined(CPU_DISABLE_SSE), if we really want to do so. Discussed on: -arch Approved by: re (scottl)
* Regen after addition of linux_getpriority wrapper.sobomax2005-06-083-5/+10
| | | | | | PR: kern/81951 Submitted by: Andriy Gapon <avg@icyb.net.ua> MFC after: 1 week
* Properly convert FreeBSD priority values into Linux values in thesobomax2005-06-081-1/+1
| | | | | | | getpriority(2) syscall. PR: kern/81951 Submitted by: Andriy Gapon <avg@icyb.net.ua>
* Rebuild generated system call definition files following the addition ofrwatson2005-05-303-271/+272
| | | | | | | the audit event field to the syscalls.master file format. Submitted by: wsalamon Obtained from: TrustedBSD Project
* Introduce a new field in the syscalls.master file format to hold therwatson2005-05-301-313/+397
| | | | | | | | | | | | | audit event identifier associated with each system call, which will be stored by makesyscalls.sh in the sy_auevent field of struct sysent. For now, default the audit identifier on all system calls to AUE_NULL, but in the near future, other BSM event identifiers will be used. The mapping of system calls to event identifiers is many:one due to multiple system calls that map to the same end functionality across compatibility wrappers, ABI wrappers, etc. Submitted by: wsalamon Obtained from: TrustedBSD Project
* Add support for O_NOFOLLOW and O_DIRECT to Linux fcntl() F_GETFL/F_SETFL.mdodd2005-04-131-0/+5
|
* - Change the vm_mmap() function to accept an objtype_t parameter specifyingjhb2005-04-011-3/+4
| | | | | | | | | | | | the type of object represented by the handle argument. - Allow vm_mmap() to map device memory via cdev objects in addition to vnodes and anonymous memory. Note that mmaping a cdev directly does not currently perform any MAC checks like mapping a vnode does. - Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the cdev the ioctl is acting on rather than trying to find a suitable vnode to map from. Reviewed by: alc, arch@
* Regen after addition of linux_nosys handler.sobomax2005-03-073-3/+9
|
* Handle unimplemented syscall by instantly returning ENOSYS instead of sendingsobomax2005-03-071-0/+4
| | | | | | | signal first and only then returning ENOSYS to match what real linux does. PR: kern/74302 Submitted by: Travis Poppe <tlp@LiquidX.org>
* In linux emulation layer try to detect attempt to use linux_clone() tosobomax2005-03-031-0/+19
| | | | | | | | | | | | | | | | | | | | | | create kernel threads and call rfork(2) with RFTHREAD flag set in this case, which puts parent and child into the same threading group. As a result all threads that belong to the same program end up in the same threading group. This is similar to what linuxthreads port does, though in this case we don't have a luxury of having access to the source code and there is no definite way to differentiate linux_clone() called for threading purposes from other uses, so that we have to resort to heuristics. Allow SIGTHR to be delivered between all processes in the same threading group previously it has been blocked for s[ug]id processes. This also should improve locking of the same file descriptor from different threads in programs running under linux compat layer. PR: kern/72922 Reported by: Andriy Gapon <avg@icyb.net.ua> Idea suggested by: rwatson
* Use linux_emul_convpath() rather than linux_emul_find() asjhb2005-02-071-7/+6
| | | | linux_emul_find() is going away.
* Use the LCONVPATHEXIST() macro rather than it's exact expansion to bejhb2005-02-071-4/+1
| | | | consistent.
* When running Linux binaries, set up the initial FPU state as Linuxdas2005-02-061-0/+7
| | | | | | would. PR: 28966
* o Split out kernel part of execve(2) syscall into two parts: one thatsobomax2005-01-293-18/+21
| | | | | | | | | | | copies arguments into the kernel space and one that operates completely in the kernel space; o use kernel-only version of execve(2) to kill another stackgap in linuxlator/i386. Obtained from: DragonFlyBSD (partially) MFC after: 2 weeks
* o Move copyin()/copyout() out of i386_{get,set}_ldt() andsobomax2005-01-261-43/+34
| | | | | | | | | i386_{get,set}_ioperm() and make those APIs visible in the kernel namespace; o use i386_{get,set}_ldt() and i386_{get,set}_ioperm() instead of sysarch() in the linuxlator, which allows to kill another two stackgaps. MFC after: 2 weeks
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Axe the semblance of support for PECOFF and Linux a.out core dumps.das2004-11-271-52/+2
|
* Maintain the broken state of backwards compatibilty for a.out (anddas2004-11-201-2/+3
| | | | | | | PECOFF!) core dumps. None of the old versions of gdb I tried were able to read a.out core dumps before or after this change. Reviewed by: arch@
* Fix the following race:das2004-10-011-3/+4
| | | | | | | | | | | 1. Process p1 is currently being swapped in. 2. Process p2 calls linux_ptrace(PTRACE_GETFPXREGS, p1_pid, ...) 3. After acquiring a reference to FIRST_THREAD_IN_PROC(p1), p2 blocks in faultin() while p1 finishes being swapped in. This means p2 won't get back the lock on p1 until after p1's threads are runnable. 4. After p1 is swapped in, the first thread in p1 exits. 5. p2 now uses its dangling reference to p1's first thread.
* Regen.dfr2004-09-063-6/+22
|
* Add a few stub syscalls to get TransGaming's winex a bit closer todfr2004-09-062-3/+30
| | | | working.
* Give setrunqueue() and sched_add() more of a clue as tojulian2004-09-011-1/+1
| | | | | | where they are coming from and what is expected from them. MFC after: 2 days
* Correct the arguments to kern_sigaltstack() as they were reversed.jhb2004-08-241-2/+2
| | | | | PR: kern/68079 Submitted by: Georg-W. Koltermann gwk at rahn-koltermann dot de
* Regenerate after fcntl() wrappers were marked MP safe.jhb2004-08-243-5/+5
|
* Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl()jhb2004-08-241-2/+2
| | | | | | | | directly. This removes a few more users of the stackgap and also marks the syscalls using these wrappers MP safe where appropriate. Tested on: i386 with linux acroread5 Compiled on: i386, alpha LINT
* Add a new type, l_uintptr_t, which is an unsigned integer type with thetjr2004-08-161-0/+4
| | | | | same width as a pointer under Linux. Add two new macros, PTRIN and PTROUT, which convert between l_uintptr_t and native pointers.
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-1/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Consistently use __inline instead of __inline__ as the former is an empty macrostefanf2004-07-041-1/+1
| | | | in <sys/cdefs.h> for compilers without support for inline.
* Add casts so all these quantities are a constant type.obrien2004-06-241-1/+1
|
* Change the types of vn_rdwr_inchunks()'s len and aresid arguments totjr2004-06-051-1/+1
| | | | | | size_t and size_t *, respectively. Update callers for the new interface. This is a better fix for overflows that occurred when dumping segments larger than 2GB to core files.
* Use the BSD madvise() syscall implementation for Linux binary emulation,bms2004-03-285-8/+3
| | | | | | | | instead of treating it as an unimplemented syscall. This appears to make StarOffice 7.0 Linux binaries work according to submitter; also tested with nvidia driver by submitter. Submitted by: Matthias Schuendehuette
* Regenerate.jhb2004-03-153-6/+6
|
* - Mark ABI syscalls that call wait4() MP safe as recent changes tojhb2004-03-151-3/+3
| | | | | | the kernel wait4() made these all panic() implementations otherwise. - The i386 linux_ptrace() syscall is MP safe. Alpha was already marked MP safe.
* Regen.jhb2004-02-043-6/+6
|
OpenPOWER on IntegriCloud