summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Remove stale comment.kib2010-10-141-5/+0
| | | | | Submitted by: arundel MFC after: 3 days
* Add macro DECLARE_MODULE_TIED to denote a module as requiring thekib2010-10-121-1/+1
| | | | | | | | | | | | | | | kernel of exactly the same __FreeBSD_version as the headers module was compiled against. Mark our in-tree ABI emulators with DECLARE_MODULE_TIED. The modules use kernel interfaces that the Release Engineering Team feel are not stable enough to guarantee they will not change during the life cycle of a STABLE branch. In particular, the layout of struct sysentvec is declared to be not part of the STABLE KBI. Discussed with: bz, rwatson Approved by: re (bz, kensmith) MFC after: 2 weeks
* Simplify timeout check in futex_wait() using itimerfix() and return errorjkim2010-10-061-22/+10
| | | | | if the given timeout is invalid. Consistently use int type for timeout and correct a format string in futex_sleep().
* Fix a comparision of an uninitialised pointer.netchild2010-10-061-1/+1
| | | | | | Submitted by: arundel Found by: clang analysis (automatic service by uqs@) Reviewed by: rdivacky
* Use the printf-like capability from kproc_create().thompsa2010-10-051-8/+3
| | | | Submitted by: Paul B Mahol
* Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not changejkim2010-10-051-1/+1
| | | | after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64.
* In linprocfs_doargv():kib2010-09-281-97/+117
| | | | | | | | | | | | | | | | | | | | | | | - handle compat32 processes; - remove the checks for copied in addresses to belong into valid usermode range, proc_rwmem() does this; - simplify loop reading single string, limit the total amount of strings collected by ARG_MAX bytes; - correctly add '\0' at the end of each copied string; - fix style. In linprocfs_doprocenviron(): - unlock the process before calling copyin code [1]. The process is held by pseudofs. In linprocfs_doproccmdline: - use linprocfs_doargv() to handle !curproc case for which p_args is not cached. Reported by: plulnet [1] Tested by: pluknet Approved by: des (linprocfs maintainer, previous version of the patch) MFC after: 3 weeks
* Implement proc/$$/environment.des2010-09-161-2/+110
| | | | | Submitted by: Fernando ApesteguĂ­a <fernando.apesteguia@gmail.com> MFC after: 3 weeks
* Replace sbuf_overflowed() with sbuf_error(), which returns any errormdf2010-09-101-2/+2
| | | | | | code associated with overflow or with the drain function. While this function is not expected to be used often, it produces more information in the form of an errno that sbuf_overflowed() did.
* Add x86bios_set_intr() to set interrupt vectors for real mode and simplifyjkim2010-08-252-3/+15
| | | | x86bios_get_intr() a little.
* Check opcode for short jump as well. Some option ROMs do short jumpsjkim2010-08-251-1/+2
| | | | | | | (e.g., some NVIDIA video cards) and we were not able to do POST while resuming because we only honored long jump. MFC after: 3 days
* Supply some useful information to the started image using ELF aux vectors.kib2010-08-171-3/+26
| | | | | | | | In particular, provide pagesize and pagesizes array, the canary value for SSP use, number of host CPUs and osreldate. Tested by: marius (sparc64) MFC after: 1 month
* Place spinlock_enter() and spinlock_exit() just around X86EMU calls.jkim2010-08-101-4/+4
|
* Tidy up locking and memory allocation for the real mode emulator wrapper.jkim2010-08-101-36/+26
| | | | | | | Now we use a regular mutex instead of a spin mutex. When we enter and exit the emulator, spinlock_enter() and spinlock_exit() are additionally used. Move some page table related stuff from x86bios_init() and x86bios_uninit() to x86bios_map_mem() and x86bios_unmap_mem().
* Tidy up printf() calls for debugging.jkim2010-08-091-46/+30
|
* Initialize a variable just before its use.jkim2010-08-091-1/+1
|
* Reduce diffs between VM86 and X86EMU wrappers for x86bios_alloc() andjkim2010-08-091-23/+29
| | | | | x86bios_free(). Add strict sanity checks for VM86 wrapper and add strict page table locking for X86EMU wrapper.
* Prefer struct sysentvec sv_psstrings to hardcoding FREEBSD32_PS_STRINGSkib2010-08-071-1/+2
| | | | | | in the compat32 code. Use sv_usrstack instead of FREEBSD32_USRSTACK as well. MFC after: 1 week
* Add compat32 definition for (old) struct ostat.kib2010-08-071-0/+18
| | | | MFC after: 1 week
* Do not block any I/O port on amd64.jkim2010-08-071-4/+8
|
* Optimize interrupt vector lookup. There is no need to check the page table.jkim2010-08-071-1/+1
|
* Consistently use architecture specific macros.jkim2010-08-061-3/+3
|
* Fix allocation of multiple pages, which forgot to increase page number.jkim2010-08-061-1/+5
| | | | | Particularly, it caused "vm86_addpage: overlap" panics under VirtualBox. Add a safety check before freeing memory while I am here.
* Re-add flag register for output. Some BIOS calls actually use it to returnjkim2010-08-051-0/+1
| | | | success/failure status. Oops.
* Do not copy stack pointer and flags. These registers are unconditionallyjkim2010-08-051-6/+0
| | | | destroyed from vm86_prepcall().
* Implement a simple native VM86 backend for X86BIOS. Now i386 uses nativejkim2010-08-052-76/+266
| | | | | | | | | | | | | VM86 calls instead of the real mode emulator as a backend. VM86 has been proven reliable for very long time and it is actually few times faster than emulation. Increase maximum number of page table entries per VM86 context from 3 to 8 pages. It was (ridiculously) low and insufficient for new VM86 backend, which shares one context globally. Slighly rearrange and clean up the emulator backend to accommodate new code. The only visible change here is stack size, which is decreased from 64K to 4K bytes to sync. with VM86. Actually, it seems there is no need for big stack in real mode. MFC after: 1 month
* Copy inode birthtime to the struct stat32.kib2010-08-041-0/+1
| | | | MFC after: 1 week
* Fix style.kib2010-08-041-1/+2
| | | | MFC after: 1 week
* 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
OpenPOWER on IntegriCloud