For more information about spin locks, see Spin Locks. The caller should release the spin lock with KeReleaseSpinLock as quickly as possible.Īttempting to acquire a spin lock recursively is guaranteed to cause a deadlock. The code within a critical region guarded by a spin lock can neither call any external function that might access pageable data or raise an exception, nor can it generate any exceptions. The code within a critical region guarded by an spin lock must neither be pageable nor make any references to pageable data. Go to file Cannot retrieve contributors at this time 1122 lines (980 sloc) 31.4 KB Raw Blame / COPYRIGHT: See COPYING in the top level directory PROJECT: ReactOS Keyboard class driver FILE: drivers/kbdclass/kbdclass.c PURPOSE: Keyboard class driver PROGRAMMERS: Herv Poussineau () / include 'kbdclass. In particular, no deadlock protection is performed and dispatching is disabled while the spin lock is held. Spin locks can cause serious problems if not used judiciously. A driver can also use a shared memory location, such as a global variable, but the driver must not use the same location for two different locks. Most drivers use a local variable to store the old IRQL value. The OldIrql value must be specified when the spin lock is released with KeReleaseSpinLock. KeAcquireSpinLock( &gFwProcessFlowPolicyLock, &oldIRQL ). The previous IRQL is written to OldIrql after the lock is acquired. Here I refer to the content of AFD in the ReactOS-0.3.4-REL-src source code. define KeAcquireSpinLock(a,b) (b) KfAcquireSpinLock(a) NTHALAPI VOID. KeAcquireSpinLock first resets the IRQL to DISPATCH_LEVEL and then acquires the lock. Contributors: Amine Khaldi Timo Kreuzer () THIS. Pointer to a KIRQL variable that is set to the current IRQL when this call occurs. Pointer to an initialized KSPIN_LOCK spin lock for which the caller provides the storage. The KeAcquireSpinLock routine acquires a spin lock so the caller can synchronize access to shared data in a multiprocessor-safe way by raising IRQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |