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
3d1c27d5
Commit
3d1c27d5
authored
Nov 11, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Factor out some view manipulation functions.
parent
5f36b7a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
7 deletions
+40
-7
virtual.c
dlls/ntdll/unix/virtual.c
+40
-7
No files found.
dlls/ntdll/unix/virtual.c
View file @
3d1c27d5
...
@@ -1541,6 +1541,31 @@ static struct file_view *alloc_view(void)
...
@@ -1541,6 +1541,31 @@ static struct file_view *alloc_view(void)
/***********************************************************************
/***********************************************************************
* free_view
*
* Free memory for view structure. virtual_mutex must be held by caller.
*/
static
void
free_view
(
struct
file_view
*
view
)
{
*
(
struct
file_view
**
)
view
=
next_free_view
;
next_free_view
=
view
;
}
/***********************************************************************
* unregister_view
*
* Remove view from the tree and update free ranges. virtual_mutex must be held by caller.
*/
static
void
unregister_view
(
struct
file_view
*
view
)
{
if
(
mmap_is_in_reserved_area
(
view
->
base
,
view
->
size
))
free_ranges_remove_view
(
view
);
wine_rb_remove
(
&
views_tree
,
&
view
->
entry
);
}
/***********************************************************************
* delete_view
* delete_view
*
*
* Deletes a view. virtual_mutex must be held by caller.
* Deletes a view. virtual_mutex must be held by caller.
...
@@ -1550,11 +1575,21 @@ static void delete_view( struct file_view *view ) /* [in] View */
...
@@ -1550,11 +1575,21 @@ static void delete_view( struct file_view *view ) /* [in] View */
if
(
!
(
view
->
protect
&
VPROT_SYSTEM
))
unmap_area
(
view
->
base
,
view
->
size
);
if
(
!
(
view
->
protect
&
VPROT_SYSTEM
))
unmap_area
(
view
->
base
,
view
->
size
);
set_page_vprot
(
view
->
base
,
view
->
size
,
0
);
set_page_vprot
(
view
->
base
,
view
->
size
,
0
);
if
(
arm64ec_map
)
clear_arm64ec_range
(
view
->
base
,
view
->
size
);
if
(
arm64ec_map
)
clear_arm64ec_range
(
view
->
base
,
view
->
size
);
unregister_view
(
view
);
free_view
(
view
);
}
/***********************************************************************
* register_view
*
* Add view to the tree and update free ranges. virtual_mutex must be held by caller.
*/
static
void
register_view
(
struct
file_view
*
view
)
{
wine_rb_put
(
&
views_tree
,
view
->
base
,
&
view
->
entry
);
if
(
mmap_is_in_reserved_area
(
view
->
base
,
view
->
size
))
if
(
mmap_is_in_reserved_area
(
view
->
base
,
view
->
size
))
free_ranges_remove_view
(
view
);
free_ranges_insert_view
(
view
);
wine_rb_remove
(
&
views_tree
,
&
view
->
entry
);
*
(
struct
file_view
**
)
view
=
next_free_view
;
next_free_view
=
view
;
}
}
...
@@ -1598,9 +1633,7 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz
...
@@ -1598,9 +1633,7 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz
view
->
protect
=
vprot
;
view
->
protect
=
vprot
;
set_page_vprot
(
base
,
size
,
vprot
);
set_page_vprot
(
base
,
size
,
vprot
);
wine_rb_put
(
&
views_tree
,
view
->
base
,
&
view
->
entry
);
register_view
(
view
);
if
(
mmap_is_in_reserved_area
(
view
->
base
,
view
->
size
))
free_ranges_insert_view
(
view
);
*
view_ret
=
view
;
*
view_ret
=
view
;
...
...
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