summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Use proc lock to protect p_ucred pointer while we deference it to read ajhb2002-04-111-0/+4
| | | | few values.
* Use td_ucred in a few spots.jhb2002-04-111-3/+3
|
* Initial support for executing IA-32 binaries. This will not compiledfr2002-04-106-0/+2839
| | | | | | | | | without a few patches for the rest of the kernel to allow the image activator to override exec_copyout_strings and setregs. None of the syscall argument translation has been done. Possibly, this translation layer can be shared with any platform that wants to support running ILP32 binaries on an LP64 host (e.g. sparc32 binaries?)
* - Change fill_kinfo_proc() to require that the process is locked when itjhb2002-04-092-4/+7
| | | | | | | | | | | | | | is called. - Change sysctl_out_proc() to require that the process is locked when it is called and to drop the lock before it returns. If this proves too complex we can change sysctl_out_proc() to simply acquire the lock at the very end and have the calling code drop the lock right after it returns. - Lock the process we are going to export before the p_cansee() in the loop in sysctl_kern_proc() and hold the lock until we call sysctl_out_proc(). - Don't call p_cansee() on the process about to be exported twice in the aforementioned loop.
* Moved signal handling and rescheduling from userret() to ast() so thatbde2002-04-042-0/+5
| | | | | | | | | | | they aren't in the usual path of execution for syscalls and traps. The main complication for this is that we have to set flags to control ast() everywhere that changes the signal mask. Avoid locking in userret() in most of the remaining cases. Submitted by: luoqi (first part only, long ago, reorganized by me) Reminded by: dillon
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-015-6/+6
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Protect proc struct (p_args and p_comm) when doing procfs IO that pullsalfred2002-03-291-11/+17
| | | | | | data from it. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Make the reference counting of 'struct pargs' SMP safe.alfred2002-03-271-2/+1
| | | | | | | | | There is still some locations where the PROC lock should be held in order to prevent inconsistent views from outside (like the proc->p_fd fix for kern/vfs_syscalls.c:checkdirs()) that can be fixed later. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Fixed some style bugs in the removal of __P(()). Tabs before "__P(("bde2002-03-241-6/+6
| | | | were not removed.
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-204-5/+2
|
* Remove __P.alfred2002-03-2026-280/+274
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-279-23/+22
| | | | reference.
* Use the updated getcredhostname() function.robert2002-02-272-5/+2
|
* - Use the new getcredhostname function in the SVR4 uname system call.robert2002-02-271-2/+3
| | | | | | - Remove spurious empty line. Reviewed by: phk
* Use the getcredhostname function to fill the hostname intorobert2002-02-271-1/+3
| | | | | | | | the linux_newuname_args structure. This should fix the case of jailed linux processes not using the jail's hostname. PR: 35336 Reviewed by: phk
* remove "discards qualifier" erro by not potentially writing tojulian2002-02-261-2/+5
| | | | a const *.
* Lock struct pgrp, session and sigio.tanimura2002-02-233-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* fix file descriptor leak.alfred2002-02-201-1/+2
| | | | Submitted by: Mark Santcroos <marks@ripe.net>
* 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.
* Attempt to unmangle some code touched in the previous commit.peter2002-02-071-11/+8
|
* Pre-KSE/M3 commit.julian2002-02-071-11/+17
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* include sys/lock.h and sys/mutex.h to make compile.alfred2002-01-301-0/+2
| | | | Noticed by: Vincent Poy <vince@oahu.WURLDLINK.NET>
* Have SIOCGIFCONF return all (if any) AF_INET addresses for themarcel2002-01-291-4/+22
| | | | | | | | | | | | | | | | | | | | | interfaces we encounter. In Linux, all addresses are returned for which gifconf handlers are installed. This boils down to AF_DECnet and AF_INET. We care mostly about AF_INET for now. Adding additional families is simple enough. Returning the addresses is important for RPC clients to function properly. Andrew found in some reference code that the logic that handles the retransmission looks for an interface that's up and has an AF_INET address. This obviously failed as we didn't return any addresses at all. Note also that with this change we don't return interfaces that don't have AF_INET addresses, whereas before we returned any interface present in the system. This is in line with what Linux does (modulo interfaces with only AF_DECnet addresses of course :-) Reported by: "Andrew Atrens" <atrens@nortelnetworks.com> MFC after: 1 week
* Linux/alpha uses the same BSDish return mechanism we do forgallatin2002-01-231-0/+4
| | | | | | | | getpid, getuid, getgid and pipe, since they bootstrapped from OSF/1 and never cleaned up. Switch to the native syscalls on alpha so that the above functions work MFC after: 7 days
* Lock the caller process if the pid passed to getsid() or getpgid()tanimura2002-01-191-4/+6
| | | | equals to zero.
* For getsid(), return the sid stored in struct session. This preventstanimura2002-01-191-1/+1
| | | | | | panic in case where a session has no session leader. Inspired by: Solaris 8
* Make compile, remove extra fdrop() calls.alfred2002-01-191-3/+1
| | | | Change name of function to what it's supposed to be (s/sys/do)
* make compile, add missing { and variable declaration.alfred2002-01-191-2/+2
|
* Semi-backout previous fgetvp change, we need the struct file pointeralfred2002-01-191-7/+11
| | | | to perform relative offset calculations, so use fget instead.
* fix typo, there's uap, just fdalfred2002-01-161-1/+1
|
* Reinstate linux_ifname. Although the Linuxulator doesn't use itmarcel2002-01-151-0/+27
| | | | | | itself, it's used outside the Linuxulator. Reimplement the function so that its behaviour matches the current renaming scheme. It's probably better to formalize these interdependencies.
* Replace ffind_* with fget calls.alfred2002-01-147-58/+38
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* Remove unused variable.alfred2002-01-131-1/+0
|
* Some of the KSE stuff was accidentally reverted by file locking,alfred2002-01-131-5/+5
| | | | | | fix it. Pointed out by: jhb
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-138-165/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* Further fixes related to the interface renaming. Now that wemarcel2002-01-101-52/+12
| | | | | | | | | | | | | | properly translate the interface name passed to us, make sure we also translate correctly before we return the list of interfaces with the SIOCGIFCONF ioctl. It is common to use the interface names returned by that ioctl in further ioctls, such as SIOCGIFFLAGS. Remove linux_ifname as it is no longer used. Also remove ifname_bsd_to_linux as it cannot be used anymore now that linux_ifname is removed (was deadcode anyway). Reported and tested by: Andrew Atrens <atrens@nortelnetworks.com>
* Gut this header; since physio_proc_init is never called, the code never doesmsmith2002-01-081-34/+1
| | | | anything more than multiply declare some unused variables.
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-5/+5
| | | | also don't use ANSI string concatenation.
* Pull in more stuff from procfs now that it's been pseudofsized.des2001-12-091-31/+3
|
* When translating the interface name when "eth?" is given, do notmarcel2001-12-041-3/+9
| | | | | | | | | | | | | | use the internal index number as the unit number to compare with. The first ethernet interface in Linux is called "eth0", whereas our internal index starts wth 1 and is not unique to ethernet interfaces (lo0 has index 1 for example). Instead, use a function- local index number that starts with 0 and is incremented only for ethernet interfaces. This way the unit number will match the n-th ethernet interface in the system, which is exactly what it means in Linux. Tested by: Glenn Johnson <gjohnson@srrc.ars.usda.gov> MFC after: 3 days
* o Introduce pr_mtx into struct prison, providing protection for therwatson2001-12-034-43/+111
| | | | | | | | | | | | | | | | | | mutable contents of struct prison (hostname, securelevel, refcount, pr_linux, ...) o Generally introduce mtx_lock()/mtx_unlock() calls throughout kern/ so as to enforce these protections, in particular, in kern_mib.c protection sysctl access to the hostname and securelevel, as well as kern_prot.c access to the securelevel for access control purposes. o Rewrite linux emulator abstractions for accessing per-jail linux mib entries (osname, osrelease, osversion) so that they don't return a pointer to the text in the struct linux_prison, rather, a copy to an array passed into the calls. Likewise, update linprocfs to use these primitives. o Update in_pcb.c to always use prison_getip() rather than directly accessing struct prison. Reviewed by: jhb
* Revert incorrect KSEfication: realitexpire expects a struct proc *, not ades2001-11-241-1/+1
| | | | struct thread *.
* Deal with a few issues that cropped up following the recent changesiedowse2001-11-192-14/+70
| | | | | | | | | | | | | | | | | | | | | | | to the code for translating socket and private ioctls: - Only perform socket ioctl translation if the file descriptor is a socket. - Treat socket ioctls on non-sockets specially, and for now assume that these are directed at a tap/vmnet device, so translate the ioctl numbers as appropriate (the way if_tap abuses some socket ioctls to pass non-ifreq data is utterly bogus, but this is how VMware on FreeBSD has always "worked"; I will deal with this later). - Add (untested) support for translating SIOCSIFADDR. - In all cases where we fail to translate an ioctl, return ENOIOCTL so that other handlers have a chance to do the translation. This should fix the "/dev/vmnet1: Invalid argument" errors that users of VMware were experiencing, though I have only verified this on RELENG_4. Submitted by: des (mostly) MFC after: 3 days
* Implement DVD-ROM ioctls.marcel2001-11-182-27/+434
| | | | | PR: 26955 Submitted by: Boris Nikolaus (email unknown)
* Implement missing SOUND_MIXER_WRITE_RECSRC ioctl.marcel2001-11-182-0/+5
| | | | | PR: 22971 Tested by: dougb
* Fix missing holdsock()->fgetsock()dillon2001-11-171-7/+5
| | | | Submitted by: Hisashi Hiramoto <hiramoto@phys.chs.nihon-u.ac.jp>
* Give struct socket structures a ref counting interface similar todillon2001-11-171-18/+12
| | | | | | | vnodes. This will hopefully serve as a base from which we can expand the MP code. We currently do not attempt to obtain any mutex or SX locks, but the door is open to add them when we nail down exactly how that part of it is going to work.
* Forward declare struct ifnet - this fixes a warning in tdfx_pci.cpeter2001-11-171-0/+1
|
* Fix printf warnings (int/long)peter2001-11-171-2/+4
| | | | #if 0 around unused ifname_bsd_to_linux() function
* Fix warning in debug printf. This is a long on alpha, and int on i386,peter2001-11-171-1/+1
| | | | but printed with %ld always.
OpenPOWER on IntegriCloud