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
f7fa433d
Commit
f7fa433d
authored
Nov 20, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store the syscall table in the TEB on ARM.
parent
d4439fd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+10
-9
No files found.
dlls/ntdll/unix/signal_arm.c
View file @
f7fa433d
...
...
@@ -194,7 +194,7 @@ struct syscall_frame
UINT
restore_flags
;
/* 044 */
UINT
fpscr
;
/* 048 */
struct
syscall_frame
*
prev_frame
;
/* 04c */
SYSTEM_SERVICE_TABLE
*
syscall_table
;
/* 050 */
void
*
unused
;
/* 050 */
UINT
align
[
3
];
/* 054 */
ULONGLONG
d
[
32
];
/* 060 */
};
...
...
@@ -205,11 +205,13 @@ struct arm_thread_data
{
void
*
exit_frame
;
/* 1d4 exit frame pointer */
struct
syscall_frame
*
syscall_frame
;
/* 1d8 frame pointer on syscall entry */
SYSTEM_SERVICE_TABLE
*
syscall_table
;
/* 1dc syscall table */
};
C_ASSERT
(
sizeof
(
struct
arm_thread_data
)
<=
sizeof
(((
struct
ntdll_thread_data
*
)
0
)
->
cpu_data
)
);
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
arm_thread_data
,
exit_frame
)
==
0x1d4
);
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
arm_thread_data
,
syscall_frame
)
==
0x1d8
);
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
arm_thread_data
,
syscall_table
)
==
0x1dc
);
static
inline
struct
arm_thread_data
*
arm_thread_data
(
void
)
{
...
...
@@ -1171,8 +1173,6 @@ __ASM_GLOBAL_FUNC( call_user_mode_callback,
"ldr r5, [r4, #0x1d8]
\n\t
"
/* arm_thread_data()->syscall_frame */
"str r5, [sp, #0x4c]
\n\t
"
/* frame->prev_frame */
"str sp, [r4, #0x1d8]
\n\t
"
/* arm_thread_data()->syscall_frame */
"ldr r6, [r5, #0x50]
\n\t
"
/* prev_frame->syscall_table */
"str r6, [sp, #0x50]
\n\t
"
/* frame->syscall_table */
"mov sp, r1
\n\t
"
"bx ip"
)
...
...
@@ -1578,6 +1578,8 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
__asm__
__volatile__
(
"mcr p15, 0, %0, c13, c0, 2"
:
:
"r"
(
teb
)
);
thread_data
->
syscall_table
=
KeServiceDescriptorTable
;
context
.
R0
=
(
DWORD
)
entry
;
context
.
R1
=
(
DWORD
)
arg
;
context
.
Sp
=
(
DWORD
)
teb
->
Tib
.
StackBase
;
...
...
@@ -1598,7 +1600,6 @@ void call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend, TEB
frame
->
r0
=
(
DWORD
)
ctx
;
frame
->
prev_frame
=
NULL
;
frame
->
restore_flags
|=
CONTEXT_INTEGER
;
frame
->
syscall_table
=
KeServiceDescriptorTable
;
pthread_sigmask
(
SIG_UNBLOCK
,
&
server_block_set
,
NULL
);
__wine_syscall_dispatcher_return
(
frame
,
0
);
...
...
@@ -1641,12 +1642,12 @@ __ASM_GLOBAL_FUNC( signal_exit_thread,
*/
__ASM_GLOBAL_FUNC
(
__wine_syscall_dispatcher
,
__ASM_EHABI
(
".cantunwind
\n\t
"
)
"mrc p15, 0, r
1
, c13, c0, 2
\n\t
"
/* NtCurrentTeb() */
"ldr r1, [r
1
, #0x1d8]
\n\t
"
/* arm_thread_data()->syscall_frame */
"mrc p15, 0, r
2
, c13, c0, 2
\n\t
"
/* NtCurrentTeb() */
"ldr r1, [r
2
, #0x1d8]
\n\t
"
/* arm_thread_data()->syscall_frame */
"add r0, r1, #0x10
\n\t
"
"stm r0, {r4-r12,lr}
\n\t
"
"add r
2
, sp, #0x10
\n\t
"
"str r
2
, [r1, #0x38]
\n\t
"
"add r
0
, sp, #0x10
\n\t
"
"str r
0
, [r1, #0x38]
\n\t
"
"str r3, [r1, #0x3c]
\n\t
"
"mrs r0, CPSR
\n\t
"
"bfi r0, lr, #5, #1
\n\t
"
/* set thumb bit */
...
...
@@ -1662,7 +1663,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
"mov r6, sp
\n\t
"
"mov sp, r1
\n\t
"
"mov r8, r1
\n\t
"
"ldr r5, [r
1, #0x50]
\n\t
"
/* frame
->syscall_table */
"ldr r5, [r
2, #0x1dc]
\n\t
"
/* arm_thread_data()
->syscall_table */
"ubfx r4, ip, #12, #2
\n\t
"
/* syscall table number */
"bfc ip, #12, #20
\n\t
"
/* syscall number */
"add r4, r5, r4, lsl #4
\n\t
"
...
...
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