Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

xipi.c File Reference

#include "ki.h"

Go to the source code of this file.

Functions

VOID KiIpiGenericCallTarget (IN PKIPI_CONTEXT SignalDone, IN PVOID BroadcastFunction, IN PVOID Context, IN PVOID Parameter3)
ULONG_PTR KiIpiGenericCall (IN PKIPI_BROADCAST_WORKER BroadcastFunction, IN ULONG_PTR Context)
VOID KiIpiStallOnPacketTargets (KAFFINITY TargetSet)


Function Documentation

ULONG_PTR KiIpiGenericCall IN PKIPI_BROADCAST_WORKER  BroadcastFunction,
IN ULONG_PTR  Context
 

Definition at line 40 of file xipi.c.

References KeActiveProcessors, KeGetCurrentPrcb, KeLowerIrql(), KeRaiseIrql(), KiIpiGenericCallTarget(), KiIpiSendPacket(), KiIpiStallOnPacketTargets(), max, NULL, PKIPI_BROADCAST_WORKER, and Status.

Referenced by KeI386VdmInitialize(), KeSetIntervalProfile(), KiAdjustInterruptTime(), KiInitMachineDependent(), KiSyncMC_Drain(), and KiSyncPrefetchVisible().

00047 : 00048 00049 This function executes the specified function on every processor in 00050 the host configuration in a synchronous manner, i.e., the function 00051 is executed on each target in series with the execution of the source 00052 processor. 00053 00054 Arguments: 00055 00056 BroadcastFunction - Supplies the address of function that is executed 00057 on each of the target processors. 00058 00059 Context - Supplies the value of the context parameter that is passed 00060 to each function. 00061 00062 Return Value: 00063 00064 The value returned by the specified function on the source processor 00065 is returned as the function value. 00066 00067 --*/ 00068 00069 { 00070 00071 KIRQL OldIrql; 00072 ULONG_PTR Status; 00073 KAFFINITY TargetProcessors; 00074 00075 // 00076 // Raise IRQL to the higher of the current level and synchronization 00077 // level to avoid a possible context switch. 00078 // 00079 00080 KeRaiseIrql((KIRQL)(max(KiSynchIrql, KeGetCurrentIrql())), &OldIrql); 00081 00082 // 00083 // Initialize the broadcast packet, compute the set of target processors, 00084 // and sent the packet to the target processors for execution. 00085 // 00086 00087 #if !defined(NT_UP) 00088 00089 TargetProcessors = KeActiveProcessors & ~KeGetCurrentPrcb()->SetMember; 00090 if (TargetProcessors != 0) { 00091 KiIpiSendPacket(TargetProcessors, 00092 KiIpiGenericCallTarget, 00093 (PVOID)BroadcastFunction, 00094 (PVOID)Context, 00095 NULL); 00096 } 00097 00098 #endif 00099 00100 // 00101 // Execute function of source processor and capture return status. 00102 // 00103 00104 Status = BroadcastFunction(Context); 00105 00106 // 00107 // Wait until all of the target processors have finished capturing the 00108 // function parameters. 00109 // 00110 00111 #if !defined(NT_UP) 00112 00113 if (TargetProcessors != 0) { 00114 KiIpiStallOnPacketTargets(TargetProcessors); 00115 } 00116 00117 #endif 00118 00119 // 00120 // Lower IRQL to its previous level and return the function execution 00121 // status. 00122 // 00123 00124 KeLowerIrql(OldIrql); 00125 return Status; 00126 }

VOID KiIpiGenericCallTarget IN PKIPI_CONTEXT  SignalDone,
IN PVOID  BroadcastFunction,
IN PVOID  Context,
IN PVOID  Parameter3
 

Definition at line 132 of file xipi.c.

References KiIpiSignalPacketDone(), and PKIPI_BROADCAST_WORKER.

Referenced by KiIpiGenericCall().

00141 : 00142 00143 This function is the target jacket function to execute a broadcast 00144 function on a set of target processors. The broadcast packet address 00145 is obtained, the specified parameters are captured, the broadcast 00146 packet address is cleared to signal the source processor to continue, 00147 and the specified function is executed. 00148 00149 Arguments: 00150 00151 SignalDone Supplies a pointer to a variable that is cleared when the 00152 requested operation has been performed. 00153 00154 BroadcastFunction - Supplies the address of function that is executed 00155 on each of the target processors. 00156 00157 Context - Supplies the value of the context parameter that is passed 00158 to each function. 00159 00160 Parameter3 - Not used. 00161 00162 Return Value: 00163 00164 None 00165 00166 --*/ 00167 00168 { 00169 00170 // 00171 // Execute the specified function. 00172 // 00173 00174 ((PKIPI_BROADCAST_WORKER)(BroadcastFunction))((ULONG_PTR)Context); 00175 KiIpiSignalPacketDone(SignalDone); 00176 return; 00177 }

VOID KiIpiStallOnPacketTargets KAFFINITY  TargetSet  ) 
 

Definition at line 182 of file xipi.c.

References KeActiveProcessors, and KeGetCurrentPrcb.

Referenced by Ke386IoSetAccessProcess(), Ke386SetDescriptorProcess(), Ke386SetIoAccessMap(), Ke386SetLdtProcess(), Ke386SetVdmInterruptHandler(), KeChangeColorPage(), KeFlushEntireTb(), KeFlushIoBuffers(), KeFlushMultipleTb(), KeFlushMultipleTb64(), KeFlushSingleTb(), KeFlushSingleTb64(), KeInvalidateAllCaches(), KeStartProfile(), KeStopProfile(), KeSweepCacheRange(), KeSweepDcache(), KeSweepDcacheRange(), KeSweepIcache(), KeSweepIcacheRange(), KeSynchronizeMemoryAccess(), KiCompleteEffectiveRangeChange(), KiFlushSingleTbSynchronous(), KiGetNewRid(), KiInitializePAT(), KiIpiGenericCall(), and KiSyncNewRegionId().

00188 : 00189 00190 This function waits until the specified set of processors have signaled 00191 their completion of a requested function. 00192 00193 N.B. The exact protocol used between the source and the target of an 00194 interprocessor request is not specified. Minimally the source 00195 must construct an appropriate packet and send the packet to a set 00196 of specified targets. Each target receives the address of the packet 00197 address as an argument, and minimally must clear the packet address 00198 when the mutually agreed upon protocol allows. The target has three 00199 options: 00200 00201 1. Capture necessary information, release the source by clearing 00202 the packet address, execute the request in parallel with the 00203 source, and return from the interrupt. 00204 00205 2. Execute the request in series with the source, release the 00206 source by clearing the packet address, and return from the 00207 interrupt. 00208 00209 3. Execute the request in series with the source, release the 00210 source, wait for a reply from the source based on a packet 00211 parameter, and return from the interrupt. 00212 00213 This function is provided to enable the source to synchronize with the 00214 target for cases 2 and 3 above. 00215 00216 N.B. There is no support for method 3 above. 00217 00218 Arguments: 00219 00220 TargetSet - Supplies the the target set of IPI processors. 00221 00222 Return Value: 00223 00224 None. 00225 00226 --*/ 00227 00228 { 00229 00230 PKPRCB Prcb; 00231 00232 // 00233 // Wait until the target set of processors is zero in the current 00234 // processor's packet. 00235 // 00236 00237 Prcb = KeGetCurrentPrcb(); 00238 while (Prcb->TargetSet != 0) { 00239 KeYieldProcessor(); 00240 } 00241 00242 // 00243 // If the target set is equal to the entire set of processors, then 00244 // update the memory barrier time stamp. 00245 // 00246 00247 #if defined(_ALPHA_) 00248 00249 if ((TargetSet | PCR->SetMember ) == KeActiveProcessors) { 00250 InterlockedIncrement(&KiMbTimeStamp); 00251 } 00252 00253 #endif 00254 00255 return; 00256 }


Generated on Sat May 15 19:46:11 2004 for test by doxygen 1.3.7