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
f492efdb
Commit
f492efdb
authored
Dec 14, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Reimplement thread initialization in assembler on ARM.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8a07ee48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
33 deletions
+27
-33
signal_arm.c
dlls/ntdll/signal_arm.c
+27
-33
No files found.
dlls/ntdll/signal_arm.c
View file @
f492efdb
...
@@ -1220,35 +1220,31 @@ static void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -1220,35 +1220,31 @@ static void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
abort
();
/* should not be reached */
abort
();
/* should not be reached */
}
}
typedef
void
(
WINAPI
*
thread_start_func
)(
LPTHREAD_START_ROUTINE
,
void
*
);
extern
void
DECLSPEC_NORETURN
start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
,
BOOL
suspend
,
void
*
relay
,
TEB
*
teb
);
struct
startup_info
__ASM_GLOBAL_FUNC
(
start_thread
,
{
".arm
\n\t
"
thread_start_func
start
;
"push {r4-r12,lr}
\n\t
"
LPTHREAD_START_ROUTINE
entry
;
/* build initial context on thread stack */
void
*
arg
;
"ldr r4, [sp, #40]
\n\t
"
/* teb */
BOOL
suspend
;
"ldr r4, [r4, #4]
\n\t
"
/* teb->Tib.StackBase */
};
"sub r5, r4, #0x1a0
\n\t
"
/* sizeof(CONTEXT) */
"mov ip, #0x0200000
\n\t
"
/* CONTEXT_ARM */
/***********************************************************************
"add ip, #0x3
\n\t
"
/* CONTEXT_FULL */
* thread_startup
"str ip, [r5]
\n\t
"
/* context->ContextFlags */
*/
"str r0, [r5, #0x4]
\n\t
"
/* context->R0 = entry */
static
void
thread_startup
(
void
*
param
)
"str r1, [r5, #0x8]
\n\t
"
/* context->R1 = arg */
{
"str r4, [r5, #0x38]
\n\t
"
/* context->Sp = stack */
CONTEXT
context
=
{
0
};
"str r3, [r5, #0x40]
\n\t
"
/* context->Pc = relay */
struct
startup_info
*
info
=
param
;
/* switch to thread stack */
"mov sp, r5
\n\t
"
/* build the initial context */
/* attach dlls */
context
.
ContextFlags
=
CONTEXT_FULL
;
"mov r0, r5
\n\t
"
/* context */
context
.
R0
=
(
DWORD
)
info
->
entry
;
"mov r1, r2
\n\t
"
/* suspend */
context
.
R1
=
(
DWORD
)
info
->
arg
;
"bl "
__ASM_NAME
(
"attach_dlls"
)
"
\n\t
"
context
.
Sp
=
(
DWORD
)
NtCurrentTeb
()
->
Tib
.
StackBase
;
/* switch to the initial context */
context
.
Pc
=
(
DWORD
)
info
->
start
;
"mov r0, r5
\n\t
"
"b "
__ASM_NAME
(
"set_cpu_context"
)
)
attach_dlls
(
&
context
,
info
->
suspend
);
set_cpu_context
(
&
context
);
}
/***********************************************************************
/***********************************************************************
* signal_start_thread
* signal_start_thread
...
@@ -1260,8 +1256,7 @@ static void thread_startup( void *param )
...
@@ -1260,8 +1256,7 @@ static void thread_startup( void *param )
*/
*/
void
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
,
BOOL
suspend
)
void
signal_start_thread
(
LPTHREAD_START_ROUTINE
entry
,
void
*
arg
,
BOOL
suspend
)
{
{
struct
startup_info
info
=
{
call_thread_entry_point
,
entry
,
arg
,
suspend
};
start_thread
(
entry
,
arg
,
suspend
,
call_thread_entry_point
,
NtCurrentTeb
()
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
}
/**********************************************************************
/**********************************************************************
...
@@ -1274,8 +1269,7 @@ void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend
...
@@ -1274,8 +1269,7 @@ void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend
*/
*/
void
signal_start_process
(
LPTHREAD_START_ROUTINE
entry
,
BOOL
suspend
)
void
signal_start_process
(
LPTHREAD_START_ROUTINE
entry
,
BOOL
suspend
)
{
{
struct
startup_info
info
=
{
kernel32_start_process
,
entry
,
NtCurrentTeb
()
->
Peb
,
suspend
};
start_thread
(
entry
,
NtCurrentTeb
()
->
Peb
,
suspend
,
kernel32_start_process
,
NtCurrentTeb
()
);
wine_switch_to_stack
(
thread_startup
,
&
info
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
}
}
/***********************************************************************
/***********************************************************************
...
...
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