Commit Graph

1429 Commits

Author SHA1 Message Date
christos
89e2b251a2 Get ready for NPTL but don't turn it on as of yet. 2007-06-13 20:57:33 +00:00
christos
344a5bd80c regen. 2007-06-13 14:31:30 +00:00
christos
76af51a354 Add futex. 2007-06-13 14:31:07 +00:00
christos
564f9b3b2f cleanup some bitrot; from Matthew Orgass 2007-06-13 02:11:40 +00:00
rjs
ef2a6ab865 Wrap ktrace calls with #ifdef KTRACE. 2007-06-06 17:08:27 +00:00
dsl
3e4175ccc9 Fix select() without a timeout parameter. 2007-06-04 21:02:22 +00:00
yamt
a15e4b5b1b wrap #include "opt_ktrace.h" by #ifdef _KERNEL_OPT. 2007-06-02 13:16:19 +00:00
dsl
3d0e15d3b2 Call selcommon() directly instead of using the stackgap... 2007-06-02 11:51:42 +00:00
dsl
d7f93c5c67 Split sys_bind() and sys_connect() so that compat code can use common code
once the 'address' has been copied into an mbuf.
Add extra flags for 'struct msghdr.msg_flags' to indicate that the address
  and control are already in mbufs, and that the uio structure is in userspace
  for sending data, rename sendit() to do_sys_sendmsg() to ensure no old code
  passes in random flags.
Changes to compat code to use new functions - removing some stackgap use.
Fix a 'use after free' in compat_43_sys_recvmsg.
I ***THINK*** the code that converts 'cmsg' formatted data is borked!
svr4_stream.c ought to be generated from svr4_32_stream.c during the build.
2007-06-01 22:53:52 +00:00
dsl
d95fed7315 (Ab)use a KTR_USER trace entry for the linux socket command and arguments. 2007-06-01 22:42:47 +00:00
christos
20bfd9898e Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
2007-05-29 21:32:27 +00:00
njoly
f70cd37804 Fix restart of interrupted system calls.
- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
  its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().

With valuable help from manu.
2007-05-24 11:21:52 +00:00
christos
c61eed39a8 rename si_sigval -> si_value to match POSIX RTS. 2007-05-21 15:35:47 +00:00
dsl
a163d15464 This is deja vu - I fixed this earlier....
No need to use stackgap for ioctl to get PTM name, directly call file's
ioctl function with kernel buffer.
2007-05-13 16:04:00 +00:00
dsl
2cc0d0a9c4 Stop using the stackgap for time functions. 2007-05-13 11:04:11 +00:00
dsl
701496b5c6 Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.
2007-05-12 23:02:49 +00:00
dsl
8beba9d093 There is no need to use the stackgap for get/setrlimit. 2007-05-12 21:07:02 +00:00
dsl
a08b772cae Fix comment and indent. 2007-05-12 20:23:36 +00:00
dsl
c83f8a10ad Change the compat sys_[fl]utime code to not use the stackgap. 2007-05-12 17:28:19 +00:00
christos
48f401a8e0 - linux uname -m on x86 returns i{3,4,5,6}86 make it so.
- delete the machine sysctl that never worked, and gc linux_machine.
2007-05-10 21:30:14 +00:00
christos
ef061fd462 move the #if 0 down a few lines so linux_machine gets initialized. Pointed
out by Joachim K�nig
2007-05-10 17:12:32 +00:00
dsl
99ec301ce3 Remember to copy the rusage to the users buffer. 2007-05-08 20:54:15 +00:00
dsl
1844147fa9 Split sys_wait4() so that compat code can fiddle with the returned 'status'
and 'rusage' without having to copy data to/from stackgap buffers.
The old split (find_stopped_child) could be removed.
amd64 seems to run netbsd32, linux and linux32 emulations. sparc64 compiles.
2007-05-07 16:53:17 +00:00
christos
f844889627 Remove change that obviously was not tested (since it uses LINUX_KERN_VERSION
again, producing EEXIST). There is no machine sysctl in linux that corresponds
to this (at least on my i386 suse box)
2007-05-06 23:25:26 +00:00
dsl
dd85830e7b Include extra header (vfs_syscalls.h). 2007-04-30 20:20:28 +00:00
dsl
906b9af2a7 Rework compat stat() and statvfs() code so that it no longer uses the stackgap. 2007-04-30 14:05:47 +00:00
dsl
8932ebd238 Remove some unused calls to stackgap_init() 2007-04-30 09:20:18 +00:00
manu
262a61f00a Linux's uname should return x86_64 as machine_arch 2007-04-23 12:45:42 +00:00
christos
92ae584013 avoid zerodivide. 2007-04-23 00:13:14 +00:00
dsl
b8fbaf8c4b Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
2007-04-22 08:29:55 +00:00
ad
8aefa8aa0c Share the sysarch stuff between the x86 ports. PR kern/36046. 2007-04-16 19:12:17 +00:00
njoly
f771d34a84 - Add compat amd64 linux32 statfs support, adapted from PR/35956.
- Move bsd_to_linux_statfs() function to its own file to be shared
  between both linux compats.

ok by manu.
2007-04-11 11:45:55 +00:00
njoly
a926b97a8e Enable stat/stat64 nsec time support, for amd64 compat linux/linux32. 2007-04-05 16:39:11 +00:00
hubertf
ef314e20d0 Remove duplicate #include <sys/param.h>,
and pull in the <sys/cdefs.h> needed for __KERNEL_RCSID

From: Slava Semushin <php-coder@altlinux.ru>
2007-03-26 22:44:40 +00:00
njoly
6bf18aa85e Update i386 LINUX_{TIOCGPTN,TIOCSPTLCK} definitions for latest
linux_ioctl_termios() changes.
2007-03-26 12:26:11 +00:00
mrg
2cdaa49944 implement emul.linux.kern.machine, which can be set to "i686", like
some applications seem to want.
2007-03-23 04:16:13 +00:00
manu
91e99f33d3 Add ptmx fakedevice hack for amd64
Fix a bug in ioctl handling
2007-03-14 21:52:17 +00:00
njoly
de5304fe4b Regen (statfs/fstatfs fixes). 2007-03-14 12:47:46 +00:00
njoly
4e3a8d7d1d Fix compat linux statfs/fstatfs syscalls on amd64.
- Do not use statfs64/fstatfs64 as they have an extra size argument.
- Add full 64bit linux struct statfs support.

ok by manu
2007-03-14 12:44:39 +00:00
dsl
893faeae9e Update all the compat stuff to not use the 'stackgap' for processing
sys_stat() and friends, instead use do_sys_stat() and do_sys_fstat()
that write the answer into a kernel buffer (on stack) that can be
converted to the correct form and written the userspace.
I've test compiled a few kernels, and tested i386 netbsd1.6 ls.
Given I think I've fixed some bugs, it might be 50-50 with new ones.
2007-03-10 21:40:23 +00:00
ad
c147748d84 - Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-09 14:11:22 +00:00
christos
c74f0279ea more caddr_t lossage. 2007-03-05 14:13:10 +00:00
tsutsui
48174a79c0 Use (char *) cast on pointer arith. 2007-03-05 10:43:32 +00:00
yamt
731acd91f9 fix fallout from caddr_t changes. 2007-03-04 15:41:02 +00:00
tsutsui
543ff60bc5 Use (char *) on pointer arith. 2007-03-04 11:56:26 +00:00
christos
5ebcdbe8b5 fix caddr_t fallout. 2007-03-04 10:21:25 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
cube
632ece3eaf Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
2007-02-19 15:10:02 +00:00
ad
cee712ad2f Make this build. 2007-02-19 01:19:16 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
dsl
2b491f69ce Acquire proclist_lock across the calls to p_find() and pg_find(). 2007-02-17 21:40:19 +00:00
ad
087fdb9080 Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
2007-02-15 20:32:47 +00:00
ad
d0a51fd23b Fix Linux compat on amd64. 2007-02-15 15:13:33 +00:00
mlelstv
8d08c62fcc Make setsockopt return compatible error codes for AF_UNIX sockets. 2007-02-11 08:00:59 +00:00
ad
88cb6cb846 Acquire proclist_mutex before sending signals. 2007-02-09 23:51:20 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
njoly
0d81683020 Add a new linux_emuldata_shared flag value LINUX_LES_USE_NPTL to allow
both NPTL and old linuxthreads behaviour depending on process needs.

Apply to exit_group(), getpid() and getppid() to share them between
compat linux32 (non NPTL) and compat linux (NPTL) on amd64.

ok by manu and christos
2007-02-05 18:31:36 +00:00
hubertf
eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
elad
1113a3afe4 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-05 15:40:51 +00:00
elad
b31e9c44cf Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 18:27:36 +00:00
elad
0ffd2bf379 Adapt to recent machdep scope changes.
Pointed out by Kouichirou Hiratsuka, thanks!
2006-12-26 16:42:06 +00:00
elad
c96fdfd49b Part of PR/33280: Christian Ehrhardt: The call to FILE_USE should be
immediatly before the FREAD | FWRITE test not after it or FILE_UNUSE will
be called after the jump to out without a corresponding FILE_USE.
2006-11-25 22:03:41 +00:00
wiz
6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
elad
68f43d80fe Clean some KAUTH_GENERIC_ISSUSER usage in compat code. 2006-11-14 13:34:29 +00:00
cbiere
4b14bb6309 Changed error message of ENOPROTOOPT to "Protocol option not available". 2006-10-31 00:38:06 +00:00
christos
a2161fece4 sprinkle __unused. 2006-10-14 18:57:06 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos
ed106f137b Coverity CID 2990: fix memory leak (from Arnaud Lacombe) 2006-09-29 14:24:55 +00:00
pavel
3cdb79bdae Replace homegrown tests for FIFO (... & S_IFIFO) by S_ISFIFO. The old code
was "correct" by luck - we don't have any other file type whose S_IF* bits
in sys/stat.h overlap with S_IFIFO.

Originally discovered by Paul Stoeber in OpenBSD.
2006-09-25 16:16:18 +00:00
dbj
2df12fb8b5 use _KERNEL_OPT instead of _LKM to check whether to include "opt_ktrace.h" 2006-09-24 21:44:58 +00:00
dogcow
e15e9231e6 opt_ktrace.h doesn't exist when building LKMs. 2006-09-24 05:48:27 +00:00
manu
63ac93df54 Add sysctl tracing to emulations.
While we are there, fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
2006-09-23 22:11:59 +00:00
christos
487c57538b Pretend to implement TIOCSPTLCK. Although failing is harmless, there is no
point in doing so.
2006-09-22 15:12:02 +00:00
manu
876294b403 Proprely convert devices on amd64 2006-09-20 09:54:55 +00:00
manu
717102f4bb Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
  and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
2006-09-13 19:55:49 +00:00
christos
46c5717199 avoid empty if body. 2006-09-13 00:52:07 +00:00
christos
6a76f8e0d2 Avoid empty body in if 2006-09-13 00:51:12 +00:00
christos
193447d4bd avoid empty if 2006-09-13 00:49:07 +00:00
christos
de02317b32 comment out impossible code 2006-09-02 06:53:17 +00:00
christos
c4501e2800 fix incomplete initializer 2006-09-02 06:52:13 +00:00
matt
2e04559304 When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
2006-09-01 21:20:46 +00:00
matt
280b69066a Regen. 2006-09-01 21:19:44 +00:00
matt
30183e299f Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
2006-09-01 20:58:18 +00:00
he
7fae0d129f Allow this to build as an LKM by testing for _KERNEL_OPT before
including opt_ptrace.h.
2006-08-30 17:14:34 +00:00
matt
3a7b10b907 Regen 2006-08-30 11:19:23 +00:00
matt
ad6aa2b08e Update to deal with options PTRACE 2006-08-30 11:14:39 +00:00
manu
432f035fa6 The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
2006-08-24 16:36:59 +00:00
dogcow
51faed03f9 move #ifdef up a few lines to prevent unused variable warning/error 2006-08-23 21:17:48 +00:00
bjh21
a707189c87 Use VALID_R15_PSR() to check the context we're restoring in
linux_sys_sigreturn().  Somehow this got missed when I introduced that macro.
2006-08-23 21:16:58 +00:00
manu
81c909dd45 1) Complete Linux exit_group() emulation
Members of the thread group must die without reporting to the parent and
without going to zombie stage. We do that by reparenting to init before
catching a SIGKILL. The parent will not see the child death.

The thread group leader must report the exit status, even if it exits
because of another thread calling exit_group(). We do that by storing the
exit status in struct linux_emuldata_shared, and the exit hook has the
duty of setting struct proc's p_xstat for the thread group leader.

2) For exit/fork/exec hooks, move the NPTL specific code to separate functions
that are shared between COMPAT_LINUX and COMPAT_LINUX32

3) Fix LINUX_CLONE_PARENT_SETTID semantics
2006-08-23 19:49:09 +00:00
manu
05c8a1b827 Add a new signature test for linux probe function. We look for a .debuglink
section, which is specific to the Linux dynamic interpeter (yes, Linux
can execute it as a stand alone program)
2006-08-07 14:19:57 +00:00
manu
a640310a53 typo 2006-07-24 19:01:49 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
manu
2e26811b6b If the user process requests a non null timeout, make sure we do not turn
it into an infinite timeout because of a conversion
2006-07-09 18:51:28 +00:00
pavel
a78062784c Use the new socket call for Linux and SVR4, because those systems (at
least Linux 2.4.31, Irix 6.5.20 and Solaris 10) use EAFNOSUPPORT.

Only the Linux emulation has been tested.

XXX somebody should audit the other emulations...
2006-06-27 09:09:40 +00:00
mrg
e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00
manu
0a52064ba3 Do not implement exit_group() the right way on platforms that do not
define LINUX_NPTL yet, that cause firefox-bin to fail.
2006-06-26 07:42:00 +00:00
manu
ce7e36a5a9 Regen 2006-06-25 16:16:52 +00:00
manu
b7432513dc - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
2006-06-25 16:15:39 +00:00
he
fe98fdf977 Regenerate after fixing the getpriority syscall definition. 2006-06-13 22:24:34 +00:00
he
e100449f69 We need the argument structure for the getpriority syscall defined, so
change NOARGS to STD.
2006-06-13 22:23:03 +00:00
christos
9d7289ea69 change 20 to NZERO; pointed out by mrg. 2006-06-13 16:54:56 +00:00
christos
155721b1be don't allocate a crapload of struct's on the stack. Use a couple of unions
and use malloc for them.
2006-06-12 00:42:18 +00:00
christos
9cfe87267e PR/33671: Nicolas Joly: Add a getpriority syscall to account for the fact
that the linux getpriority is off by 20.
2006-06-10 21:18:11 +00:00
christos
ee08f35b9a regen 2006-06-10 21:16:49 +00:00
christos
c02c268f6b linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
2006-06-10 21:15:33 +00:00
kardel
de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
yamt
9c86170376 include kauth.h for kauth_cred_getgid. 2006-05-15 13:12:13 +00:00
yamt
88f8ec6c15 include kauth.h for kauth_authorize_generic. 2006-05-15 13:11:29 +00:00
yamt
17e49bf47c include kauth.h for kauth_cred_geteuid, etc. 2006-05-15 13:11:00 +00:00
yamt
1e7ca6733e include kauth.h for kauth_cred_getegid, etc. 2006-05-15 13:04:08 +00:00
yamt
6c89e74b38 include kauth.h for kauth_cred_geteuid. 2006-05-15 09:17:05 +00:00
elad
874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
christos
ca0ec852e6 XXX: GCC uninitialized 2006-05-14 03:40:02 +00:00
mrg
84e6307a04 use socklen_t when talking to the NetBSD side of things 2006-05-12 01:58:55 +00:00
yamt
f5ff7e4897 cleanup user.h.
- remove several #include which are not directly related to
  this header anymore.  tweak *.c accordingly.
- update comments.
- move some !_KERNEL #include to proc.h because it's more appropriate
  place these days.
- whitespace.
2006-05-11 11:54:36 +00:00
yamt
f3e4e9f8a2 don't allocate struct statvfs on stack as it's too large.
while i'm here, remove some unnecessary casts.
2006-05-10 11:05:34 +00:00
dyoung
448664e102 Use __arraycount(). 2006-03-27 21:27:02 +00:00
erh
8ad33681f8 Fix Coverity issues 2321 and 2320. Make sure to free allocated memory. 2006-03-17 06:01:14 +00:00
jonathan
b9c6a2634b Rework Linux sysctl()-emulation, so that on amd64, we return the same
Linux kernel-version as on i386 and ppc (currently 2.4.18), and a date
in Feb 2002.

On all other NetBSD platforms we return a Linux-kernel version of
2.0.38 and a date sometime in 2000, which (AFAIK) predates the
existence of amd64, and therefore predates Linux support for amd64.

To me, it makes much more sense to return the same Linux-kernel-version
and date for both 32-bit x86 and 64-bit x86.

Empirically (and not least), this change also allows SuSE 10 amd64
binaries to run under our Linux amd64 binary emulation (both static
and dynamic-linked, given suitable setup) , which they didn't when we
reported a Linux/x86_64 kernel version of 2.0.38.
2006-03-08 03:55:31 +00:00
thorpej
6e72296875 Remove SET/CLR/ISSET definitions. 2006-03-06 23:19:50 +00:00
yamt
ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
perry
fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
manu
f806470fb3 - Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
2006-02-15 09:31:17 +00:00
dogcow
663b29bb4a make linux emulation compile on i386 again. 2006-02-09 23:27:08 +00:00
manu
ee0c5b44de Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
2006-02-09 19:18:56 +00:00
yamt
cab41a8b8a linux_sys_mremap: validate flags. 2006-01-31 14:02:55 +00:00
yamt
e8e7ab8637 implement compat_linux mremap. 2006-01-21 13:34:15 +00:00
perry
00d6acb4b6 bare asm -> __asm 2005-12-24 22:59:39 +00:00
christos
55f7db0668 PR/32303: Nicolas Joly: Fix -current amd64 kernel compilation failure with
options COMPAT_LINUX
2005-12-16 14:16:14 +00:00
christos
7330d168b8 proc to lwp change 2005-12-14 18:33:32 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos
184ad089a7 - make settime take timespec.
- avoid wrapping of time in settime.
- pass struct proc down so that we can log a detailed message.
2005-12-05 00:16:33 +00:00
rpaulo
462d39494a Remove the debugging printf left in linux_sys_getrlimit(). 2005-11-30 11:36:22 +00:00
jdolecek
a2e3927e39 undo linux_sys_exit_group() change _again_ - please do not commit known
broken code
2005-11-29 22:31:59 +00:00
manu
35923ac2fc Threads should not send a signal on exit. 2005-11-29 16:24:41 +00:00
manu
2697809839 To awake all processes sleeping on a futex, set maximum value to 0x7fffffff
instead of -1 (0xffffffff): the value is signed...
2005-11-23 22:38:46 +00:00
manu
c06b3dd8a8 Remove a debug printf 2005-11-23 22:23:30 +00:00
manu
23cf341ea0 - Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
2005-11-23 16:14:57 +00:00
chs
001ec1422b include additional headers that are now needed. 2005-11-11 23:22:08 +00:00
jdolecek
95d0b66d28 undo the linux_sys_exit_group() change for now - complete CLONE_THREAD support
is necessary for this to work properly
2005-11-11 22:45:41 +00:00
christos
65de380a95 More ipc support for linux; makes oracle work. From chuq and
jlrodriguez at terra dot es
2005-11-10 18:33:37 +00:00
manu
e75bcb9ebf Fix build problem 2005-11-09 21:56:11 +00:00
manu
f98d5d856e Improve Linux exit_group emulation by sending a SIGKILL to all other
processes in the group instead of letting them live. It would be better
to properly terminate them.
2005-11-09 14:56:50 +00:00
manu
f53c4d1d1e Prevent integer overflow in timout calculation.
changed DEBUG_LINUX to DEBUG_LINUX_FUTEX so that we have less debug
messages on the console
2005-11-09 14:52:18 +00:00
manu
26222780eb Correctly computes futex timeout. 2005-11-08 21:28:49 +00:00
manu
d72135b371 Include linux_machdep.h so that LINUX_UNAME_ARCH ges defined (fixes
uname emulation)
2005-11-07 14:17:45 +00:00
manu
a5d2387dbb regen 2005-11-06 21:50:28 +00:00
manu
7505cb92a6 Back out sched_{set|get}affinity addition because it breaks the
build again on i386 now it is fixed for other archs (Tom's fix and
mine got in colision)
2005-11-06 18:16:31 +00:00
tron
0c24d80f02 Regen with correct RCS Ids. 2005-11-06 14:25:48 +00:00
manu
35f76b0ac2 ifdef out sched_{get|set}affinity for ports that don't use it yet. That
should fix build.
2005-11-05 23:44:25 +00:00
dogcow
b3b0932a5d mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
2005-11-05 10:56:48 +00:00
manu
2ae48df4fc regen 2005-11-05 08:11:30 +00:00
manu
0cf4b35fe6 Implement more of Linux futex(2) 2005-11-05 08:07:44 +00:00
manu
41455b2ed0 Implement Linux sched_{set|get}affinity 2005-11-05 08:06:58 +00:00
manu
67fcd6abf5 Fix build when LINUX_NPTL is not defined 2005-11-05 07:26:45 +00:00
manu
2cac35470c Fix a messed up patch 2005-11-05 00:58:57 +00:00
manu
88a5eb33ed Instead of ifdef'ing __amd64__ all the Linux NPTL stuff, introduce an
ifdef LINUX_NPTL.
Also implement SETTLS flag to Linux clone()
2005-11-05 00:47:26 +00:00
chs
df018c387b make this compile on m68k by including sys/device.h explicitly.
on other platforms it's apparently included implicitly, probably through cpu.h.
2005-11-04 17:00:43 +00:00
manu
b72e0d5382 Fix machine name returned by uname on Linux 2005-11-04 16:58:14 +00:00
manu
78ad642708 regen 2005-11-04 16:57:03 +00:00
manu
e7609e6478 Implement Linux futex ang gettid 2005-11-04 16:54:11 +00:00
manu
3b8100b96a register_t is not an int on amd64 2005-11-04 16:52:51 +00:00
manu
e1c0c1c9dd Implement Linux futex and gettid system calls for amd64 2005-11-04 16:51:56 +00:00
manu
0a3dbc01d5 build fix 2005-11-04 16:49:55 +00:00
manu
b7ba0ebc16 Fix pipe linux emulation on amd64 2005-10-31 18:00:30 +00:00
manu
5d2a593dcd build fix 2005-10-31 17:58:07 +00:00
chs
d17f6e14bc add support for the linux PROT_GROWS{DOWN,UP} mprotect() flags.
fixes PR 30008.
2005-10-30 16:25:50 +00:00
christos
6f981830a9 PR/31905: Wolfgang Stukenbrock: Termios ioctls TIOCMBIC and TIOCMBIS missing
in linux emulation code
2005-10-24 12:58:34 +00:00
christos
e780c5edaf regen 2005-10-18 19:52:07 +00:00
christos
8fc452caf8 add the missing %% that confused joerg and the parser. 2005-10-18 19:51:47 +00:00
joerg
5e74202601 Regen. 2005-10-18 19:08:51 +00:00
joerg
39fcee12fe sys_uselib is needed by COMPAT_LINUX for EXEC_AOUT. Since it doesn't get
build when EXEC_AOUT is not defined, the syscalls.master entry has to be
conditionalized. Alpha did so already, so let the other archs catch up
with it.

Go-on: christos
2005-10-18 18:37:44 +00:00
christos
ca3a193432 factor out some of the osockaddr, omsghdr code. 2005-09-24 15:51:03 +00:00
christos
d359ae5c43 MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
2005-09-19 02:46:49 +00:00
christos
ff66f5797e need linux_syscallargs.h to compile, and remove inline function. 2005-09-13 22:08:21 +00:00
jmmv
ec93365612 Initial addition of tmpfs, an efficient memory file-system. This project
was developed as part of Google's Summer of Code 2005 program.  This
change adds the kernel code, the mount_tmpfs utility, a regression test
suite and does all other related changes to integrate these.

The file-system is still *experimental*.  Therefore, it is disabled by
default in all kernels.  However, as typically done, a commented-out
entry is added in them to ease its setup.

Note that I haven't commited the required mountd(8) changes to be able
to export tmpfs file-systems because NFS support is still very unstable
and because, before enabling it, I'd like to do some other changes.

OK'ed by my project mentor, William Studenmund (wrstuden@).
2005-09-10 19:20:48 +00:00
yamt
0ed4057082 linux_machdepioctl: remove duplicated FILE_USE/UNUSE. 2005-08-21 13:13:50 +00:00
christos
758a209d23 64 bit inode changes. 2005-08-19 02:03:49 +00:00
christos
5ae508513d - include <sys/wait.h> so that this compile
- use the code field directly, instead of redoing the logic.
- XXX: the status field must be wrong. I think that the _WSTATUS()
  should not be used directly.
2005-06-25 02:19:06 +00:00
manu
d83c516040 More accurate SIGCHLD code and status for siginfo 2005-06-24 22:57:05 +00:00
manu
c8b33aa328 report the right process status 2005-06-22 21:57:30 +00:00
manu
5e803980cd Fix siginfo to return the right child's status. 2005-06-22 20:20:30 +00:00
manu
6593739f61 Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
2005-06-22 15:10:51 +00:00
atatat
df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
christos
6f86542bb2 remove duplicate declaration. 2005-06-19 23:46:32 +00:00
tsutsui
bce385b9f7 Add a const. 2005-06-02 16:54:52 +00:00
drochner
c2a5fd0191 more cast-qual fallout 2005-06-02 13:03:27 +00:00
christos
fb4b40b7e8 - sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
  an api change.
- avoid variable shadowing.
2005-05-29 22:08:16 +00:00
jmc
36b625d324 Regen 2005-05-23 23:22:27 +00:00
jmc
55c161e3ff Add clock_* POSIX functions. 2005-05-23 23:21:49 +00:00
fvdl
57409f3466 sigreturn doesn't take arguments. Instead, find out where the signal
frame is from the stack pointer in the frame frame.

Also, don't forget to copy %rip back in.
2005-05-22 19:31:15 +00:00
fvdl
e83accc0f6 Regen after sigreturn argument change. 2005-05-22 19:29:40 +00:00
fvdl
8251c0b501 Change sigreturn to have no arguments. 2005-05-22 19:29:15 +00:00
fvdl
beae305307 Use a modified buildcontext function for Linux signals. It doesn't set
the unused segment registers, it just uses the already used values.
2005-05-22 14:52:12 +00:00
fvdl
33e2d79f47 Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.
2005-05-20 12:48:26 +00:00
mrg
f56c2db8b9 tramp and vers are used unconditionally, make them visible everywhere. 2005-05-20 01:06:50 +00:00
manu
53fb6703e5 Add support for Linux SA_RESTORER on amd64. 2005-05-19 21:16:29 +00:00
fvdl
046b9a57dc Implement clock_* POSIX functions. 2005-05-16 21:18:34 +00:00