41 Commits

Author SHA1 Message Date
Alexandre Julliard
a9a08dbc3d libwine: Remove wine/library.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-08 16:26:17 +02:00
Damjan Jovanovic
e0138c4a6a libwine: Fix a regression in the return value check for mmap() on FreeBSD.
This fixes a regression from my previous patch in commit
55ba3648379d90642f174e74809b84130d6d1ddc, which was
checking for mmap() returning NULL instead of MAP_FAILED.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49225
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-25 20:20:33 +02:00
Damjan Jovanovic
55ba364837 libwine: Add support for mmap at fixed start addresses on FreeBSD.
The way to implement MAP_TRYFIXED on FreeBSD is call mmap()
with MAP_FIXED | MAP_EXCL, which will allocate the mapping
from the exact starting address if possible, and if that fails,
call mmap() again without them. This gets PE DLLs loading at
their correct base addresses, and fixes a FreeBSD-specific
problem with Cygwin's fork() caused by cygwin1.dll loading at
different base addresses in the parent and child.

Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:50:05 +02:00
Alexandre Julliard
44dc9d7383 libwine: Remove some conditional code that was only needed for Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 10:43:57 +02:00
Ken Thomases
abfa6784ab libwine: On Mac, don't manually exclude the stack when reserving above the user space limit.
Since we don't rely on trial and error, there's no advantage to this heuristic.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 19:03:59 +01:00
Ken Thomases
4a89dd1b4d libwine: On Mac, use Mach APIs to enumerate address space holes instead of using trial and error.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 19:03:57 +01:00
Ken Thomases
91d5d56748 libwine: On Mac, use a more capable Mach function to map memory and avoid calling mmap() in some cases.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 19:03:55 +01:00
André Hentschel
b0fc60d279 libwine: Reserve memory areas for ARM64 in case we don't have a preloader.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-17 10:28:44 +01:00
Charles Davis
b5f210ddc9 libwine: Define some functions only on i386 (Clang).
Signed-off-by: Charles Davis <cdavis5x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-16 23:26:30 +09:00
Alexandre Julliard
cef0fde53d libwine: Use sysconf() instead of getpagesize(). 2013-01-09 12:21:26 +01:00
André Hentschel
e369e79bd5 libwine: Add checks for DragonFly BSD. 2012-05-29 10:47:00 +02:00
Francois Gouget
e438743041 libwine: Include a couple of extra system headers to fix the compilation on Solaris. 2011-12-02 17:25:55 +01:00
Ken Thomases
abe6a13ff1 libwine: Reap child process to avoid leaving a zombie. 2011-12-01 10:45:15 +01:00
Alexandre Julliard
6d78004899 libwine: Avoid a potential loop in reserve_area. 2011-06-22 13:43:26 +02:00
Austin English
b21319231e libwine: Add missing checks for FreeBSD_kernel. 2011-01-17 14:26:16 +01:00
Alexandre Julliard
ea8ee88f98 libwine: Reserve memory areas for 64-bit in case we don't have a preloader. 2010-12-17 13:25:41 +01:00
Alexandre Julliard
1aa749d9e7 libwine: Reserve some low memory space even without a preloader. 2009-10-27 19:06:48 +01:00
Alexandre Julliard
f41b239645 libwine: Don't export mmap functions for the Windows build. 2009-04-01 20:27:59 +02:00
Francois Gouget
ae28fdb560 libwine: Reenable the memory reservation code on FreeBSD. 2009-03-09 12:05:27 +01:00
Alexandre Julliard
c614a2481a libwine: Reserve some malloc space on Solaris before we start mapping other things. 2008-09-03 17:22:17 +02:00
Gerald Pfeifer
3ab66cd00f libwine: Conditionally provide reserve_area(). 2007-10-15 17:49:56 +02:00
Joris Huizer
eefea58d7d libwine: sign-compare fixes. 2007-01-26 12:56:07 +01:00
Francois Gouget
bb8e625b5b Assorted spelling fixes. 2006-12-05 10:31:47 +01:00
Alexandre Julliard
6a5d3600dd libwine: Better heuristic for finding the top of the address space on Linux. 2006-07-31 17:09:34 +02:00
Alexandre Julliard
0b39d1a89e libwine: Added a function to enumerate the reserved mmap areas. 2006-07-24 13:59:10 +02:00
Alexandre Julliard
0e2fcd4ba8 libwine: Better memory reservation algorithm for platforms that use try_mmap_fixed. 2006-06-20 19:07:22 +02:00
Jonathan Ernst
360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Alexandre Julliard
e814b24e6d libwine: Only try to mmap the exact address when reserving memory.
This should avoid some extra work on platforms that need the
try_mmap_fixed function.
2006-04-13 21:55:33 +02:00
Alexandre Julliard
b7d5b31cf1 libwine: Reorganize the mmap code a bit to avoid some #ifdefs. 2006-04-13 21:53:41 +02:00
Robert Millan
8800352477 Enable for GNU/kFreeBSD the same kernel-specific interface/parameter
that is used with FreeBSD.
2006-02-05 13:06:50 +01:00
Alexandre Julliard
53496f83e7 Fixed a couple of warnings on MacOS. 2006-01-23 16:48:26 +01:00
Wolfgang Thaller
4c5f9c091b Implement try_mmap_fixed for Darwin. 2005-06-20 11:43:47 +00:00
Gerald Pfeifer
e5f6637eec Make us work on FreeBSD again by working around their different mmap()
implementation.
2004-12-15 10:51:51 +00:00
Gerald Pfeifer
ac815f5a6a Disable memory reservation code on FreeBSD, where it just doesn't
work.
2004-11-04 04:52:48 +00:00
Alexandre Julliard
d0e5b8e2ee Reserve the DOS area in mmap_init if it wasn't already done by the
preloader.
2004-07-24 02:30:09 +00:00
Alexandre Julliard
7d2f5a7b15 Avoid zero size allocations. 2004-06-04 01:01:17 +00:00
Alexandre Julliard
fa3544bbdf Check for existing reserved areas in mmap_init to avoid doing
duplicate work.
2004-06-03 00:44:50 +00:00
Alexandre Julliard
dc4d05690e Don't rely on the reserved area list being empty in reserve_area,
since the preloader will need to add things to the list before
startup.
2004-05-28 03:48:09 +00:00
Kevin Koltzau
96b215ff10 Fixed last mmap issue with mingw windows build. 2004-05-27 01:55:20 +00:00
Alexandre Julliard
d3239b677f Portability fix. 2004-05-25 18:55:20 +00:00
Alexandre Julliard
94d74b5fed Added support for managing reserved memory areas in libwine and ntdll.
Try to reserve everything above 0x80000000 on startup.
2004-05-25 01:29:24 +00:00