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
ab69f719
Commit
ab69f719
authored
Feb 13, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move RtlAddFunctionTable() to the CPU backends.
parent
02ebacca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
68 deletions
+65
-68
exception.c
dlls/ntdll/exception.c
+0
-68
signal_arm.c
dlls/ntdll/signal_arm.c
+18
-0
signal_arm64.c
dlls/ntdll/signal_arm64.c
+19
-0
signal_arm64ec.c
dlls/ntdll/signal_arm64ec.c
+14
-0
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+14
-0
No files found.
dlls/ntdll/exception.c
View file @
ab69f719
...
...
@@ -382,74 +382,6 @@ static RTL_CRITICAL_SECTION_DEBUG dynamic_unwind_debug =
};
static
RTL_CRITICAL_SECTION
dynamic_unwind_section
=
{
&
dynamic_unwind_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
ULONG_PTR
get_runtime_function_end
(
RUNTIME_FUNCTION
*
func
,
ULONG_PTR
addr
)
{
#ifdef __x86_64__
return
func
->
EndAddress
;
#elif defined(__arm__)
if
(
func
->
Flag
)
return
func
->
BeginAddress
+
func
->
FunctionLength
*
2
;
else
{
struct
unwind_info
{
DWORD
function_length
:
18
;
DWORD
version
:
2
;
DWORD
x
:
1
;
DWORD
e
:
1
;
DWORD
f
:
1
;
DWORD
count
:
5
;
DWORD
words
:
4
;
}
*
info
=
(
struct
unwind_info
*
)(
addr
+
func
->
UnwindData
);
return
func
->
BeginAddress
+
info
->
function_length
*
2
;
}
#else
/* __aarch64__ */
if
(
func
->
Flag
)
return
func
->
BeginAddress
+
func
->
FunctionLength
*
4
;
else
{
struct
unwind_info
{
DWORD
function_length
:
18
;
DWORD
version
:
2
;
DWORD
x
:
1
;
DWORD
e
:
1
;
DWORD
epilog
:
5
;
DWORD
codes
:
5
;
}
*
info
=
(
struct
unwind_info
*
)(
addr
+
func
->
UnwindData
);
return
func
->
BeginAddress
+
info
->
function_length
*
4
;
}
#endif
}
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
*/
BOOLEAN
CDECL
RtlAddFunctionTable
(
RUNTIME_FUNCTION
*
table
,
DWORD
count
,
ULONG_PTR
addr
)
{
struct
dynamic_unwind_entry
*
entry
;
TRACE
(
"%p %lu %Ix
\n
"
,
table
,
count
,
addr
);
/* NOTE: Windows doesn't check if table is aligned or a NULL pointer */
entry
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
entry
)
);
if
(
!
entry
)
return
FALSE
;
entry
->
base
=
addr
;
entry
->
end
=
addr
+
(
count
?
get_runtime_function_end
(
&
table
[
count
-
1
],
addr
)
:
0
);
entry
->
table
=
table
;
entry
->
count
=
count
;
entry
->
max_count
=
0
;
entry
->
callback
=
NULL
;
entry
->
context
=
NULL
;
RtlEnterCriticalSection
(
&
dynamic_unwind_section
);
list_add_tail
(
&
dynamic_unwind_list
,
&
entry
->
entry
);
RtlLeaveCriticalSection
(
&
dynamic_unwind_section
);
return
TRUE
;
}
/**********************************************************************
* RtlInstallFunctionTableCallback (NTDLL.@)
*/
...
...
dlls/ntdll/signal_arm.c
View file @
ab69f719
...
...
@@ -1209,6 +1209,24 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base,
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
*/
BOOLEAN
CDECL
RtlAddFunctionTable
(
RUNTIME_FUNCTION
*
table
,
DWORD
count
,
ULONG_PTR
base
)
{
ULONG_PTR
end
=
base
;
void
*
ret
;
if
(
count
)
{
RUNTIME_FUNCTION
*
func
=
table
+
count
-
1
;
struct
unwind_info
*
info
=
(
struct
unwind_info
*
)(
base
+
func
->
UnwindData
);
end
+=
func
->
BeginAddress
+
2
*
(
func
->
Flag
?
func
->
FunctionLength
:
info
->
function_length
);
}
return
!
RtlAddGrowableFunctionTable
(
&
ret
,
table
,
count
,
0
,
base
,
end
);
}
/**********************************************************************
* call_consolidate_callback
*
* Wrapper function to call a consolidate callback from a fake frame.
...
...
dlls/ntdll/signal_arm64.c
View file @
ab69f719
...
...
@@ -1111,6 +1111,25 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base,
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
*/
BOOLEAN
CDECL
RtlAddFunctionTable
(
RUNTIME_FUNCTION
*
table
,
DWORD
count
,
ULONG_PTR
base
)
{
ULONG_PTR
end
=
base
;
void
*
ret
;
if
(
count
)
{
RUNTIME_FUNCTION
*
func
=
table
+
count
-
1
;
ULONG
len
=
func
->
Flag
?
func
->
FunctionLength
:
((
IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY_XDATA
*
)(
base
+
func
->
UnwindData
))
->
FunctionLength
;
end
+=
func
->
BeginAddress
+
4
*
len
;
}
return
!
RtlAddGrowableFunctionTable
(
&
ret
,
table
,
count
,
0
,
base
,
end
);
}
/**********************************************************************
* call_consolidate_callback
*
* Wrapper function to call a consolidate callback from a fake frame.
...
...
dlls/ntdll/signal_arm64ec.c
View file @
ab69f719
...
...
@@ -1858,6 +1858,20 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base,
}
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
*/
BOOLEAN
CDECL
RtlAddFunctionTable
(
RUNTIME_FUNCTION
*
table
,
DWORD
count
,
ULONG_PTR
base
)
{
ULONG_PTR
end
=
base
;
void
*
ret
;
if
(
count
)
end
+=
table
[
count
-
1
].
EndAddress
;
return
!
RtlAddGrowableFunctionTable
(
&
ret
,
table
,
count
,
0
,
base
,
end
);
}
/*******************************************************************
* RtlUnwindEx (NTDLL.@)
*/
...
...
dlls/ntdll/signal_x86_64.c
View file @
ab69f719
...
...
@@ -1079,6 +1079,20 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base,
}
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
*/
BOOLEAN
CDECL
RtlAddFunctionTable
(
RUNTIME_FUNCTION
*
table
,
DWORD
count
,
ULONG_PTR
base
)
{
ULONG_PTR
end
=
base
;
void
*
ret
;
if
(
count
)
end
+=
table
[
count
-
1
].
EndAddress
;
return
!
RtlAddGrowableFunctionTable
(
&
ret
,
table
,
count
,
0
,
base
,
end
);
}
struct
unwind_exception_frame
{
EXCEPTION_REGISTRATION_RECORD
frame
;
...
...
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