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
a9d77d09
Commit
a9d77d09
authored
Mar 18, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Factor out context_to_server() function.
parent
25e0a258
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
28 deletions
+18
-28
thread.c
dlls/ntdll/unix/thread.c
+18
-28
No files found.
dlls/ntdll/unix/thread.c
View file @
a9d77d09
...
...
@@ -228,6 +228,20 @@ static unsigned int get_native_context_flags( USHORT native_machine, USHORT wow_
/***********************************************************************
* xstate_to_server
*
* Copy xstate to the server format.
*/
static
void
xstate_to_server
(
context_t
*
to
,
const
CONTEXT_EX
*
xctx
)
{
const
XSTATE
*
xs
=
(
const
XSTATE
*
)((
const
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
to
->
flags
|=
SERVER_CTX_YMM_REGISTERS
;
if
(
xs
->
Mask
&
4
)
memcpy
(
&
to
->
ymm
.
regs
.
ymm_high
,
&
xs
->
YmmContext
,
sizeof
(
xs
->
YmmContext
)
);
}
/***********************************************************************
* context_to_server
*
* Convert a register context to the server format.
...
...
@@ -303,13 +317,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
memcpy
(
to
->
ext
.
i386_regs
,
from
->
ExtendedRegisters
,
sizeof
(
to
->
ext
.
i386_regs
)
);
}
if
(
flags
&
CONTEXT_I386_XSTATE
)
{
const
CONTEXT_EX
*
xctx
=
(
const
CONTEXT_EX
*
)(
from
+
1
);
const
XSTATE
*
xs
=
(
const
XSTATE
*
)((
const
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
to
->
flags
|=
SERVER_CTX_YMM_REGISTERS
;
if
(
xs
->
Mask
&
4
)
memcpy
(
&
to
->
ymm
.
regs
.
ymm_high
,
&
xs
->
YmmContext
,
sizeof
(
xs
->
YmmContext
)
);
}
xstate_to_server
(
to
,
(
const
CONTEXT_EX
*
)(
from
+
1
)
);
return
STATUS_SUCCESS
;
}
...
...
@@ -367,13 +375,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
fpu_to_fpux
(
(
XMM_SAVE_AREA32
*
)
to
->
fp
.
x86_64_regs
.
fpregs
,
&
from
->
FloatSave
);
}
if
(
flags
&
CONTEXT_I386_XSTATE
)
{
const
CONTEXT_EX
*
xctx
=
(
const
CONTEXT_EX
*
)(
from
+
1
);
const
XSTATE
*
xs
=
(
const
XSTATE
*
)((
const
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
to
->
flags
|=
SERVER_CTX_YMM_REGISTERS
;
if
(
xs
->
Mask
&
4
)
memcpy
(
&
to
->
ymm
.
regs
.
ymm_high
,
&
xs
->
YmmContext
,
sizeof
(
xs
->
YmmContext
)
);
}
xstate_to_server
(
to
,
(
const
CONTEXT_EX
*
)(
from
+
1
)
);
return
STATUS_SUCCESS
;
}
...
...
@@ -434,13 +436,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
to
->
debug
.
x86_64_regs
.
dr7
=
from
->
Dr7
;
}
if
(
flags
&
CONTEXT_AMD64_XSTATE
)
{
const
CONTEXT_EX
*
xctx
=
(
const
CONTEXT_EX
*
)(
from
+
1
);
const
XSTATE
*
xs
=
(
const
XSTATE
*
)((
const
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
to
->
flags
|=
SERVER_CTX_YMM_REGISTERS
;
if
(
xs
->
Mask
&
4
)
memcpy
(
&
to
->
ymm
.
regs
.
ymm_high
,
&
xs
->
YmmContext
,
sizeof
(
xs
->
YmmContext
)
);
}
xstate_to_server
(
to
,
(
const
CONTEXT_EX
*
)(
from
+
1
)
);
return
STATUS_SUCCESS
;
}
...
...
@@ -505,13 +501,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
to
->
debug
.
i386_regs
.
dr7
=
from
->
Dr7
;
}
if
(
flags
&
CONTEXT_AMD64_XSTATE
)
{
const
CONTEXT_EX
*
xctx
=
(
const
CONTEXT_EX
*
)(
from
+
1
);
const
XSTATE
*
xs
=
(
const
XSTATE
*
)((
const
char
*
)
xctx
+
xctx
->
XState
.
Offset
);
to
->
flags
|=
SERVER_CTX_YMM_REGISTERS
;
if
(
xs
->
Mask
&
4
)
memcpy
(
&
to
->
ymm
.
regs
.
ymm_high
,
&
xs
->
YmmContext
,
sizeof
(
xs
->
YmmContext
)
);
}
xstate_to_server
(
to
,
(
const
CONTEXT_EX
*
)(
from
+
1
)
);
return
STATUS_SUCCESS
;
}
...
...
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