summaryrefslogtreecommitdiffstats
path: root/sys/compat/freebsd32
Commit message (Collapse)AuthorAgeFilesLines
* Regenerate.jhb2005-07-074-8/+24
| | | | Approved by: re (scottl)
* - Add two new system calls: preadv() and pwritev() which are like readv()jhb2005-07-072-2/+37
| | | | | | | | | | | | | | | | | and writev() except that they take an additional offset argument and do not change the current file position. In SAT speak: preadv:readv::pread:read and pwritev:writev::pwrite:write. - Try to reduce code duplication some by merging most of the old kern_foov() and dofilefoo() functions into new dofilefoo() functions that are called by kern_foov() and kern_pfoov(). The non-v functions now all generate a simple uio on the stack from the passed in arguments and then call kern_foov(). For example, read() now just builds a uio and calls kern_readv() and pwrite() just builds a uio and calls kern_pwritev(). PR: kern/80362 Submitted by: Marc Olzheim marcolz at stack dot nl (1) Approved by: re (scottl) MFC after: 1 week
* - Change the commented out freebsd32_xxx() example to use kern_xxx() alongjhb2005-06-292-39/+5
| | | | | | | | | with a single copyin() + translate and translate + copyout() rather than using the stackgap. - Remove implementation of the stackgap for freebsd32 since it is no longer used for that compat ABI. Approved by: re (scottl)
* Correct the amount of data to allocate in these local copies ofjhb2005-06-241-1/+2
| | | | | | | | | exec_copyin_strings() to catch up to rev 1.266 of kern_exec.c. This fixes panics on amd64 with compat binaries since exec_free_args() was freeing more memory than these functions were allocating and the mismatch could cause memory to be freed out from under other concurrent execs. Approved by: re (scottl)
* Do not allocate memory based on not-checked argument from userland.pjd2005-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>
* Avoid code duplication in serval places by introducing universalpjd2005-06-091-22/+19
| | | | | | kern_getfsstat() function. Obtained from: jhb
* Wrap copyin/copyout for kevent so the 32bit wrapper does not haveps2005-06-031-49/+66
| | | | | | | | | to malloc nchanges * sizeof(struct kevent) AND/OR nevents * sizeof(struct kevent) on every syscall. Glanced at by: peter, jmg Obtained from: Yahoo! MFC after: 2 weeks
* Rebuild generated system call definition files following the addition ofrwatson2005-05-304-459/+460
| | | | | | | 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-531/+637
| | | | | | | | | | | | | 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
* Copyout to userland if kern_sigaction succeedsps2005-05-241-2/+2
|
* - Use a custom version of copyinuio() to implement readv/writev usingjhb2005-03-311-122/+83
| | | | | kern_readv/writev. - Use kern_settimeofday() and kern_adjtime() rather than stackgapping it.
* Use kern_kevent instead of the stackgap for 32bit syscall wrapping.ps2005-03-011-35/+31
| | | | | Submitted by: jhb Tested on: amd64
* Ooops. I will compile test before committing. The stackgap versionps2005-03-011-2/+2
| | | | | of kevent32 will be going away shortly, so this is temporary until I commit the non-stackgap version.
* Correct the freebsd32_kevent prototype.ps2005-03-012-6/+6
|
* Regen.jhb2005-02-244-7/+7
|
* Use msync() to implement msync() for freebsd32 emulation. This isn't quitejhb2005-02-241-1/+1
| | | | | | | | right for certain MAP_FIXED mappings on ia64 but it will work fine for all other mappings and works fine on amd64. Requested by: ps, Christian Zander MFC after: 1 week
* - Add a custom version of exec_copyin_args() to deal with the 32-bitjhb2005-02-181-219/+160
| | | | | | | | | | | | | | pointers in argv and envv in userland and use that together with kern_execve() and exec_free_args() to implement freebsd32_execve() without using the stackgap. - Fix freebsd32_adjtime() to call adjtime() rather than utimes(). Still uses stackgap for now. - Use kern_setitimer(), kern_getitimer(), kern_select(), kern_utimes(), kern_statfs(), kern_fstatfs(), kern_fhstatfs(), kern_stat(), kern_fstat(), and kern_lstat(). Tested by: cokane (amd64) Silence on: amd64, ia64
* Add a 32bit syscall wrapper for modstatps2005-01-195-8/+13
| | | | Obtained from: Yahoo!
* - rename nanosleep1 to kern_nanosleepps2005-01-196-4/+40
| | | | | | | - Add a 32bit syscall entry for nanosleep Reviewed by: peter Obtained from: Yahoo!
* Regenerate.jhb2005-01-044-13/+15
|
* Partial sync up to the master syscalls.master file:jhb2005-01-041-8/+9
| | | | | | | | - Mark mount, unmount and nmount MPSAFE. - Add a stub for _umtx_op(). - Mark open(), link(), unlink(), and freebsd32_sigaction() MPSAFE. Pointy hats to: several
* Don't include sys/user.h merely for its side-effect of recursivelydas2004-11-271-2/+0
| | | | including other headers.
* Rebuild from compat/freebsd32/syscalls.master:1.43marks2004-11-182-2/+2
| | | | | Reviewed by: imp, phk, njl, peter Approved by: njl
* 32-bit FreeBSD ABI compatibility stubs from syscalls.master:1.179marks2004-11-181-1/+1
| | | | | Reviewed by: imp, phk, njl, peter Approved by: njl
* Rebuild from FreeBSD32 syscalls.master:1.42.rwatson2004-10-234-5/+23
|
* 32-bit FreeBSD ABI compatibility stubs from syscalls.master:1.178.rwatson2004-10-231-0/+9
|
* Put on my peril sensitive sunglasses and add a flags field to the internalpeter2004-10-111-7/+3
| | | | | | | | | | | | | | | | sysctl routines and state. Add some code to use it for signalling the need to downconvert a data structure to 32 bits on a 64 bit OS when requested by a 32 bit app. I tried to do this in a generic abi wrapper that intercepted the sysctl oid's, or looked up the format string etc, but it was a real can of worms that turned into a fragile mess before I even got it partially working. With this, we can now run 'sysctl -a' on a 32 bit sysctl binary and have it not abort. Things like netstat, ps, etc have a long way to go. This also fixes a bug in the kern.ps_strings and kern.usrstack hacks. These do matter very much because they are used by libc_r and other things.
* Close a race between a thread exiting and the freeing of it's stack.mtm2004-10-065-6/+6
| | | | | | | | | After some discussion the best option seems to be to signal the thread's death from within the kernel. This requires that thr_exit() take an argument. Discussed with: davidxu, deischen, marcel MFC after: 3 days
* Rework how we store process times in the kernel such that we always storejhb2004-10-051-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Regenpeter2004-07-144-9/+4
|
* Unmapped syscalls should be NOPROTO so that we don't get a duplicatepeter2004-07-141-1/+1
| | | | prototype. (kldunloadf in this case)
* Give kldunload a -f(orce) argument.phk2004-07-134-5/+13
| | | | | | | | | | | | | | | | | Add a MOD_QUIESCE event for modules. This should return error (EBUSY) of the module is in use. MOD_UNLOAD should now only fail if it is impossible (as opposed to inconvenient) to unload the module. Valid reasons are memory references into the module which cannot be tracked down and eliminated. When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is not given, MOD_QUIESCE failing will also prevent the unload. For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as success. Document that modules should return EOPNOTSUPP for unknown events.
* Add kldunloadf() system call. Stay tuned for follwing commit messages.phk2004-07-131-2/+3
|
* Change the thread ID (thr_id_t) used for 1:1 threading from being amarcel2004-07-021-4/+4
| | | | | | | | | | | | | | | | | | | | pointer to the corresponding struct thread to the thread ID (lwpid_t) assigned to that thread. The primary reason for this change is that libthr now internally uses the same ID as the debugger and the kernel when referencing to a kernel thread. This allows us to implement the support for debugging without additional translations and/or mappings. To preserve the ABI, the 1:1 threading syscalls, including the umtx locking API have not been changed to work on a lwpid_t. Instead the 1:1 threading syscalls operate on long and the umtx locking API has not been changed except for the contested bit. Previously this was the least significant bit. Now it's the most significant bit. Since the contested bit should not be tested by userland, this change is not expected to be visible. Just to be sure, UMTX_CONTESTED has been removed from <sys/umtx.h>. Reviewed by: mtm@ ABI preservation tested on: i386, ia64
* Regen.marcel2004-07-024-4/+4
|
* Second half of the dev_t cleanup.phk2004-06-171-2/+2
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Fix build for non-COMPAT_FREEBSD4 configurations. Make the FreeBSD 4marcel2004-04-241-0/+10
| | | | statfs functions conditional upon the option.
* Regenpeter2004-04-144-40/+49
|
* Catch up to the not-so-recent statfs(2) changes.peter2004-04-143-18/+49
|
* Regen for libthr thread synchronization syscalls.mtm2004-03-274-5/+11
|
* Separate thread synchronization from signals in libthr. Insteadmtm2004-03-271-0/+2
| | | | | | use msleep() and wakeup_one(). Discussed with: jhb, peter, tjr
* - Replace wait1() with a kern_wait() function that accepts the pid,jhb2004-03-171-13/+9
| | | | | | | | | | | | | | | 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
* Regen (FWIW)peter2004-02-214-5/+5
|
* Try and make the compat sigreturn prototypes closer to reality.peter2004-02-211-1/+1
|
* Regen.deischen2004-02-034-5/+7
|
* Sync with kern/syscalls.master.deischen2004-02-031-0/+1
|
* Regenpeter2004-01-285-7/+40
|
* Add getitimer swab stubpeter2004-01-281-2/+2
|
* GC unused 'syshide' override to /dev/null. This was here to disablepeter2003-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.
* Regen (should be a NOP except for rcsid)peter2003-12-234-4/+4
|
OpenPOWER on IntegriCloud