Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c3352feb
Commit
c3352feb
authored
May 30, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use nameless unions/structs for CPU-related data.
parent
65edf192
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
122 deletions
+111
-122
exception.c
dlls/ntdll/exception.c
+4
-6
heap.c
dlls/ntdll/heap.c
+0
-1
rtl.c
dlls/ntdll/rtl.c
+25
-27
time.c
dlls/ntdll/tests/time.c
+9
-11
time.c
dlls/ntdll/time.c
+1
-2
system.c
dlls/ntdll/unix/system.c
+50
-51
thread.c
dlls/ntdll/unix/thread.c
+22
-24
No files found.
dlls/ntdll/exception.c
View file @
c3352feb
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
#include <signal.h>
#include <signal.h>
#include <stdarg.h>
#include <stdarg.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include "windef.h"
#include "windef.h"
...
@@ -312,7 +310,7 @@ static ULONG_PTR get_runtime_function_end( RUNTIME_FUNCTION *func, ULONG_PTR add
...
@@ -312,7 +310,7 @@ static ULONG_PTR get_runtime_function_end( RUNTIME_FUNCTION *func, ULONG_PTR add
#ifdef __x86_64__
#ifdef __x86_64__
return
func
->
EndAddress
;
return
func
->
EndAddress
;
#elif defined(__arm__)
#elif defined(__arm__)
if
(
func
->
u
.
s
.
Flag
)
return
func
->
BeginAddress
+
func
->
u
.
s
.
FunctionLength
*
2
;
if
(
func
->
Flag
)
return
func
->
BeginAddress
+
func
->
FunctionLength
*
2
;
else
else
{
{
struct
unwind_info
struct
unwind_info
...
@@ -324,11 +322,11 @@ static ULONG_PTR get_runtime_function_end( RUNTIME_FUNCTION *func, ULONG_PTR add
...
@@ -324,11 +322,11 @@ static ULONG_PTR get_runtime_function_end( RUNTIME_FUNCTION *func, ULONG_PTR add
DWORD
f
:
1
;
DWORD
f
:
1
;
DWORD
count
:
5
;
DWORD
count
:
5
;
DWORD
words
:
4
;
DWORD
words
:
4
;
}
*
info
=
(
struct
unwind_info
*
)(
addr
+
func
->
u
.
UnwindData
);
}
*
info
=
(
struct
unwind_info
*
)(
addr
+
func
->
UnwindData
);
return
func
->
BeginAddress
+
info
->
function_length
*
2
;
return
func
->
BeginAddress
+
info
->
function_length
*
2
;
}
}
#else
/* __aarch64__ */
#else
/* __aarch64__ */
if
(
func
->
u
.
s
.
Flag
)
return
func
->
BeginAddress
+
func
->
u
.
s
.
FunctionLength
*
4
;
if
(
func
->
Flag
)
return
func
->
BeginAddress
+
func
->
FunctionLength
*
4
;
else
else
{
{
struct
unwind_info
struct
unwind_info
...
@@ -339,7 +337,7 @@ static ULONG_PTR get_runtime_function_end( RUNTIME_FUNCTION *func, ULONG_PTR add
...
@@ -339,7 +337,7 @@ static ULONG_PTR get_runtime_function_end( RUNTIME_FUNCTION *func, ULONG_PTR add
DWORD
e
:
1
;
DWORD
e
:
1
;
DWORD
epilog
:
5
;
DWORD
epilog
:
5
;
DWORD
codes
:
5
;
DWORD
codes
:
5
;
}
*
info
=
(
struct
unwind_info
*
)(
addr
+
func
->
u
.
UnwindData
);
}
*
info
=
(
struct
unwind_info
*
)(
addr
+
func
->
UnwindData
);
return
func
->
BeginAddress
+
info
->
function_length
*
4
;
return
func
->
BeginAddress
+
info
->
function_length
*
4
;
}
}
#endif
#endif
...
...
dlls/ntdll/heap.c
View file @
c3352feb
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h"
#include "windef.h"
#include "winnt.h"
#include "winnt.h"
#include "winternl.h"
#include "winternl.h"
...
...
dlls/ntdll/rtl.c
View file @
c3352feb
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
#include <stdarg.h>
#include <stdarg.h>
#include "ntstatus.h"
#include "ntstatus.h"
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include "winsock2.h"
#include "winsock2.h"
#include "windef.h"
#include "windef.h"
...
@@ -1567,7 +1565,7 @@ PVOID WINAPI RtlDecodePointer( PVOID ptr )
...
@@ -1567,7 +1565,7 @@ PVOID WINAPI RtlDecodePointer( PVOID ptr )
VOID
WINAPI
RtlInitializeSListHead
(
PSLIST_HEADER
list
)
VOID
WINAPI
RtlInitializeSListHead
(
PSLIST_HEADER
list
)
{
{
#ifdef _WIN64
#ifdef _WIN64
list
->
s
.
Alignment
=
list
->
s
.
Region
=
0
;
list
->
Alignment
=
list
->
Region
=
0
;
list
->
Header16
.
HeaderType
=
1
;
/* we use the 16-byte header */
list
->
Header16
.
HeaderType
=
1
;
/* we use the 16-byte header */
#else
#else
list
->
Alignment
=
0
;
list
->
Alignment
=
0
;
...
@@ -1582,7 +1580,7 @@ WORD WINAPI RtlQueryDepthSList(PSLIST_HEADER list)
...
@@ -1582,7 +1580,7 @@ WORD WINAPI RtlQueryDepthSList(PSLIST_HEADER list)
#ifdef _WIN64
#ifdef _WIN64
return
list
->
Header16
.
Depth
;
return
list
->
Header16
.
Depth
;
#else
#else
return
list
->
s
.
Depth
;
return
list
->
Depth
;
#endif
#endif
}
}
...
@@ -1594,7 +1592,7 @@ PSLIST_ENTRY WINAPI RtlFirstEntrySList(const SLIST_HEADER* list)
...
@@ -1594,7 +1592,7 @@ PSLIST_ENTRY WINAPI RtlFirstEntrySList(const SLIST_HEADER* list)
#ifdef _WIN64
#ifdef _WIN64
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
list
->
Header16
.
NextEntry
<<
4
);
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
list
->
Header16
.
NextEntry
<<
4
);
#else
#else
return
list
->
s
.
Next
.
Next
;
return
list
->
Next
.
Next
;
#endif
#endif
}
}
...
@@ -1607,24 +1605,24 @@ PSLIST_ENTRY WINAPI RtlInterlockedFlushSList(PSLIST_HEADER list)
...
@@ -1607,24 +1605,24 @@ PSLIST_ENTRY WINAPI RtlInterlockedFlushSList(PSLIST_HEADER list)
#ifdef _WIN64
#ifdef _WIN64
if
(
!
list
->
Header16
.
NextEntry
)
return
NULL
;
if
(
!
list
->
Header16
.
NextEntry
)
return
NULL
;
new
.
s
.
Alignment
=
new
.
s
.
Region
=
0
;
new
.
Alignment
=
new
.
Region
=
0
;
new
.
Header16
.
HeaderType
=
1
;
/* we use the 16-byte header */
new
.
Header16
.
HeaderType
=
1
;
/* we use the 16-byte header */
do
do
{
{
old
=
*
list
;
old
=
*
list
;
new
.
Header16
.
Sequence
=
old
.
Header16
.
Sequence
+
1
;
new
.
Header16
.
Sequence
=
old
.
Header16
.
Sequence
+
1
;
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
s
.
Region
,
new
.
s
.
Alignment
,
(
__int64
*
)
&
old
));
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
Region
,
new
.
Alignment
,
(
__int64
*
)
&
old
));
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
#else
#else
if
(
!
list
->
s
.
Next
.
Next
)
return
NULL
;
if
(
!
list
->
Next
.
Next
)
return
NULL
;
new
.
Alignment
=
0
;
new
.
Alignment
=
0
;
do
do
{
{
old
=
*
list
;
old
=
*
list
;
new
.
s
.
Sequence
=
old
.
s
.
Sequence
+
1
;
new
.
Sequence
=
old
.
Sequence
+
1
;
}
while
(
InterlockedCompareExchange64
((
__int64
*
)
&
list
->
Alignment
,
new
.
Alignment
,
}
while
(
InterlockedCompareExchange64
((
__int64
*
)
&
list
->
Alignment
,
new
.
Alignment
,
old
.
Alignment
)
!=
old
.
Alignment
);
old
.
Alignment
)
!=
old
.
Alignment
);
return
old
.
s
.
Next
.
Next
;
return
old
.
Next
.
Next
;
#endif
#endif
}
}
...
@@ -1643,19 +1641,19 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushEntrySList(PSLIST_HEADER list, PSLIST_ENTR
...
@@ -1643,19 +1641,19 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushEntrySList(PSLIST_HEADER list, PSLIST_ENTR
entry
->
Next
=
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
entry
->
Next
=
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
new
.
Header16
.
Depth
=
old
.
Header16
.
Depth
+
1
;
new
.
Header16
.
Depth
=
old
.
Header16
.
Depth
+
1
;
new
.
Header16
.
Sequence
=
old
.
Header16
.
Sequence
+
1
;
new
.
Header16
.
Sequence
=
old
.
Header16
.
Sequence
+
1
;
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
s
.
Region
,
new
.
s
.
Alignment
,
(
__int64
*
)
&
old
));
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
Region
,
new
.
Alignment
,
(
__int64
*
)
&
old
));
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
#else
#else
new
.
s
.
Next
.
Next
=
entry
;
new
.
Next
.
Next
=
entry
;
do
do
{
{
old
=
*
list
;
old
=
*
list
;
entry
->
Next
=
old
.
s
.
Next
.
Next
;
entry
->
Next
=
old
.
Next
.
Next
;
new
.
s
.
Depth
=
old
.
s
.
Depth
+
1
;
new
.
Depth
=
old
.
Depth
+
1
;
new
.
s
.
Sequence
=
old
.
s
.
Sequence
+
1
;
new
.
Sequence
=
old
.
Sequence
+
1
;
}
while
(
InterlockedCompareExchange64
((
__int64
*
)
&
list
->
Alignment
,
new
.
Alignment
,
}
while
(
InterlockedCompareExchange64
((
__int64
*
)
&
list
->
Alignment
,
new
.
Alignment
,
old
.
Alignment
)
!=
old
.
Alignment
);
old
.
Alignment
)
!=
old
.
Alignment
);
return
old
.
s
.
Next
.
Next
;
return
old
.
Next
.
Next
;
#endif
#endif
}
}
...
@@ -1683,18 +1681,18 @@ PSLIST_ENTRY WINAPI RtlInterlockedPopEntrySList(PSLIST_HEADER list)
...
@@ -1683,18 +1681,18 @@ PSLIST_ENTRY WINAPI RtlInterlockedPopEntrySList(PSLIST_HEADER list)
{
{
}
}
__ENDTRY
__ENDTRY
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
s
.
Region
,
new
.
s
.
Alignment
,
(
__int64
*
)
&
old
));
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
Region
,
new
.
Alignment
,
(
__int64
*
)
&
old
));
#else
#else
do
do
{
{
old
=
*
list
;
old
=
*
list
;
if
(
!
(
entry
=
old
.
s
.
Next
.
Next
))
return
NULL
;
if
(
!
(
entry
=
old
.
Next
.
Next
))
return
NULL
;
/* entry could be deleted by another thread */
/* entry could be deleted by another thread */
__TRY
__TRY
{
{
new
.
s
.
Next
.
Next
=
entry
->
Next
;
new
.
Next
.
Next
=
entry
->
Next
;
new
.
s
.
Depth
=
old
.
s
.
Depth
-
1
;
new
.
Depth
=
old
.
Depth
-
1
;
new
.
s
.
Sequence
=
old
.
s
.
Sequence
+
1
;
new
.
Sequence
=
old
.
Sequence
+
1
;
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -1722,19 +1720,19 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushListSListEx(PSLIST_HEADER list, PSLIST_ENT
...
@@ -1722,19 +1720,19 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushListSListEx(PSLIST_HEADER list, PSLIST_ENT
new
.
Header16
.
Depth
=
old
.
Header16
.
Depth
+
count
;
new
.
Header16
.
Depth
=
old
.
Header16
.
Depth
+
count
;
new
.
Header16
.
Sequence
=
old
.
Header16
.
Sequence
+
1
;
new
.
Header16
.
Sequence
=
old
.
Header16
.
Sequence
+
1
;
last
->
Next
=
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
last
->
Next
=
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
s
.
Region
,
new
.
s
.
Alignment
,
(
__int64
*
)
&
old
));
}
while
(
!
InterlockedCompareExchange128
((
__int64
*
)
list
,
new
.
Region
,
new
.
Alignment
,
(
__int64
*
)
&
old
));
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
return
(
SLIST_ENTRY
*
)((
ULONG_PTR
)
old
.
Header16
.
NextEntry
<<
4
);
#else
#else
new
.
s
.
Next
.
Next
=
first
;
new
.
Next
.
Next
=
first
;
do
do
{
{
old
=
*
list
;
old
=
*
list
;
new
.
s
.
Depth
=
old
.
s
.
Depth
+
count
;
new
.
Depth
=
old
.
Depth
+
count
;
new
.
s
.
Sequence
=
old
.
s
.
Sequence
+
1
;
new
.
Sequence
=
old
.
Sequence
+
1
;
last
->
Next
=
old
.
s
.
Next
.
Next
;
last
->
Next
=
old
.
Next
.
Next
;
}
while
(
InterlockedCompareExchange64
((
__int64
*
)
&
list
->
Alignment
,
new
.
Alignment
,
}
while
(
InterlockedCompareExchange64
((
__int64
*
)
&
list
->
Alignment
,
new
.
Alignment
,
old
.
Alignment
)
!=
old
.
Alignment
);
old
.
Alignment
)
!=
old
.
Alignment
);
return
old
.
s
.
Next
.
Next
;
return
old
.
Next
.
Next
;
#endif
#endif
}
}
...
...
dlls/ntdll/tests/time.c
View file @
c3352feb
...
@@ -18,8 +18,6 @@
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntdll_test.h"
#include "ntdll_test.h"
#include "ddk/wdm.h"
#include "ddk/wdm.h"
#include "intrin.h"
#include "intrin.h"
...
@@ -160,18 +158,18 @@ static void test_RtlQueryPerformanceCounter(void)
...
@@ -160,18 +158,18 @@ static void test_RtlQueryPerformanceCounter(void)
return
;
return
;
}
}
if
(
!
(
usd
->
u3
.
s
.
QpcBypassEnabled
&
SHARED_GLOBAL_FLAGS_QPC_BYPASS_ENABLED
))
if
(
!
(
usd
->
QpcBypassEnabled
&
SHARED_GLOBAL_FLAGS_QPC_BYPASS_ENABLED
))
{
{
todo_wine
win_skip
(
"QpcBypassEnabled is not set, skipping tests
\n
"
);
todo_wine
win_skip
(
"QpcBypassEnabled is not set, skipping tests
\n
"
);
return
;
return
;
}
}
if
((
usd
->
u3
.
s
.
QpcBypassEnabled
&
SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_HV_PAGE
))
if
((
usd
->
QpcBypassEnabled
&
SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_HV_PAGE
))
{
{
ok
(
usd
->
u3
.
s
.
QpcBypassEnabled
==
(
SHARED_GLOBAL_FLAGS_QPC_BYPASS_ENABLED
|
SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_HV_PAGE
|
SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_RDTSCP
),
ok
(
usd
->
QpcBypassEnabled
==
(
SHARED_GLOBAL_FLAGS_QPC_BYPASS_ENABLED
|
SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_HV_PAGE
|
SHARED_GLOBAL_FLAGS_QPC_BYPASS_USE_RDTSCP
),
"unexpected QpcBypassEnabled %x, expected 0x83
\n
"
,
usd
->
u3
.
s
.
QpcBypassEnabled
);
"unexpected QpcBypassEnabled %x, expected 0x83
\n
"
,
usd
->
QpcBypassEnabled
);
ok
(
usd
->
QpcFrequency
==
10000000
,
"unexpected QpcFrequency %I64d, expected 10000000
\n
"
,
usd
->
QpcFrequency
);
ok
(
usd
->
QpcFrequency
==
10000000
,
"unexpected QpcFrequency %I64d, expected 10000000
\n
"
,
usd
->
QpcFrequency
);
ok
(
!
usd
->
u3
.
s
.
QpcShift
,
"unexpected QpcShift %d, expected 0
\n
"
,
usd
->
u3
.
s
.
QpcShift
);
ok
(
!
usd
->
QpcShift
,
"unexpected QpcShift %d, expected 0
\n
"
,
usd
->
QpcShift
);
hsd
=
NULL
;
hsd
=
NULL
;
status
=
pNtQuerySystemInformation
(
SystemHypervisorSharedPageInformation
,
&
hsd
,
sizeof
(
void
*
),
&
len
);
status
=
pNtQuerySystemInformation
(
SystemHypervisorSharedPageInformation
,
&
hsd
,
sizeof
(
void
*
),
&
len
);
...
@@ -192,7 +190,7 @@ static void test_RtlQueryPerformanceCounter(void)
...
@@ -192,7 +190,7 @@ static void test_RtlQueryPerformanceCounter(void)
}
}
else
else
{
{
ok
(
usd
->
u3
.
s
.
QpcShift
==
10
,
"unexpected QpcShift %d, expected 10
\n
"
,
usd
->
u3
.
s
.
QpcShift
);
ok
(
usd
->
QpcShift
==
10
,
"unexpected QpcShift %d, expected 10
\n
"
,
usd
->
QpcShift
);
tsc0
=
__rdtsc
();
tsc0
=
__rdtsc
();
ret
=
pRtlQueryPerformanceCounter
(
&
counter
);
ret
=
pRtlQueryPerformanceCounter
(
&
counter
);
...
@@ -200,9 +198,9 @@ static void test_RtlQueryPerformanceCounter(void)
...
@@ -200,9 +198,9 @@ static void test_RtlQueryPerformanceCounter(void)
ok
(
ret
,
"RtlQueryPerformanceCounter failed
\n
"
);
ok
(
ret
,
"RtlQueryPerformanceCounter failed
\n
"
);
tsc0
+=
usd
->
QpcBias
;
tsc0
+=
usd
->
QpcBias
;
tsc0
>>=
usd
->
u3
.
s
.
QpcShift
;
tsc0
>>=
usd
->
QpcShift
;
tsc1
+=
usd
->
QpcBias
;
tsc1
+=
usd
->
QpcBias
;
tsc1
>>=
usd
->
u3
.
s
.
QpcShift
;
tsc1
>>=
usd
->
QpcShift
;
ok
(
tsc0
<=
counter
.
QuadPart
,
"rdtscp %I64d and RtlQueryPerformanceCounter %I64d are out of order
\n
"
,
tsc0
,
counter
.
QuadPart
);
ok
(
tsc0
<=
counter
.
QuadPart
,
"rdtscp %I64d and RtlQueryPerformanceCounter %I64d are out of order
\n
"
,
tsc0
,
counter
.
QuadPart
);
ok
(
counter
.
QuadPart
<=
tsc1
,
"RtlQueryPerformanceCounter %I64d and rdtscp %I64d are out of order
\n
"
,
counter
.
QuadPart
,
tsc1
);
ok
(
counter
.
QuadPart
<=
tsc1
,
"RtlQueryPerformanceCounter %I64d and rdtscp %I64d are out of order
\n
"
,
counter
.
QuadPart
,
tsc1
);
...
@@ -422,7 +420,7 @@ static void test_user_shared_data_time(void)
...
@@ -422,7 +420,7 @@ static void test_user_shared_data_time(void)
if
(
user_shared_data
->
NtMajorVersion
<=
5
&&
user_shared_data
->
NtMinorVersion
<=
1
)
if
(
user_shared_data
->
NtMajorVersion
<=
5
&&
user_shared_data
->
NtMinorVersion
<=
1
)
t2
=
(
DWORD
)((
*
(
volatile
ULONG
*
)
&
user_shared_data
->
TickCountLowDeprecated
*
(
ULONG64
)
user_shared_data
->
TickCountMultiplier
)
>>
24
);
t2
=
(
DWORD
)((
*
(
volatile
ULONG
*
)
&
user_shared_data
->
TickCountLowDeprecated
*
(
ULONG64
)
user_shared_data
->
TickCountMultiplier
)
>>
24
);
else
else
t2
=
(
DWORD
)((
read_ksystem_time
(
&
user_shared_data
->
u
.
TickCount
)
*
user_shared_data
->
TickCountMultiplier
)
>>
24
);
t2
=
(
DWORD
)((
read_ksystem_time
(
&
user_shared_data
->
TickCount
)
*
user_shared_data
->
TickCountMultiplier
)
>>
24
);
t3
=
GetTickCount
();
t3
=
GetTickCount
();
}
while
(
t3
<
t1
&&
i
++
<
1
);
/* allow for wrap, but only once */
}
while
(
t3
<
t1
&&
i
++
<
1
);
/* allow for wrap, but only once */
...
...
dlls/ntdll/time.c
View file @
c3352feb
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h"
#include "windef.h"
#include "winternl.h"
#include "winternl.h"
#include "ddk/wdm.h"
#include "ddk/wdm.h"
...
@@ -403,7 +402,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RtlQueryPerformanceFrequency( LARGE_INTEGER *frequ
...
@@ -403,7 +402,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RtlQueryPerformanceFrequency( LARGE_INTEGER *frequ
ULONG
WINAPI
DECLSPEC_HOTPATCH
NtGetTickCount
(
void
)
ULONG
WINAPI
DECLSPEC_HOTPATCH
NtGetTickCount
(
void
)
{
{
/* note: we ignore TickCountMultiplier */
/* note: we ignore TickCountMultiplier */
return
user_shared_data
->
u
.
TickCount
.
LowPart
;
return
user_shared_data
->
TickCount
.
LowPart
;
}
}
/***********************************************************************
/***********************************************************************
...
...
dlls/ntdll/unix/system.c
View file @
c3352feb
...
@@ -67,7 +67,6 @@
...
@@ -67,7 +67,6 @@
# include <mach/vm_map.h>
# include <mach/vm_map.h>
#endif
#endif
#define NONAMELESSUNION
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include "windef.h"
#include "windef.h"
...
@@ -619,12 +618,12 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel,
...
@@ -619,12 +618,12 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel,
while
(
ofs
<
logical_proc_info_ex_size
)
while
(
ofs
<
logical_proc_info_ex_size
)
{
{
dataex
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
char
*
)
logical_proc_info_ex
+
ofs
);
dataex
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
char
*
)
logical_proc_info_ex
+
ofs
);
if
(
rel
==
RelationProcessorPackage
&&
dataex
->
Relationship
==
rel
&&
dataex
->
u
.
Processor
.
Reserved
[
1
]
==
id
)
if
(
rel
==
RelationProcessorPackage
&&
dataex
->
Relationship
==
rel
&&
dataex
->
Processor
.
Reserved
[
1
]
==
id
)
{
{
dataex
->
u
.
Processor
.
GroupMask
[
0
].
Mask
|=
mask
;
dataex
->
Processor
.
GroupMask
[
0
].
Mask
|=
mask
;
return
TRUE
;
return
TRUE
;
}
}
else
if
(
rel
==
RelationProcessorCore
&&
dataex
->
Relationship
==
rel
&&
dataex
->
u
.
Processor
.
Reserved
[
1
]
==
id
)
else
if
(
rel
==
RelationProcessorCore
&&
dataex
->
Relationship
==
rel
&&
dataex
->
Processor
.
Reserved
[
1
]
==
id
)
{
{
return
TRUE
;
return
TRUE
;
}
}
...
@@ -640,16 +639,16 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel,
...
@@ -640,16 +639,16 @@ static BOOL logical_proc_info_ex_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel,
dataex
->
Relationship
=
rel
;
dataex
->
Relationship
=
rel
;
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
PROCESSOR_RELATIONSHIP
)
);
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
PROCESSOR_RELATIONSHIP
)
);
if
(
rel
==
RelationProcessorCore
)
if
(
rel
==
RelationProcessorCore
)
dataex
->
u
.
Processor
.
Flags
=
count_bits
(
mask
)
>
1
?
LTP_PC_SMT
:
0
;
dataex
->
Processor
.
Flags
=
count_bits
(
mask
)
>
1
?
LTP_PC_SMT
:
0
;
else
else
dataex
->
u
.
Processor
.
Flags
=
0
;
dataex
->
Processor
.
Flags
=
0
;
dataex
->
u
.
Processor
.
EfficiencyClass
=
0
;
dataex
->
Processor
.
EfficiencyClass
=
0
;
dataex
->
u
.
Processor
.
GroupCount
=
1
;
dataex
->
Processor
.
GroupCount
=
1
;
dataex
->
u
.
Processor
.
GroupMask
[
0
].
Mask
=
mask
;
dataex
->
Processor
.
GroupMask
[
0
].
Mask
=
mask
;
dataex
->
u
.
Processor
.
GroupMask
[
0
].
Group
=
0
;
dataex
->
Processor
.
GroupMask
[
0
].
Group
=
0
;
/* mark for future lookup */
/* mark for future lookup */
dataex
->
u
.
Processor
.
Reserved
[
0
]
=
0
;
dataex
->
Processor
.
Reserved
[
0
]
=
0
;
dataex
->
u
.
Processor
.
Reserved
[
1
]
=
id
;
dataex
->
Processor
.
Reserved
[
1
]
=
id
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
return
TRUE
;
return
TRUE
;
...
@@ -668,13 +667,13 @@ static BOOL logical_proc_info_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, DWO
...
@@ -668,13 +667,13 @@ static BOOL logical_proc_info_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, DWO
for
(
i
=
0
;
i
<
logical_proc_info_len
;
i
++
)
for
(
i
=
0
;
i
<
logical_proc_info_len
;
i
++
)
{
{
if
(
rel
==
RelationProcessorPackage
&&
logical_proc_info
[
i
].
Relationship
==
rel
if
(
rel
==
RelationProcessorPackage
&&
logical_proc_info
[
i
].
Relationship
==
rel
&&
logical_proc_info
[
i
].
u
.
Reserved
[
1
]
==
id
)
&&
logical_proc_info
[
i
].
Reserved
[
1
]
==
id
)
{
{
logical_proc_info
[
i
].
ProcessorMask
|=
mask
;
logical_proc_info
[
i
].
ProcessorMask
|=
mask
;
return
logical_proc_info_ex_add_by_id
(
rel
,
id
,
mask
);
return
logical_proc_info_ex_add_by_id
(
rel
,
id
,
mask
);
}
}
else
if
(
rel
==
RelationProcessorCore
&&
logical_proc_info
[
i
].
Relationship
==
rel
else
if
(
rel
==
RelationProcessorCore
&&
logical_proc_info
[
i
].
Relationship
==
rel
&&
logical_proc_info
[
i
].
u
.
Reserved
[
1
]
==
id
)
&&
logical_proc_info
[
i
].
Reserved
[
1
]
==
id
)
return
logical_proc_info_ex_add_by_id
(
rel
,
id
,
mask
);
return
logical_proc_info_ex_add_by_id
(
rel
,
id
,
mask
);
}
}
...
@@ -683,9 +682,9 @@ static BOOL logical_proc_info_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, DWO
...
@@ -683,9 +682,9 @@ static BOOL logical_proc_info_add_by_id( LOGICAL_PROCESSOR_RELATIONSHIP rel, DWO
logical_proc_info
[
i
].
Relationship
=
rel
;
logical_proc_info
[
i
].
Relationship
=
rel
;
logical_proc_info
[
i
].
ProcessorMask
=
mask
;
logical_proc_info
[
i
].
ProcessorMask
=
mask
;
if
(
rel
==
RelationProcessorCore
)
if
(
rel
==
RelationProcessorCore
)
logical_proc_info
[
i
].
u
.
ProcessorCore
.
Flags
=
count_bits
(
mask
)
>
1
?
LTP_PC_SMT
:
0
;
logical_proc_info
[
i
].
ProcessorCore
.
Flags
=
count_bits
(
mask
)
>
1
?
LTP_PC_SMT
:
0
;
logical_proc_info
[
i
].
u
.
Reserved
[
0
]
=
0
;
logical_proc_info
[
i
].
Reserved
[
0
]
=
0
;
logical_proc_info
[
i
].
u
.
Reserved
[
1
]
=
id
;
logical_proc_info
[
i
].
Reserved
[
1
]
=
id
;
logical_proc_info_len
=
i
+
1
;
logical_proc_info_len
=
i
+
1
;
return
logical_proc_info_ex_add_by_id
(
rel
,
id
,
mask
);
return
logical_proc_info_ex_add_by_id
(
rel
,
id
,
mask
);
...
@@ -699,7 +698,7 @@ static BOOL logical_proc_info_add_cache( ULONG_PTR mask, CACHE_DESCRIPTOR *cache
...
@@ -699,7 +698,7 @@ static BOOL logical_proc_info_add_cache( ULONG_PTR mask, CACHE_DESCRIPTOR *cache
for
(
i
=
0
;
i
<
logical_proc_info_len
;
i
++
)
for
(
i
=
0
;
i
<
logical_proc_info_len
;
i
++
)
{
{
if
(
logical_proc_info
[
i
].
Relationship
==
RelationCache
&&
logical_proc_info
[
i
].
ProcessorMask
==
mask
if
(
logical_proc_info
[
i
].
Relationship
==
RelationCache
&&
logical_proc_info
[
i
].
ProcessorMask
==
mask
&&
logical_proc_info
[
i
].
u
.
Cache
.
Level
==
cache
->
Level
&&
logical_proc_info
[
i
].
u
.
Cache
.
Type
==
cache
->
Type
)
&&
logical_proc_info
[
i
].
Cache
.
Level
==
cache
->
Level
&&
logical_proc_info
[
i
]
.
Cache
.
Type
==
cache
->
Type
)
return
TRUE
;
return
TRUE
;
}
}
...
@@ -707,14 +706,14 @@ static BOOL logical_proc_info_add_cache( ULONG_PTR mask, CACHE_DESCRIPTOR *cache
...
@@ -707,14 +706,14 @@ static BOOL logical_proc_info_add_cache( ULONG_PTR mask, CACHE_DESCRIPTOR *cache
logical_proc_info
[
i
].
Relationship
=
RelationCache
;
logical_proc_info
[
i
].
Relationship
=
RelationCache
;
logical_proc_info
[
i
].
ProcessorMask
=
mask
;
logical_proc_info
[
i
].
ProcessorMask
=
mask
;
logical_proc_info
[
i
].
u
.
Cache
=
*
cache
;
logical_proc_info
[
i
].
Cache
=
*
cache
;
logical_proc_info_len
=
i
+
1
;
logical_proc_info_len
=
i
+
1
;
for
(
ofs
=
0
;
ofs
<
logical_proc_info_ex_size
;
)
for
(
ofs
=
0
;
ofs
<
logical_proc_info_ex_size
;
)
{
{
dataex
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
char
*
)
logical_proc_info_ex
+
ofs
);
dataex
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
char
*
)
logical_proc_info_ex
+
ofs
);
if
(
dataex
->
Relationship
==
RelationCache
&&
dataex
->
u
.
Cache
.
GroupMask
.
Mask
==
mask
if
(
dataex
->
Relationship
==
RelationCache
&&
dataex
->
Cache
.
GroupMask
.
Mask
==
mask
&&
dataex
->
u
.
Cache
.
Level
==
cache
->
Level
&&
dataex
->
u
.
Cache
.
Type
==
cache
->
Type
)
&&
dataex
->
Cache
.
Level
==
cache
->
Level
&&
dataex
->
Cache
.
Type
==
cache
->
Type
)
return
TRUE
;
return
TRUE
;
ofs
+=
dataex
->
Size
;
ofs
+=
dataex
->
Size
;
}
}
...
@@ -725,13 +724,13 @@ static BOOL logical_proc_info_add_cache( ULONG_PTR mask, CACHE_DESCRIPTOR *cache
...
@@ -725,13 +724,13 @@ static BOOL logical_proc_info_add_cache( ULONG_PTR mask, CACHE_DESCRIPTOR *cache
dataex
->
Relationship
=
RelationCache
;
dataex
->
Relationship
=
RelationCache
;
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
CACHE_RELATIONSHIP
)
);
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
CACHE_RELATIONSHIP
)
);
dataex
->
u
.
Cache
.
Level
=
cache
->
Level
;
dataex
->
Cache
.
Level
=
cache
->
Level
;
dataex
->
u
.
Cache
.
Associativity
=
cache
->
Associativity
;
dataex
->
Cache
.
Associativity
=
cache
->
Associativity
;
dataex
->
u
.
Cache
.
LineSize
=
cache
->
LineSize
;
dataex
->
Cache
.
LineSize
=
cache
->
LineSize
;
dataex
->
u
.
Cache
.
CacheSize
=
cache
->
Size
;
dataex
->
Cache
.
CacheSize
=
cache
->
Size
;
dataex
->
u
.
Cache
.
Type
=
cache
->
Type
;
dataex
->
Cache
.
Type
=
cache
->
Type
;
dataex
->
u
.
Cache
.
GroupMask
.
Mask
=
mask
;
dataex
->
Cache
.
GroupMask
.
Mask
=
mask
;
dataex
->
u
.
Cache
.
GroupMask
.
Group
=
0
;
dataex
->
Cache
.
GroupMask
.
Group
=
0
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
...
@@ -746,7 +745,7 @@ static BOOL logical_proc_info_add_numa_node( ULONG_PTR mask, DWORD node_id )
...
@@ -746,7 +745,7 @@ static BOOL logical_proc_info_add_numa_node( ULONG_PTR mask, DWORD node_id )
logical_proc_info
[
logical_proc_info_len
].
Relationship
=
RelationNumaNode
;
logical_proc_info
[
logical_proc_info_len
].
Relationship
=
RelationNumaNode
;
logical_proc_info
[
logical_proc_info_len
].
ProcessorMask
=
mask
;
logical_proc_info
[
logical_proc_info_len
].
ProcessorMask
=
mask
;
logical_proc_info
[
logical_proc_info_len
].
u
.
NumaNode
.
NodeNumber
=
node_id
;
logical_proc_info
[
logical_proc_info_len
].
NumaNode
.
NodeNumber
=
node_id
;
++
logical_proc_info_len
;
++
logical_proc_info_len
;
if
(
!
grow_logical_proc_ex_buf
(
log_proc_ex_size_plus
(
sizeof
(
NUMA_NODE_RELATIONSHIP
)
)))
return
FALSE
;
if
(
!
grow_logical_proc_ex_buf
(
log_proc_ex_size_plus
(
sizeof
(
NUMA_NODE_RELATIONSHIP
)
)))
return
FALSE
;
...
@@ -755,9 +754,9 @@ static BOOL logical_proc_info_add_numa_node( ULONG_PTR mask, DWORD node_id )
...
@@ -755,9 +754,9 @@ static BOOL logical_proc_info_add_numa_node( ULONG_PTR mask, DWORD node_id )
dataex
->
Relationship
=
RelationNumaNode
;
dataex
->
Relationship
=
RelationNumaNode
;
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
NUMA_NODE_RELATIONSHIP
)
);
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
NUMA_NODE_RELATIONSHIP
)
);
dataex
->
u
.
NumaNode
.
NodeNumber
=
node_id
;
dataex
->
NumaNode
.
NodeNumber
=
node_id
;
dataex
->
u
.
NumaNode
.
GroupMask
.
Mask
=
mask
;
dataex
->
NumaNode
.
GroupMask
.
Mask
=
mask
;
dataex
->
u
.
NumaNode
.
GroupMask
.
Group
=
0
;
dataex
->
NumaNode
.
GroupMask
.
Group
=
0
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
...
@@ -774,11 +773,11 @@ static BOOL logical_proc_info_add_group( DWORD num_cpus, ULONG_PTR mask )
...
@@ -774,11 +773,11 @@ static BOOL logical_proc_info_add_group( DWORD num_cpus, ULONG_PTR mask )
dataex
->
Relationship
=
RelationGroup
;
dataex
->
Relationship
=
RelationGroup
;
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
GROUP_RELATIONSHIP
)
);
dataex
->
Size
=
log_proc_ex_size_plus
(
sizeof
(
GROUP_RELATIONSHIP
)
);
dataex
->
u
.
Group
.
MaximumGroupCount
=
1
;
dataex
->
Group
.
MaximumGroupCount
=
1
;
dataex
->
u
.
Group
.
ActiveGroupCount
=
1
;
dataex
->
Group
.
ActiveGroupCount
=
1
;
dataex
->
u
.
Group
.
GroupInfo
[
0
].
MaximumProcessorCount
=
num_cpus
;
dataex
->
Group
.
GroupInfo
[
0
].
MaximumProcessorCount
=
num_cpus
;
dataex
->
u
.
Group
.
GroupInfo
[
0
].
ActiveProcessorCount
=
num_cpus
;
dataex
->
Group
.
GroupInfo
[
0
].
ActiveProcessorCount
=
num_cpus
;
dataex
->
u
.
Group
.
GroupInfo
[
0
].
ActiveProcessorMask
=
mask
;
dataex
->
Group
.
GroupInfo
[
0
].
ActiveProcessorMask
=
mask
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
logical_proc_info_ex_size
+=
dataex
->
Size
;
return
TRUE
;
return
TRUE
;
...
@@ -1259,8 +1258,8 @@ static NTSTATUS create_cpuset_info(SYSTEM_CPU_SET_INFORMATION *info)
...
@@ -1259,8 +1258,8 @@ static NTSTATUS create_cpuset_info(SYSTEM_CPU_SET_INFORMATION *info)
{
{
if
(
proc_info
->
Relationship
==
RelationCache
)
if
(
proc_info
->
Relationship
==
RelationCache
)
{
{
if
(
max_cache_level
<
proc_info
->
u
.
Cache
.
Level
)
if
(
max_cache_level
<
proc_info
->
Cache
.
Level
)
max_cache_level
=
proc_info
->
u
.
Cache
.
Level
;
max_cache_level
=
proc_info
->
Cache
.
Level
;
}
}
proc_info
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
BYTE
*
)
proc_info
+
proc_info
->
Size
);
proc_info
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
BYTE
*
)
proc_info
+
proc_info
->
Size
);
}
}
...
@@ -1274,45 +1273,45 @@ static NTSTATUS create_cpuset_info(SYSTEM_CPU_SET_INFORMATION *info)
...
@@ -1274,45 +1273,45 @@ static NTSTATUS create_cpuset_info(SYSTEM_CPU_SET_INFORMATION *info)
{
{
info
[
i
].
Size
=
sizeof
(
*
info
);
info
[
i
].
Size
=
sizeof
(
*
info
);
info
[
i
].
Type
=
CpuSetInformation
;
info
[
i
].
Type
=
CpuSetInformation
;
info
[
i
].
u
.
CpuSet
.
Id
=
0x100
+
i
;
info
[
i
].
CpuSet
.
Id
=
0x100
+
i
;
info
[
i
].
u
.
CpuSet
.
LogicalProcessorIndex
=
i
;
info
[
i
].
CpuSet
.
LogicalProcessorIndex
=
i
;
}
}
for
(
i
=
0
;
(
char
*
)
proc_info
!=
(
char
*
)
logical_proc_info_ex
+
cpu_info_size
;
++
i
)
for
(
i
=
0
;
(
char
*
)
proc_info
!=
(
char
*
)
logical_proc_info_ex
+
cpu_info_size
;
++
i
)
{
{
if
(
proc_info
->
Relationship
==
RelationProcessorCore
)
if
(
proc_info
->
Relationship
==
RelationProcessorCore
)
{
{
if
(
proc_info
->
u
.
Processor
.
GroupCount
!=
1
)
if
(
proc_info
->
Processor
.
GroupCount
!=
1
)
{
{
FIXME
(
"Unsupported group count %u.
\n
"
,
proc_info
->
u
.
Processor
.
GroupCount
);
FIXME
(
"Unsupported group count %u.
\n
"
,
proc_info
->
Processor
.
GroupCount
);
continue
;
continue
;
}
}
cpu_mask
=
proc_info
->
u
.
Processor
.
GroupMask
[
0
].
Mask
;
cpu_mask
=
proc_info
->
Processor
.
GroupMask
[
0
].
Mask
;
for
(
j
=
0
;
j
<
count
;
++
j
)
for
(
j
=
0
;
j
<
count
;
++
j
)
if
(((
ULONG64
)
1
<<
j
)
&
cpu_mask
)
if
(((
ULONG64
)
1
<<
j
)
&
cpu_mask
)
{
{
info
[
j
].
u
.
CpuSet
.
CoreIndex
=
core_index
;
info
[
j
].
CpuSet
.
CoreIndex
=
core_index
;
info
[
j
].
u
.
CpuSet
.
EfficiencyClass
=
proc_info
->
u
.
Processor
.
EfficiencyClass
;
info
[
j
].
CpuSet
.
EfficiencyClass
=
proc_info
->
Processor
.
EfficiencyClass
;
}
}
++
core_index
;
++
core_index
;
}
}
else
if
(
proc_info
->
Relationship
==
RelationCache
)
else
if
(
proc_info
->
Relationship
==
RelationCache
)
{
{
if
(
proc_info
->
u
.
Cache
.
Level
==
max_cache_level
)
if
(
proc_info
->
Cache
.
Level
==
max_cache_level
)
{
{
cpu_mask
=
proc_info
->
u
.
Cache
.
GroupMask
.
Mask
;
cpu_mask
=
proc_info
->
Cache
.
GroupMask
.
Mask
;
for
(
j
=
0
;
j
<
count
;
++
j
)
for
(
j
=
0
;
j
<
count
;
++
j
)
if
(((
ULONG64
)
1
<<
j
)
&
cpu_mask
)
if
(((
ULONG64
)
1
<<
j
)
&
cpu_mask
)
info
[
j
].
u
.
CpuSet
.
LastLevelCacheIndex
=
cache_index
;
info
[
j
].
CpuSet
.
LastLevelCacheIndex
=
cache_index
;
}
}
++
cache_index
;
++
cache_index
;
}
}
else
if
(
proc_info
->
Relationship
==
RelationNumaNode
)
else
if
(
proc_info
->
Relationship
==
RelationNumaNode
)
{
{
cpu_mask
=
proc_info
->
u
.
NumaNode
.
GroupMask
.
Mask
;
cpu_mask
=
proc_info
->
NumaNode
.
GroupMask
.
Mask
;
for
(
j
=
0
;
j
<
count
;
++
j
)
for
(
j
=
0
;
j
<
count
;
++
j
)
if
(((
ULONG64
)
1
<<
j
)
&
cpu_mask
)
if
(((
ULONG64
)
1
<<
j
)
&
cpu_mask
)
info
[
j
].
u
.
CpuSet
.
NumaNodeIndex
=
proc_info
->
u
.
NumaNode
.
NodeNumber
;
info
[
j
].
CpuSet
.
NumaNodeIndex
=
proc_info
->
NumaNode
.
NodeNumber
;
}
}
proc_info
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
char
*
)
proc_info
+
proc_info
->
Size
);
proc_info
=
(
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
)((
char
*
)
proc_info
+
proc_info
->
Size
);
}
}
...
...
dlls/ntdll/unix/thread.c
View file @
c3352feb
...
@@ -63,8 +63,6 @@
...
@@ -63,8 +63,6 @@
#include <mach/mach.h>
#include <mach/mach.h>
#endif
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include "winternl.h"
#include "winternl.h"
...
@@ -420,7 +418,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
...
@@ -420,7 +418,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
if
(
flags
&
CONTEXT_AMD64_FLOATING_POINT
)
if
(
flags
&
CONTEXT_AMD64_FLOATING_POINT
)
{
{
to
->
flags
|=
SERVER_CTX_FLOATING_POINT
;
to
->
flags
|=
SERVER_CTX_FLOATING_POINT
;
memcpy
(
to
->
fp
.
x86_64_regs
.
fpregs
,
&
from
->
u
.
FltSave
,
sizeof
(
to
->
fp
.
x86_64_regs
.
fpregs
)
);
memcpy
(
to
->
fp
.
x86_64_regs
.
fpregs
,
&
from
->
FltSave
,
sizeof
(
to
->
fp
.
x86_64_regs
.
fpregs
)
);
}
}
if
(
flags
&
CONTEXT_AMD64_DEBUG_REGISTERS
)
if
(
flags
&
CONTEXT_AMD64_DEBUG_REGISTERS
)
{
{
...
@@ -481,8 +479,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
...
@@ -481,8 +479,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
I386_FLOATING_SAVE_AREA
fpu
;
I386_FLOATING_SAVE_AREA
fpu
;
to
->
flags
|=
SERVER_CTX_EXTENDED_REGISTERS
|
SERVER_CTX_FLOATING_POINT
;
to
->
flags
|=
SERVER_CTX_EXTENDED_REGISTERS
|
SERVER_CTX_FLOATING_POINT
;
memcpy
(
to
->
ext
.
i386_regs
,
&
from
->
u
.
FltSave
,
sizeof
(
to
->
ext
.
i386_regs
)
);
memcpy
(
to
->
ext
.
i386_regs
,
&
from
->
FltSave
,
sizeof
(
to
->
ext
.
i386_regs
)
);
fpux_to_fpu
(
&
fpu
,
&
from
->
u
.
FltSave
);
fpux_to_fpu
(
&
fpu
,
&
from
->
FltSave
);
to
->
fp
.
i386_regs
.
ctrl
=
fpu
.
ControlWord
;
to
->
fp
.
i386_regs
.
ctrl
=
fpu
.
ControlWord
;
to
->
fp
.
i386_regs
.
status
=
fpu
.
StatusWord
;
to
->
fp
.
i386_regs
.
status
=
fpu
.
StatusWord
;
to
->
fp
.
i386_regs
.
tag
=
fpu
.
TagWord
;
to
->
fp
.
i386_regs
.
tag
=
fpu
.
TagWord
;
...
@@ -547,7 +545,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
...
@@ -547,7 +545,7 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
if
(
flags
&
CONTEXT_ARM_FLOATING_POINT
)
if
(
flags
&
CONTEXT_ARM_FLOATING_POINT
)
{
{
to
->
flags
|=
SERVER_CTX_FLOATING_POINT
;
to
->
flags
|=
SERVER_CTX_FLOATING_POINT
;
for
(
i
=
0
;
i
<
32
;
i
++
)
to
->
fp
.
arm_regs
.
d
[
i
]
=
from
->
u
.
D
[
i
];
for
(
i
=
0
;
i
<
32
;
i
++
)
to
->
fp
.
arm_regs
.
d
[
i
]
=
from
->
D
[
i
];
to
->
fp
.
arm_regs
.
fpscr
=
from
->
Fpscr
;
to
->
fp
.
arm_regs
.
fpscr
=
from
->
Fpscr
;
}
}
if
(
flags
&
CONTEXT_ARM_DEBUG_REGISTERS
)
if
(
flags
&
CONTEXT_ARM_DEBUG_REGISTERS
)
...
@@ -569,8 +567,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
...
@@ -569,8 +567,8 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
if
(
flags
&
CONTEXT_ARM64_CONTROL
)
if
(
flags
&
CONTEXT_ARM64_CONTROL
)
{
{
to
->
flags
|=
SERVER_CTX_CONTROL
;
to
->
flags
|=
SERVER_CTX_CONTROL
;
to
->
integer
.
arm64_regs
.
x
[
29
]
=
from
->
u
.
s
.
Fp
;
to
->
integer
.
arm64_regs
.
x
[
29
]
=
from
->
Fp
;
to
->
integer
.
arm64_regs
.
x
[
30
]
=
from
->
u
.
s
.
Lr
;
to
->
integer
.
arm64_regs
.
x
[
30
]
=
from
->
Lr
;
to
->
ctl
.
arm64_regs
.
sp
=
from
->
Sp
;
to
->
ctl
.
arm64_regs
.
sp
=
from
->
Sp
;
to
->
ctl
.
arm64_regs
.
pc
=
from
->
Pc
;
to
->
ctl
.
arm64_regs
.
pc
=
from
->
Pc
;
to
->
ctl
.
arm64_regs
.
pstate
=
from
->
Cpsr
;
to
->
ctl
.
arm64_regs
.
pstate
=
from
->
Cpsr
;
...
@@ -578,15 +576,15 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
...
@@ -578,15 +576,15 @@ static NTSTATUS context_to_server( context_t *to, USHORT to_machine, const void
if
(
flags
&
CONTEXT_ARM64_INTEGER
)
if
(
flags
&
CONTEXT_ARM64_INTEGER
)
{
{
to
->
flags
|=
SERVER_CTX_INTEGER
;
to
->
flags
|=
SERVER_CTX_INTEGER
;
for
(
i
=
0
;
i
<=
28
;
i
++
)
to
->
integer
.
arm64_regs
.
x
[
i
]
=
from
->
u
.
X
[
i
];
for
(
i
=
0
;
i
<=
28
;
i
++
)
to
->
integer
.
arm64_regs
.
x
[
i
]
=
from
->
X
[
i
];
}
}
if
(
flags
&
CONTEXT_ARM64_FLOATING_POINT
)
if
(
flags
&
CONTEXT_ARM64_FLOATING_POINT
)
{
{
to
->
flags
|=
SERVER_CTX_FLOATING_POINT
;
to
->
flags
|=
SERVER_CTX_FLOATING_POINT
;
for
(
i
=
0
;
i
<
32
;
i
++
)
for
(
i
=
0
;
i
<
32
;
i
++
)
{
{
to
->
fp
.
arm64_regs
.
q
[
i
].
low
=
from
->
V
[
i
].
s
.
Low
;
to
->
fp
.
arm64_regs
.
q
[
i
].
low
=
from
->
V
[
i
].
Low
;
to
->
fp
.
arm64_regs
.
q
[
i
].
high
=
from
->
V
[
i
].
s
.
High
;
to
->
fp
.
arm64_regs
.
q
[
i
].
high
=
from
->
V
[
i
].
High
;
}
}
to
->
fp
.
arm64_regs
.
fpcr
=
from
->
Fpcr
;
to
->
fp
.
arm64_regs
.
fpcr
=
from
->
Fpcr
;
to
->
fp
.
arm64_regs
.
fpsr
=
from
->
Fpsr
;
to
->
fp
.
arm64_regs
.
fpsr
=
from
->
Fpsr
;
...
@@ -820,8 +818,8 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -820,8 +818,8 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_AMD64_FLOATING_POINT
))
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_AMD64_FLOATING_POINT
))
{
{
to
->
ContextFlags
|=
CONTEXT_AMD64_FLOATING_POINT
;
to
->
ContextFlags
|=
CONTEXT_AMD64_FLOATING_POINT
;
memcpy
(
&
to
->
u
.
FltSave
,
from
->
fp
.
x86_64_regs
.
fpregs
,
sizeof
(
from
->
fp
.
x86_64_regs
.
fpregs
)
);
memcpy
(
&
to
->
FltSave
,
from
->
fp
.
x86_64_regs
.
fpregs
,
sizeof
(
from
->
fp
.
x86_64_regs
.
fpregs
)
);
to
->
MxCsr
=
to
->
u
.
FltSave
.
MxCsr
;
to
->
MxCsr
=
to
->
FltSave
.
MxCsr
;
}
}
if
((
from
->
flags
&
SERVER_CTX_DEBUG_REGISTERS
)
&&
(
to_flags
&
CONTEXT_AMD64_DEBUG_REGISTERS
))
if
((
from
->
flags
&
SERVER_CTX_DEBUG_REGISTERS
)
&&
(
to_flags
&
CONTEXT_AMD64_DEBUG_REGISTERS
))
{
{
...
@@ -887,7 +885,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -887,7 +885,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
if
((
from
->
flags
&
SERVER_CTX_EXTENDED_REGISTERS
)
&&
(
to_flags
&
CONTEXT_AMD64_FLOATING_POINT
))
if
((
from
->
flags
&
SERVER_CTX_EXTENDED_REGISTERS
)
&&
(
to_flags
&
CONTEXT_AMD64_FLOATING_POINT
))
{
{
to
->
ContextFlags
|=
CONTEXT_AMD64_FLOATING_POINT
;
to
->
ContextFlags
|=
CONTEXT_AMD64_FLOATING_POINT
;
memcpy
(
&
to
->
u
.
FltSave
,
from
->
ext
.
i386_regs
,
sizeof
(
to
->
u
.
FltSave
)
);
memcpy
(
&
to
->
FltSave
,
from
->
ext
.
i386_regs
,
sizeof
(
to
->
FltSave
)
);
}
}
else
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_AMD64_FLOATING_POINT
))
else
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_AMD64_FLOATING_POINT
))
{
{
...
@@ -903,7 +901,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -903,7 +901,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
fpu
.
DataSelector
=
from
->
fp
.
i386_regs
.
data_sel
;
fpu
.
DataSelector
=
from
->
fp
.
i386_regs
.
data_sel
;
fpu
.
Cr0NpxState
=
from
->
fp
.
i386_regs
.
cr0npx
;
fpu
.
Cr0NpxState
=
from
->
fp
.
i386_regs
.
cr0npx
;
memcpy
(
fpu
.
RegisterArea
,
from
->
fp
.
i386_regs
.
regs
,
sizeof
(
fpu
.
RegisterArea
)
);
memcpy
(
fpu
.
RegisterArea
,
from
->
fp
.
i386_regs
.
regs
,
sizeof
(
fpu
.
RegisterArea
)
);
fpu_to_fpux
(
&
to
->
u
.
FltSave
,
&
fpu
);
fpu_to_fpux
(
&
to
->
FltSave
,
&
fpu
);
}
}
if
((
from
->
flags
&
SERVER_CTX_DEBUG_REGISTERS
)
&&
(
to_flags
&
CONTEXT_AMD64_DEBUG_REGISTERS
))
if
((
from
->
flags
&
SERVER_CTX_DEBUG_REGISTERS
)
&&
(
to_flags
&
CONTEXT_AMD64_DEBUG_REGISTERS
))
{
{
...
@@ -966,7 +964,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -966,7 +964,7 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_ARM_FLOATING_POINT
))
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_ARM_FLOATING_POINT
))
{
{
to
->
ContextFlags
|=
CONTEXT_ARM_FLOATING_POINT
;
to
->
ContextFlags
|=
CONTEXT_ARM_FLOATING_POINT
;
for
(
i
=
0
;
i
<
32
;
i
++
)
to
->
u
.
D
[
i
]
=
from
->
fp
.
arm_regs
.
d
[
i
];
for
(
i
=
0
;
i
<
32
;
i
++
)
to
->
D
[
i
]
=
from
->
fp
.
arm_regs
.
d
[
i
];
to
->
Fpscr
=
from
->
fp
.
arm_regs
.
fpscr
;
to
->
Fpscr
=
from
->
fp
.
arm_regs
.
fpscr
;
}
}
if
((
from
->
flags
&
SERVER_CTX_DEBUG_REGISTERS
)
&&
(
to_flags
&
CONTEXT_ARM_DEBUG_REGISTERS
))
if
((
from
->
flags
&
SERVER_CTX_DEBUG_REGISTERS
)
&&
(
to_flags
&
CONTEXT_ARM_DEBUG_REGISTERS
))
...
@@ -988,24 +986,24 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
...
@@ -988,24 +986,24 @@ static NTSTATUS context_from_server( void *dst, const context_t *from, USHORT ma
if
((
from
->
flags
&
SERVER_CTX_CONTROL
)
&&
(
to_flags
&
CONTEXT_ARM64_CONTROL
))
if
((
from
->
flags
&
SERVER_CTX_CONTROL
)
&&
(
to_flags
&
CONTEXT_ARM64_CONTROL
))
{
{
to
->
ContextFlags
|=
CONTEXT_ARM64_CONTROL
;
to
->
ContextFlags
|=
CONTEXT_ARM64_CONTROL
;
to
->
u
.
s
.
Fp
=
from
->
integer
.
arm64_regs
.
x
[
29
];
to
->
Fp
=
from
->
integer
.
arm64_regs
.
x
[
29
];
to
->
u
.
s
.
Lr
=
from
->
integer
.
arm64_regs
.
x
[
30
];
to
->
Lr
=
from
->
integer
.
arm64_regs
.
x
[
30
];
to
->
Sp
=
from
->
ctl
.
arm64_regs
.
sp
;
to
->
Sp
=
from
->
ctl
.
arm64_regs
.
sp
;
to
->
Pc
=
from
->
ctl
.
arm64_regs
.
pc
;
to
->
Pc
=
from
->
ctl
.
arm64_regs
.
pc
;
to
->
Cpsr
=
from
->
ctl
.
arm64_regs
.
pstate
;
to
->
Cpsr
=
from
->
ctl
.
arm64_regs
.
pstate
;
}
}
if
((
from
->
flags
&
SERVER_CTX_INTEGER
)
&&
(
to_flags
&
CONTEXT_ARM64_INTEGER
))
if
((
from
->
flags
&
SERVER_CTX_INTEGER
)
&&
(
to_flags
&
CONTEXT_ARM64_INTEGER
))
{
{
to
->
ContextFlags
|=
CONTEXT_ARM64_INTEGER
;
to
->
ContextFlags
|=
CONTEXT_ARM64_INTEGER
;
for
(
i
=
0
;
i
<=
28
;
i
++
)
to
->
u
.
X
[
i
]
=
from
->
integer
.
arm64_regs
.
x
[
i
];
for
(
i
=
0
;
i
<=
28
;
i
++
)
to
->
X
[
i
]
=
from
->
integer
.
arm64_regs
.
x
[
i
];
}
}
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_ARM64_FLOATING_POINT
))
if
((
from
->
flags
&
SERVER_CTX_FLOATING_POINT
)
&&
(
to_flags
&
CONTEXT_ARM64_FLOATING_POINT
))
{
{
to
->
ContextFlags
|=
CONTEXT_ARM64_FLOATING_POINT
;
to
->
ContextFlags
|=
CONTEXT_ARM64_FLOATING_POINT
;
for
(
i
=
0
;
i
<
32
;
i
++
)
for
(
i
=
0
;
i
<
32
;
i
++
)
{
{
to
->
V
[
i
].
s
.
Low
=
from
->
fp
.
arm64_regs
.
q
[
i
].
low
;
to
->
V
[
i
].
Low
=
from
->
fp
.
arm64_regs
.
q
[
i
].
low
;
to
->
V
[
i
].
s
.
High
=
from
->
fp
.
arm64_regs
.
q
[
i
].
high
;
to
->
V
[
i
].
High
=
from
->
fp
.
arm64_regs
.
q
[
i
].
high
;
}
}
to
->
Fpcr
=
from
->
fp
.
arm64_regs
.
fpcr
;
to
->
Fpcr
=
from
->
fp
.
arm64_regs
.
fpcr
;
to
->
Fpsr
=
from
->
fp
.
arm64_regs
.
fpsr
;
to
->
Fpsr
=
from
->
fp
.
arm64_regs
.
fpsr
;
...
...
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