migrate substitution keywords to SVN
[reactos.git] / reactos / ntoskrnl / ke / device.c
1 /* $Id$
2 *
3 * FILE: ntoskrnl/ke/profile.c
4 * PURPOSE: Kernel Device/Settings Functions
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
6 * UPDATE HISTORY:
7 * Created 23/06/04
8 */
9
10 #include <ntoskrnl.h>
11 #define NDEBUG
12 #include <internal/debug.h>
13
14 /*
15 * @implemented
16 */
17 STDCALL
18 PVOID
19 KeFindConfigurationEntry(
20 IN PVOID Unknown,
21 IN ULONG Class,
22 IN CONFIGURATION_TYPE Type,
23 IN PULONG RegKey
24 )
25 {
26 /* Start Search at Root */
27 return KeFindConfigurationNextEntry(Unknown, Class, Type, RegKey, NULL);
28 }
29
30 /*
31 * @unimplemented
32 */
33 STDCALL
34 PVOID
35 KeFindConfigurationNextEntry(
36 IN PVOID Unknown,
37 IN ULONG Class,
38 IN CONFIGURATION_TYPE Type,
39 IN PULONG RegKey,
40 IN PVOID *NextLink
41 )
42 {
43 UNIMPLEMENTED;
44 return 0;
45 }
46
47 /*
48 * @implemented
49 */
50 STDCALL
51 VOID
52 KeFlushEntireTb(
53 IN BOOLEAN Unknown,
54 IN BOOLEAN CurrentCpuOnly
55 )
56 {
57 KIRQL OldIrql;
58 PKPROCESS Process = NULL;
59 PKPCR Pcr = NULL;
60
61 /* Raise the IRQL for the TB Flush */
62 OldIrql = KeRaiseIrqlToSynchLevel();
63
64 /* All CPUs need to have the TB flushed. */
65 if (CurrentCpuOnly == FALSE) {
66 Pcr = KeGetCurrentKPCR();
67
68 /* How many CPUs is our caller using? */
69 Process = Pcr->PrcbData.CurrentThread->ApcState.Process;
70
71 /* More then one, so send an IPI */
72 if (Process->ActiveProcessors > 1) {
73 /* Send IPI Packet */
74 }
75 }
76
77 /* Flush the TB for the Current CPU */
78 KeFlushCurrentTb();
79
80 /* Clean up */
81 if (CurrentCpuOnly == FALSE) {
82 /* Did we send an IPI? If so, wait for completion */
83 if (Process->ActiveProcessors > 1) {
84 do {
85 } while (Pcr->PrcbData.TargetSet != 0);
86 }
87 }
88
89 /* FIXME: According to MSKB, we should increment a counter? */
90
91 /* Return to Original IRQL */
92 KeLowerIrql(OldIrql);
93 }
94
95
96 /*
97 * @implemented
98 */
99 STDCALL
100 VOID
101 KeSetDmaIoCoherency(
102 IN ULONG Coherency
103 )
104 {
105 KiDmaIoCoherency = Coherency;
106 }
107
108 /*
109 * @unimplemented
110 */
111 STDCALL
112 PKDEVICE_QUEUE_ENTRY
113 KeRemoveByKeyDeviceQueueIfBusy (
114 IN PKDEVICE_QUEUE DeviceQueue,
115 IN ULONG SortKey
116 )
117 {
118 UNIMPLEMENTED;
119 return 0;
120 }
121
122 /*
123 * @implemented
124 */
125 STDCALL
126 KAFFINITY
127 KeQueryActiveProcessors (
128 VOID
129 )
130 {
131 return KeActiveProcessors;
132 }
133
134
135 /*
136 * @unimplemented
137 */
138 VOID
139 __cdecl
140 KeSaveStateForHibernate(
141 IN PVOID State
142 )
143 {
144 UNIMPLEMENTED;
145 }