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
c3c2a4f6
Commit
c3c2a4f6
authored
Jan 28, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implement DPC-level queued spinlock functions.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
558cdd7a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+2
-2
sync.c
dlls/ntoskrnl.exe/sync.c
+65
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
c3c2a4f6
...
...
@@ -42,9 +42,9 @@
@ stdcall -norelay IofCallDriver(ptr ptr)
@ stdcall -norelay IofCompleteRequest(ptr long)
@ stdcall -norelay KeAcquireInStackQueuedSpinLock(ptr ptr)
@ st
ub KeAcquireInStackQueuedSpinLockAtDpcLevel
@ st
dcall -norelay KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr)
@ stdcall -norelay KeReleaseInStackQueuedSpinLock(ptr)
@ st
ub KeReleaseInStackQueuedSpinLockFromDpcLevel
@ st
dcall -norelay KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr)
@ stub KeSetTimeUpdateNotifyRoutine
@ stub KefAcquireSpinLockAtDpcLevel
@ stub KefReleaseSpinLockFromDpcLevel
...
...
dlls/ntoskrnl.exe/sync.c
View file @
c3c2a4f6
...
...
@@ -414,6 +414,71 @@ void WINAPI KeReleaseSpinLockFromDpcLevel( KSPIN_LOCK *lock )
InterlockedExchangePointer
(
(
void
**
)
lock
,
0
);
}
#define QUEUED_SPINLOCK_OWNED 0x2
/***********************************************************************
* KeAcquireInStackQueuedSpinLockAtDpcLevel (NTOSKRNL.EXE.@)
*/
#ifdef DEFINE_FASTCALL2_ENTRYPOINT
DEFINE_FASTCALL2_ENTRYPOINT
(
KeAcquireInStackQueuedSpinLockAtDpcLevel
)
void
WINAPI
DECLSPEC_HIDDEN
__regs_KeAcquireInStackQueuedSpinLockAtDpcLevel
(
KSPIN_LOCK
*
lock
,
KLOCK_QUEUE_HANDLE
*
queue
)
#else
void
WINAPI
KeAcquireInStackQueuedSpinLockAtDpcLevel
(
KSPIN_LOCK
*
lock
,
KLOCK_QUEUE_HANDLE
*
queue
)
#endif
{
KSPIN_LOCK_QUEUE
*
tail
;
TRACE
(
"lock %p, queue %p.
\n
"
,
lock
,
queue
);
queue
->
LockQueue
.
Next
=
NULL
;
if
(
!
(
tail
=
InterlockedExchangePointer
(
(
void
**
)
lock
,
&
queue
->
LockQueue
)))
queue
->
LockQueue
.
Lock
=
(
KSPIN_LOCK
*
)((
ULONG_PTR
)
lock
|
QUEUED_SPINLOCK_OWNED
);
else
{
queue
->
LockQueue
.
Lock
=
lock
;
InterlockedExchangePointer
(
(
void
**
)
&
tail
->
Next
,
&
queue
->
LockQueue
);
while
(
!
((
ULONG_PTR
)
InterlockedCompareExchangePointer
(
(
void
**
)
&
queue
->
LockQueue
.
Lock
,
0
,
0
)
&
QUEUED_SPINLOCK_OWNED
))
{
small_pause
();
}
}
}
/***********************************************************************
* KeReleaseInStackQueuedSpinLockFromDpcLevel (NTOSKRNL.EXE.@)
*/
#ifdef DEFINE_FASTCALL1_ENTRYPOINT
DEFINE_FASTCALL1_ENTRYPOINT
(
KeReleaseInStackQueuedSpinLockFromDpcLevel
)
void
WINAPI
DECLSPEC_HIDDEN
__regs_KeReleaseInStackQueuedSpinLockFromDpcLevel
(
KLOCK_QUEUE_HANDLE
*
queue
)
#else
void
WINAPI
KeReleaseInStackQueuedSpinLockFromDpcLevel
(
KLOCK_QUEUE_HANDLE
*
queue
)
#endif
{
KSPIN_LOCK
*
lock
=
(
KSPIN_LOCK
*
)((
ULONG_PTR
)
queue
->
LockQueue
.
Lock
&
~
QUEUED_SPINLOCK_OWNED
);
KSPIN_LOCK_QUEUE
*
next
;
TRACE
(
"lock %p, queue %p.
\n
"
,
lock
,
queue
);
queue
->
LockQueue
.
Lock
=
NULL
;
if
(
!
(
next
=
queue
->
LockQueue
.
Next
))
{
/* If we are truly the last in the queue, the lock will point to us. */
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
lock
,
NULL
,
&
queue
->
LockQueue
)
==
queue
)
return
;
/* Otherwise, someone just queued themselves, but hasn't yet set
* themselves as successor. Spin waiting for them to do so. */
while
(
!
(
next
=
queue
->
LockQueue
.
Next
))
small_pause
();
}
InterlockedExchangePointer
(
(
void
**
)
&
next
->
Lock
,
(
KSPIN_LOCK
*
)((
ULONG_PTR
)
lock
|
QUEUED_SPINLOCK_OWNED
)
);
}
#ifndef __i386__
/***********************************************************************
* KeReleaseSpinLock (NTOSKRNL.EXE.@)
...
...
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