aboutsummaryrefslogtreecommitdiff
path: root/sys/alpha/osf1
Commit message (Collapse)AuthorAgeFilesLines
* First pass at removing Alpha kernel support.John Baldwin2006-05-1117-5421/+0
| | | | Notes: svn path=/head/; revision=158458
* - Always call exec_free_args() in kern_execve() instead of doing it in allJohn Baldwin2006-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. Notes: svn path=/head/; revision=155402
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostDavid Xu2005-10-142-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=151316
* Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57,Robert Watson2005-09-283-32/+6
| | | | | | | | | | | | | | | | | | | | | | | osf1_signal.c:1.41, amd64/amd64/trap.c:1.291, linux_socket.c:1.60, svr4_fcntl.c:1.36, svr4_ioctl.c:1.23, svr4_ipc.c:1.18, svr4_misc.c:1.81, svr4_signal.c:1.34, svr4_stat.c:1.21, svr4_stream.c:1.55, svr4_termios.c:1.13, svr4_ttold.c:1.15, svr4_util.h:1.10, ext2_alloc.c:1.43, i386/i386/trap.c:1.279, vm86.c:1.58, unaligned.c:1.12, imgact_elf.c:1.164, ffs_alloc.c:1.133: Now that Giant is acquired in uprintf() and tprintf(), the caller no longer leads to acquire Giant unless it also holds another mutex that would generate a lock order reversal when calling into these functions. Specifically not backed out is the acquisition of Giant in nfs_socket.c and rpcclnt.c, where local mutexes are held and would otherwise violate the lock order with Giant. This aligns this code more with the eventual locking of ttys. Suggested by: bde Notes: svn path=/head/; revision=150663
* Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),Robert Watson2005-09-193-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment). Modify all consumers of uprintf() and tprintf() to hold Giant around calls into these functions. In most cases, this means adding an acquisition of Giant immediately around the function. In some cases (nfs_timer()), it means acquiring Giant higher up in the callout. With these changes, UFS no longer panics on SMP when either blocks are exhausted or inodes are exhausted under load due to races in the tty code when running without Giant. NB: Some reduction in calls to uprintf() in the svr4 code is probably desirable. NB: In the case of nfs_timer(), calling uprintf() while holding a mutex, or even in a callout at all, is a bad idea, and will generate warnings and potential upset. This needs to be fixed, but was a problem before this change. NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having non-MPSAFE tty code. MFC after: 1 week Notes: svn path=/head/; revision=150335
* Add a 'sysent' target that depends on the various files built fromJohn Baldwin2005-07-131-1/+3
| | | | | | | | | | | syscalls.master for the master list and the Alpha/OSF1 compat ABI to be consistent with all the other compat ABIs where 'make sysent' already works. MFC after: 3 days Notes: svn path=/head/; revision=147977
* Regen.John Baldwin2005-07-133-81/+81
| | | | Notes: svn path=/head/; revision=147975
* Make a pass through all the compat ABIs sychronizing the MP safe flagsJohn Baldwin2005-07-131-79/+79
| | | | | | | | | | with the master syscall table as well as marking several ABI wrapper functions safe. MFC after: 1 week Notes: svn path=/head/; revision=147974
* - Remove spl's from osf1_usleep_thread().John Baldwin2005-07-071-8/+4
| | | | | | | | | | - Fix the calculation of the 'slept' timeval returned by osf1_usleep_thread() which has been broken since 1.1. Approved by: re (scottl) Notes: svn path=/head/; revision=147815
* Do not allocate memory based on not-checked argument from userland.Pawel Jakub Dawidek2005-06-111-6/+2
| | | | | | | | | | | | | | It can be used to panic the kernel by giving too big value. Fix it by moving allocation and size verification into kern_getfsstat(). This even simplifies kern_getfsstat() consumers, but destroys symmetry - memory is allocated inside kern_getfsstat(), but has to be freed by the caller. Found by: FreeBSD Kernel Stress Test Suite: http://www.holm.cc/stress/ Reported by: Peter Holm <peter@holm.cc> Notes: svn path=/head/; revision=147302
* Fix copy&paste bug.Pawel Jakub Dawidek2005-06-111-1/+1
| | | | Notes: svn path=/head/; revision=147299
* Avoid code duplication in serval places by introducing universalPawel Jakub Dawidek2005-06-091-43/+25
| | | | | | | | | kern_getfsstat() function. Obtained from: jhb Notes: svn path=/head/; revision=147178
* Rebuild generated system call definition files following the addition ofRobert Watson2005-05-303-304/+305
| | | | | | | | | | the audit event field to the syscalls.master file format. Submitted by: wsalamon Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=146807
* Introduce a new field in the syscalls.master file format to hold theRobert Watson2005-05-301-334/+408
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=146806
* Add missing jail.h include.Pawel Jakub Dawidek2005-05-221-0/+1
| | | | Notes: svn path=/head/; revision=146504
* This code seems to be dead, but anyway:Pawel Jakub Dawidek2005-05-221-3/+9
| | | | | | | | | - Don't leak fsid. - Don't forget about prison_check_mount(). - Don't use additional variable when there is no need to. Notes: svn path=/head/; revision=146503
* - Change the vm_mmap() function to accept an objtype_t parameter specifyingJohn Baldwin2005-04-012-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@ Notes: svn path=/head/; revision=144501
* Use a custom version of copyinuio() to implement osf1_{read,write}v() viaJohn Baldwin2005-03-311-79/+56
| | | | | | | kern_{read,write}v(). Notes: svn path=/head/; revision=144448
* - Implement osf1_emul_find() using kern_alternate_path(). This changesJohn Baldwin2005-02-183-308/+112
| | | | | | | | | | | | | | | | | the semantics in that the returned filename to use is now a kernel pointer rather than a user space pointer. This required changing the arguments to the CHECKALT*() macros some and changing the various system calls that used pathnames to use the kern_foo() functions that can accept kernel space filename pointers instead of calling the system call directly. - Use kern_open(), kern_stat(), kern_lstat(), kern_fstat(), kern_access(), kern_truncate(), kern_pathconf(), kern_execve(), kern_select(), kern_setitimer(), kern_getitimer(), kern_statfs(), and kern_fstatfs(). Silence on: alpha@ Notes: svn path=/head/; revision=142053
* Backout previous change (disabling of security checks for signals deliveredMaxim Sobolev2005-02-131-1/+1
| | | | | | | | | in emulation layers), since it appears to be too broad. Requested by: rwatson Notes: svn path=/head/; revision=141815
* Split out kill(2) syscall service routine into user-level and kernel part, theMaxim Sobolev2005-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | former is callable from user space and the latter from the kernel one. Make kernel version take additional argument which tells if the respective call should check for additional restrictions for sending signals to suid/sugid applications or not. Make all emulation layers using non-checked version, since signal numbers in emulation layers can have different meaning that in native mode and such protection can cause misbehaviour. As a result remove LIBTHR from the signals allowed to be delivered to a suid/sugid application. Requested (sorta) by: rwatson MFC after: 2 weeks Notes: svn path=/head/; revision=141812
* o Split out kernel part of execve(2) syscall into two parts: one thatMaxim Sobolev2005-01-292-10/+5
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=140992
* Begin all license/copyright comments with /*- or #-Warner Losh2005-01-057-7/+7
| | | | Notes: svn path=/head/; revision=139727
* Don't include sys/user.h merely for its side-effect of recursivelyDavid Schultz2004-11-272-2/+2
| | | | | | | including other headers. Notes: svn path=/head/; revision=138129
* Add missing flag to userland_sysctl()Poul-Henning Kamp2004-10-141-1/+1
| | | | Notes: svn path=/head/; revision=136506
* Rework how we store process times in the kernel such that we always storeJohn Baldwin2004-10-051-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the raw values including for child process statistics and only compute the system and user timevals on demand. - Fix the various kern_wait() syscall wrappers to only pass in a rusage pointer if they are going to use the result. - Add a kern_getrusage() function for the ABI syscalls to use so that they don't have to play stackgap games to call getrusage(). - Fix the svr4_sys_times() syscall to just call calcru() to calculate the times it needs rather than calling getrusage() twice with associated stackgap, etc. - Add a new rusage_ext structure to store raw time stats such as tick counts for user, system, and interrupt time as well as a bintime of the total runtime. A new p_rux field in struct proc replaces the same inline fields from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime). A new p_crux field in struct proc contains the "raw" child time usage statistics. ruadd() has been changed to handle adding the associated rusage_ext structures as well as the values in rusage. Effectively, the values in rusage_ext replace the ru_utime and ru_stime values in struct rusage. These two fields in struct rusage are no longer used in the kernel. - calcru() has been split into a static worker function calcru1() that calculates appropriate timevals for user and system time as well as updating the rux_[isu]u fields of a passed in rusage_ext structure. calcru() uses a copy of the process' p_rux structure to compute the timevals after updating the runtime appropriately if any of the threads in that process are currently executing. It also now only locks sched_lock internally while doing the rux_runtime fixup. calcru() now only requires the caller to hold the proc lock and calcru1() only requires the proc lock internally. calcru() also no longer allows callers to ask for an interrupt timeval since none of them actually did. - calcru() now correctly handles threads executing on other CPUs. - A new calccru() function computes the child system and user timevals by calling calcru1() on p_crux. Note that this means that any code that wants child times must now call this function rather than reading from p_cru directly. This function also requires the proc lock. - This finishes the locking for rusage and friends so some of the Giant locks in exit1() and kern_wait() are now gone. - The locking in ttyinfo() has been tweaked so that a shared lock of the proctree lock is used to protect the process group rather than the process group lock. By holding this lock until the end of the function we now ensure that the process/thread that we pick to dump info about will no longer vanish while we are trying to output its info to the console. Submitted by: bde (mostly) MFC after: 1 month Notes: svn path=/head/; revision=136152
* Regenerate after fcntl() wrappers were marked MP safe.John Baldwin2004-08-243-4/+4
| | | | Notes: svn path=/head/; revision=134267
* Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl()John Baldwin2004-08-242-21/+14
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=134266
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This isColin Percival2004-07-261-2/+2
| | | | | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb Notes: svn path=/head/; revision=132653
* - Replace wait1() with a kern_wait() function that accepts the pid,John Baldwin2004-03-171-15/+12
| | | | | | | | | | | | | | | | | | options, status pointer and rusage pointer as arguments. It is up to the caller to copyout the status and rusage to userland if needed. This lets us axe the 'compat' argument and hide all that functionality in owait(), by the way. This also cleans up some locking in kern_wait() since it no longer has to drop locks around copyout() since all the copyout()'s are deferred. - Convert owait(), wait4(), and the various ABI compat wait() syscalls to use kern_wait() rather than wait1() or wait4(). This removes a bit more stackgap usage. Tested on: i386 Compiled on: i386, alpha, amd64 Notes: svn path=/head/; revision=127140
* Regenerate.John Baldwin2004-03-153-4/+4
| | | | Notes: svn path=/head/; revision=127042
* - Mark ABI syscalls that call wait4() MP safe as recent changes toJohn Baldwin2004-03-151-1/+1
| | | | | | | | | the kernel wait4() made these all panic() implementations otherwise. - The i386 linux_ptrace() syscall is MP safe. Alpha was already marked MP safe. Notes: svn path=/head/; revision=127041
* Regen.John Baldwin2004-02-043-5/+5
| | | | Notes: svn path=/head/; revision=125457
* The following compat syscalls are now mpsafe: linux_getrlimit(),John Baldwin2004-02-041-2/+2
| | | | | | | | | | linux_setrlimit(), linux_old_getrlimit(), osf1_getrlimit(), osf1_setrlimit(), svr4_sys_ulimit(), svr4_sys_setrlimit(), svr4_sys_getrlimit(), svr4_sys_setrlimit64(), svr4_sys_getrlimit64(), ibcs2_sysconf(), and ibcs2_ulimit(). Notes: svn path=/head/; revision=125455
* Locking for the per-process resource limits structure.John Baldwin2004-02-041-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64 Notes: svn path=/head/; revision=125454
* GC old unused dev_t mangling stuff.Poul-Henning Kamp2004-02-021-21/+0
| | | | Notes: svn path=/head/; revision=125321
* Make sigaltstack as per-threaded, because per-process sigaltstack stateDavid Xu2004-01-031-6/+6
| | | | | | | | | | | | | | is useless for threaded programs, multiple threads can not share same stack. The alternative signal stack is private for thread, no lock is needed, the orignal P_ALTSTACK is now moved into td_pflags and renamed to TDP_ALTSTACK. For single thread or Linux clone() based threaded program, there is no semantic changed, because those programs only have one kernel thread in every process. Notes: svn path=/head/; revision=124114
* GC unused 'syshide' override to /dev/null. This was here to disablePeter Wemm2003-12-241-1/+0
| | | | | | | | the output of the namespc column. Its functionality was removed some time ago, but the overrides and the namespc column remained. Notes: svn path=/head/; revision=123790
* Regen (should be NOP except for rcsid)Peter Wemm2003-12-243-3/+3
| | | | Notes: svn path=/head/; revision=123789
* GC unused namespc column and un-wrap some longer lines that now fit.Peter Wemm2003-12-241-357/+335
| | | | Notes: svn path=/head/; revision=123788
* Fix build on alphaKris Kennaway2003-11-161-0/+1
| | | | | | | Pointy hat to: alfred Notes: svn path=/head/; revision=122816
* Regen.John Baldwin2003-11-073-52/+62
| | | | Notes: svn path=/head/; revision=122248
* Sync up with global syscalls.master for MP safe syscalls for the firstJohn Baldwin2003-11-071-48/+48
| | | | | | | | | | | | | | | time. This includes read(), write(), close(), getpid(), osf1_setuid(), getuid(), osf1_kill(), setpgid(), dup(), pipe(), getgid(), osf1_sigprocmask(), getlogin(), setlogin(), osf1_sigpending(), umask(), getpgrp(), getgroups(), setgroups(), osf1_setpgrp(), getdtablesize(), dup2(), setpriority(), getpriority(), osf1_sigreturn(), osf1_sigsuspend(), osf1_osigstack(), setreuid(), setregid(), osf1_setgid(), setsid(), osf1_sigaction(), msgctl(), msgget(), msgrcv(), msgsnd(), __semctl(), semget(), semop(), shmat(), shmctl(), shmdt(), shmget(), osf1_signal(), getpgid(), getsid(), osf1_sigaltstack(), osf1_sysinfo(). Notes: svn path=/head/; revision=122247
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-1/+1
| | | | | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname) Notes: svn path=/head/; revision=121816
* style: strcmp() does not return a bool.Brooks Davis2003-10-301-1/+1
| | | | Notes: svn path=/head/; revision=121769
* Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bitPeter Wemm2003-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things. Notes: svn path=/head/; revision=120422
* Cleanup <machine/cpu.h> by moving MD prototypes to <machine/md_var.h>Marcel Moolenaar2003-08-171-7/+8
| | | | | | | | | | | | | | | | | | like we have on other platforms. Move savectx() to <machine/pcb.h>. A lot of files got these MD prototypes through the indirect inclusion of <machine/cpu.h> and now need to include <machine/md_var.h>. The number of which is unexpectedly large... osf1_misc.c especially is tricky because szsigcode is redefined in one of the osf1 header files. Reordering of the include files was needed. linprocfs.c now needs an explicit extern declaration. Tested with: LINT Notes: svn path=/head/; revision=119008
* Add a f_vnode field to struct file.Poul-Henning Kamp2003-06-221-1/+1
| | | | | | | | | | | | | | | Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work. Notes: svn path=/head/; revision=116678
* Use __FBSDID().David E. O'Brien2003-06-106-15/+17
| | | | Notes: svn path=/head/; revision=116159
* - Merge struct procsig with struct sigacts.John Baldwin2003-05-131-0/+3
| | | | | | | | | | | | | | | | | | | | - Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson) Notes: svn path=/head/; revision=114983