Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ea8ee88f
Commit
ea8ee88f
authored
Dec 17, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Reserve memory areas for 64-bit in case we don't have a preloader.
parent
5af634fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
mmap.c
libs/wine/mmap.c
+16
-8
No files found.
libs/wine/mmap.c
View file @
ea8ee88f
...
...
@@ -243,8 +243,7 @@ static inline int mmap_reserve( void *addr, size_t size )
*
* Reserve as much memory as possible in the given area.
*/
#ifdef __i386__
static
void
reserve_area
(
void
*
addr
,
void
*
end
)
static
inline
void
reserve_area
(
void
*
addr
,
void
*
end
)
{
size_t
size
=
(
char
*
)
end
-
(
char
*
)
addr
;
...
...
@@ -294,7 +293,7 @@ static void reserve_area( void *addr, void *end )
* Solaris malloc is not smart enough to obtain space through mmap(), so try to make
* sure that there is some available sbrk() space before we reserve other things.
*/
static
void
reserve_malloc_space
(
size_t
size
)
static
inline
void
reserve_malloc_space
(
size_t
size
)
{
#ifdef __sun
size_t
i
,
count
=
size
/
1024
;
...
...
@@ -309,15 +308,13 @@ static void reserve_malloc_space( size_t size )
#endif
}
#endif
/* __i386__ */
/***********************************************************************
* reserve_dos_area
*
* Reserve the DOS area (0x00000000-0x00110000).
*/
static
void
reserve_dos_area
(
void
)
static
inline
void
reserve_dos_area
(
void
)
{
const
size_t
page_size
=
getpagesize
();
const
size_t
dos_area_size
=
0x110000
;
...
...
@@ -341,9 +338,9 @@ static void reserve_dos_area(void)
*/
void
mmap_init
(
void
)
{
#ifdef __i386__
struct
reserved_area
*
area
;
struct
list
*
ptr
;
#ifdef __i386__
char
stack
;
char
*
const
stack_ptr
=
&
stack
;
char
*
user_space_limit
=
(
char
*
)
0x7ffe0000
;
...
...
@@ -383,7 +380,6 @@ void mmap_init(void)
reserve_area
(
base
,
end
);
}
else
reserve_area
(
user_space_limit
,
0
);
#endif
/* __i386__ */
/* reserve the DOS area if not already done */
...
...
@@ -394,6 +390,18 @@ void mmap_init(void)
if
(
!
area
->
base
)
return
;
/* already reserved */
}
reserve_dos_area
();
#elif defined(__x86_64__)
if
(
!
list_head
(
&
reserved_areas
))
{
/* if we don't have a preloader, try to reserve the space now */
reserve_area
(
(
void
*
)
0x000000010000
,
(
void
*
)
0x000068000000
);
reserve_area
(
(
void
*
)
0x00007ff00000
,
(
void
*
)
0x00007fff0000
);
reserve_area
(
(
void
*
)
0x7ffffe000000
,
(
void
*
)
0x7fffffff0000
);
}
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment