Commit Graph

201157 Commits

Author SHA1 Message Date
dchagin
198b8af898 MFC r283453:
Remove the unnecessary cast.
2016-01-09 17:01:26 +00:00
dchagin
09f25351da Regen for r293555. 2016-01-09 17:00:15 +00:00
dchagin
682bdd605d MFC r283451:
Implement ppoll() system call.
2016-01-09 16:58:57 +00:00
dchagin
d2d5fcaa34 MFC r283450:
td_sigmask of a newly created thread copied from td.
Remove excess initialization of td_sigmask.
2016-01-09 16:58:03 +00:00
dchagin
1a379079e7 MFC r283449:
Update Linux compat revision to 32.
2016-01-09 16:57:03 +00:00
dchagin
ed9f0dfcff MFC r283448:
Connect linux64 module to the build.
2016-01-09 16:55:44 +00:00
dchagin
9d7b3777ea MFC r283446:
Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can
access to the semop structs and functions.
2016-01-09 16:52:25 +00:00
dchagin
b7022d5321 Regen for r293549. 2016-01-09 16:50:09 +00:00
dchagin
1eeab3feb9 MFC r283444:
Implement eventfd system call.
2016-01-09 16:48:50 +00:00
dchagin
623ca98188 MFC r283443:
Put the correct value for the abi_nfdbits parameter of kern_select() for
all supported Linuxulators.
2016-01-09 16:47:36 +00:00
dchagin
2ce85f55b6 Regen for r293546. 2016-01-09 16:45:54 +00:00
dchagin
ea9daca708 MFC r283441:
Implement epoll family system calls. This is a tiny wrapper
around kqueue() to implement epoll subset of functionality.
The kqueue user data are 32bit on i386 which is not enough for
epoll user data, so we keep user data in the proc emuldata.

Initial patch developed by rdivacky@ in 2007, then extended
by Yuri Victorovich @ r255672 and finished by me
in collaboration with mjg@ and jillies@.
2016-01-09 16:44:17 +00:00
dchagin
b6688c70e9 MFC r283440:
For future use in the Linuxulator:

1. Add a kern_kqueue() counterpart for kqueue() with flags parameter.

2. Be a bit secure. To avoid a double fp lookup add a kern_kevent_fp()
counterpart for kern_kevent() with file pointer parameter instead
of file descriptor an pass the buck to it.

Suggested by: mjg [2]
2016-01-09 16:39:15 +00:00
dchagin
a95b158e60 MFC r283439:
Implement F_DUPFD_CLOEXEC fcntl flag.
2016-01-09 16:33:55 +00:00
dchagin
6c949662c5 MFC r283438:
Add several fcntl flags.
2016-01-09 16:32:35 +00:00
dchagin
2205518265 MFC r283437:
To avoid code duplication move open/fcntl definitions to the MI
header file.
2016-01-09 16:31:10 +00:00
dchagin
f31e70952f MFC r283436:
Use the BSD_TO_LINUX_SIGNAL() wherever there is no need
to check the ABI as it is known.
2016-01-09 16:29:51 +00:00
dchagin
cda33c12b3 MFC r283435:
Convert Linux wait options to the FreeBSD.
Check wait options as a Linux do.
Linux always set WEXITED option not a WUNTRACED|WNOHANG
which is a strange bug.
2016-01-09 16:28:40 +00:00
dchagin
711049c77b MFC r283434:
Set WIFCONTINUED to the wait status if needed.
2016-01-09 16:27:33 +00:00
dchagin
c0b5073f8d MFC r283433:
Rewrite linux_recvfrom. To avoid double conversion of sockaddr use
kern_recvit() directly.
And check fromlen parameter before sockaddr copyin and conversion.
2016-01-09 16:26:39 +00:00
dchagin
a1e3b366c7 MFC r283432:
Being exported through vdso the note.Linux section used by glibc
to determine the kernel version (this saves one uname call).
Temporarily disable the export of a note.Linux section until I figured
out how to change the kernel version in the note.Linux on the fly.
2016-01-09 16:25:30 +00:00
dchagin
68ddeae1b4 MFC r283431:
Add AT_RANDOM and AT_EXECFN auxiliary vector entries which are used by
glibc. At list since glibc version 2.16 using AT_RANDOM is mandatory.
2016-01-09 16:24:30 +00:00
dchagin
6a70519414 Regen for r293533. 2016-01-09 16:23:11 +00:00
dchagin
f186d260e2 MFC r283428:
Change linux faccessat syscall definition to match actual linux one.

The AT_EACCESS and AT_SYMLINK_NOFOLLOW flags are actually implemented
within the glibc wrapper function for faccessat().  If either of these
flags are specified, then the wrapper function employs fstatat() to
determine access permissions.
2016-01-09 16:21:39 +00:00
dchagin
9bb36bc01c MFC r283427:
Where possible we will use M_LINUX malloc(9) type.
Move M_FUTEX defines to the linux_common.ko.
2016-01-09 16:20:29 +00:00
dchagin
199f40b151 Regen for r293530. 2016-01-09 16:16:16 +00:00
dchagin
aaac17a4f9 MFC r283424:
Add preliminary support for x86-64 Linux binaries.
2016-01-09 16:14:24 +00:00
dchagin
2b349bc9ba MFC r283423:
Move FEATURE macros for v4l and v4l2 to the common module.
2016-01-09 16:12:37 +00:00
dchagin
6c12e20ac1 MFC r283422:
Refund the proc emuldata struct for future use. For now move flags from
thread emuldata to proc emuldata as it was originally intended.

As we can have both 64 & 32 bit Linuxulator running any eventhandler
can be called twice for us. To prevent this move eventhandlers code
from linux_emul.c to the linux_common.ko module.
2016-01-09 16:11:09 +00:00
dchagin
d30e84112a MFC r283421:
Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c
2016-01-09 16:08:22 +00:00
dchagin
e6de850e05 MFC r283447:
Fix build with KTR option.
2016-01-09 16:01:57 +00:00
dchagin
f1749dc5ea MFC r283420:
Add newfstatat system call for 64-bit Linuxulator.
2016-01-09 16:00:13 +00:00
dchagin
de7c911268 MFC r283419:
Fix compilation with -DDEBUG option.
2016-01-09 15:58:42 +00:00
dchagin
6ad4ee40e0 MFC r283417:
Add 64 bit support to the vdso.
2016-01-09 15:57:28 +00:00
dchagin
793bb9c3f7 MFC r283416:
x86_64 Linux do not use multiplexing on ipc system calls.
Move struct ipc_perm definition to the MD path as it differs for 64 and
32 bit platform.
2016-01-09 15:56:01 +00:00
dchagin
0a1120ef09 MFC r283415:
Disable i386 call for x86-64 Linux.
2016-01-09 15:54:55 +00:00
dchagin
d394e9fe7e MFC r283414:
Print out proper procmap entry for 64 bit binaries.
2016-01-09 15:53:50 +00:00
dchagin
62726e37ba MFC r283413:
64-bit paltforms, like x86_64, do not use multiplexing on
socketcall system calls.
2016-01-09 15:52:32 +00:00
dchagin
8ecef5bcca MFC r283412:
Get ready to commit x86_64 Linux emulation.
All fields of type l_int in struct statfs are defined
as l_long on i386 and amd64.
2016-01-09 15:50:55 +00:00
dchagin
f536abaf31 MFC r283411:
Remove stale comment about a signal trampoline which
is moved to the shared page at r219609.
2016-01-09 15:49:42 +00:00
dchagin
a034df74fd MFC r283410:
Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.
2016-01-09 15:48:11 +00:00
dchagin
5c3e282c6e MFC r283408:
Eliminate a now unused global declaration of elf_linux_sysvec.
2016-01-09 15:46:05 +00:00
dchagin
18c1672334 MFC r283407:
Implement vdso - virtual dynamic shared object. Through vdso Linux
exposes functions from kernel with proper DWARF CFI information so that
it becomes easier to unwind through them.
Using vdso is a mandatory for a thread cancelation && cleanup
on a modern glibc.
2016-01-09 15:44:38 +00:00
dchagin
2e9cc3f70d Regen for r293511. 2016-01-09 15:40:44 +00:00
dchagin
4ed27590e5 MFC r283403:
Implement pselect6() system call.
2016-01-09 15:39:41 +00:00
dchagin
4992ef5f9d Regen for r293510. 2016-01-09 15:38:16 +00:00
dchagin
027f6631c0 MFC r283401:
Implement prlimit64() system call.
2016-01-09 15:37:10 +00:00
dchagin
a82405c150 Regen for r293508. 2016-01-09 15:35:57 +00:00
dchagin
b4d7be064f MFC r283399:
Implement dup3() system call.
2016-01-09 15:34:54 +00:00
dchagin
9ef9a01839 MFC r283398:
Sched_rr_get_interval returns EINVAL in case when the invalid pid
specified. This silence the ltp tests.
2016-01-09 15:33:48 +00:00