3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/ke/device.c
6 * PURPOSE: Kernel Device/Settings Functions
8 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
13 #include <internal/debug.h>
20 KeFindConfigurationEntry(
23 IN CONFIGURATION_TYPE Type
,
27 /* Start Search at Root */
28 return KeFindConfigurationNextEntry(Unknown
, Class
, Type
, RegKey
, NULL
);
36 KeFindConfigurationNextEntry(
39 IN CONFIGURATION_TYPE Type
,
55 IN BOOLEAN CurrentCpuOnly
59 PKPROCESS Process
= NULL
;
62 /* Raise the IRQL for the TB Flush */
63 OldIrql
= KeRaiseIrqlToSynchLevel();
65 /* All CPUs need to have the TB flushed. */
66 if (CurrentCpuOnly
== FALSE
) {
67 Pcr
= KeGetCurrentKPCR();
69 /* How many CPUs is our caller using? */
70 Process
= Pcr
->PrcbData
.CurrentThread
->ApcState
.Process
;
72 /* More then one, so send an IPI */
73 if (Process
->ActiveProcessors
> 1) {
78 /* Flush the TB for the Current CPU */
82 if (CurrentCpuOnly
== FALSE
) {
83 /* Did we send an IPI? If so, wait for completion */
84 if (Process
->ActiveProcessors
> 1) {
86 } while (Pcr
->PrcbData
.TargetSet
!= 0);
90 /* FIXME: According to MSKB, we should increment a counter? */
92 /* Return to Original IRQL */
106 KiDmaIoCoherency
= Coherency
;
114 KeRemoveByKeyDeviceQueueIfBusy (
115 IN PKDEVICE_QUEUE DeviceQueue
,
128 KeQueryActiveProcessors (
132 return KeActiveProcessors
;
141 KeSaveStateForHibernate(