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
b8dc6b24
Commit
b8dc6b24
authored
Jun 25, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move RtlGetSystemTimePrecise() to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
13c1f008
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
28 deletions
+25
-28
time.c
dlls/ntdll/time.c
+1
-24
loader.c
dlls/ntdll/unix/loader.c
+1
-0
server.c
dlls/ntdll/unix/server.c
+1
-1
sync.c
dlls/ntdll/unix/sync.c
+19
-2
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-0
unixlib.h
dlls/ntdll/unixlib.h
+2
-1
No files found.
dlls/ntdll/time.c
View file @
b8dc6b24
...
...
@@ -32,9 +32,6 @@
#include <string.h>
#include <limits.h>
#include <time.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
...
...
@@ -399,27 +396,7 @@ NTSTATUS WINAPI NtQuerySystemTime( LARGE_INTEGER *time )
*/
LONGLONG
WINAPI
RtlGetSystemTimePrecise
(
void
)
{
LONGLONG
time
;
#ifdef HAVE_CLOCK_GETTIME
struct
timespec
ts
;
if
(
!
clock_gettime
(
CLOCK_REALTIME
,
&
ts
))
{
time
=
ts
.
tv_sec
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
;
time
+=
(
ts
.
tv_nsec
+
50
)
/
100
;
}
else
#endif
{
struct
timeval
now
;
gettimeofday
(
&
now
,
0
);
time
=
now
.
tv_sec
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
;
time
+=
now
.
tv_usec
*
10
;
}
return
time
;
return
unix_funcs
->
RtlGetSystemTimePrecise
();
}
/******************************************************************************
...
...
dlls/ntdll/unix/loader.c
View file @
b8dc6b24
...
...
@@ -1450,6 +1450,7 @@ static struct unix_funcs unix_funcs =
NtWriteVirtualMemory
,
NtYieldExecution
,
DbgUiIssueRemoteBreakin
,
RtlGetSystemTimePrecise
,
RtlWaitOnAddress
,
RtlWakeAddressAll
,
RtlWakeAddressSingle
,
...
...
dlls/ntdll/unix/server.c
View file @
b8dc6b24
...
...
@@ -679,7 +679,7 @@ unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT f
{
LARGE_INTEGER
now
;
RtlQueryPerformanceCounter
(
&
now
);
NtQueryPerformanceCounter
(
&
now
,
NULL
);
abs_timeout
-=
now
.
QuadPart
;
}
...
...
dlls/ntdll/unix/sync.c
View file @
b8dc6b24
...
...
@@ -1044,7 +1044,7 @@ NTSTATUS WINAPI NtQueryTimer( HANDLE handle, TIMER_INFORMATION_CLASS class,
if
(
basic_info
->
RemainingTime
.
QuadPart
>
0
)
NtQuerySystemTime
(
&
now
);
else
{
RtlQueryPerformanceCounter
(
&
now
);
NtQueryPerformanceCounter
(
&
now
,
NULL
);
basic_info
->
RemainingTime
.
QuadPart
=
-
basic_info
->
RemainingTime
.
QuadPart
;
}
...
...
@@ -1243,6 +1243,23 @@ ULONG WINAPI NtGetTickCount(void)
/******************************************************************************
* RtlGetSystemTimePrecise (NTDLL.@)
*/
LONGLONG
WINAPI
RtlGetSystemTimePrecise
(
void
)
{
struct
timeval
now
;
#ifdef HAVE_CLOCK_GETTIME
struct
timespec
ts
;
if
(
!
clock_gettime
(
CLOCK_REALTIME
,
&
ts
))
return
ts
.
tv_sec
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
+
(
ts
.
tv_nsec
+
50
)
/
100
;
#endif
gettimeofday
(
&
now
,
0
);
return
now
.
tv_sec
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
+
now
.
tv_usec
*
10
;
}
/******************************************************************************
* NtCreateKeyedEvent (NTDLL.@)
*/
NTSTATUS
WINAPI
NtCreateKeyedEvent
(
HANDLE
*
handle
,
ACCESS_MASK
access
,
...
...
@@ -2248,7 +2265,7 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size
{
LARGE_INTEGER
now
;
RtlQueryPerformanceCounter
(
&
now
);
NtQueryPerformanceCounter
(
&
now
,
NULL
);
abs_timeout
-=
now
.
QuadPart
;
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
b8dc6b24
...
...
@@ -89,6 +89,7 @@ extern NTSTATUS CDECL fast_RtlSleepConditionVariableCS( RTL_CONDITION_VARIABLE *
RTL_CRITICAL_SECTION
*
cs
,
const
LARGE_INTEGER
*
timeout
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
fast_RtlWakeConditionVariable
(
RTL_CONDITION_VARIABLE
*
variable
,
int
count
)
DECLSPEC_HIDDEN
;
extern
LONGLONG
CDECL
fast_RtlGetSystemTimePrecise
(
void
)
DECLSPEC_HIDDEN
;
void
CDECL
mmap_add_reserved_area
(
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
void
CDECL
mmap_remove_reserved_area
(
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unixlib.h
View file @
b8dc6b24
...
...
@@ -29,7 +29,7 @@ struct msghdr;
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 6
2
#define NTDLL_UNIXLIB_VERSION 6
3
struct
unix_funcs
{
...
...
@@ -261,6 +261,7 @@ struct unix_funcs
/* other Win32 API functions */
NTSTATUS
(
WINAPI
*
DbgUiIssueRemoteBreakin
)(
HANDLE
process
);
LONGLONG
(
WINAPI
*
RtlGetSystemTimePrecise
)(
void
);
NTSTATUS
(
WINAPI
*
RtlWaitOnAddress
)(
const
void
*
addr
,
const
void
*
cmp
,
SIZE_T
size
,
const
LARGE_INTEGER
*
timeout
);
void
(
WINAPI
*
RtlWakeAddressAll
)(
const
void
*
addr
);
...
...
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