This repository was archived by the owner on Jan 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -102,11 +102,8 @@ typedef struct hax_kmap_phys {
102102
103103typedef struct {
104104 KSPIN_LOCK lock ;
105- // According to MSDN:
106- // https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/queued-spin-locks
107- // "Drivers for Windows XP and later versions of Windows should use queued
108- // spin locks instead of ordinary spin locks."
109- KLOCK_QUEUE_HANDLE handle ;
105+ uint32_t flags ;
106+ KIRQL old_irq ;
110107} hax_spinlock ;
111108
112109typedef FAST_MUTEX * hax_mutex ;
Original file line number Diff line number Diff line change @@ -75,14 +75,17 @@ static inline hax_spinlock *hax_spinlock_alloc_init(void)
7575
7676static inline void hax_spin_lock (hax_spinlock * lock )
7777{
78+ KIRQL old_irq ;
7879 ASSERT (lock );
79- KeAcquireInStackQueuedSpinLockAtDpcLevel (& lock -> lock , & lock -> handle );
80+ KeAcquireSpinLock (& lock -> lock , & old_irq );
81+ lock -> old_irq = old_irq ;
8082}
8183
84+ /* Do we need a flag to track if old_irq is valid? */
8285static inline void hax_spin_unlock (hax_spinlock * lock )
8386{
8487 ASSERT (lock );
85- KeReleaseInStackQueuedSpinLockFromDpcLevel (& lock -> handle );
88+ KeReleaseSpinLock (& lock -> lock , lock -> old_irq );
8689}
8790
8891static inline hax_mutex hax_mutex_alloc_init (void )
You can’t perform that action at this time.
0 commit comments