Commit Graph

3204 Commits

Author SHA1 Message Date
jdolecek b43cbaf291 fix two bugs in previous:
* flags passed from fork1() are FORK_*, not CLONE_*; thus, correct is to check
  for FORK_SHAREVM, not CLONE_VM
* fix a reference counting bug
2004-08-08 19:52:37 +00:00
jdolecek a714ac8294 linux processes sharing VM space (via clone() call) must also
share same 'break' value used for brk()/sbrk(), otherwise application SIGSEGVs
quickly once different threads try to adjust data segment size

this fixes linux Mozilla crashes with SuSE 9.1 libraries, and possibly
other linux applications using real threads
2004-08-08 09:40:50 +00:00
jdolecek 74436be135 pass the fork flags down to the emulation fork hook, so that emulation
code can use the information for setup
2004-08-08 08:42:03 +00:00
manu 158fe62cd6 Fix a build problem pointed out by wiz 2004-08-02 18:45:53 +00:00
jdolecek 10a205d5d1 Linux returns ENOMEM (not EFAULT) if the address specified in mprotect()
is not part of process address space

this fixes Linux libgcc_s's stack executability setup
2004-08-01 22:44:10 +00:00
jdolecek 88c36114af regen - sync syscall lists with Linux kernel 2.6.7 2004-08-01 15:38:10 +00:00
jdolecek 6e41cd161f add entries for #403, #404 (unused) 2004-08-01 15:36:23 +00:00
jdolecek d1d5ac79b4 sync the syscall lists with Linux kernel 2.6.7 2004-08-01 15:34:22 +00:00
jdolecek 945fc3e577 regen:
add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
2004-08-01 14:17:19 +00:00
jdolecek 2873b62b57 add stub entries for syscalls added until Linux kernel 2.6.7
move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
2004-08-01 14:16:32 +00:00
jdolecek 4b33174cf9 regen:
connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
2004-08-01 10:38:38 +00:00
jdolecek ae85fa27f7 connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
2004-08-01 10:32:40 +00:00
manu cdd12932c6 Regen 2004-07-28 22:25:10 +00:00
manu 66fc5fb621 Empty shell for Darwin audit API 2004-07-28 22:24:06 +00:00
manu bc620e30a6 Added the utrace system call 2004-07-28 21:30:00 +00:00
manu 6c669327ef Add the emul.mach.exception.hang sysctl, which helps catching programs
that die before they disapear. This is usefull because we cannot start
Mach-O binaries under gdb. We attach the hung process instead.
2004-07-27 22:01:56 +00:00
manu 09ee1c0349 The entropy collection sysctl returns the number of record and not the
copied data size.
2004-07-27 20:41:48 +00:00
manu 0a61854f64 Build with debug enabled 2004-07-27 20:41:13 +00:00
chs f8fa568ead remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
2004-07-25 23:26:44 +00:00
manu a380f938d4 Added kern.debug.getentropy sysctl 2004-07-25 07:54:54 +00:00
manu 7e06aa42fb Regen 2004-07-24 15:47:23 +00:00
manu 4bc8afece2 Added port_get_refs and port_mod_refs 2004-07-24 15:46:02 +00:00
manu c0431a8e23 - Perform alternate path checks in emulation tree for connect with AF_LOCAL
sockets
- When converting Darwin to native sockets, beware that darwin does not set
the size to AF_LOCAL sockets. We need to recompute by hand.
2004-07-24 15:45:27 +00:00
manu 86cd319fea Add a wrapper for connect that check an alternate path in emulation tree
for AF_LOCAL sockets.
2004-07-24 15:44:09 +00:00
manu e7d6d3e79b garbage data following darwin_if_msghdr was in fact a struct sockaddr_dl
Fixing this makes ifconfig nearly happy.
2004-07-24 01:00:29 +00:00
manu 59c4edd145 typo that caused ifaddr to report no addresses. 2004-07-23 21:34:01 +00:00
manu ebac5544ba Don't try to pre-compute the ifaddr data, it just leads to mistakes when
the code that fills the structure is modified and the the size computation
code.

Instead compute while filling the data.
2004-07-23 21:03:33 +00:00
he e3def7a76a It's not supposed to be possible to commit files with remnants of
CVS conflicts in them, but apparently this happened here around
__KERNEL_RCSID().  Fix it.
2004-07-22 09:43:19 +00:00
manu d5cb507ae3 If struct sockaddr's sa_family must be transalted, then struct sockaddr
itself needs to be translated. It means that we must translate it in
every system call using it: recvfrom, sendto, connect, accept, bind,
getpeername, getsockname.
2004-07-21 23:43:25 +00:00
manu 828bbdacac Don't assume ARG_MAX < MAXPATHLEN: someone might build with a modified
constant
2004-07-21 21:45:34 +00:00
manu 00c1d07082 Simplify the socket translation code.
Have the same size in the darwin/native and native/darwin AF translators
2004-07-21 20:57:30 +00:00
manu 941b113c0e Add the sysctl that provides interface enumeration (used by getifaddrs()
library call). Programs such as ifconfig or XFree86 4.4 XDarwin use it.
The emulation is not complete, as ifconfig is not able to display inet6
addresses correctly.
2004-07-21 01:37:57 +00:00
manu f58d4a42e1 bugfix: vm_copy was only copying the first page 2004-07-18 23:19:52 +00:00
kent a9236e26b4 pass the whole of pecoff_opthdr, not only pecoff_imghdr. 2004-07-18 04:36:42 +00:00
manu d4d3cc307c commpage function changes:
Copy all the commpages instead of one
Add the missing bcopy function
Wrong function name: pthread_getspecific instead of pthread_specific
2004-07-11 19:38:14 +00:00
christos b970e18139 Regen 2004-07-07 22:04:27 +00:00
christos 63c19634d0 no #ifdef __powerpc__ here. 2004-07-07 22:03:38 +00:00
manu 67cf1bc043 MacOS X.3 introduces a new sigreturn for PowerPC, with a usercontext
versionning argument. For now we only implement the X.2 flavor.
2004-07-04 21:03:55 +00:00
manu aab7e2ab6f Useful debug since ktrace doesn't show sysctl arg array. 2004-07-04 20:30:14 +00:00
christos 439d1da971 #ifdef the altivec option, because only powerpc has it. To be fixed in
a better way later.
2004-07-04 15:27:26 +00:00
manu 7fef082024 Move all the MD bits of commpage to a new file.
Map the comm page as RW in kernel (we want to modify it but not to execute it),
and RX in userland (no need to modify it but we want to execute it
2004-07-03 22:17:18 +00:00
manu 318748a9d0 Wrong argument to memset for bzero in commpage. 2004-07-03 17:29:17 +00:00
manu 5d33c4b91c 2^53 does not compute 2 power 53... 2004-07-03 16:47:13 +00:00
manu 4d933c5be0 Mark the thread id as clean in cthread_set_self 2004-07-03 09:44:04 +00:00
manu 26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
drochner 6f8b4c1216 There is no point in mapping a NetBSD signal trampoline
(which doesn't exist unless COMPAT_16 anyway)
into a Darwin emulation process' address space.
2004-06-24 17:02:06 +00:00
manu 31f25e173c Fix a reversed errno issue for Linux binaries on mips. While we are there,
fix broken includes for alpha and m68k.
2004-06-19 22:59:40 +00:00
manu b2563527a8 Build COMPAT_LINUX again on mips after the siginfo change. 2004-06-19 18:45:30 +00:00
manu 0d510f3e7e include <sys/resourcevar.h>. It is not required for building -current,
but it is for -netbsd-2-0. Next step is to pull up the change...
2004-06-18 17:06:15 +00:00
cube 4277a3964f Regen. 2004-06-17 18:30:54 +00:00