summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* When compat32 recvmsg(2) does not need to copy out control messages, setkib2010-08-031-0/+2
| | | | | | | | msg_controllen to 0. PR: kern/149227 Submitted by: Stef Walter <stef memberwebs com> MFC after: 1 weeks
* Introduce exec_alloc_args(). The objective being to encapsulate thealc2010-07-271-9/+7
| | | | | | | | | | details of the string buffer allocation in one place. Eliminate the portion of the string buffer that was dedicated to storing the interpreter name. The pointer to the interpreter name can simply be made to point to the appropriate argument string. Reviewed by: kib
* Revert r210451, and the similar part of the r210431. The forward-declarationkib2010-07-261-1/+1
| | | | | | | | for the enum tag when enum definition is not complete is not allowed by C99, and is gcc extension. Requested by: stefanf MFC after: 28 days
* Change the order in which the file name, arguments, environment, andalc2010-07-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | shell command are stored in exec*()'s demand-paged string buffer. For a "buildworld" on an 8GB amd64 multiprocessor, the new order reduces the number of global TLB shootdowns by 31%. It also eliminates about 330k page faults on the kernel address space. Change exec_shell_imgact() to use "args->begin_argv" consistently as the start of the argument and environment strings. Previously, it would sometimes use "args->buf", which is the start of the overall buffer, but no longer the start of the argument and environment strings. While I'm here, eliminate unnecessary passing of "&length" to copystr(), where we don't actually care about the length of the copied string. Clean up the initialization of the exec map. In particular, use the correct size for an entry, and express that size in the same way that is used when an entry is allocated. The old size was one page too large. (This discrepancy originated in 2004 when I rewrote exec_map_first_page() to use sf_buf_alloc() instead of the exec map for mapping the first page of the executable.) Reviewed by: kib
* Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() maykib2010-07-232-1/+5
| | | | | | | server as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32. Reviewed by: alc MFC after: 3 weeks
* Eliminate a little bit of duplicated code.alc2010-07-231-3/+1
|
* Remove proc locking, it's not needed after r210132.trasz2010-07-171-5/+1
|
* Make svr4(4) version of poll(2) use the same limit of file descriptors as thetrasz2010-07-151-4/+1
| | | | usual poll(2) does, instead of checking resource limits.
* Constify source argument for siginfo_to_siginfo32().kib2010-07-042-2/+2
| | | | MFC after: 1 week
* Tweak the in-kernel API for sending signals to threads:jhb2010-06-291-2/+2
| | | | | | | | | | - Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c. - Add tdsignal() and tdksignal() routines that mirror psignal() and pksignal() except that they accept a thread as an argument instead of a process. They send a signal to a specific thread rather than to an individual process. Reviewed by: kib
* Regeneratekib2010-06-288-788/+788
|
* Count number of threads that enter and leave dynamically registeredkib2010-06-281-10/+10
| | | | | | | | | | syscalls. On the dynamic syscall deregistration, wait until all threads leave the syscall code. This somewhat increases the safety of the loadable modules unloading. Reviewed by: jhb Tested by: pho MFC after: 1 month
* Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOKjkim2010-06-232-3/+3
| | | | | from VESA BIOS initialization. All other malloc(9) uses in the function is blocking any way.
* ANSIfy prototypes in subr_usbd.c.ed2010-06-121-72/+29
| | | | | | | | | | | | | | | | | | | Clang generates the following warnings when building subr_usbd.c: | subr_usbd.c:598:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype | subr_usbd.c:627:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype | subr_usbd.c:649:13: warning: promoted type 'int' of K&R function | parameter is not compatible with the parameter type 'uint8_t' (aka | 'unsigned char') declared in a previous prototype Instead of just ANSIfying these three prototypes, do it for the entire file. Spotted by: clang
* Update several places that iterate over CPUs to use CPU_FOREACH().jhb2010-06-111-3/+1
|
* Bring USB fixes for linux(4).wkoszek2010-05-242-14/+147
| | | | | | | | | | | | | | | | | | | | | | Intention of this commit is to let us take a full advantage of libusb(8) ported to Linux. This decreases a possibility of getting any collisions within ioctl() "command" space, especially with relation to LINUX_SNDCTL_SEQ... stuff. Basically, we provide commands, that will be mapped in the kernel to correct ones and forward those to the USB layer. Port enabling functionality brought with this patch is here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146895 Bump __FreeBSD_version to catch, since which version installing a port makes sense. This patch should bring no regressions. So far, only i386 is tested. Tested by: thompsa@ Reviewed by: thompsa@ OKed by: netchild@
* Reorganize syscall entry and leave handling.kib2010-05-233-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend struct sysvec with three new elements: sv_fetch_syscall_args - the method to fetch syscall arguments from usermode into struct syscall_args. The structure is machine-depended (this might be reconsidered after all architectures are converted). sv_set_syscall_retval - the method to set a return value for usermode from the syscall. It is a generalization of cpu_set_syscall_retval(9) to allow ABIs to override the way to set a return value. sv_syscallnames - the table of syscall names. Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding the call to cpu_set_syscall_retval(). The new functions syscallenter(9) and syscallret(9) are provided that use sv_*syscall* pointers and contain the common repeated code from the syscall() implementations for the architecture-specific syscall trap handlers. Syscallenter() fetches arguments, calls syscall implementation from ABI sysent table, and set up return frame. The end of syscall bookkeeping is done by syscallret(). Take advantage of single place for MI syscall handling code and implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the thread is stopped at syscall entry or return point respectively. The EXEC flag augments SCX and notifies debugger that the process address space was changed by one of exec(2)-family syscalls. The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are changed to use syscallenter()/syscallret(). MIPS and arm are not converted and use the mostly unchanged syscall() implementation. Reviewed by: jhb, marcel, marius, nwhitehorn, stas Tested by: marcel (ia64), marius (sparc64), nwhitehorn (powerpc), stas (mips) MFC after: 1 month
* - #ifdef out the cliplist part, skype seems like using an uninitializednetchild2010-05-031-7/+24
| | | | | | | | | | variable and can cause problems, without the cliplist handling it works without problems - improve the cliplist error handling - fix VIDIOCGTUNER and VIDIOCSMICROCODE (still no hardware available to test) Submitted by: J.R. Oldroyd <jr@opal.com> X-MFC after: soon (together with all the v4l stuff)
* Reduce MD code further. At least, it compiles on ia64 now (but it is notjkim2010-05-011-36/+78
| | | | connected to build). The idea/code was shamelessly taken from r207329.
* Do not initialize mutex and return error if it cannot map memory.jkim2010-05-011-13/+13
|
* Provide compat32 shims for kinfo_proc sysctl. This allows 32bit ps(1) tokib2010-04-211-0/+82
| | | | | | | | | | mostly work on 64bit host. The work is based on an original patch submitted by emaste, obtained from Sandvine's source tree. Reviewed by: jhb MFC after: 1 week
* Extract the code to copy-out struct rusage32 from struct rusagekib2010-04-212-33/+28
| | | | | | | into the new function. Reviewed by: jhb MFC after: 1 week
* Linux puts a blank line between each CPU.emaste2010-04-141-1/+1
|
* Add a forward declaration to silence a warning when compiling ia32_genassym.c.bz2010-04-031-0/+1
| | | | | Reviewed by: kib MFC after: 3 days
* Re-apply r205683 with some modifications:netchild2010-04-021-15/+23
| | | | | | | | | | Fix some bogus values in linprocfs. Submitted by: Petr Salinger <Petr.Salinger@seznam.cz> Verified on: GNU/kFreeBSD debian 8.0-1-686 (by submitter) PR: 144584 Reviewed by / discussed with: kib, des, jhb, submitter
* Rename st_*timespec fields to st_*tim for POSIX 2008 compliance.ed2010-03-284-25/+34
| | | | | | | | | | | | | | | A nice thing about POSIX 2008 is that it finally standardizes a way to obtain file access/modification/change times in sub-second precision, namely using struct timespec, which we already have for a very long time. Unfortunately POSIX uses different names. This commit adds compatibility macros, so existing code should still build properly. Also change all source code in the kernel to work without any of the compatibility macros. This makes it all a less ambiguous. I am also renaming st_birthtime to st_birthtim, even though it was a local extension anyway. It seems Cygwin also has a st_birthtim.
* Revert r205683 to resolve some code quality issues which do not affect thenetchild2010-03-261-54/+14
| | | | | | build or use of linprocfs, before committing the reworked patch again. Requested by: des
* Fix some bogus values in linprocfs.netchild2010-03-261-14/+54
| | | | | | Submitted by: Petr Salinger <Petr.Salinger@seznam.cz> Verified on: GNU/kFreeBSD debian 8.0-1-686 (by submitter) PR: 144584
* Fix some problems which may lead to a panic:netchild2010-03-261-1/+3
| | | | | | | - right order of src and dst in memcpy - NULL out the clips after freeing to prevent an accident Noticed by: hselasky
* Revert accidentally committed initial real mode %sp change of r205347.jkim2010-03-251-2/+0
| | | | | Note I am keeping %ds change because X.org int10 handler does it and it seems reasonable.
* Optimize real mode page table lookup.jkim2010-03-251-5/+4
|
* Fix stupid typos. Some VESA BIOSes directly call BIOS interrupt handlersjkim2010-03-251-2/+2
| | | | | | | | | within the VBE interrupt handler. Unfortunately it was causing real mode page faults because we were fetching instructions from bogus addresses. Pass me the pointyhat, please. PR: kern/144654 MFC after: 3 days
* Change the arguments of exec_setregs() so that it receives a pointernwhitehorn2010-03-251-2/+2
| | | | | | | | to the image_params struct instead of several members of that struct individually. This makes it easier to expand its arguments in the future without touching all platforms. Reviewed by: jhb
* Add missing Giant locking for the vfsconf list.jhb2010-03-241-0/+2
| | | | Submitted by: kib
* Implement /proc/filesystems.jhb2010-03-231-0/+18
| | | | Submitted by: Fernando Apesteguia fernando.apesteguia (gmail)
* Support memory wraparound instead of high memory as VM86 mode does.jkim2010-03-221-14/+4
| | | | Suggested by: delphij
* Fix i386 PAE kernel build.jkim2010-03-221-1/+1
| | | | Reported by: tinderbox
* Actually make O_DIRECTORY work.ed2010-03-211-6/+2
| | | | | | According to POSIX open() must return ENOTDIR when the path name does not refer to a path name. Change vn_open() to respect this flag. This also simplifies the Linuxolator a bit.
* - Map EBDA if available and add 64KB above 1MB (high memory), just in case.jkim2010-03-191-33/+113
| | | | | | | - Print the initial memory map when bootverbose is set. - Change the page fault address format from linear to %cs:%ip style. - Move duplicate code into a newly added function. - Add strictly aligned memory access for distant future. ;-)
* Regenkib2010-03-194-53/+123
|
* Remove empty line.kib2010-03-191-1/+0
| | | | MFC after: 2 weeks
* Implement compat32 shims for mqueuefs.kib2010-03-192-6/+25
| | | | | Reviewed by: jhb MFC after: 2 weeks
* Implement compat32 shims for ksem syscalls.kib2010-03-191-11/+15
| | | | | Reviewed by: jhb MFC after: 2 weeks
* Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to correspondingkib2010-03-192-548/+21
| | | | | | | | | | | | | | sysv_{msg,sem,shm}.c files. Mark SysV IPC freebsd32 syscalls as NOSTD and add required SYSCALL_INIT_HELPER/SYSCALL32_INIT_HELPERs to provide auto register/unregister on module load. This makes COMPAT_FREEBSD32 functional with SysV IPC compiled and loaded as modules. Reviewed by: jhb MFC after: 2 weeks
* Move SysV IPC freebsd32 compat shims helpers from freebsd32_misc.c tokib2010-03-192-54/+8
| | | | | | | sysv_ipc.c. Reviewed by: jhb MFC after: 2 weeks
* Introduce SYSCALL_INIT_HELPER and SYSCALL32_INIT_HELPER macros andkib2010-03-192-0/+41
| | | | | | | | | neccessary support functions to allow registering dynamically loaded syscalls from the MOD_LOAD handlers. Helpers handle registration failures semi-automatically. Reviewed by: jhb MFC after: 2 weeks
* FOr SYSCALL_MODULE_HELPER, use "sys/<syscallname>" module name.kib2010-03-191-1/+1
| | | | | | | | | | | | FOr SYSCALL32_MODULE_HELPER, use "sys32/<syscallname>" module name. This avoids modules name conflict when compat32 syscall does not need shims. Note that SYSCALL_MODULE_HELPER is going to be unused in the tree by several next commits. Suggested by: jhb MFC after: 2 weeks
* Make freebsd32_copyiniov() available outside of freebsd32_misc.kib2010-03-192-1/+4
| | | | MFC after: 2 weeks
* Detect illegal access to unmapped memory within real mode emulator to aidjkim2010-03-181-9/+44
| | | | debugging. Update copyright date while I am here.
* Regen after big endian compatibility import.nwhitehorn2010-03-114-4/+4
|
OpenPOWER on IntegriCloud