summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Stop using linux_getpgid(). The implementation at this time ismarcel2001-09-281-1/+1
| | | | | | | | | broken and fixing it only creates a duplicate of what is already in the FreeBSD kernel. Therefore, map the syscall directly to getpgid(). PR: kern/21402 Submitted by: Christian Weisgerber <naddy@mips.inka.de>
* o Modify access control checks in linux_iopl() to use securelevel_gt()rwatson2001-09-261-2/+2
| | | | | | | rather than direct variable checks. (Yet another API to perform direct hardware I/O.) Obtained from: TrustedBSD Project
* Add a lock assertion to linux_sendsig() to match other sendsig functions.jhb2001-09-171-0/+1
|
* Add a wrapper for linux_getsid -> getsid Syscall.mr2001-09-151-1/+0
|
* Implement LINUX_[SEM|IPC]_[STAT|INFO]mr2001-09-151-0/+2
| | | | | | | to make /compat/linux/usr/bin/ipcs -s happy. PR: kern/29698 (part) Reviewed by: audit
* KSE Milestone 2julian2001-09-124-237/+243
| | | | | | | | | | | | | | 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
* Fix LINT breakage caused by previous commit. The linux_rt_sendsigmarcel2001-09-101-0/+9
| | | | | | | | | | | | and linux_sendsig functions guarded their debugging output with ldebug(sigreturn). This has been mistaken for a cut-n-paste bug, and was replaced by ldebug(rt_sendsig) and ldebug(sendsig) resp. Since the sendsig functions are not syscalls, this brokei any build that defines DEBUG. The fix maps both functions to the unused syscall 0 so that they can be enabled/disabled independently from sigreturn, but not independently from each other.
* Round of cleanups and enhancements. These include (in random order):marcel2001-09-088-798/+1102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Introduce private types for use in linux syscalls for two reasons: 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Provide dummy functions for all syscalls and remove dummy functions or implementations of truely obsolete syscalls. o Sanitize the shm*, sem* and msg* syscalls. o Make a first attempt to implement the linux_sysctl syscall. At this time it only returns one MIB (KERN_VERSION), but most importantly, it tells us when we need to add additional sysctls :-) o Bump the kenel version up to 2.4.2 (this is not the same as the KERN_VERSION MIB, BTW). o Implement new syscalls, of which most are specific to i386. Our syscall table is now up to date with Linux 2.4.2. Some highlights: - Implement the 32-bit uid_t and gid_t bases syscalls. - Implement a couple of 64-bit file size/offset bases syscalls. o Fix or improve numerous syscalls and prototypes. o Reduce style(9) violations while I'm here. Especially indentation inconsistencies within the same file are addressed. Re-indenting did not obfuscate actual changes to the extend that it could not be combined. NOTE: I spend some time testing these changes and found that if there were regressions, they were not caused by these changes AFAICT. It was observed that installing a RH 7.1 runtime environment did make matters worse. Hangs and/or reboots have been observed with and without these changes, so when it failed to make life better in cases it doesn't look like it made it worse.
* o Introduce private types for use in linux syscalls for two reasons:marcel2001-09-081-166/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Remove dummy functions for syscalls that are now truely unimplemented. o Rename syscalls so they match the names used in the Linux kernel. Also, provide more accurate prototypes. This generally improves cross-referencing and reduces head-scratching. o Provide seperate implementations for the 16-bit uid_t and gid_t based syscalls as Linux used to have. The new 32-bit uid_t and gid_t based syscalls now map to their FreeBSD equivalents. o Fix the linux_ipc syscall so that it doesn't force the shm*, sem* and msg* syscalls to have the same syscall. The prototypes for these syscalls now match the those used on Alpha. While here, add the same kludge for MSGRCV as is present in the Linux kernel. o Implement the following syscalls: linux_stat64, linux_lstat64 and linux_fstat64 linux_sysctl o Added syscalls numbered 198 - 221. This include: - the 32-bit uid_t and gid_t bases syscalls - 64-bit file offset/size based syscalls
* Call sendsig() with the proc lock held and return with it held.jhb2001-09-061-2/+2
|
* Synchronize syscalls.master(s) with recent Giant pushdown workdillon2001-09-011-8/+8
|
* Remove the MPSAFE keyword from the parser for syscalls.master.dillon2001-08-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead introduce the [M] prefix to existing keywords. e.g. MSTD is the MP SAFE version of STD. This is prepatory for a massive Giant lock pushdown. The old MPSAFE keyword made syscalls.master too messy. Begin comments MP-Safe procedures with the comment: /* * MPSAFE */ This comments means that the procedure may be called without Giant held (The procedure itself may still need to obtain Giant temporarily to do its thing). sv_prepsyscall() is now MP SAFE and assumed to be MP SAFE sv_transtrap() is now MP SAFE and assumed to be MP SAFE ktrsyscall() and ktrsysret() are now MP SAFE (Giant Pushdown) trapsignal() is now MP SAFE (Giant Pushdown) Places which used to do the if (mtx_owned(&Giant)) mtx_unlock(&Giant) test in syscall[2]() in */*/trap.c now do not. Instead they explicitly unlock Giant if they previously obtained it, and then assert that it is no longer held to catch broken system calls. Rebuild syscall tables.
* Added the linux_sysinfo function to implement sysinfo(2).pirzyk2001-07-233-3/+2
| | | | | | | PR: kern/27759 Reviewed by: marcel Approved by: marcel MFC after: 1 week
* Added the proper arguments the sysinfo system callpirzyk2001-07-231-1/+1
| | | | | | | | PR: kern/27759 Reviewed by: marcel Approved by: marcel Obtained from: Linux man page sysinfo(2) MFC after: 1 week
* Add a new MI pointer to the process' trapframe p_frame instead of usingjhb2001-06-292-6/+6
| | | | | | various differently named pointers buried under p_md. Reviewed by: jake (in principle)
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-132-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-0/+1
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Preserve the state of the %gs register when setting up the signaldeischen2001-05-121-2/+0
| | | | | | | | | | handler in Linux emulation. According to bde, this is what Linux does. Recent versions of linuxthreads use %gs for thread-specific data, while FreeBSD uses %fs (mostly because WINE uses %gs). Tested by: drew
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-013-9/+14
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Regen after adding linux_sched_get_priority_max() andalc2001-04-013-7/+15
| | | | linux_sched_get_priority_min().
* Add linux_sched_get_priority_max() and linux_sched_get_priority_min(): Thealc2001-04-011-2/+2
| | | | policy parameter requires translation.
* rfork() masks RFSTOPPED out of the flags it passes to fork1(), so we havedes2001-03-111-7/+3
| | | | | | | to call fork1() directly if we don't want out process queued right away. This has the serendipitous side effect of saving us a call to pfind(). This makes threaded Linux apps (such as Opera) work again.
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-2/+4
|
* Create clone'd linux processes as stopped processes at first and don'tjhb2001-03-061-1/+9
| | | | | actually make them runnable until after the emulator layer has had a chance to perform fixups.
* Linux does not filesystem-sync file-backed writable mmap pages ondillon2001-02-281-0/+2
| | | | | | | | | | | | a regular basis. Adjust our linux emulation to conform. This will cause more dirty pages to be left for the pagedaemon to deal with, but our new low-memory handling code can deal with it. The linux way appears to be a trend, and we may very well make MAP_NOSYNC the default for FreeBSD as well (once we have reasonable sequential write-behind heuristics for random faults). (will be MFC'd prior to 4.3 freeze) Suggested by: Andrew Gallatin
* Remove the leading underscore from all symbols defined in x86 asmjake2001-02-252-9/+9
| | | | | | | | | | | and used in C or vice versa. The elf compiler uses the same names for both. Remove asnames.h with great prejudice; it has served its purpose. Note that this does not affect the ability to generate an aout kernel due to gcc's -mno-underscores option. moral support from: peter, jhb
* MFS: bring the consistent `compat_3_brand' support into -CURRENTobrien2001-02-241-0/+2
| | | | | (the work was first done in the RELENG_4 branch near a release during a MFC to make the code cleaner and more consistent)
* Allow debugging output to be controlled on a per-syscall granularity.jlemon2001-02-163-45/+67
| | | | | | Also clean up debugging output in a slightly more uniform fashion. The default behavior remains the same (all debugging output is turned on)
* Re-gen auto generated files.jlemon2001-02-163-11/+22
|
* Remove dummy stub functions.jlemon2001-02-161-3/+0
|
* Add mount syscall to linux emulation. Also improve emulation of reboot.jlemon2001-02-162-4/+15
|
* Proc locking.jhb2001-01-242-0/+17
|
* - Proc locking.jhb2001-01-241-1/+6
| | | | - Use NULL instead of 0.
* The Linuxulator needs sysvipc to work.des2001-01-141-0/+3
|
* Remove after repo-copy to sys/compat/linprocfs.des2000-12-125-2290/+0
|
* Add proc/<pid>/cmdline.des2000-12-093-1/+9
|
* Add a dependency on procfs.des2000-12-091-0/+1
|
* A bunch of fixes that have been rotting in my tree for a month or twodes2000-12-091-71/+91
| | | | | | | | | | | | | | | waiting for procfs to get fixed: - Use fill_eproc() to obtain correct VM stats. Attempt to compute VmLib. - Fill some more fields in proc/<pid>/stat, and add four (unimplemented) fields after studying a recent Linux kernel. - Compute CPU frequency only once instead of twice. - Fix some comments that were OBE. - Fix indentation except where it makes the code less readable.
* Protect access to p_stat with sched_lock.jhb2000-12-011-0/+2
|
* Don't use p->p_sigstk.ss_flags to keep state of whether themarcel2000-11-303-20/+12
| | | | | | | | | | | | | | | process is on the alternate stack or not. For compatibility with sigstack(2) state is being updated if such is needed. We now determine whether the process is on the alternate stack by looking at its stack pointer. This allows a process to siglongjmp from a signal handler on the alternate stack to the place of the sigsetjmp on the normal stack. When maintaining state, this would have invalidated the state information and causing a subsequent signal to be delivered on the normal stack instead of the alternate stack. PR: 22286
* Add bogomips to cpuinfo (set it equal to the CPU frequency, which is bogusdes2000-11-271-7/+10
| | | | | | | but not more so than Linux' definition). This should get the IBM JDK 1.3 working again. Prompted by: sobomax
* Correct a misnamed argument hidden behind a #ifdef DEBUGjlemon2000-11-251-1/+1
| | | | Found by: LINT
* o Change the argument of linux_sigreturn to be a pointer to amarcel2000-11-236-77/+72
| | | | | | | | | | struct sigframe. We need more than only the signal context. o Properly convert the signal mask when setting up the signal frame in linux_sendsig and properly convert it back in linux_sigreturn. Do some cleanups and improve style while here.
* Change the argument of linux_sigreturn to be a pointer to amarcel2000-11-231-1/+1
| | | | struct sigframe.
* Don't unregister the ioctl handlers before we verified wemarcel2000-11-231-11/+14
| | | | | | | | | | | can unload. Doing so leaves the linuxulator in a crippled state (no ioctl support) when Linux binaries are run at unload time. While here, consistently spell ELF in capitals and perform some minor style improvements. ELF spelling submitted by: asmodai
* remove redundant declaration of bsd_to_linux_sigset()gallatin2000-11-161-1/+0
| | | | reviewed by: marcel
* fix glaring bugs in rt signals -- copyout the right signal mask ingallatin2000-11-161-2/+3
| | | | | | | | linux_rt_sendsig() and restore the same signal mask linux does in rt_sigreturn(). This gets us saving/restoring all 64-bits of the linux sigset_t in rt signals. Reviewed by: marcel
* Make linux_sendsig and linux_sigreturn use all 64 bits of agallatin2000-11-132-5/+56
| | | | | | | | | | | | | | | | | | linux_sigset_t by updating the linux_sigframe struct so as to include linux's "extramask" field. This field contains the upper 32-bits of the sigset. extramask sits behind a linux_fpstate struct, which I've defined primarily for padding purposes. While we're here, define LINUX_NSIG in terms of LINUX_NBPW (32) and LINUX_NSIG_WORDS (2). This fixes problems where threaded apps would accumulate a large number of zombies. This was happening because the exit signal resides in the upper 32-bits of the sigset and was never getting unmasked by the manager thread after the first child exited. PR: misc/18530 (may be related, originator not yet contacted) Reviewed by: marcel
* Revert auto-generation. The Alpha port is broken.marcel2000-11-109-6/+1125
| | | | Syncing with it is wrong.
OpenPOWER on IntegriCloud