summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Remove some unnecessary includes.tijl2012-03-181-9/+0
|
* Eliminate ia32_reg.h by moving its contents to x86 and ia64 reg.h.tijl2012-03-181-93/+0
| | | | Reviewed by: kib
* Copy i386 reg.h to x86 and merge with amd64 reg.h. Replace i386/amd64/pc98tijl2012-03-181-0/+2
| | | | | | | | | | | | | | | | | reg.h with stubs. The tREGISTER macros are only made visible on i386. These macros are deprecated and should not be available on amd64. The i386 and amd64 versions of struct reg have been renamed to struct __reg32 and struct __reg64. During compilation either __reg32 or __reg64 is defined as reg depending on the machine architecture. On amd64 the i386 struct is also available as struct reg32 which is used in COMPAT_FREEBSD32 code. Most of compat/ia32/ia32_reg.h is now IA64 only. Reviewed by: kib (previous version)
* Move userland bits of i386 npx.h and amd64 fpu.h to x86 fpu.h.tijl2012-03-161-27/+0
| | | | | | | | | | | | | | Remove FPU types from compat/ia32/ia32_reg.h that are no longer needed. Create machine/npx.h on amd64 to allow compiling i386 code that uses this header. The original npx.h and fpu.h define struct envxmm differently. Both definitions have been included in the new x86 header as struct __envxmm32 and struct __envxmm64. During compilation either __envxmm32 or __envxmm64 is defined as envxmm depending on machine architecture. On amd64 the i386 struct is also available as struct envxmm32. Reviewed by: kib
* Fix race condition in KfRaiseIrql().brucec2012-03-041-4/+6
| | | | | | | | | | After getting the current irql, if the kthread gets preempted and subsequently runs on a different CPU, the saved irql could be wrong. Also, correct the panic string. PR: kern/165630 Submitted by: Vladislav Movchan <vladislav.movchan at gmail.com>
* On MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries. This mightjmallett2012-03-031-0/+4
| | | | | | | not be ideal, but is the ABI we've shipped so far. Fix macros which reflect the results of _ALIGN on 32-bit MIPS to use the right alignment. This fixes sendmsg under COMPAT_FREEBSD32 on n64 MIPS kernels.
* o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with ↵jmallett2012-03-038-18/+33
| | | | | | | | | | | | | | | | | | | | | userlands using the o32 ABI. This mostly follows nwhitehorn's lead in implementing COMPAT_FREEBSD32 on powerpc64. o) Add a new type to the freebsd32 compat layer, time32_t, which is time_t in the 32-bit ABI being used. Since the MIPS port is relatively-new, even the 32-bit ABIs use a 64-bit time_t. o) Because time{spec,val}32 has the same size and layout as time{spec,val} on MIPS with 32-bit compatibility, then, disable some code which assumes otherwise wrongly when built for MIPS. A more general macro to check in this case would seem like a good idea eventually. If someone adds support for using n32 userland with n64 kernels on MIPS, then they will have to add a variety of flags related to each piece of the ABI that can vary. That's probably the right time to generalize further. o) Add MIPS to the list of architectures which use PAD64_REQUIRED in the freebsd32 compat code. Probably this should be generalized at some point. Reviewed by: gonzo
* Add procfs to jail-mountable filesystems.mm2012-02-292-2/+2
| | | | | Reviewed by: jamie MFC after: 1 week
* Fix found places where uio_resid is truncated to int.kib2012-02-211-1/+2
| | | | | | | | | Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from the usermode. Discussed with: bde, das (previous versions) MFC after: 1 month
* Fix misuse of the kernel map in miscellaneous image activators.kib2012-02-172-38/+22
| | | | | | | | | | | | | | | | | | | Vnode-backed mappings cannot be put into the kernel map, since it is a system map. Use exec_map for transient mappings, and remove the mappings with kmem_free_wakeup() to notify the waiters on available map space. Do not map the whole executable into KVA at all to copy it out into usermode. Directly use vn_rdwr() for the case of not page aligned binary. There is one place left where the potentially unbounded amount of data is mapped into exec_map, namely, in the COFF image activator enumeration of the needed shared libraries. Reviewed by: alc MFC after: 2 weeks
* Remove direct access to si_name.ed2012-02-103-5/+5
| | | | | | | | Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks
* Add 32-bit compat code for AIO kevent flags introduced in revision 230857.davidxu2012-02-051-0/+1
|
* Add support for the extended FPU states on amd64, both for nativekib2012-01-211-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64bit and 32bit ABIs. As a side-effect, it enables AVX on capable CPUs. In particular: - Query the CPU support for XSAVE, list of the supported extensions and the required size of FPU save area. The hw.use_xsave tunable is provided for disabling XSAVE, and hw.xsave_mask may be used to select the enabled extensions. - Remove the FPU save area from PCB and dynamically allocate the (run-time sized) user save area on the top of the kernel stack, right above the PCB. Reorganize the thread0 PCB initialization to postpone it after BSP is queried for save area size. - The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as well. FPU state is only useful for suspend, where it is saved in dynamically allocated suspfpusave area. - Use XSAVE and XRSTOR to save/restore FPU state, if supported and enabled. - Define new mcontext_t flag _MC_HASFPXSTATE, indicating that mcontext_t has a valid pointer to out-of-struct extended FPU state. Signal handlers are supplied with stack-allocated fpu state. The sigreturn(2) and setcontext(2) syscall honour the flag, allowing the signal handlers to inspect and manipilate extended state in the interrupted context. - The getcontext(2) never returns extended state, since there is no place in the fixed-sized mcontext_t to place variable-sized save area. And, since mcontext_t is embedded into ucontext_t, makes it impossible to fix in a reasonable way. Instead of extending getcontext(2) syscall, provide a sysarch(2) facility to query extended FPU state. - Add ptrace(2) support for getting and setting extended state; while there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries. - Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to consumers, making it opaque. Internally, struct fpu_kern_ctx now contains a space for the extended state. Convert in-kernel consumers of fpu_kern KPI both on i386 and amd64. First version of the support for AVX was submitted by Tim Bird <tim.bird am sony com> on behalf of Sony. This version was written from scratch. Tested by: pho (previous version), Yamagi Burmeister <lists yamagi org> MFC after: 1 month
* Make sure all intermediate variables holding mount flags (mnt_flag)mckusick2012-01-171-3/+11
| | | | | | | and that all internal kernel calls passing mount flags are declared as uint64_t so that flags in the top 32-bits are not lost. MFC after: 2 weeks
* Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always wanttrociny2012-01-151-2/+2
| | | | | | | | | | | | | | | to read strings completely to know the actual size. As a side effect it fixes the issue with kern.proc.args and kern.proc.env sysctls, which didn't return the size of available data when calling sysctl(3) with the NULL argument for oldp. Note, in get_ps_strings(), which does actual work for proc_getargv() and proc_getenvv(), we still have a safety limit on the size of data read in case of a corrupted procces stack. Suggested by: kib MFC after: 3 days
* Convert files to UTF-8uqs2012-01-158-8/+8
|
* In sys/compat/linux/linux_ioctl.c, work around a warning when a pointerdim2012-01-031-1/+1
| | | | | | | | is compared to an integer, by casting the pointer to l_uintptr_t. No functional difference on both i386 and amd64. Reviewed by: ed, jhb MFC after: 1 week
* In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory functiondim2011-12-301-4/+1
| | | | | | | | definition from K&R to ANSI, to avoid a clang warning about the uint8_t parameter being promoted to int, which is not compatible with the type declared in the earlier prototype. MFC after: 1 week
* Implement linux_fadvise64() and linux_fadvise64_64() usingjhb2011-12-291-0/+45
| | | | | | | kern_posix_fadvise(). Reviewed by: silence on emulation@ MFC after: 2 weeks
* Protect process environment variables with p_candebug().trociny2011-12-041-1/+1
| | | | | Discussed with: jilles, kib, rwatson MFC after: 2 weeks
* Retire linprocfs_doargv(). Instead use new functions, proc_getargv()trociny2011-11-221-146/+14
| | | | | | | | | | and proc_getenvv(), which were implemented using linprocfs_doargv() as a reference. Suggested by: kib Reviewed by: kib Approved by: des (linprocfs maintainer) MFC after: 2 weeks
* - Add the ffclock_getcounter(), ffclock_getestimate() and ffclock_setestimate()lstewart2011-11-216-9/+81
| | | | | | | | | | | | | | | | | | | | system calls to provide feed-forward clock management capabilities to userspace processes. ffclock_getcounter() returns the current value of the kernel's feed-forward clock counter. ffclock_getestimate() returns the current feed-forward clock parameter estimates and ffclock_setestimate() updates the feed-forward clock parameter estimates. - Document the syscalls in the ffclock.2 man page. - Regenerate the script-derived syscall related files. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au)
* Make the Linux *at() calls a bit more complete.ed2011-11-192-14/+16
| | | | | | | Properly support: - AT_EACCESS for faccessat(), - AT_SYMLINK_FOLLOW for linkat().
* Regenerate system call tables.ed2011-11-199-12/+12
|
* Improve *access*() parameter name consistency.ed2011-11-194-11/+11
| | | | | | | | | The current code mixes the use of `flags' and `mode'. This is a bit confusing, since the faccessat() function as a `flag' parameter to store the AT_ flag. Make this less confusing by using the same name as used in the POSIX specification -- `amode'.
* - Split out a kern_posix_fadvise() from the posix_fadvise() system call sojhb2011-11-141-11/+4
| | | | | | | it can be used by in-kernel consumers. - Make kern_posix_fallocate() public. - Use kern_posix_fadvise() and kern_posix_fallocate() to implement the freebsd32 wrappers for the two system calls.
* struct timespec32: change types of tv_sec and tv_nsec fields to signedpluknet2011-11-111-2/+2
| | | | | | | | | to match native struct timespec ABI on __LP32__. This change is a prerequisite for upcoming futimens()/utimensat() in whose implementations it is assumed that timespec32 can take a negative value. MFC after: 1 week
* Correct the types of the arguments to return probes of the syscallrstone2011-11-111-1/+1738
| | | | | | | | provider. Previously we were erroneously supplying the argument types of the corresponding entry probe. Reviewed by: rpaulo MFC after: 1 week
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-073-3/+4
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-2/+2
| | | | This means that their use is restricted to a single C file.
* Regen.jhb2011-11-045-6/+54
|
* Add the posix_fadvise(2) system call. It is somewhat similar tojhb2011-11-042-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | madvise(2) except that it operates on a file descriptor instead of a memory region. It is currently only supported on regular files. Just as with madvise(2), the advice given to posix_fadvise(2) can be divided into two types. The first type provide hints about data access patterns and are used in the file read and write routines to modify the I/O flags passed down to VOP_READ() and VOP_WRITE(). These modes are thus filesystem independent. Note that to ease implementation (and since this API is only advisory anyway), only a single non-normal range is allowed per file descriptor. The second type of hints are used to hint to the OS that data will or will not be used. These hints are implemented via a new VOP_ADVISE(). A default implementation is provided which does nothing for the WILLNEED request and attempts to move any clean pages to the cache page queue for the DONTNEED request. This latter case required two other changes. First, a new V_CLEANONLY flag was added to vinvalbuf(). This requests vinvalbuf() to only flush clean buffers for the vnode from the buffer cache and to not remove any backing pages from the vnode. This is used to ensure clean pages are not wired into the buffer cache before attempting to move them to the cache page queue. The second change adds a new vm_object_page_cache() method. This method is somewhat similar to vm_object_page_remove() except that instead of freeing each page in the specified range, it attempts to move clean pages to the cache queue if possible. To preserve the ABI of struct file, the f_cdevpriv pointer is now reused in a union to point to the currently active advice region if one is present for regular files. Reviewed by: jilles, kib, arch@ Approved by: re (kib) MFC after: 1 month
* Control the execution permission of the readable segments forkib2011-10-151-2/+2
| | | | | | | i386 binaries on the amd64 and ia64 with the sysctl, instead of unconditionally enabling it. Reviewed by: marcel
* Regen.jhb2011-10-145-12/+12
|
* Use PAIR32TO64() for the offset and length parameters tojhb2011-10-142-4/+4
| | | | | | | freebsd32_posix_fallocate() to properly handle big-endian platforms. Reviewed by: mdf MFC after: 1 week
* Use PTRIN().marcel2011-10-131-1/+1
|
* Wrap mprotect(2) so that we can add execute permissions when readmarcel2011-10-136-10/+32
| | | | | permissions are requested. This is needed on amd64 and ia64 for JDK 1.4.x
* Wrap mprotect(2)marcel2011-10-131-1/+1
|
* In freebsd32_mmap() and when compiling for amd64 or ia64, alsomarcel2011-10-131-0/+5
| | | | | ask for execute permissions when read permissions are wanted. This is needed for JDK 1.4.x on i386.
* Add curly braces missed in r226247.brueffer2011-10-111-1/+2
| | | | | | Pointy hat to: brueffer Submitted by: many MFC after: 1 week
* Properly free linux_gidset in case of an error.brueffer2011-10-111-0/+1
| | | | | | CID: 4136 Found with: Coverity Prevent(tm) MFC after: 1 week
* Use the caculated length instead of maximum length.jkim2011-10-061-2/+2
|
* Remove a now-defunct variable.jkim2011-10-061-16/+15
|
* Use uint32_t instead of u_int32_t. Fix style(9) nits.jkim2011-10-061-10/+9
|
* Make sure to ignore the leading NULL byte from Linux abstract namespace.jkim2011-10-061-2/+10
|
* Restore the original socket address length if it was not really AF_INET6.jkim2011-10-061-16/+19
|
* Retern more appropriate errno when Linux path name is too long.jkim2011-10-061-1/+1
|
* Inline do_sa_get() function and remove an unused return value.jkim2011-10-061-23/+9
|
* Unroll inlined strnlen(9) and make it easier to read. No functional change.jkim2011-10-061-10/+6
|
* Fix a bug in UNIX socket handling in the linux emulator which wascperciva2011-10-041-0/+15
| | | | | | | | | exposed by the security fix in FreeBSD-SA-11:05.unix. Approved by: so (cperciva) Approved by: re (kib) Security: Related to FreeBSD-SA-11:05.unix, but not actually a security fix.
OpenPOWER on IntegriCloud