summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,nwhitehorn2010-03-1110-247/+448
| | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
* Make /proc/self/fd `work'.ed2010-03-071-0/+16
| | | | | | | | | | | | | | | | On Linux, /proc/<pid>/fd is comparable to fdescfs, where it allows you to inspect the file descriptors used by each process. Glibc's ttyname() works by performing a readlink() on these nodes, since all nodes in this directory are symlinks. It is a bit hard to implement this in linprocfs right now, so I am not going to bother. Add a way to make ttyname(3) work, by adding a /proc/<pid>/fd symlink, which points to /dev/fd only if the calling process matches. When fdescfs is mounted, this will cause the readlink() in ttyname() to fail, causing it to fall back on manually finding a matching node in /dev. Discussed on: emulation@
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-012-14/+0
| | | | | | their software. Obtained from: NetBSD
* No need to include security/mac/mac_framework.h here.pjd2010-02-181-2/+0
|
* - Return EAFNOSUPPORT instead of EINVAL for unsupported address family,delphij2010-02-091-2/+7
| | | | | | | | | | | | this matches the Linux behavior. - Check if we have sufficient space allocated for socket structure, which fixes a buffer overflow when wrong length is being passed into the emulation layer. [1] PR: kern/138860 Submitted by: Mateusz Guzik <mjguzik gmail com> Reported by: Alexander Best [1] MFC after: 2 weeks
* Remove unused LIBCOMPAT keyword from syscalls.master.ed2010-02-082-3/+1
|
* Let us to use our libusb(3) in Linuxolator.wkoszek2010-01-182-0/+28
| | | | | | | | | | | With this change, Linux binaries can work with our libusb(3) when it's compiled against our header files on GNU/Linux system -- this solves the problem with differences between /dev layouts. With ported libusb(3), I am able to use my USB JTAG cable with Linux binaries that support it. Reviewed by: thompsa
* Whitespace change to be able to provide the correct commit log for r202364:netchild2010-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---snip--- Add video clipping support but with the caveats below. Background info: Video clipping allows the user to provide either a series of clip rectangles or a clip bitmap to the driver and have the driver mask the video according to the clipping specs provided. Adding support for clipping to the FreeBSD Linux emulator is problematic because it seems that this feature is not supported by many drivers and therefore it is ignored by many applications. Unfortunately, when not using it, rather than passing in a null clipping list, some apps leave the clipping fields uninitialized, casuing random values to be passed in. In the case where the driver does not use the clipping info, this is not a problem (although it is bad form). But the Linux emulator does not know which drivers will use this and which won't, so the Linux emulator must try to handle this clip list, and deal gracefully with cases where the values seem to be uninitialized. Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields in the video_window structure: the integer clipcount and the pointer clips. How the linuxulator handles this from this commit on: * if (clipcount == VIDEO_CLIP_BITMAP) The clips variable is a void * pointer to a 128*625 byte (1024*625 bit) memory area containing a bitmap of the clipping area. The pointer in the video_window structure is copied, but no video_clip structures are copied. * if (clipcount > 0 && clipcount <= 16384) The clips variable is pointer to a list of video_clip structures. Up to clipcount structures are copied and passed to the driver. The upper limit of 16384 was imposed here so that user code that does not properly initialize clipcount falls through below and no attempt is made to copy an uninitialized list. This value was found by examining Linux drivers that support the clip list. * else The clipcount is either negative (but not VIDEO_CLIP_BITMAP), zero or positive (> 16384). All these cases are treated as invalid data. Both the clipcount field and clips pointer are forced to zero/NULL and passed to the driver. It should be noted that, at the time of developing this V4L emulator code, the pwc(4) V4L driver does not support clipping. Submitted by: J.R. Oldroyd <fbsd@opal.com> MFC after: 1 month ---snip---
OpenPOWER on IntegriCloud