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
ce5f17c8
Commit
ce5f17c8
authored
Mar 01, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store FPU and XMM contexts in x86 syscall frame.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bbae70bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
3 deletions
+50
-3
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+1
-0
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+22
-1
virtual.c
dlls/ntdll/unix/virtual.c
+0
-1
import.c
tools/winebuild/import.c
+27
-1
No files found.
dlls/ntdll/unix/signal_arm.c
View file @
ce5f17c8
...
...
@@ -918,6 +918,7 @@ void signal_init_threading(void)
*/
NTSTATUS
signal_alloc_thread
(
TEB
*
teb
)
{
teb
->
WOW32Reserved
=
__wine_syscall_dispatcher
;
return
STATUS_SUCCESS
;
}
...
...
dlls/ntdll/unix/signal_i386.c
View file @
ce5f17c8
...
...
@@ -461,6 +461,17 @@ enum i386_trap_code
#endif
};
struct
syscall_xsave
{
union
{
XSAVE_FORMAT
xsave
;
FLOATING_SAVE_AREA
fsave
;
}
u
;
};
C_ASSERT
(
sizeof
(
struct
syscall_xsave
)
==
0x200
);
struct
syscall_frame
{
DWORD
eflags
;
/* 00 */
...
...
@@ -502,6 +513,8 @@ C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, gs )
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
x86_thread_data
,
exit_frame
)
==
0x1f4
);
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
x86_thread_data
,
syscall_frame
)
==
0x1f8
);
static
void
*
syscall_dispatcher
;
static
inline
struct
x86_thread_data
*
x86_thread_data
(
void
)
{
return
(
struct
x86_thread_data
*
)
ntdll_get_thread_data
()
->
cpu_data
;
...
...
@@ -2424,6 +2437,7 @@ NTSTATUS signal_alloc_thread( TEB *teb )
}
else
thread_data
->
fs
=
gdt_fs_sel
;
teb
->
WOW32Reserved
=
syscall_dispatcher
;
return
STATUS_SUCCESS
;
}
...
...
@@ -2501,7 +2515,14 @@ void signal_init_process(void)
*/
void
*
signal_init_syscalls
(
void
)
{
return
__wine_syscall_dispatcher
;
extern
void
__wine_syscall_dispatcher_fxsave
(
void
)
DECLSPEC_HIDDEN
;
if
(
cpu_info
.
FeatureSet
&
CPU_FEATURE_FXSR
)
syscall_dispatcher
=
__wine_syscall_dispatcher_fxsave
;
else
syscall_dispatcher
=
__wine_syscall_dispatcher
;
return
NtCurrentTeb
()
->
WOW32Reserved
=
syscall_dispatcher
;
}
...
...
dlls/ntdll/unix/virtual.c
View file @
ce5f17c8
...
...
@@ -2556,7 +2556,6 @@ static void init_teb( TEB *teb, PEB *peb )
PtrToUlong
(
&
teb64
->
ActivationContextStack
.
FrameListCache
);
teb64
->
StaticUnicodeString
.
Buffer
=
PtrToUlong
(
teb64
->
StaticUnicodeBuffer
);
teb64
->
StaticUnicodeString
.
MaximumLength
=
sizeof
(
teb64
->
StaticUnicodeBuffer
);
teb
->
WOW32Reserved
=
__wine_syscall_dispatcher
;
#endif
teb
->
Peb
=
peb
;
teb
->
Tib
.
Self
=
&
teb
->
Tib
;
...
...
tools/winebuild/import.c
View file @
ce5f17c8
...
...
@@ -1456,7 +1456,19 @@ static void output_syscall_dispatcher( int count, const char *variant )
output
(
"
\t
movl %%ecx,-0x28(%%ebp)
\n
"
);
/* frame->esp */
output
(
"
\t
movl 4(%%ebp),%%ecx
\n
"
);
output
(
"
\t
movl %%ecx,-0x2c(%%ebp)
\n
"
);
/* frame->eip */
output
(
"
\t
movl %%esp,%%fs:0x1f8
\n
"
);
/* x86_thread_data()->syscall_frame */
output
(
"
\t
subl $0x200,%%esp
\n
"
)
;
output
(
"
\t
andl $~63,%%esp
\n
"
);
if
(
!*
variant
)
{
output
(
"
\t
fnsave (%%esp)
\n
"
);
output
(
"
\t
fwait
\n
"
);
}
else
{
output
(
"
\t
fxsave (%%esp)
\n
"
);
}
output
(
"
\t
leal -0x30(%%ebp),%%ecx
\n
"
);
output
(
"
\t
movl %%ecx,%%fs:0x1f8
\n
"
);
/* x86_thread_data()->syscall_frame */
output
(
"
\t
cmpl $%u,%%eax
\n
"
,
count
);
output
(
"
\t
jae 4f
\n
"
);
if
(
UsePIC
)
...
...
@@ -1479,6 +1491,17 @@ static void output_syscall_dispatcher( int count, const char *variant )
else
output
(
"
\t
call *.Lsyscall_table(,%%eax,4)
\n
"
);
output
(
"2:
\t
movl $0,%%fs:0x1f8
\n
"
);
output
(
"
\t
leal -0x230(%%ebp),%%ebx
\n
"
)
;
output
(
"
\t
andl $~63,%%ebx
\n
"
);
if
(
!*
variant
)
{
output
(
"
\t
frstor (%%ebx)
\n
"
);
output
(
"
\t
fwait
\n
"
);
}
else
{
output
(
"
\t
fxrstor (%%ebx)
\n
"
);
}
output
(
"
\t
leal -0x30(%%ebp),%%ebx
\n
"
);
output_cfi
(
".cfi_def_cfa_register %%ebx"
);
output_cfi
(
".cfi_adjust_cfa_offset 0x30
\n
"
);
...
...
@@ -1792,6 +1815,9 @@ void output_syscalls( DLLSPEC *spec )
switch
(
target_cpu
)
{
case
CPU_x86
:
output_syscall_dispatcher
(
count
,
"_fxsave"
);
break
;
case
CPU_x86_64
:
output_syscall_dispatcher
(
count
,
"_xsave"
);
output_syscall_dispatcher
(
count
,
"_xsavec"
);
...
...
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